class Caco::Rbenv::Install

Constants

CloneRepo

Public Class Methods

repo_exist?() click to toggle source
# File lib/caco/rbenv/install.rb, line 47
def self.repo_exist?
  File.exist?("/opt/rbenv") ? true : CloneRepo
end

Public Instance Methods

clone_repo(ctx, **) click to toggle source
# File lib/caco/rbenv/install.rb, line 51
def clone_repo(ctx, **)
  result = Caco::Executer.(command: "git clone https://github.com/rbenv/rbenv.git /opt/rbenv")
  result.success?
end
install_packages!(ctx, **) click to toggle source
# File lib/caco/rbenv/install.rb, line 28
def install_packages!(ctx, **)
  packages = []
  if Caco::Facter.("os", "distro", "codename") == "stretch"
    packages = %w(git autoconf bison libssl-dev libyaml-dev libreadline-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev)
  elsif Caco::Facter.("os", "distro", "codename") == "buster"
    packages = %w(git autoconf bison libssl-dev libyaml-dev libreadline-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev)
  end

  packages.each do |package|
    result = Caco::Debian::PackageInstall.(package: package)
    return false if result.failure?
  end
  true
end
repo_exist?(ctx, **) click to toggle source
# File lib/caco/rbenv/install.rb, line 43
def repo_exist?(ctx, **)
  self.class.repo_exist?
end