Sha256: 6012ac08464a33fb1d99ca92e3a61fd3383270a199408a61833e8c9489dc5226

Contents?: true

Size: 521 Bytes

Versions: 3

Compression:

Stored size: 521 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.exist?(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.exist?(src_dir)
    FileUtils.rm_rf(vims_dir) if File.exist?(vims_dir)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vvm-rb-0.2.2 lib/vvm-rb/uninstaller.rb
vvm-rb-0.2.1 lib/vvm-rb/uninstaller.rb
vvm-rb-0.2.0 lib/vvm-rb/uninstaller.rb