xcode-install 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +11 -10
- data/.rubocop_todo.yml +34 -0
- data/.travis.yml +5 -1
- data/Gemfile +1 -0
- data/README.md +28 -15
- data/Rakefile +5 -1
- data/lib/xcode/install/cli.rb +1 -2
- data/lib/xcode/install/install.rb +7 -8
- data/lib/xcode/install/installed.rb +10 -1
- data/lib/xcode/install/select.rb +1 -1
- data/lib/xcode/install/simulators.rb +9 -8
- data/lib/xcode/install/uninstall.rb +5 -4
- data/lib/xcode/install/version.rb +1 -1
- data/lib/xcode/install.rb +116 -61
- data/spec/cli_spec.rb +1 -1
- data/spec/curl_spec.rb +26 -0
- data/spec/fixtures/devcenter/xcode-20160601.html +1872 -0
- data/spec/fixtures/hdiutil.plist +31 -0
- data/spec/fixtures/mail-verify.html +222 -0
- data/spec/install_spec.rb +41 -25
- data/spec/prerelease_spec.rb +7 -0
- data/spec/uninstall_spec.rb +12 -0
- data/xcode-install.gemspec +4 -2
- metadata +39 -24
- data/bin/xcode-install +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 692e7a2d0f5405ba8f1f5d8aed39cc36be68cd91
|
|
4
|
+
data.tar.gz: af0d1cf4e618a42dc06c540c8c050340757cbcb4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 490d574a7dbfcec4e9c2d7193deb91ed3fe3b29a3497b1b364fe33824c8d75e41cd6e90ff210f5d4f203819b46f760a353c72b618113356351f0d19c7eb572b2
|
|
7
|
+
data.tar.gz: cf9dcb687e61e0387ccae70536259371fcd6018b2b1c2d61083310fb6e9a89165e156a418915366627597cc16784d2b151b38572cb4637f7f98c94ce49b41131
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
Max: 18
|
|
3
|
-
|
|
4
|
-
Metrics/ClassLength:
|
|
5
|
-
Max: 130
|
|
6
|
-
|
|
7
|
-
Metrics/CyclomaticComplexity:
|
|
8
|
-
Max: 7
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
|
9
2
|
|
|
10
3
|
Metrics/LineLength:
|
|
11
4
|
Max: 215
|
|
12
5
|
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
Style/AsciiComments:
|
|
7
|
+
Enabled: false
|
|
15
8
|
|
|
16
9
|
Style/Documentation:
|
|
17
10
|
Enabled: false
|
|
18
11
|
|
|
12
|
+
Style/FileName:
|
|
13
|
+
Exclude:
|
|
14
|
+
- bin/🎉
|
|
15
|
+
- bin/xcode-install
|
|
16
|
+
|
|
17
|
+
Style/SpecialGlobalVars:
|
|
18
|
+
Enabled: false
|
|
19
|
+
|
|
19
20
|
Lint/Void:
|
|
20
21
|
Enabled: false
|
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This configuration was generated by
|
|
2
|
+
# `rubocop --auto-gen-config`
|
|
3
|
+
# on 2016-04-26 22:45:06 -0700 using RuboCop version 0.35.1.
|
|
4
|
+
# The point is for the user to remove these configuration records
|
|
5
|
+
# one by one as the offenses are removed from the code base.
|
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
+
|
|
9
|
+
# Offense count: 11
|
|
10
|
+
Metrics/AbcSize:
|
|
11
|
+
Max: 39
|
|
12
|
+
|
|
13
|
+
# Offense count: 1
|
|
14
|
+
# Configuration parameters: CountComments.
|
|
15
|
+
Metrics/ClassLength:
|
|
16
|
+
Max: 226
|
|
17
|
+
|
|
18
|
+
# Offense count: 3
|
|
19
|
+
Metrics/CyclomaticComplexity:
|
|
20
|
+
Max: 8
|
|
21
|
+
|
|
22
|
+
# Offense count: 10
|
|
23
|
+
# Configuration parameters: CountComments.
|
|
24
|
+
Metrics/MethodLength:
|
|
25
|
+
Max: 40
|
|
26
|
+
|
|
27
|
+
# Offense count: 1
|
|
28
|
+
# Configuration parameters: CountKeywordArgs.
|
|
29
|
+
Metrics/ParameterLists:
|
|
30
|
+
Max: 6
|
|
31
|
+
|
|
32
|
+
# Offense count: 2
|
|
33
|
+
Metrics/PerceivedComplexity:
|
|
34
|
+
Max: 9
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -7,15 +7,24 @@
|
|
|
7
7
|
|
|
8
8
|
Install and update your Xcodes automatically.
|
|
9
9
|
|
|
10
|
-
```
|
|
10
|
+
```
|
|
11
11
|
$ gem install xcode-install
|
|
12
12
|
$ xcversion install 6.3
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
|
-
```
|
|
18
|
-
$ gem install
|
|
17
|
+
```
|
|
18
|
+
$ gem install xcode-install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Note: unfortunately, XcodeInstall has a transitive dependency on a gem with native extensions and this is not really fixable at this point in time. If you are installing this on a machine without a working compiler, please use these alternative instructions instead:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
$ curl -sL -O https://github.com/neonichu/ruby-domain_name/releases/download/v0.5.99999999/domain_name-0.5.99999999.gem
|
|
25
|
+
$ gem install domain_name-0.5.99999999.gem
|
|
26
|
+
$ gem install --conservative xcode-install
|
|
27
|
+
$ rm -f domain_name-0.5.99999999.gem
|
|
19
28
|
```
|
|
20
29
|
|
|
21
30
|
## Usage
|
|
@@ -30,7 +39,7 @@ XCODE_INSTALL_PASSWORD
|
|
|
30
39
|
|
|
31
40
|
To list available versions:
|
|
32
41
|
|
|
33
|
-
```
|
|
42
|
+
```
|
|
34
43
|
$ xcversion list
|
|
35
44
|
6.0.1
|
|
36
45
|
6.1
|
|
@@ -39,11 +48,11 @@ $ xcversion list
|
|
|
39
48
|
6.3
|
|
40
49
|
```
|
|
41
50
|
|
|
42
|
-
|
|
51
|
+
Installed versions will be omitted and by default, only the latest major version is listed.
|
|
43
52
|
|
|
44
53
|
To install a certain version, simply:
|
|
45
54
|
|
|
46
|
-
```
|
|
55
|
+
```
|
|
47
56
|
$ xcversion install 6.3
|
|
48
57
|
########################################################### 82.1%
|
|
49
58
|
######################################################################## 100.0%
|
|
@@ -57,7 +66,7 @@ This will download and install that version of Xcode. It will also be automatica
|
|
|
57
66
|
|
|
58
67
|
Note: GMs and beta versions usually have special names, e.g.
|
|
59
68
|
|
|
60
|
-
```
|
|
69
|
+
```
|
|
61
70
|
$ xcversion list
|
|
62
71
|
7 GM seed
|
|
63
72
|
7.1 beta
|
|
@@ -73,24 +82,28 @@ XcodeInstall can also install Xcode's Command Line Tools by calling `xcversion i
|
|
|
73
82
|
|
|
74
83
|
XcodeInstall can also manage your local simulators using the `simulators` command.
|
|
75
84
|
|
|
76
|
-
```
|
|
77
|
-
$
|
|
78
|
-
Xcode 6.4
|
|
85
|
+
```
|
|
86
|
+
$ xcversion simulators
|
|
87
|
+
Xcode 6.4 (/Applications/Xcode-6.4.app)
|
|
79
88
|
iOS 7.1 Simulator (installed)
|
|
80
89
|
iOS 8.1 Simulator (not installed)
|
|
81
90
|
iOS 8.2 Simulator (not installed)
|
|
82
91
|
iOS 8.3 Simulator (installed)
|
|
83
|
-
Xcode 7.
|
|
92
|
+
Xcode 7.2.1 (/Applications/Xcode-7.2.1.app)
|
|
84
93
|
iOS 8.1 Simulator (not installed)
|
|
85
94
|
iOS 8.2 Simulator (not installed)
|
|
86
95
|
iOS 8.3 Simulator (installed)
|
|
87
|
-
iOS 8.4 Simulator (installed)
|
|
96
|
+
iOS 8.4 Simulator (not installed)
|
|
97
|
+
iOS 9.0 Simulator (not installed)
|
|
98
|
+
iOS 9.1 Simulator (not installed)
|
|
99
|
+
tvOS 9.0 Simulator (not installed)
|
|
100
|
+
watchOS 2.0 Simulator (installed)
|
|
88
101
|
```
|
|
89
102
|
|
|
90
|
-
To install a simulator,
|
|
103
|
+
To install a simulator, use `--install` and the beginning of a simulator name:
|
|
91
104
|
|
|
92
|
-
```
|
|
93
|
-
$
|
|
105
|
+
```
|
|
106
|
+
$ xcversion simulators --install='iOS 8.4'
|
|
94
107
|
########################################################### 82.1%
|
|
95
108
|
######################################################################## 100.0%
|
|
96
109
|
Please authenticate to install iOS 8.4 Simulator...
|
data/Rakefile
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'bundler/gem_tasks'
|
|
2
|
+
require 'rubocop/rake_task'
|
|
2
3
|
|
|
3
4
|
def specs(dir)
|
|
4
5
|
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
|
|
@@ -9,4 +10,7 @@ task :spec do
|
|
|
9
10
|
sh "bundle exec bacon #{specs('**')}"
|
|
10
11
|
end
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
desc 'Lints all the files'
|
|
14
|
+
RuboCop::RakeTask.new(:rubocop)
|
|
15
|
+
|
|
16
|
+
task default: [:spec, :rubocop]
|
data/lib/xcode/install/cli.rb
CHANGED
|
@@ -12,6 +12,7 @@ module XcodeInstall
|
|
|
12
12
|
|
|
13
13
|
def self.options
|
|
14
14
|
[['--url', 'Custom Xcode DMG file path or HTTP URL.'],
|
|
15
|
+
['--force', 'Install even if the same version is already installed.'],
|
|
15
16
|
['--no-switch', 'Don’t switch to this version after installation'],
|
|
16
17
|
['--no-install', 'Only download DMG, but do not install it.'],
|
|
17
18
|
['--no-progress', 'Don’t show download progress.'],
|
|
@@ -22,6 +23,7 @@ module XcodeInstall
|
|
|
22
23
|
@installer = Installer.new
|
|
23
24
|
@version = argv.shift_argument
|
|
24
25
|
@url = argv.option('url')
|
|
26
|
+
@force = argv.flag?('force', false)
|
|
25
27
|
@should_clean = argv.flag?('clean', true)
|
|
26
28
|
@should_install = argv.flag?('install', true)
|
|
27
29
|
@should_switch = argv.flag?('switch', true)
|
|
@@ -32,18 +34,15 @@ module XcodeInstall
|
|
|
32
34
|
def validate!
|
|
33
35
|
super
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
fail Informative, "Version #{@version} already installed." if @installer.installed?(@version)
|
|
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
|
|
37
|
+
help! 'A VERSION argument is required.' unless @version
|
|
38
|
+
fail Informative, "Version #{@version} already installed." if @installer.installed?(@version) && !@force
|
|
39
|
+
fail Informative, "Version #{@version} doesn't exist." unless @url || @installer.exist?(@version)
|
|
40
|
+
fail Informative, "Invalid URL: `#{@url}`" unless !@url || @url =~ /\A#{URI.regexp}\z/
|
|
42
41
|
end
|
|
43
42
|
|
|
44
43
|
def run
|
|
45
44
|
@installer.install_version(@version, @should_switch, @should_clean, @should_install,
|
|
46
|
-
|
|
45
|
+
@progress, @url)
|
|
47
46
|
end
|
|
48
47
|
end
|
|
49
48
|
end
|
|
@@ -4,10 +4,19 @@ module XcodeInstall
|
|
|
4
4
|
self.command = 'installed'
|
|
5
5
|
self.summary = 'List installed Xcodes.'
|
|
6
6
|
|
|
7
|
+
def self.options
|
|
8
|
+
[['--uuid', 'Show DVTPlugInCompatibilityUUIDs in the list.']].concat(super)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def initialize(argv)
|
|
12
|
+
@uuid = argv.flag?('uuid', false)
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
|
|
7
16
|
def run
|
|
8
17
|
installer = XcodeInstall::Installer.new
|
|
9
18
|
installer.installed_versions.each do |xcode|
|
|
10
|
-
puts "#{xcode.version}\t(#{xcode.path})"
|
|
19
|
+
puts "#{xcode.version}\t(#{xcode.path})\t#{@uuid ? xcode.uuid : ''}"
|
|
11
20
|
end
|
|
12
21
|
end
|
|
13
22
|
end
|
data/lib/xcode/install/select.rb
CHANGED
|
@@ -17,7 +17,7 @@ module XcodeInstall
|
|
|
17
17
|
def validate!
|
|
18
18
|
super
|
|
19
19
|
|
|
20
|
-
fail Informative,
|
|
20
|
+
fail Informative, 'Please specify a version to select.' if @version.nil?
|
|
21
21
|
fail Informative, "Version #{@version} not installed." unless @installer.installed?(@version)
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -7,7 +7,7 @@ module XcodeInstall
|
|
|
7
7
|
self.summary = 'List or install iOS simulators.'
|
|
8
8
|
|
|
9
9
|
def self.options
|
|
10
|
-
[['--install=
|
|
10
|
+
[['--install=name', 'Install simulator beginning with name, e.g. \'iOS 8.4\', \'tvOS 9.0\'.']].concat(super)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def initialize(argv)
|
|
@@ -24,23 +24,24 @@ module XcodeInstall
|
|
|
24
24
|
:private
|
|
25
25
|
|
|
26
26
|
def install
|
|
27
|
-
filtered_simulators = @installed_xcodes.map
|
|
28
|
-
sim.
|
|
27
|
+
filtered_simulators = @installed_xcodes.map(&:available_simulators).flatten.uniq(&:name).select do |sim|
|
|
28
|
+
sim.name.start_with?(@install)
|
|
29
29
|
end
|
|
30
|
-
|
|
30
|
+
case filtered_simulators.count
|
|
31
|
+
when 0
|
|
31
32
|
puts "[!] No simulator matching #{@install} was found. Please specify a version from the following available simulators:".ansi.red
|
|
32
33
|
list
|
|
33
34
|
exit 1
|
|
34
|
-
|
|
35
|
+
when 1
|
|
35
36
|
simulator = filtered_simulators.first
|
|
36
37
|
fail Informative, "#{simulator.name} is already installed." if simulator.installed?
|
|
37
38
|
puts "Installing #{simulator.name} for Xcode #{simulator.xcode.bundle_version}..."
|
|
38
39
|
simulator.install
|
|
39
40
|
else
|
|
40
41
|
puts "[!] More than one simulator matching #{@install} was found. Please specify the full version.".ansi.red
|
|
41
|
-
filtered_simulators.each do |
|
|
42
|
-
puts "Xcode #{
|
|
43
|
-
puts "
|
|
42
|
+
filtered_simulators.each do |candidate|
|
|
43
|
+
puts "Xcode #{candidate.xcode.bundle_version} (#{candidate.xcode.path})".ansi.green
|
|
44
|
+
puts "xcversion simulators --install=#{candidate.name}"
|
|
44
45
|
end
|
|
45
46
|
exit 1
|
|
46
47
|
end
|
|
@@ -16,6 +16,8 @@ module XcodeInstall
|
|
|
16
16
|
|
|
17
17
|
def validate!
|
|
18
18
|
super
|
|
19
|
+
help! 'A VERSION argument is required.' unless @version
|
|
20
|
+
|
|
19
21
|
fail Informative, "Version #{@version} is not installed." unless @installer.installed?(@version)
|
|
20
22
|
end
|
|
21
23
|
|
|
@@ -25,10 +27,9 @@ module XcodeInstall
|
|
|
25
27
|
|
|
26
28
|
`sudo rm -rf #{installed_path.path}`
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
end
|
|
30
|
+
return unless @installer.symlinks_to == installed_path.path
|
|
31
|
+
newest_version = @installer.installed_versions.last
|
|
32
|
+
@installer.symlink(newest_version)
|
|
32
33
|
end
|
|
33
34
|
end
|
|
34
35
|
end
|