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/artifact | |
| 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/artifact')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/base.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/base.rb b/Library/Homebrew/cask/lib/hbc/artifact/base.rb index 2d9330b13..ae15552a4 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/base.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/base.rb @@ -1,6 +1,8 @@ module Hbc module Artifact class Base + extend Predicable + def self.artifact_name @artifact_name ||= name.sub(/^.*:/, "").gsub(/(.)([A-Z])/, '\1_\2').downcase end @@ -65,13 +67,7 @@ module Hbc {} end - def verbose? - @verbose - end - - def force? - @force - end + attr_predicate :force?, :verbose? def initialize(cask, command: SystemCommand, force: false, verbose: false) @cask = cask |
