Commit 59b88a8a authored by Robert Zuber's avatar Robert Zuber

Always include version in list without flag.

As requested in original PR (#1617).

Also remove some extraneous whitespace that crept in.
parent 93caccd2
......@@ -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
......
......@@ -7,8 +7,7 @@ module Pod
def self.options
[[
"--update", "Run `pod repo update` before listing",
"--stats", "Show additional stats (like GitHub watchers and forks)",
"--pod-versions", "Show latest version of each pod"
"--stats", "Show additional stats (like GitHub watchers and forks)"
]].concat(super)
end
......@@ -18,7 +17,6 @@ module Pod
def initialize(argv)
@update = argv.flag?('update')
@stats = argv.flag?('stats')
@pod_versions = argv.flag?('pod-versions')
super
end
......@@ -26,7 +24,7 @@ module Pod
update_if_necessary!
sets = SourcesManager.all_sets
sets.each { |set| UI.pod(set, @pod_versions ? :name_and_version : :name) }
sets.each { |set| UI.pod(set, :name_and_version) }
UI.puts "\n#{sets.count} pods were found"
end
......
......@@ -158,9 +158,7 @@ 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
elsif mode == :name_and_version
if mode == :name_and_version
puts_indented "#{set.name} #{set.versions.first.version}"
else
pod = Specification::Set::Presenter.new(set, statistics_provider)
......
......@@ -29,17 +29,15 @@ module Pod
out.should.not.include('JSONKit')
end
it "presents the known pods with versions when using --pod-versions" do
it "presents the known pods with versions" do
sets = SourcesManager.all_sets
jsonkit_set = sets.find { |s| s.name == 'JSONKit' }
out = run_command('list','--pod-versions')
out = run_command('list')
[ /BananaLib 1.0/,
/JSONKit #{jsonkit_set.versions.first}/,
/\d+ pods were found/
].each { |regex| out.should =~ regex }
end
end
end
......@@ -50,4 +50,3 @@ module Pod
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