class ActiveScripts::Packages::Rbenv

Private Instance Methods

install() click to toggle source

INFO: ActiveScripts::Packages::Rbenv contains code that

execute the rbenv package.
# File lib/active_scripts/packages/rbenv.rb, line 10
def install
  if package_installed?(includes: "rbenv")
    notify_package_exists!
  else
    case $operating_system
    when :macosx
      execute_command!("brew install rbenv")
      execute_command!("cat #{addendum_path!('rbenv.txt')} >> ~/.bash_profile")
      execute_command!("source ~/.bash_profile")
      say_ok("   Installation complete!")
    when :linux
      execute_command!("brew install rbenv")
      execute_command!("cat #{addendum_path!('rbenv.txt')} >> ~/.bashrc")
      execute_command!("source ~/.bashrc")
      say_ok("   Installation complete!")
    else
      notify_package_unavailable!
    end
  end
end
uninstall() click to toggle source
# File lib/active_scripts/packages/rbenv.rb, line 46
def uninstall
  if package_installed?(includes: "rbenv")
    case $operating_system
    when :macosx, :linux
      execute_command!("brew remove rbenv")
      say_ok("   Uninstallation complete!")
    else
      notify_package_unavailable!
    end
  else
    notify_package_missing!
  end
end
upgrade() click to toggle source
# File lib/active_scripts/packages/rbenv.rb, line 31
def upgrade
  if package_installed?(includes: "rbenv")
    case $operating_system
    when :macosx, :linux
      output = execute_command!("brew upgrade rbenv")
      say_warning("   [!] #{output.squish}") unless option_dry_run? || package_output?(output, includes: "Error:")
      say_ok("   Upgrade complete!")
    else
      notify_package_unavailable!
    end
  else
    notify_package_missing!
  end
end