Commit 1abf727b authored by Fabio Pelosin's avatar Fabio Pelosin

[pod-list] added pod authors

parent 6c9c347a
...@@ -56,7 +56,7 @@ module Pod ...@@ -56,7 +56,7 @@ module Pod
days.reverse.each do |d| days.reverse.each do |d|
sets = groups[d] sets = groups[d]
next unless sets next unless sets
puts "Pods added in the last #{d == 1 ? '1 day' : "#{d} days"}".yellow puts "Pods added in the last #{d == 1 ? 'day' : "#{d} days"}".yellow
puts @presenter.render(sets.sort_by {|set| creation_dates[set.name]}) puts @presenter.render(sets.sort_by {|set| creation_dates[set.name]})
end end
end end
......
...@@ -23,6 +23,8 @@ module Pod ...@@ -23,6 +23,8 @@ module Pod
result << wrap_string(pod.summary) result << wrap_string(pod.summary)
result << detail('Homepage', pod.homepage) result << detail('Homepage', pod.homepage)
result << detail('Source', pod.source_url) result << detail('Source', pod.source_url)
result << detail('Authors', pod.authors) if @stats && pod.authors =~ /,/
result << detail('Author', pod.authors) if @stats && pod.authors !~ /,/
result << detail('Platform', pod.platform) if @stats result << detail('Platform', pod.platform) if @stats
result << detail('License', pod.license) if @stats result << detail('License', pod.license) if @stats
result << detail('Watchers', pod.github_watchers) if @stats result << detail('Watchers', pod.github_watchers) if @stats
......
...@@ -6,10 +6,7 @@ module Pod ...@@ -6,10 +6,7 @@ module Pod
@set = set @set = set
end end
def spec # set information
@spec ||= @set.specification.part_of_other_pod? ? @set.specification.part_of_specification : @set.specification
end
def name def name
@set.name @set.name
end end
...@@ -22,6 +19,15 @@ module Pod ...@@ -22,6 +19,15 @@ module Pod
@set.versions.reverse.join(", ") @set.versions.reverse.join(", ")
end end
# specification information
def spec
@spec ||= @set.specification.part_of_other_pod? ? @set.specification.part_of_specification : @set.specification
end
def authors
oxfordify spec.authors.keys
end
def homepage def homepage
spec.homepage spec.homepage
end end
...@@ -46,6 +52,7 @@ module Pod ...@@ -46,6 +52,7 @@ module Pod
spec.license[:type] if spec.license spec.license[:type] if spec.license
end end
# Statistics information
def creation_date def creation_date
Pod::Specification::Statistics.instance.creation_date(@set) Pod::Specification::Statistics.instance.creation_date(@set)
end end
...@@ -55,7 +62,16 @@ module Pod ...@@ -55,7 +62,16 @@ module Pod
end end
def github_forks def github_forks
Pod::Specification::Statistics.instance.github_watchers(@set) Pod::Specification::Statistics.instance.github_forks(@set)
end
private
def oxfordify words
if words.size < 3
words.join ' and '
else
"#{words[0..-2].join(', ')}, and #{words.last}"
end
end end
end 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