Class: XcodeInstall::Command::Uninstall
- Inherits:
-
XcodeInstall::Command
- Object
- CLAide::Command
- XcodeInstall::Command
- XcodeInstall::Command::Uninstall
- Defined in:
- lib/xcode/install/uninstall.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Uninstall
constructor
A new instance of Uninstall.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from XcodeInstall::Command
Constructor Details
Instance Method Details
#run ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/xcode/install/uninstall.rb', line 24 def run installed_path = @installer.installed_versions.find { |x| x.version == @version } return if installed_path.nil? || installed_path.path.nil? `sudo rm -rf #{installed_path.path}` return unless @installer.symlinks_to == installed_path.path newest_version = @installer.installed_versions.last @installer.symlink(newest_version) end |
#validate! ⇒ Object
17 18 19 20 21 22 |
# File 'lib/xcode/install/uninstall.rb', line 17 def validate! super help! 'A VERSION argument is required.' unless @version fail Informative, "Version #{@version} is not installed." unless @installer.installed?(@version) end |