Class: XcodeInstall::Command::Install
- Inherits:
-
XcodeInstall::Command
- Object
- CLAide::Command
- XcodeInstall::Command
- XcodeInstall::Command::Install
- Defined in:
- lib/xcode/install/install.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Install
constructor
A new instance of Install.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Install
Returns a new instance of Install.
16 17 18 19 20 21 22 |
# File 'lib/xcode/install/install.rb', line 16 def initialize(argv) @installer = Installer.new @version = argv.shift_argument @should_clean = argv.flag?('clean', true) @should_switch = argv.flag?('switch', true) super end |
Class Method Details
.options ⇒ Object
11 12 13 14 |
# File 'lib/xcode/install/install.rb', line 11 def self. [['--no-switch', 'Don’t switch to this version after installation'], ['--no-clean', 'Don’t delete DMG after installation.']].concat(super) end |
Instance Method Details
#run ⇒ Object
30 31 32 33 |
# File 'lib/xcode/install/install.rb', line 30 def run return if @version.nil? @installer.install_version(@version, @should_switch, @should_clean) end |
#validate! ⇒ Object
24 25 26 27 28 |
# File 'lib/xcode/install/install.rb', line 24 def validate! return if @version.nil? raise Informative, "Version #{@version} already installed." if @installer.installed?(@version) raise Informative, "Version #{@version} doesn't exist." unless @installer.exist?(@version) end |