Commit 6f547d2a authored by Kyle Fuller's avatar Kyle Fuller

Merge branch 'issue-2823'

parents d0b598a3 814f05ec
...@@ -42,6 +42,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -42,6 +42,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Hugo Tunius](https://github.com/K0nserv) [Hugo Tunius](https://github.com/K0nserv)
[#2579](https://github.com/CocoaPods/CocoaPods/issues/2579) [#2579](https://github.com/CocoaPods/CocoaPods/issues/2579)
* Any errors which occur during fetching of external podspecs over HTTP
will now be gracefully handled.
[Hugo Tunius](https://github.com/K0nserv)
[#2823](https://github.com/CocoaPods/CocoaPods/issues/2823)
## 0.36.0.beta.1 ## 0.36.0.beta.1
......
...@@ -11,7 +11,12 @@ module Pod ...@@ -11,7 +11,12 @@ module Pod
UI.titled_section(title, :verbose_prefix => '-> ') do UI.titled_section(title, :verbose_prefix => '-> ') do
is_json = podspec_uri.split('.').last == 'json' is_json = podspec_uri.split('.').last == 'json'
require 'open-uri' require 'open-uri'
open(podspec_uri) { |io| store_podspec(sandbox, io.read, is_json) } begin
open(podspec_uri) { |io| store_podspec(sandbox, io.read, is_json) }
rescue OpenURI::HTTPError => e
status = e.io.status.join(' ')
raise Informative, "Failed to fetch podspec for `#{name}` at `#{podspec_uri}`.\n Error: #{status}"
end
end end
end end
......
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../../../spec_helper', __FILE__)
require 'webmock'
module Pod module Pod
describe ExternalSources::PodspecSource do describe ExternalSources::PodspecSource do
...@@ -52,5 +53,17 @@ module Pod ...@@ -52,5 +53,17 @@ module Pod
path.should == 'http://www.example.com/Reachability.podspec' path.should == 'http://www.example.com/Reachability.podspec'
end end
end end
describe 'http source' do
it 'raises an Informative error if the specified url fails to load' do
@subject.stubs(:params).returns(:podspec => 'https://github.com/username/TSMessages/TSMessages.podspec')
WebMock::API.stub_request(:get, 'https://github.com/username/TSMessages/TSMessages.podspec').
to_return(:status => 404)
lambda { @subject.fetch(config.sandbox) }.should.raise(Informative).
message.should.match(/Failed to fetch podspec for/)
WebMock.reset!
end
end
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