diff options
| author | Markus Reiter | 2016-08-26 16:04:47 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-10-01 20:00:49 +0200 |
| commit | 6d8ee395fa5878282a1ce3975b632103448be042 (patch) | |
| tree | 557520df749494a6a58ee54a139d4238ad41380d /Library/Homebrew/cask/lib | |
| parent | 19e633f1900ea910c2a9db85dc7c7bea0825676d (diff) | |
| download | brew-6d8ee395fa5878282a1ce3975b632103448be042.tar.bz2 | |
Refactor Tty.
Diffstat (limited to 'Library/Homebrew/cask/lib')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/moved.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/info.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/style.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/installer.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/utils.rb | 11 |
5 files changed, 8 insertions, 14 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb index 6095887e3..ff6e5f273 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb @@ -81,11 +81,10 @@ module Hbc if target.exist? target_abv = " (#{target.abv})" else - warning = "Missing #{self.class.artifact_english_name}" - warning = "#{Tty.red}#{warning}#{Tty.reset}: " + error = "#{Tty.red}Missing #{self.class.artifact_english_name}:#{Tty.reset} " end - "#{warning}#{printable_target}#{target_abv}" + "#{error}#{printable_target}#{target_abv}" end end end diff --git a/Library/Homebrew/cask/lib/hbc/cli/info.rb b/Library/Homebrew/cask/lib/hbc/cli/info.rb index 7fbdff3eb..e2f360296 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/info.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/info.rb @@ -27,7 +27,7 @@ module Hbc end def self.formatted_url(url) - "#{Tty.em}#{url}#{Tty.reset}" + "#{Tty.underline}#{url}#{Tty.reset}" end def self.installation_info(cask) diff --git a/Library/Homebrew/cask/lib/hbc/cli/style.rb b/Library/Homebrew/cask/lib/hbc/cli/style.rb index 66117da8b..bb179fb0c 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/style.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/style.rb @@ -30,7 +30,7 @@ module Hbc begin Homebrew.install_gem_setup_path! "rubocop-cask", RUBOCOP_CASK_VERSION, "rubocop" rescue SystemExit - raise CaskError, $stderr.string.chomp.sub("#{Tty.red}Error#{Tty.reset}: ", "") + raise CaskError, Tty.strip_ansi($stderr.string).chomp.sub(/\AError: /, "") end end end diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb index f0cc0d1a9..1002be460 100644 --- a/Library/Homebrew/cask/lib/hbc/installer.rb +++ b/Library/Homebrew/cask/lib/hbc/installer.rb @@ -87,7 +87,7 @@ module Hbc s = if MacOS.version >= :lion && !ENV["HOMEBREW_NO_EMOJI"] (ENV["HOMEBREW_INSTALL_BADGE"] || "\xf0\x9f\x8d\xba") + " " else - "#{Tty.blue}==>#{Tty.reset} #{Tty.white}Success!#{Tty.reset} " + "#{Tty.blue}==>#{Tty.reset} #{Tty.bold}Success!#{Tty.reset} " end s << "#{@cask} was successfully installed!" end diff --git a/Library/Homebrew/cask/lib/hbc/utils.rb b/Library/Homebrew/cask/lib/hbc/utils.rb index 9159544a6..c6a970fca 100644 --- a/Library/Homebrew/cask/lib/hbc/utils.rb +++ b/Library/Homebrew/cask/lib/hbc/utils.rb @@ -32,11 +32,6 @@ end def odebug(title, *sput) return unless Hbc.respond_to?(:debug) return unless Hbc.debug - - width = Tty.width * 4 - 6 - if $stdout.tty? && title.to_s.length > width - title = title.to_s[0, width - 3] + "..." - end puts "#{Tty.magenta}==>#{Tty.reset} #{Tty.white}#{title}#{Tty.reset}" puts sput unless sput.empty? end @@ -152,11 +147,11 @@ module Hbc <<-EOS.undent Most likely, this means you have an outdated version of Homebrew-Cask. Please run: - #{Tty.green}#{UPDATE_CMD} + #{Tty.green}#{UPDATE_CMD}#{Tty.reset} - #{Tty.reset}If this doesn’t fix the problem, please report this bug: + If this doesn’t fix the problem, please report this bug: - #{Tty.em}#{ISSUES_URL}#{Tty.reset} + #{Tty.underline}#{ISSUES_URL}#{Tty.reset} EOS end |
