diff options
| author | Markus Reiter | 2017-07-01 05:32:19 +0200 |
|---|---|---|
| committer | GitHub | 2017-07-01 05:32:19 +0200 |
| commit | fd5e673d2d367eff03f1411d909ca0bbb2003a2c (patch) | |
| tree | f908de0884ea7048aa79caedc726ef8a8cc12818 /Library/Homebrew/cask/lib/hbc/utils.rb | |
| parent | 0a5052141d59ece4adb3c9dbd62096c7a2ed7282 (diff) | |
| parent | 6a1fa87191bfef31ff1b2d47d3ebf281398a210f (diff) | |
| download | brew-fd5e673d2d367eff03f1411d909ca0bbb2003a2c.tar.bz2 | |
Merge pull request #2825 from reitermarkus/refactoring
Refactoring using `Forwardable` and `DelegateClass`.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/utils.rb')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/utils.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/utils.rb b/Library/Homebrew/cask/lib/hbc/utils.rb index 59e85aaeb..22f826e74 100644 --- a/Library/Homebrew/cask/lib/hbc/utils.rb +++ b/Library/Homebrew/cask/lib/hbc/utils.rb @@ -4,24 +4,15 @@ require "stringio" BUG_REPORTS_URL = "https://github.com/caskroom/homebrew-cask#reporting-bugs".freeze -# monkeypatch Object - not a great idea -class Object - def utf8_inspect - return inspect unless defined?(Encoding) - return map(&:utf8_inspect) if respond_to?(:map) - inspect.force_encoding("UTF-8").sub(/\A"(.*)"\Z/, '\1') - end -end - class Buffer < StringIO + extend Predicable + + attr_predicate :tty? + def initialize(tty = false) super() @tty = tty end - - def tty? - @tty - end end # global methods |
