Class: XcodeInstaller::Download
- Inherits:
-
Object
- Object
- XcodeInstaller::Download
- Defined in:
- lib/xcode-installer/download.rb
Instance Attribute Summary collapse
-
#release ⇒ Object
Returns the value of attribute release.
Instance Method Summary collapse
Instance Attribute Details
#release ⇒ Object
Returns the value of attribute release.
9 10 11 |
# File 'lib/xcode-installer/download.rb', line 9 def release @release end |
Instance Method Details
#action(args, options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/xcode-installer/download.rb', line 11 def action(args, ) download_type = (args.include? 'cli') ? 'cli' : 'gui' mgr = XcodeInstaller::ReleaseManager.new @release = mgr.get_release(.release, .pre_release, download_type) if @release xcode_url = @release['download_url'] else puts "No Xcode release with number #{.release}. Use the 'list' command to see a list of known releases." exit end puts "Downloading Xcode #{@release['version']}" puts xcode_url agent.verbose = .verbose agent.dry_run = .dry_run try { filename = agent.download(xcode_url) puts "File saved to: #{Dir.pwd}/#{filename}" if filename } end |