mirror of
https://github.com/zhigang1992/CocoaPods.git
synced 2026-01-12 17:12:54 +08:00
@@ -141,11 +141,11 @@ module Pod
|
||||
puts_indented set.name
|
||||
else
|
||||
pod = UIPod.new(set)
|
||||
title("\n-> #{pod.name} (#{pod.version})".green, '', 3) do
|
||||
title("\n-> #{pod.name} (#{pod.version})".green, '', 1) do
|
||||
puts_indented pod.summary
|
||||
labeled('Homepage', pod.homepage)
|
||||
labeled('Source', pod.source_url)
|
||||
labeled('Versions', pod.versions) unless set.versions.count == 1
|
||||
labeled('Versions', pod.verions_by_source)
|
||||
if mode == :stats
|
||||
labeled('Pushed', pod.github_last_activity)
|
||||
labeled('Authors', pod.authors) if pod.authors =~ /,/
|
||||
|
||||
@@ -15,11 +15,25 @@ module Pod
|
||||
end
|
||||
|
||||
def version
|
||||
@set.versions.last
|
||||
@set.versions.first
|
||||
end
|
||||
|
||||
def versions
|
||||
@set.versions.reverse.join(", ")
|
||||
@set.versions.sort.reverse
|
||||
end
|
||||
|
||||
def verions_by_source
|
||||
result = []
|
||||
@set.versions_by_source.each do |source, versions|
|
||||
result << "#{versions.map(&:to_s) * ', '} [#{source.name} repo]"
|
||||
end
|
||||
result * ' - '
|
||||
end
|
||||
|
||||
# @return [Array<String>]
|
||||
#
|
||||
def sources
|
||||
@set.sources.map(&:name).sort
|
||||
end
|
||||
|
||||
# specification information
|
||||
|
||||
@@ -20,6 +20,13 @@ describe Pod::UI do
|
||||
output.should.include? 'https://github.com/robbiehanson/CocoaLumberjack.git'
|
||||
end
|
||||
|
||||
|
||||
it "presents the name, version, description, homepage and source of a specification set" do
|
||||
Pod::UI.pod(@set)
|
||||
output = Pod::UI.output.gsub(/\n */,'')
|
||||
output.should.include? 'Versions: 1.6, 1.3.3, 1.3.2, 1.3.1, 1.3, 1.2.3, 1.2.2, 1.2.1, 1.2, 1.1, 1.0 [master repo]'
|
||||
end
|
||||
|
||||
it "presents the stats of a specification set" do
|
||||
repo = { "forks"=>42, "watchers"=>318, "pushed_at"=>"2011-01-26T19:06:43Z" }
|
||||
Octokit.expects(:repo).with("robbiehanson/CocoaLumberjack").returns(repo)
|
||||
|
||||
Reference in New Issue
Block a user