Class: Ddenv::Goals::RubyShadowenvCreated
Constant Summary
collapse
- PATH =
".shadowenv.d/10_ruby.lisp"
Instance Method Summary
collapse
Methods inherited from Ddenv::Goal
#==, #eql?, #hash, #post_goals, #with_pre_and_post_goals
Constructor Details
Returns a new instance of RubyShadowenvCreated.
8
9
10
11
12
13
|
# File 'lib/ddenv/goals/ruby_shadowenv_created.rb', line 8
def initialize(ruby_version, ruby_path)
super()
@ruby_version = ruby_version
@ruby_path = ruby_path
end
|
Instance Method Details
#achieve ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/ddenv/goals/ruby_shadowenv_created.rb', line 23
def achieve
File.write(PATH, shadowenv_contents)
cmd = TTY::Command.new(printer: :null)
cmd.run("shadowenv", "trust")
end
|
#achieved? ⇒ Boolean
19
20
21
|
# File 'lib/ddenv/goals/ruby_shadowenv_created.rb', line 19
def achieved?
File.file?(PATH) && File.read(PATH) == shadowenv_contents
end
|
#message ⇒ Object
15
16
17
|
# File 'lib/ddenv/goals/ruby_shadowenv_created.rb', line 15
def message
"Adding Ruby to shadowenv"
end
|
#props ⇒ Object
37
38
39
|
# File 'lib/ddenv/goals/ruby_shadowenv_created.rb', line 37
def props
[@ruby_version, @ruby_path]
end
|