aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-03-27 23:07:25 -0500
committerJack Nagel2013-03-28 14:16:15 -0500
commit74cf152787fbe413e4993e3a02a8ef534d63f54f (patch)
treead79bdd30688400fdd382f209f952013864d99a6 /Library
parent6036dcf4e7f34cdb7618d26b641e7a5ff6b16345 (diff)
downloadhomebrew-74cf152787fbe413e4993e3a02a8ef534d63f54f.tar.bz2
Tab#to_s returns a one-line summary of the receipt
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/tab.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index b4a85b64e..35b40ec41 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -104,4 +104,18 @@ class Tab < OpenStruct
def write
tabfile.write to_json
end
+
+ def to_s
+ s = []
+ case poured_from_bottle
+ when true then s << "Poured from bottle"
+ when false then s << "Built from source"
+ end
+ unless used_options.empty?
+ s << "Installed" if s.empty?
+ s << "with:"
+ s << used_options.to_a.join(", ")
+ end
+ s.join(" ")
+ end
end