Commit d0e5a9cd authored by Fabio Pelosin's avatar Fabio Pelosin

Removed trailing white space

parent 8f0fef0e
...@@ -33,7 +33,7 @@ module Pod ...@@ -33,7 +33,7 @@ module Pod
def download_commit def download_commit
git "clone '#{url}' '#{target_path}'" git "clone '#{url}' '#{target_path}'"
Dir.chdir(target_path) do Dir.chdir(target_path) do
git "checkout -b activated-pod-commit #{options[:commit]}" git "checkout -b activated-pod-commit #{options[:commit]}"
end end
...@@ -43,37 +43,37 @@ module Pod ...@@ -43,37 +43,37 @@ module Pod
(target_path + '.git').rmtree (target_path + '.git').rmtree
end end
end end
class GitHub < Git class GitHub < Git
def download_head def download_head
download_only? ? download_and_extract_tarball('master') : super download_only? ? download_and_extract_tarball('master') : super
end end
def download_tag def download_tag
super unless download_only? super unless download_only?
download_only? ? download_and_extract_tarball(options[:tag]) : super download_only? ? download_and_extract_tarball(options[:tag]) : super
end end
def download_commit def download_commit
super unless download_only? super unless download_only?
download_only? ? download_and_extract_tarball(options[:commit]) : super download_only? ? download_and_extract_tarball(options[:commit]) : super
end end
def clean def clean
# no-op # no-op
end end
def tarball_url_for(id) def tarball_url_for(id)
original_url, username, reponame = *(url.match(/[:\/]([\w\-]+)\/([\w\-]+)\.git/).to_a) original_url, username, reponame = *(url.match(/[:\/]([\w\-]+)\/([\w\-]+)\.git/).to_a)
"https://github.com/#{username}/#{reponame}/tarball/#{id}" "https://github.com/#{username}/#{reponame}/tarball/#{id}"
end end
private private
def download_only? def download_only?
@options[:download_only] @options[:download_only]
end end
def download_and_extract_tarball(id) def download_and_extract_tarball(id)
tmp_path = target_path + "tarball.tar.gz" tmp_path = target_path + "tarball.tar.gz"
...@@ -81,10 +81,10 @@ module Pod ...@@ -81,10 +81,10 @@ module Pod
open tarball_url_for(id) do |archive| open tarball_url_for(id) do |archive|
tmpfile.write Zlib::GzipReader.new(archive).read tmpfile.write Zlib::GzipReader.new(archive).read
end end
system "tar xf #{tmpfile.path} -C #{target_path} --strip-components 1" system "tar xf #{tmpfile.path} -C #{target_path} --strip-components 1"
end end
FileUtils.rm_f(tmp_path) FileUtils.rm_f(tmp_path)
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment