Class: Vvm::Cli
- Inherits:
-
Thor
show all
- Includes:
- Thor::Actions, Validator
- Defined in:
- lib/vvm/cli.rb
Constant Summary
Constants included
from Validator
Validator::METHOD_MAP
Instance Method Summary
collapse
Methods included from Validator
hg?, installed_version?, new_version?, validate_before_invoke, version?
Instance Method Details
#install(version, *conf) ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'lib/vvm/cli.rb', line 10
def install(version, *conf)
i = Installer.new(Version.format(version), conf)
i.checkout
i.configure
i.make_install
Installer.cp_etc
invoke :use, [version], {} if options[:use]
i.message
end
|
#rebuild(version, *conf) ⇒ Object
41
42
43
44
45
46
|
# File 'lib/vvm/cli.rb', line 41
def rebuild(version, *conf)
r = Installer.new(Version.format(version), conf)
r.make_clean
r.configure
r.make_install
end
|
#reinstall(version, *conf) ⇒ Object
35
36
37
38
|
# File 'lib/vvm/cli.rb', line 35
def reinstall(version, *conf)
invoke :uninstall, [version]
invoke :install, [version, *conf]
end
|
#uninstall(version) ⇒ Object
#update ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/vvm/cli.rb', line 21
def update
Installer.pull
if (current = Version.current) == 'system'
run 'vvm install --use latest'
run 'vvm use system' unless $?.success?
else
run 'vvm use system'
run 'vvm install --use latest'
action = $?.success? ? 'uninstall' : 'use'
run "vvm #{action} #{current}"
end
end
|
#versions ⇒ Object
60
61
62
|
# File 'lib/vvm/cli.rb', line 60
def versions
puts Version.versions.join("\n")
end
|