Class: Serverkit::Resources::RbenvRuby

Inherits:
Base
  • Object
show all
Defined in:
lib/serverkit/resources/rbenv_ruby.rb

Constant Summary collapse

DEFAULT_GLOBAL =
false
DEFAULT_RBENV_EXECUTABLE_PATH =
"rbenv"

Instance Method Summary collapse

Instance Method Details

#applyObject

Note:

Override

Install the specified version of Ruby with rbenv if rbenv is executable



17
18
19
20
21
22
23
24
25
# File 'lib/serverkit/resources/rbenv_ruby.rb', line 17

def apply
  if dependencies
    install_dependencies
  end
  if has_rbenv?
    install_specified_ruby_version unless has_specified_ruby_version?
    set_specified_global_version if has_invalid_global_version?
  end
end

#checktrue, false

Note:

Override

Check if rbenv is executable and the specified version of Ruby is installed

Returns:

  • (true, false)

    True if the specified version of Ruby is installed



30
31
32
# File 'lib/serverkit/resources/rbenv_ruby.rb', line 30

def check
  has_correct_dependencies? && has_rbenv? && has_specified_ruby_version? && !has_invalid_global_version?
end