Module: PangeaRbenv

Includes:
PangeaBase
Defined in:
lib/pangea-orchestrator/modules.rb

Constant Summary collapse

BIN =
%(rbenv).freeze
RBENV_DIR =
File.join(
  BASE_DIR,
  %(rbenv)
)
VERSIONS_DIR =
File.join(
  RBENV_DIR,
  %(versions)
)

Constants included from PangeaBase

PangeaBase::BASE_DIR

Class Method Summary collapse

Class Method Details

.rbenv_install(version, path) ⇒ Object



42
43
44
45
46
47
# File 'lib/pangea-orchestrator/modules.rb', line 42

def rbenv_install(version, path)
  system %(mkdir -p #{VERSIONS_DIR}) unless Dir.exist?(VERSIONS_DIR)
  if rbenv_installed? && !Dir.exist?(File.join(path.to_s))
    system [BIN, %(install), version.to_s, path.to_s].join(%( ))
  end
end

.rbenv_installed?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/pangea-orchestrator/modules.rb', line 38

def rbenv_installed?
  `which rbenv`.strip != ''
end

.versions_dirObject



34
35
36
# File 'lib/pangea-orchestrator/modules.rb', line 34

def versions_dir
  VERSIONS_DIR
end