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 ...@@ -6,7 +6,8 @@ module Pod
$ pod outdated $ 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 end
def self.options def self.options
...@@ -30,41 +31,17 @@ module Pod ...@@ -30,41 +31,17 @@ module Pod
resolver.update_mode = true resolver.update_mode = true
resolver.update_external_specs = false resolver.update_external_specs = false
resolver.resolve resolver.resolve
pods_to_install = resolver.pods_to_install
external_pods = resolver.pods_from_external_sources
known_update_specs = [] names = resolver.pods_to_install - resolver.pods_from_external_sources
head_mode_specs = [] specs = resolver.specs.select do |spec|
resolver.specs.each do |s| names.include?(spec.name) && !spec.version.head?
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
end end
if pods_to_install.empty? if specs.empty?
puts "\nNo updates are available.\n".yellow puts "No updates are available.".yellow
else else
puts "The following updates are available:".green
unless known_update_specs.empty? puts " - " << specs.join("\n - ") << "\n"
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
end end
end end
end end
......
...@@ -120,13 +120,13 @@ module Pod ...@@ -120,13 +120,13 @@ module Pod
def pods_to_install def pods_to_install
unless @pods_to_install unless @pods_to_install
if lockfile if lockfile
@pods_to_install = specs.select { |spec| @pods_to_install = specs.select do |spec|
spec.version != lockfile.pods_versions[spec.pod_name] spec.version != lockfile.pods_versions[spec.pod_name]
}.map(&:name) end.map(&:name)
if update_mode 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) spec.version.head? || pods_from_external_sources.include?(spec.pod_name)
}.map(&:name) end.map(&:name)
end end
@pods_to_install += @pods_by_state[:added] + @pods_by_state[:changed] @pods_to_install += @pods_by_state[:added] + @pods_by_state[:changed]
else else
......
...@@ -326,7 +326,7 @@ module Pod ...@@ -326,7 +326,7 @@ module Pod
@resolver.should_install?("JSONKit").should.be.true @resolver.should_install?("JSONKit").should.be.true
end end
it "respects the constraints of the pofile" do it "respects the constraints of the podfile" do
podfile = Podfile.new do podfile = Podfile.new do
platform :ios platform :ios
pod 'BlocksKit' 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