xcode-install 0.9.6 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42dac883f70abe088d3de8820a9f465b097bd121
4
- data.tar.gz: 29abe4bcda93cc9d5da4fd38b594c527f06fd57f
3
+ metadata.gz: a2b948df58ca7b2f2c720472b89214775f134d23
4
+ data.tar.gz: 15aa407f7d766643d655e2a80df65e90498ddb24
5
5
  SHA512:
6
- metadata.gz: e060a74eb4a236a12cd19d14c76a04dada5e8343f4318664187fec2d0bb2c5c22455621b4c705241bca4674a36bbbf4b7125b055a38ab1da49fc78711d2f0822
7
- data.tar.gz: 4a9f4578d366f38d424838bab7d99ba766db809088863281e2d4d69561bbdc0220c90818cf3c0c734884657bafc11f7449eba27184027b6777cab20cf3fcb7af
6
+ metadata.gz: 1bebaacc5640edecaa090ab1cfd80a381c2c50564f2af37cfc148b8b734d74019b967fd0f4ec17041e3a4018ada81868872e1bb9d180eee4264894c079bb1bd7
7
+ data.tar.gz: c1dddfc1b74d0da06784eeb4c0a12f0afed8be3dcd072e5f6ef366976e563292f01163cee594ece527d904c195eed7db0da370e940b060009088b4797b0f6e84
data/README.md CHANGED
@@ -9,19 +9,19 @@ Install and update your Xcodes automatically.
9
9
 
10
10
  ```bash
11
11
  $ gem install xcode-install
12
- $ xcode-install install 6.3
12
+ $ xcversion install 6.3
13
13
  ```
14
14
 
15
15
  ## Installation
16
16
 
17
17
  ```bash
18
- $ gem install xcode-install
18
+ $ gem install xcversion
19
19
  ```
20
20
 
21
21
  ## Usage
22
22
 
23
23
  XcodeInstall needs environment variables with your credentials to access the Apple Developer
24
- Center, they are stored using the [CredentialsManager][1] of [Fastlane][2]:
24
+ Center, they are stored using the [CredentialsManager][1] of [fastlane][2]:
25
25
 
26
26
  ```
27
27
  XCODE_INSTALL_USER
@@ -31,7 +31,7 @@ XCODE_INSTALL_PASSWORD
31
31
  To list available versions:
32
32
 
33
33
  ```bash
34
- $ xcode-install list
34
+ $ xcversion list
35
35
  6.0.1
36
36
  6.1
37
37
  6.1.1
@@ -44,7 +44,7 @@ By default, only the latest major version is listed.
44
44
  To install a certain version, simply:
45
45
 
46
46
  ```bash
47
- $ xcode-install install 6.3
47
+ $ xcversion install 6.3
48
48
  ########################################################### 82.1%
49
49
  ######################################################################## 100.0%
50
50
  Please authenticate for Xcode installation...
@@ -58,12 +58,16 @@ This will download and install that version of Xcode. It will also be automatica
58
58
  Note: GMs and beta versions usually have special names, e.g.
59
59
 
60
60
  ```bash
61
- $ xcode-install list
61
+ $ xcversion list
62
62
  7 GM seed
63
63
  7.1 beta
