Sha256: aa8917add116083901af7f4574d8acc05f56c6f80ec6f8093eebd5237b28f4dd

Contents?: true

Size: 524 Bytes

Versions: 16

Compression:

Stored size: 524 Bytes

Contents

require 'fileutils'

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

  def uninstall
    current  = get_current_dir
    vims_dir = get_vims_dir(@version)
    src_dir  = get_src_dir(@version)
    if File.exists?(current)
      target = File.readlink(current)
      if target == vims_dir
        abort "#{@version} can not be uninstalled; it is currently used."
      end
    end
    FileUtils.rm_rf(src_dir) if File.exists?(src_dir)
    FileUtils.rm_rf(vims_dir) if File.exists?(vims_dir)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vvm-rb-0.1.6 lib/vvm-rb/uninstaller.rb
vvm-rb-0.1.5 lib/vvm-rb/uninstaller.rb
vvm-rb-0.1.4 lib/vvm-rb/uninstaller.rb
vvm-rb-0.1.3 lib/vvm-rb/uninstaller.rb
vvm-rb-0.1.2 lib/vvm-rb/uninstaller.rb
vvm-rb-0.1.1 lib/vvm-rb/uninstaller.rb
vvm-rb-0.1.0 lib/vvm-rb/uninstaller.rb
vvm-rb-0.0.15 lib/vvm-rb/uninstaller.rb
vvm-rb-0.0.14 lib/vvm-rb/uninstaller.rb
vvm-rb-0.0.13 lib/vvm-rb/uninstaller.rb
vvm-rb-0.0.12 lib/vvm-rb/uninstaller.rb
vvm-rb-0.0.11 lib/vvm-rb/uninstaller.rb
vvm-rb-0.0.10 lib/vvm-rb/uninstaller.rb
vvm-rb-0.0.9 lib/vvm-rb/uninstaller.rb
vvm-rb-0.0.8 lib/vvm-rb/uninstaller.rb
vvm-rb-0.0.7 lib/vvm-rb/uninstaller.rb