Class: Uninstaller
- Inherits:
-
Object
- Object
- Uninstaller
- Defined in:
- lib/vvm-rb/uninstaller.rb
Instance Method Summary collapse
-
#initialize(version) ⇒ Uninstaller
constructor
A new instance of Uninstaller.
- #uninstall ⇒ Object
Constructor Details
#initialize(version) ⇒ Uninstaller
4 5 6 |
# File 'lib/vvm-rb/uninstaller.rb', line 4 def initialize(version) @version = version end |
Instance Method Details
#uninstall ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/vvm-rb/uninstaller.rb', line 8 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 if File.exists?(src_dir) FileUtils.rm_rf(src_dir) end if File.exists?(vims_dir) FileUtils.rm_rf(vims_dir) end end |