64
64
  ```
65
65
 
66
- they have to be installed using the full name, e.g. `xcode-install install '7 GM seed'`.
66
+ they have to be installed using the full name, e.g. `xcversion install '7 GM seed'`.
67
+
68
+ ### Command Line Tools
69
+
70
+ XcodeInstall can also install Xcode's Command Line Tools by calling `xcversion install-cli-tools`.
67
71
 
68
72
  ## Limitations
69
73
 
@@ -91,6 +95,9 @@ project, especially [@henrikhodne][6] and [@lacostej][7] for making XcodeInstall
91
95
  4. Push to the branch (`git push origin my-new-feature`)
92
96
  5. Create a new Pull Request
93
97
 
98
+ ## Help needed
99
+
100
+ Follow [@NeoNacho](https://twitter.com/NeoNacho) to help me beat [@orta](https://twitter.com/orta) in followers count.
94
101
 
95
102
  [1]: https://github.com/fastlane/credentials_manager#using-environment-variables
96
103
  [2]: http://fastlane.tools
data/bin/xcode-install CHANGED
@@ -1,12 +1,5 @@
1
- #!/usr/bin/env ruby
2
-
3
- if $PROGRAM_NAME == __FILE__
4
- ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
5
- require 'rubygems'
6
- require 'bundler/setup'
7
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
8
- end
9
-
10
- require 'xcode/install'
11
-
12
- XcodeInstall::Command.run(ARGV)
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ >&2 echo 'DEPRECATED: `xcode-install` is now named `🎉` (or `xcversion`)'
4
+ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5
+ exec $DIR/xcversion $@
data/bin/xcversion ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if $PROGRAM_NAME == __FILE__
4
+ ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
5
+ require 'rubygems'
6
+ require 'bundler/setup'
7
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
8
+ end
9
+
10
+ require 'xcode/install'
11
+
12
+ XcodeInstall::Command.run(ARGV)
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if $PROGRAM_NAME == __FILE__
4
+ ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
5
+ require 'rubygems'
6
+ require 'bundler/setup'
7
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
8
+ end
9
+
10
+ require 'xcode/install'
11
+
12
+ XcodeInstall::Command.run(ARGV)
data/lib/xcode/install.rb CHANGED
@@ -44,12 +44,12 @@ module XcodeInstall
44
44
  File.symlink?(SYMLINK_PATH) ? SYMLINK_PATH : nil
45
45
  end
46
46
 
47
- def download(version, progress)
48
- return unless exist?(version)
47
+ def download(version, progress, url = nil)
48
+ return unless exist?(version) || url
49
49
  xcode = seedlist.find { |x| x.name == version }
50
- dmg_file = Pathname.new(File.basename(xcode.path))
50
+ dmg_file = Pathname.new(File.basename(url || xcode.path))
51
51
 
52
- result = Curl.new.fetch(xcode.url, CACHE_DIR, spaceship.cookie, dmg_file, progress)
52
+ result = Curl.new.fetch(url || xcode.url, CACHE_DIR, spaceship.cookie, dmg_file, progress)
53
53
  result ? CACHE_DIR + dmg_file : nil
54
54
  end
55
55
 
@@ -75,11 +75,12 @@ module XcodeInstall
75
75
  source = Dir.glob('/Volumes/Xcode/Xcode*.app').first
76
76
 
77
77
  if source.nil?
78
- $stderr.puts <<-HELP
78
+ out <<-HELP
79
79
  No `Xcode.app` found in DMG. Please remove #{dmgPath} if you suspect a corrupted
80
- download or run `xcode-install update` to see if the version you tried to install
80
+ download or run `xcversion update` to see if the version you tried to install
81
81
  has been pulled by Apple. If none of this is true, please open a new GH issue.
82
82
  HELP
83
+ $stderr.puts out.gsub("\n", ' ')
83
84
  return
84
85
  end
85
86
 
@@ -92,7 +93,7 @@ HELP
92
93
  end
93
94
 
94
95
  enable_developer_mode
95
- `sudo xcodebuild -license accept` unless xcode_license_approved?
96
+ InstalledXcode.new(xcode_path).approve_license
96
97
 
97
98
  if switch
98
99
  `sudo rm -f #{SYMLINK_PATH}` unless current_symlink.nil?
@@ -105,12 +106,19 @@ HELP
105
106
  FileUtils.rm_f(dmgPath) if clean
106
107
  end
107
108
 
108
- def install_version(version, switch = true, clean = true, install = true, progress = true)
109
- return if version.nil?
110
- dmg_path = get_dmg(version, progress)
109
+ def install_version(version, switch = true, clean = true, install = true, progress = true, url = nil)
110
+ dmg_path = get_dmg(version, progress, url)
111
111
  fail Informative, "Failed to download Xcode #{version}." if dmg_path.nil?
112
112
 
113
113
  install_dmg(dmg_path, "-#{version.split(' ')[0]}", switch, clean) if install
114
+
115
+ open_release_notes_url(version)
116
+ end
117
+
118
+ def open_release_notes_url(version)
119
+ return if version.nil?
120
+ xcode = seedlist.find { |x| x.name == version }
121
+ `open #{xcode.release_notes_url}` unless xcode.nil? || xcode.release_notes_url.nil?
114
122
  end
