Commit 2f9a0f8b authored by Boris Bügling's avatar Boris Bügling

Merge pull request #4728 from CocoaPods/seg-outdated-no-podspec

[Outdated] Friendly error when no podspec present for external source deps
parents 26b26f60 a26203c4
...@@ -4,6 +4,16 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -4,6 +4,16 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
To install release candidates run `[sudo] gem install cocoapods --pre` To install release candidates run `[sudo] gem install cocoapods --pre`
## Master
##### Enhancements
* Present a friendly error suggesting running `pod install` when there are
missing local podspecs when running `pod outdated`.
[Samuel Giddins](https://github.com/segiddins)
[#4716](https://github.com/CocoaPods/CocoaPods/issues/4716)
## 1.0.0.beta.1 (2015-12-30) ## 1.0.0.beta.1 (2015-12-30)
##### Breaking ##### Breaking
......
...@@ -52,6 +52,7 @@ module Pod ...@@ -52,6 +52,7 @@ module Pod
def updates def updates
@updates ||= begin @updates ||= begin
ensure_external_podspecs_present!
spec_sets.map do |set| spec_sets.map do |set|
spec = set.specification spec = set.specification
source_version = set.versions.first source_version = set.versions.first
...@@ -111,6 +112,17 @@ module Pod ...@@ -111,6 +112,17 @@ module Pod
config.lockfile config.lockfile
end end
end end
def ensure_external_podspecs_present!
return unless config.podfile
config.podfile.dependencies.each do |dep|
next if dep.external_source.nil?
unless config.sandbox.specification(dep.root_name)
raise Informative, 'You must run `pod install` first to ensure that the ' \
"podspec for `#{dep.root_name}` has been fetched."
end
end
end
end end
end end
end end
...@@ -78,5 +78,18 @@ module Pod ...@@ -78,5 +78,18 @@ module Pod
SourcesManager.expects(:update).never SourcesManager.expects(:update).never
run_command('outdated', '--no-repo-update') run_command('outdated', '--no-repo-update')
end end
it 'tells the user to run `pod install` when external sources need to be fetched' do
lockfile = mock('Lockfile')
lockfile.stubs(:version).returns(Version.new('1.0'))
lockfile.stubs(:pod_names).returns(%w(AFNetworking))
config.stubs(:lockfile).returns(lockfile)
podfile = Podfile.new do
pod 'AFNetworking', :git => 'https://github.com/AFNetworking/AFNetworking.git'
end
config.stubs(:podfile).returns(podfile)
exception = lambda { run_command('outdated', '--no-repo-update') }.should.raise Informative
exception.message.should.include 'You must run `pod install` first to ensure that the podspec for `AFNetworking` has been fetched.'
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