class Nvvm::Cli

Public Instance Methods

install(version, *conf) click to toggle source
# File lib/nvvm/cli.rb, line 10
def install(version, *conf)
  installer = Installer.new(Version.format(version), conf)
  installer.checkout
  installer.make_install
  Installer.cp_etc
  invoke :use, [version], {} if options[:use]
  installer.message
end
invoke_command(command, *args) click to toggle source
Calls superclass method
# File lib/nvvm/cli.rb, line 68
def invoke_command(command, *args)
  validate_before_invoke(command.name)
  super
end
list() click to toggle source
# File lib/nvvm/cli.rb, line 52
def list
  Installer.pull
  puts Version.list.join("\n")
end
rebuild(version, *conf) click to toggle source
# File lib/nvvm/cli.rb, line 40
def rebuild(version, *conf)
  installer = Installer.new(Version.format(version), conf)
  installer.make_clean
  installer.make_install
end
reinstall(version, *conf) click to toggle source
# File lib/nvvm/cli.rb, line 34
def reinstall(version, *conf)
  invoke :uninstall, [version]
  invoke :install, [version, *conf]
end
uninstall(version) click to toggle source
# File lib/nvvm/cli.rb, line 63
def uninstall(version)
  Uninstaller.new(Version.format(version)).uninstall
end
update() click to toggle source
# File lib/nvvm/cli.rb, line 20
def update
  Installer.pull
  if (current = Version.current) == 'system'
    run 'nvvm install --use latest'
    run 'nvvm use system' unless $?.success?
  else
    run 'nvvm use system'
    run 'nvvm install --use latest'
    action = $?.success? ? 'uninstall' : 'use'
    run "nvvm #{action} #{current}"
  end
end
use(version) click to toggle source
# File lib/nvvm/cli.rb, line 47
def use(version)
  Switcher.new(Version.format(version)).use
end
versions() click to toggle source
# File lib/nvvm/cli.rb, line 58
def versions
  puts Version.versions.join("\n")
end