115
123
 
116
124
  def list_current
@@ -171,13 +179,17 @@ HELP
171
179
  `sudo /usr/sbin/dseditgroup -o edit -t group -a staff _developer`
172
180
  end
173
181
 
174
- def get_dmg(version, progress = true)
182
+ def get_dmg(version, progress = true, url = nil)
183
+ if url
184
+ path = Pathname.new(url)
185
+ return path if path.exist?
186
+ end
175
187
  if ENV.key?('XCODE_INSTALL_CACHE_DIR')
176
188
  cache_path = Pathname.new(ENV['XCODE_INSTALL_CACHE_DIR']) + Pathname.new("xcode-#{version}.dmg")
177
189
  return cache_path if cache_path.exist?
178
190
  end
179
191
 
180
- download(version, progress)
192
+ download(version, progress, url)
181
193
  end
182
194
 
183
195
  def fetch_seedlist
@@ -211,7 +223,7 @@ HELP
211
223
  end
212
224
 
213
225
  def parse_seedlist(seedlist)
214
- seeds = seedlist['downloads'].select do |t|
226
+ seeds = Array(seedlist['downloads']).select do |t|
215
227
  /^Xcode [0-9]/.match(t['name'])
216
228
  end
217
229
 
@@ -230,8 +242,16 @@ HELP
230
242
  def prereleases
231
243
  body=spaceship.send(:request, :get, '/xcode/download/').body
232
244
  links=body.scan(/<a.+?href="(.+?.dmg)".*>(.*)<\/a>/)
233
-
234
- links.map { |pre| Xcode.new_prelease(pre[1].strip.gsub(/.*Xcode /, ''), pre[0]) }
245
+ links = links.map do |link|
246
+ parent = link[0].scan(/path=(\/.*\/.*\/)/).first.first
247
+ match = body.scan(/#{Regexp.quote(parent)}(.+?.pdf)/).first
248
+ if match
249
+ link += [parent + match.first]
250
+ else
251
+ link += [nil]
252
+ end
253
+ end
254
+ links.map { |pre| Xcode.new_prerelease(pre[1].strip.gsub(/.*Xcode /, ''), pre[0], pre[2]) }
235
255
  end
236
256
 
237
257
  def seedlist
@@ -243,10 +263,6 @@ HELP
243
263
  puts `/usr/sbin/spctl --assess --verbose=4 --type execute #{path}`
244
264
  $?.exitstatus == 0
245
265
  end
246
-
247
- def xcode_license_approved?
248
- !(`/usr/bin/xcrun clang 2>&1` =~ /license/ && !$CHILD_STATUS.success?)
249
- end
250
266
  end
251
267
 
252
268
  class InstalledXcode
@@ -258,6 +274,15 @@ HELP
258
274
  @version = get_version(path)
259
275
  end
260
276
 
277
+ def approve_license
278
+ license_path = "#{@path}/Contents/Resources/English.lproj/License.rtf"
279
+ license_id = IO.read(license_path).match(/^EA\d{4}/)
280
+ license_plist_path = '/Library/Preferences/com.apple.dt.Xcode.plist'
281
+ `sudo rm -rf #{license_plist_path}`
282
+ `sudo /usr/libexec/PlistBuddy -c "add :IDELastGMLicenseAgreedTo string #{license_id}" #{license_plist_path}`
283
+ `sudo /usr/libexec/PlistBuddy -c "add :IDEXcodeVersionForAgreedToGMLicense string #{@version}" #{license_plist_path}`
284
+ end
285
+
261
286
  :private
262
287
 
263
288
  def get_version(xcode_path)
@@ -273,12 +298,15 @@ HELP
273
298
  attr_reader :path
274
299
  attr_reader :url
275
300
  attr_reader :version
301
+ attr_reader :release_notes_url
276
302
 
277
303
  def initialize(json)
278
304
  @date_modified = json['dateModified'].to_i
279
305
  @name = json['name'].gsub(/^Xcode /, '')
280
306
  @path = json['files'].first['remotePath']
281
- @url = "https://developer.apple.com/devcenter/download.action?path=#{@path}"
307
+ url_prefix = 'https://developer.apple.com/devcenter/download.action?path='
308
+ @url = "#{url_prefix}#{@path}"
309
+ @release_notes_url = "#{url_prefix}#{json['release_notes_path']}" if json['release_notes_path']
282
310
 
283
311
  begin
284
312
  @version = Gem::Version.new(@name.split(' ')[0])
@@ -296,10 +324,11 @@ HELP
296
324
  url == other.url && version == other.version
297
325
  end
298
326
 
299
- def self.new_prelease(version, url)
327
+ def self.new_prerelease(version, url, release_notes_path)
300
328
  new('name' => version,
301
329
  'dateModified' => Time.now.to_i,
302
- 'files' => [{ 'remotePath' => url.split('=').last }])
330
+ 'files' => [{ 'remotePath' => url.split('=').last }],
331
+ 'release_notes_path' => release_notes_path)
303
332
  end
