Class: Ddenv::Goals::NodeInstalled
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Ddenv::Goal
#==, #eql?, #hash, #props, #with_pre_and_post_goals
Constructor Details
#initialize(node_version) ⇒ NodeInstalled
Returns a new instance of NodeInstalled.
8
9
10
11
12
|
# File 'lib/ddenv/goals/node_installed.rb', line 8
def initialize(node_version)
super()
@node_version = node_version.to_s
end
|
Instance Attribute Details
#node_version ⇒ Object
Returns the value of attribute node_version.
6
7
8
|
# File 'lib/ddenv/goals/node_installed.rb', line 6
def node_version
@node_version
end
|
Instance Method Details
#achieve ⇒ Object
22
23
24
25
26
|
# File 'lib/ddenv/goals/node_installed.rb', line 22
def achieve
cmd = TTY::Command.new(printer: :null)
cmd.run("node-build", node_version, node_pathname.to_s)
end
|
#achieved? ⇒ Boolean
18
19
20
|
# File 'lib/ddenv/goals/node_installed.rb', line 18
def achieved?
node_pathname.directory?
end
|
#message ⇒ Object
14
15
16
|
# File 'lib/ddenv/goals/node_installed.rb', line 14
def message
"Installing Node v#{node_version}"
end
|
#post_goals ⇒ Object
34
35
36
37
38
|
# File 'lib/ddenv/goals/node_installed.rb', line 34
def post_goals
[
NodeShadowenvCreated.new(node_version, node_pathname.to_s)
]
end
|
#pre_goals ⇒ Object
28
29
30
31
32
|
# File 'lib/ddenv/goals/node_installed.rb', line 28
def pre_goals
[
NodeBuildInstalled.new
]
end
|