Sha256: 13c93a55a3c565afcddb7f897452a164c5d0ab9b757b5c2b5ff355b37cf18fc2

Contents?: true

Size: 830 Bytes

Versions: 1

Compression:

Stored size: 830 Bytes

Contents

module XcodeInstall
	class PlainInformative < StandardError
    	include CLAide::InformativeError
  	end

	class Informative < PlainInformative
    	def message
      		"[!] #{super}".red
    	end
  	end

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

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

			def initialize(argv)
				@installer = Installer.new
				@version = argv.shift_argument
			end

			def validate!
				raise Informative, "Version #{@version} doesn't exist." unless @installer.exist?(@version)
			end

			def run
				dmgPath = @installer.download(@version)
				raise Informative, "Failed to download Xcode #{@version}." if dmgPath.nil?

				@installer.install_dmg(dmgPath, "-#{@version}")
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xcode-install-0.0.1 lib/xcode/install/install.rb