304
333
  end
305
334
  end
@@ -0,0 +1,28 @@
1
+ module XcodeInstall
2
+ class Command
3
+ class InstallCLITools < Command
4
+ self.command = 'install-cli-tools'
5
+ self.summary = 'Installs Xcode Command Line Tools.'
6
+
7
+ def run
8
+ fail Informative, 'Xcode CLI Tools are already installed.' if installed?
9
+ install
10
+ end
11
+
12
+ def installed?
13
+ `xcode-select -p`
14
+ $?.success?
15
+ end
16
+
17
+ def install
18
+ cli_placeholder_file = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
19
+ # create the placeholder file that's checked by CLI updates' .dist code in Apple's SUS catalog
20
+ FileUtils.touch(cli_placeholder_file)
21
+ # find the CLI Tools update
22
+ product = `softwareupdate -l | grep "\*.*Command Line" | head -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | tr -d '\n'`
23
+ `softwareupdate -i "#{product}" -v`
24
+ FileUtils.rm(cli_placeholder_file)
25
+ end
26
+ end
27
+ end
28
+ end
@@ -14,6 +14,7 @@ module XcodeInstall
14
14
 
15
15
  class Command < CLAide::Command
16
16
  require 'xcode/install/cleanup'
17
+ require 'xcode/install/cli'
17
18
  require 'xcode/install/install'
18
19
  require 'xcode/install/installed'
19
20
  require 'xcode/install/list'
@@ -23,7 +24,7 @@ module XcodeInstall
23
24
  require 'xcode/install/update'
24
25
 
25
26
  self.abstract_command = true
26
- self.command = 'xcode-install'
27
+ self.command = 'xcversion'
27
28
  self.version = VERSION
28
29
  self.description = 'Xcode installation manager.'
29
30
  end
@@ -1,3 +1,5 @@
1
+ require 'uri'
2
+
1
3
  module XcodeInstall
2
4
  class Command
3
5
  class Install < Command
@@ -9,7 +11,8 @@ module XcodeInstall
9
11
  ]
10
12
 
11
13
  def self.options
12
- [['--no-switch', 'Don’t switch to this version after installation'],
14
+ [['--url', 'Custom Xcode DMG file path or HTTP URL.'],
15
+ ['--no-switch', 'Don’t switch to this version after installation'],
13
16
  ['--no-install', 'Only download DMG, but do not install it.'],
14
17
  ['--no-progress', 'Don’t show download progress.'],
15
18
  ['--no-clean', 'Don’t delete DMG after installation.']].concat(super)
@@ -18,6 +21,7 @@ module XcodeInstall
18
21
  def initialize(argv)
19
22
  @installer = Installer.new
20
23
  @version = argv.shift_argument
24
+ @url = argv.option('url')
21
25
  @should_clean = argv.flag?('clean', true)
22
26
  @should_install = argv.flag?('install', true)
23
27
  @should_switch = argv.flag?('switch', true)
@@ -31,12 +35,15 @@ module XcodeInstall
31
35
  return if @version.nil?
32
36
  fail Informative, "Version #{@version} already installed." if @installer.installed?(@version)
33
37
  fail Informative, "Version #{@version} doesn't exist." unless @installer.exist?(@version)
38
+
39
+ if @url
40
+ fail Informative, "Invalid URL: `#{@url}`" unless @url =~ /\A#{URI::regexp}\z/
41
+ end
34
42
  end
35
43
 
36
44
  def run
37
- return if @version.nil?
38
45
  @installer.install_version(@version, @should_switch, @should_clean, @should_install,
39
- @progress)
46
+ @progress, @url)
40
47
  end
