diff options
| author | Nath Tumlin | 2017-03-13 17:52:32 -0500 |
|---|---|---|
| committer | Nath Tumlin | 2017-03-13 17:52:32 -0500 |
| commit | 2080c360e26868efc08a0603c507a0be44c37b67 (patch) | |
| tree | b14f8fc65e29719ce0bb6c389eef683cacee5341 /Library/Homebrew/cask | |
| parent | 250f3445b70ee09cdce4685d500b591978dbf63d (diff) | |
| download | brew-2080c360e26868efc08a0603c507a0be44c37b67.tar.bz2 | |
Added tests for highlight installed and fixed style errors
Diffstat (limited to 'Library/Homebrew/cask')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/search.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/search.rb b/Library/Homebrew/cask/lib/hbc/cli/search.rb index 68d725755..992aca583 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/search.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/search.rb @@ -49,15 +49,12 @@ module Hbc else ohai "Partial matches" end - highlighted = partial_matches.map { |match| highlight_installed match } - puts Formatter.columns(highlighted) + puts Formatter.columns(partial_matches.map(&method(:highlight_installed))) end def self.highlight_installed(token) - if Cask.new(token).installed? - token = pretty_installed token - end - token + return token unless Cask.new(token).installed? + pretty_installed token end def self.help |
