From 7af5a74c4e3d1de334e3d38329243c50adeb342f Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 31 Mar 2013 15:18:38 -0500 Subject: DRY ohai truncation --- Library/Homebrew/utils.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index ddcdc1aab..2879e6a11 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -3,7 +3,7 @@ require 'exceptions' require 'macos' class Tty - class <#{Tty.white} #{title}#{Tty.reset}" puts sput unless sput.empty? end def oh1 title - title = title.to_s[0, Tty.width - 4] if $stdout.tty? && !ARGV.verbose? + title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose? puts "#{Tty.green}==>#{Tty.white} #{title}#{Tty.reset}" end -- cgit v1.2.3