41
48
  end
42
49
  end
@@ -1,3 +1,3 @@
1
1
  module XcodeInstall
2
- VERSION = '0.9.6'
2
+ VERSION = '1.0.0'
3
3
  end
data/spec/cli_spec.rb ADDED
@@ -0,0 +1,16 @@
1
+ require File.expand_path('../spec_helper', __FILE__)
2
+
3
+ module XcodeInstall
4
+ describe Command::InstallCLITools do
5
+ it 'fails if tools are already installed' do
6
+ Command::InstallCLITools.any_instance.expects(:installed?).returns(true)
7
+ lambda { Command::InstallCLITools.run }.should.raise(SystemExit)
8
+ end
9
+
10
+ it 'runs if tools are not installed' do
11
+ Command::InstallCLITools.any_instance.expects(:installed?).returns(false)
12
+ Command::InstallCLITools.any_instance.expects(:install)
13
+ Command::InstallCLITools.run
14
+ end
15
+ end
16
+ end
data/spec/install_spec.rb CHANGED
@@ -11,19 +11,26 @@ module XcodeInstall
11
11
  end
12
12
 
13
13
  it 'downloads and installs' do
14
- Installer.any_instance.expects(:download).with('6.3', true).returns('/some/path')
14
+ Installer.any_instance.expects(:download).with('6.3', true, nil).returns('/some/path')
15
15
  Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true)
16
16
  Command::Install.run(['6.3'])
17
17
  end
18
18
 
19
+ it 'downloads and installs with custom HTTP URL' do
20
+ url = 'http://yolo.com/xcode.dmg'
21
+ Installer.any_instance.expects(:download).with('6.3', true, url).returns('/some/path')
22
+ Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true)
23
+ Command::Install.run(['6.3', "--url=#{url}"])
24
+ end
25
+
19
26
  it 'downloads and installs and does not switch if --no-switch given' do
20
- Installer.any_instance.expects(:download).with('6.3', true).returns('/some/path')
27
+ Installer.any_instance.expects(:download).with('6.3', true, nil).returns('/some/path')
21
28
  Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', false, true)
22
29
  Command::Install.run(['6.3', '--no-switch'])
23
30
  end
24
31
 
25
32
  it 'downloads without progress if switch --no-progress is given' do
26
- Installer.any_instance.expects(:download).with('6.3', false).returns('/some/path')
33
+ Installer.any_instance.expects(:download).with('6.3', false, nil).returns('/some/path')
27
34
  Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true)
28
35
  Command::Install.run(['6.3', '--no-progress'])
29
36
  end
@@ -29,45 +29,45 @@ module XcodeInstall
29
29
  it 'can parse prereleases from 20150414' do
30
30
  prereleases = parse_prereleases('20150414')
31
31
 
32
- prereleases.should == [Xcode.new_prelease('6.4', '/Developer_Tools/Xcode_6.4_Beta/Xcode_6.4_beta.dmg')]
32
+ prereleases.should == [Xcode.new_prerelease('6.4', '/Developer_Tools/Xcode_6.4_Beta/Xcode_6.4_beta.dmg', '/Developer_Tools/Xcode_6.4_Beta/Xcode_6.4_beta_Release_Notes.pdf')]
33
33
  end
34
34
 
35
35
  it 'can parse prereleases from 20150427' do
36
36
  prereleases = parse_prereleases('20150427')
37
37
 
