aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-03-27 23:07:25 -0500
committerJack Nagel2013-03-28 14:16:15 -0500
commit5e5e82f9ef622c8142eb24faa6b89c5c9dfc0baf (patch)
treec53de33da8dd94627a585d927fe6d9d0cc9f1041
parentd9f64a157407cc5c9a5bc6bf9fc9a7c7f4ffdfd4 (diff)
downloadbrew-5e5e82f9ef622c8142eb24faa6b89c5c9dfc0baf.tar.bz2
Tab#to_s returns a one-line summary of the receipt
-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