Commit cb2d9967 authored by Eloy Durán's avatar Eloy Durán

[outdated] Don’t show pods that can't be checked.

parent 4954dbed
......@@ -6,7 +6,8 @@ module Pod
$ pod outdated
Shows the outdated pods in the current Podfile.lock.}
Shows the outdated pods in the current Podfile.lock, but only those from
spec repos, not those from local/external sources or `:head' versions.}
end
def self.options
......@@ -30,41 +31,17 @@ module Pod
resolver.update_mode = true
resolver.update_external_specs = false
resolver.resolve
pods_to_install = resolver.pods_to_install
external_pods = resolver.pods_from_external_sources
known_update_specs = []
head_mode_specs = []
resolver.specs.each do |s|
next if external_pods.include?(s.name)
next unless pods_to_install.include?(s.name)
if s.version.head?
head_mode_specs << s.name
else
known_update_specs << s.to_s
end
names = resolver.pods_to_install - resolver.pods_from_external_sources
specs = resolver.specs.select do |spec|
names.include?(spec.name) && !spec.version.head?
end
if pods_to_install.empty?
puts "\nNo updates are available.\n".yellow
if specs.empty?
puts "No updates are available.".yellow
else
unless known_update_specs.empty?
puts "\nThe following updates are available:".green
puts " - " << known_update_specs.join("\n - ") << "\n"
end
unless head_mode_specs.empty?
puts "\nThe following pods might present updates as they are in head mode:".green
puts " - " << head_mode_specs.join("\n - ") << "\n"
end
unless (external_pods).empty?
puts "\nThe following pods might present updates as they loaded from an external source:".green
puts " - " << external_pods.join("\n - ") << "\n"
end
puts
puts "The following updates are available:".green
puts " - " << specs.join("\n - ") << "\n"
end
end
end
......
......@@ -120,13 +120,13 @@ module Pod
def pods_to_install
unless @pods_to_install
if lockfile
@pods_to_install = specs.select { |spec|
@pods_to_install = specs.select do |spec|
spec.version != lockfile.pods_versions[spec.pod_name]
}.map(&:name)
end.map(&:name)
if update_mode
@pods_to_install += specs.select { |spec|
@pods_to_install += specs.select do |spec|
spec.version.head? || pods_from_external_sources.include?(spec.pod_name)
}.map(&:name)
end.map(&:name)
end
@pods_to_install += @pods_by_state[:added] + @pods_by_state[:changed]
else
......
......@@ -326,7 +326,7 @@ module Pod
@resolver.should_install?("JSONKit").should.be.true
end
it "respects the constraints of the pofile" do
it "respects the constraints of the podfile" do
podfile = Podfile.new do
platform :ios
pod 'BlocksKit'
......
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