aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/installer.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-06-26 07:30:28 +0200
committerMarkus Reiter2017-06-28 09:25:31 +0200
commit3b4ee58c491f164c2751c1c0f941568c35fb0ac6 (patch)
treeeb6690a2d0e872c3f7e317d5aeadb0eb03697195 /Library/Homebrew/cask/lib/hbc/installer.rb
parent4fb60d89886758884fae29566fc04de66837f0c6 (diff)
downloadbrew-3b4ee58c491f164c2751c1c0f941568c35fb0ac6.tar.bz2
Refactor using `Forwardable` and `DelegateClass`.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/installer.rb')
-rw-r--r--Library/Homebrew/cask/lib/hbc/installer.rb19
1 files changed, 3 insertions, 16 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb
index aa6d600f7..0477cbd22 100644
--- a/Library/Homebrew/cask/lib/hbc/installer.rb
+++ b/Library/Homebrew/cask/lib/hbc/installer.rb
@@ -6,6 +6,7 @@ require "hbc/verify"
module Hbc
class Installer
+ extend Predicable
# TODO: it is unwise for Hbc::Staged to be a module, when we are
# dealing with both staged and unstaged Casks here. This should
# either be a class which is only sometimes instantiated, or there
@@ -27,21 +28,7 @@ module Hbc
@reinstall = false
end
- def skip_cask_deps?
- @skip_cask_deps
- end
-
- def force?
- @force
- end
-
- def binaries?
- @binaries
- end
-
- def verbose?
- @verbose
- end
+ attr_predicate :binaries?, :force?, :skip_cask_deps?, :require_sha?, :verbose?
def self.print_caveats(cask)
odebug "Printing caveats"
@@ -75,7 +62,7 @@ module Hbc
odebug "Hbc::Installer#fetch"
satisfy_dependencies
- verify_has_sha if @require_sha && !force?
+ verify_has_sha if require_sha? && !force?
download
verify
end