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

Merge branch 'command-list-added-pod-versions' of…

Merge branch 'command-list-added-pod-versions' of https://github.com/z00b/CocoaPods into z00b-command-list-added-pod-versions
parents 96f4b00b 59b88a8a
......@@ -7,6 +7,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[CocoaPods-Core](https://github.com/CocoaPods/Core/compare/0.30.0...master)
##### Enhancements
* Add version to output of `pod list`
[Stefan Damm](https://github.com/StefanDamm)
[Robert Zuber](https://github.com/z00b)
[#1617](https://github.com/CocoaPods/CocoaPods/issues/1617)
##### Bug Fixes
* Fix for when using s.version as the :tag for a git repository in a Podspec
......
......@@ -24,7 +24,7 @@ module Pod
update_if_necessary!
sets = SourcesManager.all_sets
sets.each { |set| UI.pod(set, :name) }
sets.each { |set| UI.pod(set, :name_and_version) }
UI.puts "\n#{sets.count} pods were found"
end
......
......@@ -158,8 +158,8 @@ module Pod
# Prints the textual representation of a given set.
#
def pod(set, mode = :normal, statistics_provider = nil)
if mode == :name
puts_indented set.name
if mode == :name_and_version
puts_indented "#{set.name} #{set.versions.first.version}"
else
pod = Specification::Set::Presenter.new(set, statistics_provider)
title("\n-> #{pod.name} (#{pod.version})".green, '', 1) do
......
......@@ -28,6 +28,16 @@ module Pod
out.should.include('BananaLib')
out.should.not.include('JSONKit')
end
it "presents the known pods with versions" do
sets = SourcesManager.all_sets
jsonkit_set = sets.find { |s| s.name == 'JSONKit' }
out = run_command('list')
[ /BananaLib 1.0/,
/JSONKit #{jsonkit_set.versions.first}/,
/\d+ pods were found/
].each { |regex| out.should =~ regex }
end
end
end
......@@ -41,6 +41,12 @@ module Pod
output = UI.output
output.should.include? "RestKit/Network"
end
it "presents only name and version of a specification set in :name_and_version mode" do
@set = SourcesManager.search_by_name('RestKit').first
UI.pod(@set, :name_and_version)
output = UI.output
output.should.include? "RestKit #{@set.versions.first}"
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