From 198bf4d3bdeaf3047f9af80788ea18cd192541af Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 2 Oct 2016 20:39:43 +0200 Subject: Convert `puts_columns` to `puts Formatter.columns`. --- Library/Homebrew/cask/lib/hbc/cli/install.rb | 8 +++++--- Library/Homebrew/cask/lib/hbc/cli/list.rb | 2 +- Library/Homebrew/cask/lib/hbc/cli/search.rb | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'Library/Homebrew/cask') diff --git a/Library/Homebrew/cask/lib/hbc/cli/install.rb b/Library/Homebrew/cask/lib/hbc/cli/install.rb index 1292ad076..3e9ce4e4f 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/install.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/install.rb @@ -42,12 +42,14 @@ module Hbc def self.warn_unavailable_with_suggestion(cask_token, e) exact_match, partial_matches = Search.search(cask_token) + error_message = e.message if exact_match - onoe e.message.concat(". Did you mean:\n#{exact_match}") + error_message.concat(". Did you mean:\n#{exact_match}") elsif !partial_matches.empty? - onoe e.message.concat(". Did you mean one of:") - $stderr.puts_columns(partial_matches.take(20)) + error_message.concat(". Did you mean one of:\n") + .concat(Formatter.columns(partial_matches.take(20))) end + onoe error_message end def self.help diff --git a/Library/Homebrew/cask/lib/hbc/cli/list.rb b/Library/Homebrew/cask/lib/hbc/cli/list.rb index 3a993f8e6..330c81b90 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/list.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/list.rb @@ -68,7 +68,7 @@ module Hbc elsif @options[:versions] puts installed_casks.map(&method(:format_versioned)) else - puts_columns installed_casks.map(&:to_s) + puts Formatter.columns(installed_casks.map(&:to_s)) end installed_casks.empty? ? nil : true diff --git a/Library/Homebrew/cask/lib/hbc/cli/search.rb b/Library/Homebrew/cask/lib/hbc/cli/search.rb index b671ea862..147e6d194 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/search.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/search.rb @@ -47,7 +47,7 @@ module Hbc else ohai "Partial matches" end - puts_columns partial_matches + puts Formatter.columns(partial_matches) end end -- cgit v1.2.3