Class: Ddenv::Goals::RubyInstalled
Instance Method Summary
collapse
Methods inherited from Ddenv::Goal
#==, #eql?, #hash, #initialize, #props, #with_pre_and_post_goals
Constructor Details
This class inherits a constructor from Ddenv::Goal
Instance Method Details
#achieve ⇒ Object
15
16
17
18
19
|
# File 'lib/ddenv/goals/ruby_installed.rb', line 15
def achieve
cmd = TTY::Command.new(printer: :null)
cmd.run("ruby-install", "--cleanup", ruby_version)
end
|
#achieved? ⇒ Boolean
10
11
12
13
|
# File 'lib/ddenv/goals/ruby_installed.rb', line 10
def achieved?
pathname = Pathname.new(Dir.home) / ".rubies" / "ruby-#{ruby_version}"
pathname.directory?
end
|
#message ⇒ Object
6
7
8
|
# File 'lib/ddenv/goals/ruby_installed.rb', line 6
def message
"Installing Ruby v#{ruby_version}"
end
|
#post_goals ⇒ Object
27
28
29
30
31
|
# File 'lib/ddenv/goals/ruby_installed.rb', line 27
def post_goals
[
RubyShadowenvCreated.new(ruby_version, ruby_pathname.to_s)
]
end
|