Class: Switcher
- Inherits:
-
Object
- Object
- Switcher
- Defined in:
- lib/vvm-rb/switcher.rb
Instance Method Summary collapse
-
#initialize(version) ⇒ Switcher
constructor
A new instance of Switcher.
- #use ⇒ Object
Constructor Details
#initialize(version) ⇒ Switcher
Returns a new instance of Switcher.
4 5 6 |
# File 'lib/vvm-rb/switcher.rb', line 4 def initialize(version) @version = version end |
Instance Method Details
#use ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/vvm-rb/switcher.rb', line 8 def use current = get_current_dir FileUtils.rm(current) if File.exist?(current) unless @version == 'system' vims_dir = get_vims_dir(@version) abort "#{@version} is not installed." unless File.exist?(vims_dir) FileUtils.ln_s(vims_dir, current) end end |