Sha256: 6a8fdf3a573750ea9b1a57705b7a04d876c7b14575c30d295ef45dbce88d227e

Contents?: true

Size: 393 Bytes

Versions: 3

Compression:

Stored size: 393 Bytes

Contents

require 'fileutils'

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

    def use
      current = current_dir
      FileUtils.rm(current) if File.exist?(current)
      return if @version == 'system'

      src = src_dir(@version)
      abort "#{@version} is not installed." unless File.exist?(src)
      FileUtils.ln_s(src, current)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nvvm-0.5.0 lib/nvvm/switcher.rb
nvvm-0.4.0 lib/nvvm/switcher.rb
nvvm-0.3.0 lib/nvvm/switcher.rb