class Nvvm::Uninstaller
Public Class Methods
new(version)
click to toggle source
# File lib/nvvm/uninstaller.rb, line 5 def initialize(version) @version = version end
Public Instance Methods
uninstall()
click to toggle source
# File lib/nvvm/uninstaller.rb, line 9 def uninstall abort "#{@version} can not be uninstalled; It is currently used." if used? src = src_dir(@version) FileUtils.rm_rf(src) if File.exist?(src) end
Private Instance Methods
used?()
click to toggle source
# File lib/nvvm/uninstaller.rb, line 17 def used? current = current_dir return false unless File.exist?(current) File.readlink(current) == src_dir(@version) end