aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorZhiming Wang2016-05-03 16:52:00 -0700
committerMartin Afanasjew2016-05-05 23:53:36 +0200
commit1fa48234e5301f018dc93e62bc7e03d71729b296 (patch)
treea4af08a41b08c45f2dc873bb364728715811354c /Library/Homebrew
parent742df8bbf415a5145352b9dad5bef83a09cc92c4 (diff)
downloadbrew-1fa48234e5301f018dc93e62bc7e03d71729b296.tar.bz2
tab: include installation date in string representation
This way brew info will include the installation date for each installed version. Closes #196. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/tab.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index 9b6f28403..32ab284ae 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -246,12 +246,15 @@ class Tab < OpenStruct
def to_s
s = []
- case poured_from_bottle
- when true then s << "Poured from bottle"
- when false then s << "Built from source"
+ if poured_from_bottle
+ s << "Poured from bottle"
+ else
+ s << "Built from source"
+ end
+ if time
+ s << Time.at(time).strftime("on %Y-%m-%d at %H:%M:%S")
end
unless used_options.empty?
- s << "Installed" if s.empty?
s << "with:"
s << used_options.to_a.join(" ")
end