Commit 3599c080 authored by Eloy Durán's avatar Eloy Durán

Merge branch 'fix_head_download_option' of https://github.com/neonichu/CocoaPods…

Merge branch 'fix_head_download_option' of https://github.com/neonichu/CocoaPods into neonichu-fix_head_download_option

Conflicts:
	spec/unit/installer/pod_source_installer_spec.rb
parents ca365cf1 82e0afaa
......@@ -63,7 +63,9 @@ module Pod
def install!
download_source unless predownloaded? || local?
run_prepare_command
rescue => e
rescue Informative
raise
rescue Object => e
UI.notice("Error installing #{root_spec.name}")
clean!
raise
......@@ -99,8 +101,18 @@ module Pod
def download_source
root.rmtree if root.exist?
if head_pod?
downloader.download_head
@specific_source = downloader.checkout_options
begin
downloader.download_head
@specific_source = downloader.checkout_options
rescue RuntimeError => e
if e.message == 'Abstract method'
raise Informative, "The pod '" + root_spec.name + "' does not " +
"support the :head option, as it uses a " + downloader.name +
" source. Remove that option to use this pod."
else
raise
end
end
else
downloader.download
unless downloader.options_specific?
......
......@@ -81,6 +81,16 @@ module Pod
partially_downloaded_file.should.not.exist
end
it "fails when using :head for Http source" do
config.sandbox.store_head_pod('BananaLib')
@spec.source = { :http => 'http://dl.google.com/googleadmobadssdk/googleadmobsearchadssdkios.zip' }
@spec.source_files = 'GoogleAdMobSearchAdsSDK/*.h'
Pod::Downloader::Http.any_instance.stubs(:download_head)
should.raise Informative do
@installer.install!
end.message.should.match /does not support the :head option, as it uses a Http source./
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