Class: Ddenv::Goals::GemInstalled
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 GemInstalled.
6
7
8
9
|
# File 'lib/ddenv/goals/gem_installed.rb', line 6
def initialize(gem_name)
super()
@gem_name = gem_name
end
|
Instance Method Details
#achieve ⇒ Object
21
22
23
24
25
|
# File 'lib/ddenv/goals/gem_installed.rb', line 21
def achieve
cmd = TTY::Command.new(printer: :null)
cmd.run("shadowenv", "exec", "--", "gem", "install", @gem_name)
end
|
#achieved? ⇒ Boolean
15
16
17
18
19
|
# File 'lib/ddenv/goals/gem_installed.rb', line 15
def achieved?
cmd = TTY::Command.new(printer: :null)
stdout, _stderr = cmd.run("shadowenv", "exec", "--", "gem", "list", "-i", "^#{@gem_name}$")
stdout.chomp == "true"
end
|
#message ⇒ Object
11
12
13
|
# File 'lib/ddenv/goals/gem_installed.rb', line 11
def message
"Installing Ruby gem #{@gem_name}"
end
|
#props ⇒ Object
27
28
29
|
# File 'lib/ddenv/goals/gem_installed.rb', line 27
def props
[@gem_name]
end
|