Class: Ddenv::Goals::HomebrewPackageInstalled
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Ddenv::Goal
#==, #eql?, #hash, #post_goals, #pre_goals, #with_pre_and_post_goals
Constructor Details
Returns a new instance of HomebrewPackageInstalled.
8
9
10
11
|
# File 'lib/ddenv/goals/homebrew_package_installed.rb', line 8
def initialize(package_name)
super()
@package_name = package_name
end
|
Instance Attribute Details
#package_name ⇒ Object
Returns the value of attribute package_name.
6
7
8
|
# File 'lib/ddenv/goals/homebrew_package_installed.rb', line 6
def package_name
@package_name
end
|
Instance Method Details
#achieve ⇒ Object
21
22
23
24
25
|
# File 'lib/ddenv/goals/homebrew_package_installed.rb', line 21
def achieve
cmd = TTY::Command.new(printer: :null)
cmd.run("brew", "install", @package_name)
end
|
#achieved? ⇒ Boolean
17
18
19
|
# File 'lib/ddenv/goals/homebrew_package_installed.rb', line 17
def achieved?
Homebrew.package_installed?(@package_name)
end
|
#message ⇒ Object
13
14
15
|
# File 'lib/ddenv/goals/homebrew_package_installed.rb', line 13
def message
"Installing Homebrew package #{@package_name}"
end
|
#props ⇒ Object
27
28
29
|
# File 'lib/ddenv/goals/homebrew_package_installed.rb', line 27
def props
[@package_name]
end
|