Commit 1a8478a2 authored by Fabio Pelosin's avatar Fabio Pelosin

[Downloader] Deprecated #clean.

parent d10959c9
......@@ -153,7 +153,6 @@ module Pod
puts " * Pre-downloading: '#{name}'" unless config.silent?
Downloader.for_target(sandbox.root + name, @params).tap do |downloader|
downloader.download
downloader.clean if config.clean?
end
end
......
......@@ -22,10 +22,6 @@ module Pod
@target_path.mkpath
end
def clean
# implement in sub-classes
end
private
def self.for_target(target_path, options)
......
......@@ -112,10 +112,6 @@ module Pod
git "checkout -b activated-pod-commit #{options[:commit]}"
end
end
def clean
(target_path + '.git').rmtree
end
end
class GitHub < Git
......@@ -131,14 +127,6 @@ module Pod
download_only? ? download_and_extract_tarball(options[:commit]) : super
end
def clean
if download_only?
FileUtils.rm_f(tmp_path)
else
super
end
end
def tarball_url_for(id)
original_url, username, reponame = *(url.match(/[:\/]([\w\-]+)\/([\w\-]+)\.git/).to_a)
"https://github.com/#{username}/#{reponame}/tarball/#{id}"
......
......@@ -25,10 +25,6 @@ module Pod
options[:type] || type_with_url(url)
end
def clean
FileUtils.rm @download_path
end
private
def type_with_url(url)
if url =~ /.zip$/
......
......@@ -18,10 +18,6 @@ module Pod
def download_revision
hg "clone '#{url}' --rev '#{options[:revision]}' '#{target_path}'"
end
def clean
(target_path + '.hg').rmtree
end
end
end
end
......
......@@ -18,10 +18,6 @@ module Pod
def download_revision
svn "checkout '#{url}' -r '#{options[:revision]}' '#{target_path}'"
end
def clean
target_path.glob('**/.svn').each(&:rmtree)
end
end
end
end
......@@ -27,16 +27,6 @@ describe "Pod::Downloader" do
(@pod.root + 'README').read.strip.should == 'v1.0'
end
it "removes the .git directory when cleaning" do
@pod.top_specification.stubs(:source).returns(
:git => fixture('banana-lib')
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
downloader.clean
(@pod.root + '.git').should.not.exist
end
it "prepares the cache if it does not exits" do
@pod.top_specification.stubs(:source).returns(
:git => fixture('banana-lib'), :commit => 'fd56054'
......@@ -153,7 +143,7 @@ describe "Pod::Downloader" do
end
end
describe "for Gbthub repositories, with :download_only set to true" do
describe "for GitHub repositories, with :download_only set to true" do
extend SpecHelper::TemporaryDirectory
it "downloads HEAD with no other options specified" do
......@@ -191,29 +181,6 @@ describe "Pod::Downloader" do
# deliberately keep this assertion as loose as possible for now
(@pod.root + 'README.md').readlines[0].should =~ /PusherTouch/
end
it 'deletes the downloaded tarball after unpacking it' do
@pod.top_specification.stubs(:source).returns(
:git => "git://github.com/lukeredpath/libPusher.git", :download_only => true
)
downloader = Pod::Downloader.for_pod(@pod)
VCR.use_cassette('tarballs', :record => :new_episodes) { downloader.download }
downloader.clean
(@pod.root + 'tarball.tar.gz').should.not.exist
end
it "removes the .git directory when cleaning" do
@pod.top_specification.stubs(:source).returns(
:git => "git://github.com/lukeredpath/libPusher.git", :download_only => false
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
downloader.clean
(@pod.root + '.git').should.not.exist
end
end
describe "for Mercurial" do
......@@ -225,16 +192,6 @@ describe "Pod::Downloader" do
downloader.download
(@pod.root + 'README').read.strip.should == 'first commit'
end
it "removes the .hg directory when cleaning" do
@pod.top_specification.stubs(:source).returns(
:hg => fixture('mercurial-repo')
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
downloader.clean
(@pod.root + '.hg').should.not.exist
end
end
describe "for Subversion" do
......@@ -255,16 +212,6 @@ describe "Pod::Downloader" do
downloader.download
(@pod.root + 'README').read.strip.should == 'tag 1'
end
it "removes the .svn directories when cleaning" do
@pod.top_specification.stubs(:source).returns(
:svn => "file://#{fixture('subversion-repo')}/trunk"
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
downloader.clean
(@pod.root + '.svn').should.not.exist
end
end
describe "for Http" do
......@@ -280,15 +227,5 @@ describe "Pod::Downloader" do
(@pod.root + 'GoogleAdMobSearchAdsSDK/GADSearchRequest.h').should.exist
(@pod.root + 'GoogleAdMobSearchAdsSDK/GADSearchRequest.h').read.strip.should =~ /Google Search Ads iOS SDK/
end
it "removes the .zip when cleaning" do
@pod.top_specification.stubs(:source).returns(
:http => 'http://dl.google.com/googleadmobadssdk/googleadmobsearchadssdkios.zip'
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
downloader.clean
(@pod.root + 'file.zip').should.not.exist
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