Class: Ddenv::Goals::NodeShadowenvCreated
Constant Summary
collapse
- PATH =
".shadowenv.d/20_node.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 NodeShadowenvCreated.
8
9
10
11
12
13
|
# File 'lib/ddenv/goals/node_shadowenv_created.rb', line 8
def initialize(node_version, node_path)
super()
@node_version = node_version
@node_path = node_path
end
|
Instance Method Details
#achieve ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/ddenv/goals/node_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/node_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/node_shadowenv_created.rb', line 15
def message
"Adding Node to shadowenv"
end
|
#props ⇒ Object
37
38
39
|
# File 'lib/ddenv/goals/node_shadowenv_created.rb', line 37
def props
[@node_version, @node_path]
end
|