Commit 5981e6ca authored by Fabio Pelosin's avatar Fabio Pelosin

[Pod::Command::Presenter#detail] minor semplification

parent 5832226c
...@@ -2,7 +2,7 @@ module Pod ...@@ -2,7 +2,7 @@ module Pod
class Command class Command
class Presenter class Presenter
def self.options def self.options
" --stats Show additional stats (like GitHub watchers and forks)\n" [["--stats", "Show additional stats (like GitHub watchers and forks)"]]
end end
autoload :CocoaPod, 'cocoapods/command/presenter/cocoa_pod' autoload :CocoaPod, 'cocoapods/command/presenter/cocoa_pod'
...@@ -43,18 +43,15 @@ module Pod ...@@ -43,18 +43,15 @@ module Pod
txt.strip.gsub(/(.{1,#{col}})( +|$)\n?|(.{#{col}})/, indent + "\\1\\3\n") txt.strip.gsub(/(.{1,#{col}})( +|$)\n?|(.{#{col}})/, indent + "\\1\\3\n")
end end
def detail(title, value, preferred_indentation = 8) def detail(title, value)
# 8 is the length of Homepage
return '' if !value return '' if !value
number_of_spaces = ((preferred_indentation - title.length) > 0) ? (preferred_indentation - title.length) : 0
spaces = ' ' * number_of_spaces
''.tap do |t| ''.tap do |t|
t << " - #{title}:" t << " - #{title}:".ljust(16)
if value.class == Array if value.class == Array
separator = "\n - " separator = "\n - "
t << separator + value.join(separator) t << separator << value.join(separator)
else else
t << " #{spaces + value.to_s}\n" t << value.to_s << "\n"
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