Sha256: eef7f855c4a84952d1679de8db4d9440750b0660cf93aabca9428115edd62d95

Contents?: true

Size: 417 Bytes

Versions: 1

Compression:

Stored size: 417 Bytes

Contents

require 'fileutils'

class Switcher
  def initialize(version)
    @version = version
  end

  def use
    current = get_current_dir
    if Dir.exists?(current)
      FileUtils.rm(current)
    end
    unless @version == 'system'
      vims_dir = get_vims_dir(@version)
      unless Dir.exists?(vims_dir)
        abort "#{@version} is not installed."
      end
      FileUtils.ln_s(vims_dir, current)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vvm-rb-0.0.4 lib/vvm-rb/switcher.rb