38
- prereleases.should == [Xcode.new_prelease('6.4 beta 2', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2.dmg')]
38
+ prereleases.should == [Xcode.new_prerelease('6.4 beta 2', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2.dmg', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2_Release_Notes.pdf')]
39
39
  end
40
40
 
41
41
  it 'can parse prereleases from 20150508' do
42
42
  prereleases = parse_prereleases('20150508')
43
43
 
44
44
  prereleases.count.should == 2
45
- prereleases.first.should == Xcode.new_prelease('6.3.2 GM seed', '/Developer_Tools/Xcode_6.3.2_GM_seed/Xcode_6.3.2_GM_seed.dmg')
46
- prereleases.last.should == Xcode.new_prelease('6.4 beta 2', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2.dmg')
45
+ prereleases.first.should == Xcode.new_prerelease('6.3.2 GM seed', '/Developer_Tools/Xcode_6.3.2_GM_seed/Xcode_6.3.2_GM_seed.dmg', '/Developer_Tools/Xcode_6.3.2_GM_seed/Xcode_6.3.2_GM_Seed_Release_Notes.pdf')
46
+ prereleases.last.should == Xcode.new_prerelease('6.4 beta 2', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2.dmg', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2_Release_Notes.pdf')
47
47
  end
48
48
 
49
49
  it 'can parse prereleases from 20150608' do
50
50
  prereleases = parse_prereleases('20150608')
51
51
 
52
52
  prereleases.count.should == 2
53
- prereleases.first.should == Xcode.new_prelease('7 beta', '/WWDC_2015/Xcode_7_beta/Xcode_7_beta.dmg')
54
- prereleases.last.should == Xcode.new_prelease('6.4 beta 3', '/Developer_Tools/Xcode_6.4_beta_3/Xcode_6.4_beta_3.dmg')
53
+ prereleases.first.should == Xcode.new_prerelease('7 beta', '/WWDC_2015/Xcode_7_beta/Xcode_7_beta.dmg', '/WWDC_2015/Xcode_7_beta/Xcode_7_beta_Release_Notes.pdf')
54
+ prereleases.last.should == Xcode.new_prerelease('6.4 beta 3', '/Developer_Tools/Xcode_6.4_beta_3/Xcode_6.4_beta_3.dmg', '/Developer_Tools/Xcode_6.4_beta_3/Xcode_6.4_beta_3_Release_Notes.pdf')
55
55
  end
56
56
 
57
57
  it 'can parse prereleases from 20150624' do
58
58
  prereleases = parse_prereleases('20150624')
59
59
 
60
60
  prereleases.count.should == 2
61
- prereleases.first.should == Xcode.new_prelease('7 beta 2', '/Developer_Tools/Xcode_7_beta_2/Xcode_7_beta_2.dmg')
62
- prereleases.last.should == Xcode.new_prelease('6.4 beta 4', '/WWDC_2015/Xcode_6.4_beta_4/Xcode_6.4_beta_4.dmg')
61
+ prereleases.first.should == Xcode.new_prerelease('7 beta 2', '/Developer_Tools/Xcode_7_beta_2/Xcode_7_beta_2.dmg', '/Developer_Tools/Xcode_7_beta_2/Xcode_7_beta_2_Release_Notes.pdf')
62
+ prereleases.last.should == Xcode.new_prerelease('6.4 beta 4', '/WWDC_2015/Xcode_6.4_beta_4/Xcode_6.4_beta_4.dmg', '/WWDC_2015/Xcode_6.4_beta_4/Xcode_6.4_beta_4_Release_Notes.pdf')
63
63
  end
64
64
 
65
65
  it 'can parse prereleases from 20150909' do
66
66
  prereleases = parse_prereleases('20150909')
67
67
 
68
68
  prereleases.count.should == 2
69
- prereleases.first.should == Xcode.new_prelease('7.1 beta', '/Developer_Tools/Xcode_7.1_beta/Xcode_7.1_beta.dmg')
70
- prereleases.last.should == Xcode.new_prelease('7 GM seed', '/Developer_Tools/Xcode_7_GM_seed/Xcode_7_GM_seed.dmg')
69
+ prereleases.first.should == Xcode.new_prerelease('7.1 beta', '/Developer_Tools/Xcode_7.1_beta/Xcode_7.1_beta.dmg', '/Developer_Tools/Xcode_7.1_beta/Xcode_7.1_beta_Release_Notes.pdf')
70
+ prereleases.last.should == Xcode.new_prerelease('7 GM seed', '/Developer_Tools/Xcode_7_GM_seed/Xcode_7_GM_seed.dmg', nil)
71
71
  end
72
72
  end
73
73
  end
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,7 @@ ROOT = Pathname.new(File.expand_path('../../', __FILE__))
6
6
  $LOAD_PATH.unshift((ROOT + 'lib').to_s)
7
7
  $LOAD_PATH.unshift((ROOT + 'spec').to_s)
8
8
 
9
- ENV['DELIVER_USER'] = 'xcode-install'
9
+ ENV['DELIVER_USER'] = 'xcversion'
10
10
  ENV['DELIVER_PASSWORD'] = '12345password'
11
11
 
12
12
  require 'bundler/setup'
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'claide', '~> 0.9.1'
22
- spec.add_dependency 'spaceship', '~> 0.3.4'
22
+ spec.add_dependency 'spaceship', '>= 0.13.0', '< 1.0.0'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.7'
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
metadata CHANGED
@@ -1,69 +1,75 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcode-install
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Bügling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-26 00:00:00.000000000 Z
11
+ date: 2015-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.9.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spaceship
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.4
33
+ version: 0.13.0
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: 1.0.0
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - ~>
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 0.13.0
44
+ - - "<"
39
45
  - !ruby/object:Gem::Version
40
- version: 0.3.4
46
+ version: 1.0.0
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: bundler
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - ~>
51
+ - - "~>"
46
52
  - !ruby/object:Gem::Version
47
53
  version: '1.7'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - ~>
58
+ - - "~>"
53
59
  - !ruby/object:Gem::Version
54
60
  version: '1.7'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: rake
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
- - - ~>
65
+ - - "~>"
60
66
  - !ruby/object:Gem::Version
61
67
  version: '10.0'
62
68
  type: :development
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
- - - ~>
72
+ - - "~>"
67
73
  - !ruby/object:Gem::Version
68
74
  version: '10.0'
69
75
  description: Download, install and upgrade Xcodes with ease.
@@ -71,20 +77,25 @@ email:
71
77
  - boris@icculus.org
72
78
  executables:
73
79
  - xcode-install
80
+ - xcversion
81
+ - "\U0001F389"
74
82
  extensions: []
75
83
  extra_rdoc_files: []
76
84
  files:
77
- - .gitattributes
78
- - .gitignore
79
- - .rubocop.yml
80
- - .travis.yml
85
+ - ".gitattributes"
86
+ - ".gitignore"
87
+ - ".rubocop.yml"
88
+ - ".travis.yml"
81
89
  - Gemfile
82
90
  - LICENSE.txt
83
91
  - README.md
84
92
  - Rakefile
85
93
  - bin/xcode-install
94
+ - bin/xcversion
95
+ - "bin/\U0001F389"
86
96
  - lib/xcode/install.rb
87
97
  - lib/xcode/install/cleanup.rb
98
+ - lib/xcode/install/cli.rb
88
99
  - lib/xcode/install/command.rb
89
100
  - lib/xcode/install/install.rb
90
101
  - lib/xcode/install/installed.rb
@@ -94,6 +105,7 @@ files:
94
105
  - lib/xcode/install/uninstall.rb
95
106
  - lib/xcode/install/update.rb
96
107
  - lib/xcode/install/version.rb
108
+ - spec/cli_spec.rb
97
109
  - spec/fixtures/devcenter/xcode-20150414.html
98
110
  - spec/fixtures/devcenter/xcode-20150427.html
99
111
  - spec/fixtures/devcenter/xcode-20150508.html
@@ -121,12 +133,12 @@ require_paths:
121
133
  - lib
122
134
  required_ruby_version: !ruby/object:Gem::Requirement
123
135
  requirements:
124
- - - '>='
136
+ - - ">="
125
137
  - !ruby/object:Gem::Version
126
138
  version: '0'
127
139
  required_rubygems_version: !ruby/object:Gem::Requirement
128
140
  requirements:
129
- - - '>='
141
+ - - ">="
130
142
  - !ruby/object:Gem::Version
131
143
  version: '0'
132
144
  requirements: []
@@ -136,6 +148,7 @@ signing_key:
136
148
  specification_version: 4
137
149
  summary: Xcode installation manager.
138
150
  test_files:
151
+ - spec/cli_spec.rb
139
152
  - spec/fixtures/devcenter/xcode-20150414.html
140
153
  - spec/fixtures/devcenter/xcode-20150427.html
141
154
  - spec/fixtures/devcenter/xcode-20150508.html