From 5e5e82f9ef622c8142eb24faa6b89c5c9dfc0baf Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 27 Mar 2013 23:07:25 -0500 Subject: Tab#to_s returns a one-line summary of the receipt --- Library/Homebrew/tab.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Library') 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 -- cgit v1.2.3