Commit 9c4488d9 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'segiddins-warn-for-deprecated-specs-on-outdated'

* segiddins-warn-for-deprecated-specs-on-outdated:
  Update Changelog
  Refactored Command::Outdated to make it stub-able
  Warn for deprecated specs on outdated
parents b1257fa6 fb55a0e5
......@@ -27,6 +27,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Samuel E. Giddins][segiddins]
[#1853](https://github.com/CocoaPods/CocoaPods/issues/1853)
* Show deprecated specs when invoking `pod outdated`
[Samuel E. Giddins](https://github.com/segiddins)
[#2003](https://github.com/CocoaPods/CocoaPods/issues/2003)
## 0.32.1
##### Bug Fixes
......@@ -35,7 +39,6 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Fabio Pelosin][irrationalfab]
[#2050](https://github.com/CocoaPods/CocoaPods/issues/2050)
## 0.32.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/master...0.31.1)
......
......@@ -23,21 +23,6 @@ module Pod
# @todo fix.
#
def run
verify_podfile_exists!
verify_lockfile_exists!
lockfile = config.lockfile
pods = lockfile.pod_names
updates = []
pods.each do |pod_name|
set = SourcesManager.search(Dependency.new(pod_name))
next unless set
source_version = set.versions.first
lockfile_version = lockfile.version(pod_name)
if source_version > lockfile_version
updates << [pod_name, lockfile_version, source_version]
end
end
if updates.empty?
UI.puts "No updates are available.".yellow
......@@ -48,8 +33,72 @@ module Pod
end
end
end
if deprecated_pods.any?
UI.section 'The following pods are deprecated:' do
deprecated_pods.each do |spec|
if spec.deprecated_in_favor_of
UI.puts "- #{spec.name}" \
" (in favor of #{spec.deprecated_in_favor_of})"
else
UI.puts "- #{spec.name}"
end
end
end
end
end
private
def updates
@updates ||= begin
spec_sets.map do |set|
spec = set.specification
source_version = set.versions.first
pod_name = spec.name
lockfile_version = lockfile.version(pod_name)
if source_version > lockfile_version
[pod_name, lockfile_version, source_version]
else
nil
end
end.compact.uniq
end
end
def deprecated_pods
@deprecated_pods ||= begin
spec_sets.map(&:specification).select do |spec|
spec.deprecated || spec.deprecated_in_favor_of
end.compact.uniq
end
end
def spec_sets
@spec_sets ||= begin
installed_pods.map do |pod_name|
SourcesManager.search(Dependency.new(pod_name))
end.compact.uniq
end
end
def installed_pods
@installed_pods ||= begin
verify_podfile_exists!
lockfile.pod_names
end
end
def lockfile
@lockfile ||= begin
verify_lockfile_exists!
config.lockfile
end
end
end
end
end
......
......@@ -17,6 +17,15 @@ module Pod
exception.message.should.include "No `Podfile.lock' found in the current working directory"
end
end
it 'tells the user about deprecated pods' do
spec = Specification.new(nil, 'AFNetworking')
spec.deprecated_in_favor_of = 'BlocksKit'
Command::Outdated.any_instance.stubs(:deprecated_pods).returns([spec])
Command::Outdated.any_instance.stubs(:updates).returns([])
run_command('outdated', '--no-repo-update')
UI.output.should.include('in favor of BlocksKit')
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