Sha256: 0d0d258ebc664cafab04274c20d793c5a74834d2cb6bfbde8e04fb17cc5a0862

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

module XcodeInstall
  class Command
    class Install < Command
      self.command = 'install'
      self.summary = 'Install a specific version of Xcode.'

      self.arguments = [
        CLAide::Argument.new('VERSION', :true)
      ]

      def self.options
        [['--no-switch', 'Don’t switch to this version after installation'],
         ['--no-install', 'Only download DMG, but do not install it.'],
         ['--no-progress', 'Don’t show download progress.'],
         ['--no-install-components', 'Don’t install additional components.'],
         ['--no-clean', 'Don’t delete DMG after installation.']].concat(super)
      end

      def initialize(argv)
        @installer = Installer.new
        @version = argv.shift_argument
        @should_clean = argv.flag?('clean', true)
        @should_install = argv.flag?('install', true)
        @should_switch = argv.flag?('switch', true)
        @progress = argv.flag?('progress', true)
        @components = argv.flag?('components', true)
        super
      end

      def validate!
        super

        return if @version.nil?
        fail Informative, "Version #{@version} already installed." if @installer.installed?(@version)
        fail Informative, "Version #{@version} doesn't exist." unless @installer.exist?(@version)
      end

      def run
        return if @version.nil?
        @installer.install_version(@version, @should_switch, @should_clean, @should_install,
          @progress, @components)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xcode-install-0.9.5 lib/xcode/install/install.rb
xcode-install-0.9.4 lib/xcode/install/install.rb
xcode-install-0.9.3 lib/xcode/install/install.rb
xcode-install-0.9.2 lib/xcode/install/install.rb