xcode-install 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xcode/install.rb +6 -11
- data/lib/xcode/install/install.rb +1 -3
- data/lib/xcode/install/version.rb +1 -1
- data/spec/install_spec.rb +3 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42dac883f70abe088d3de8820a9f465b097bd121
|
4
|
+
data.tar.gz: 29abe4bcda93cc9d5da4fd38b594c527f06fd57f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e060a74eb4a236a12cd19d14c76a04dada5e8343f4318664187fec2d0bb2c5c22455621b4c705241bca4674a36bbbf4b7125b055a38ab1da49fc78711d2f0822
|
7
|
+
data.tar.gz: 4a9f4578d366f38d424838bab7d99ba766db809088863281e2d4d69561bbdc0220c90818cf3c0c734884657bafc11f7449eba27184027b6777cab20cf3fcb7af
|
data/lib/xcode/install.rb
CHANGED
@@ -57,10 +57,6 @@ module XcodeInstall
|
|
57
57
|
list_versions.include?(version)
|
58
58
|
end
|
59
59
|
|
60
|
-
def install_components(xcode_path)
|
61
|
-
`#{xcode_path}/Contents/MacOS/Xcode -installComponents`
|
62
|
-
end
|
63
|
-
|
64
60
|
def installed?(version)
|
65
61
|
installed_versions.map(&:version).include?(version)
|
66
62
|
end
|
@@ -71,7 +67,7 @@ module XcodeInstall
|
|
71
67
|
end
|
72
68
|
end
|
73
69
|
|
74
|
-
def install_dmg(dmgPath, suffix = '', switch = true, clean = true
|
70
|
+
def install_dmg(dmgPath, suffix = '', switch = true, clean = true)
|
75
71
|
xcode_path = "/Applications/Xcode#{suffix}.app"
|
76
72
|
|
77
73
|
`hdiutil mount -nobrowse -noverify #{dmgPath}`
|
@@ -92,11 +88,11 @@ HELP
|
|
92
88
|
|
93
89
|
if not verify_integrity(xcode_path)
|
94
90
|
`sudo rm -f #{xcode_path}`
|
91
|
+
return
|
95
92
|
end
|
96
93
|
|
97
94
|
enable_developer_mode
|
98
|
-
`sudo xcodebuild -license` unless xcode_license_approved?
|
99
|
-
install_components(xcode_path) if components
|
95
|
+
`sudo xcodebuild -license accept` unless xcode_license_approved?
|
100
96
|
|
101
97
|
if switch
|
102
98
|
`sudo rm -f #{SYMLINK_PATH}` unless current_symlink.nil?
|
@@ -109,13 +105,12 @@ HELP
|
|
109
105
|
FileUtils.rm_f(dmgPath) if clean
|
110
106
|
end
|
111
107
|
|
112
|
-
def install_version(version, switch = true, clean = true, install = true, progress = true
|
113
|
-
components = true)
|
108
|
+
def install_version(version, switch = true, clean = true, install = true, progress = true)
|
114
109
|
return if version.nil?
|
115
110
|
dmg_path = get_dmg(version, progress)
|
116
111
|
fail Informative, "Failed to download Xcode #{version}." if dmg_path.nil?
|
117
112
|
|
118
|
-
install_dmg(dmg_path, "-#{version.split(' ')[0]}", switch, clean
|
113
|
+
install_dmg(dmg_path, "-#{version.split(' ')[0]}", switch, clean) if install
|
119
114
|
end
|
120
115
|
|
121
116
|
def list_current
|
@@ -245,7 +240,7 @@ HELP
|
|
245
240
|
end
|
246
241
|
|
247
242
|
def verify_integrity(path)
|
248
|
-
puts
|
243
|
+
puts `/usr/sbin/spctl --assess --verbose=4 --type execute #{path}`
|
249
244
|
$?.exitstatus == 0
|
250
245
|
end
|
251
246
|
|
@@ -12,7 +12,6 @@ module XcodeInstall
|
|
12
12
|
[['--no-switch', 'Don’t switch to this version after installation'],
|
13
13
|
['--no-install', 'Only download DMG, but do not install it.'],
|
14
14
|
['--no-progress', 'Don’t show download progress.'],
|
15
|
-
['--no-install-components', 'Don’t install additional components.'],
|
16
15
|
['--no-clean', 'Don’t delete DMG after installation.']].concat(super)
|
17
16
|
end
|
18
17
|
|
@@ -23,7 +22,6 @@ module XcodeInstall
|
|
23
22
|
@should_install = argv.flag?('install', true)
|
24
23
|
@should_switch = argv.flag?('switch', true)
|
25
24
|
@progress = argv.flag?('progress', true)
|
26
|
-
@components = argv.flag?('components', true)
|
27
25
|
super
|
28
26
|
end
|
29
27
|
|
@@ -38,7 +36,7 @@ module XcodeInstall
|
|
38
36
|
def run
|
39
37
|
return if @version.nil?
|
40
38
|
@installer.install_version(@version, @should_switch, @should_clean, @should_install,
|
41
|
-
@progress
|
39
|
+
@progress)
|
42
40
|
end
|
43
41
|
end
|
44
42
|
end
|
data/spec/install_spec.rb
CHANGED
@@ -12,26 +12,20 @@ module XcodeInstall
|
|
12
12
|
|
13
13
|
it 'downloads and installs' do
|
14
14
|
Installer.any_instance.expects(:download).with('6.3', true).returns('/some/path')
|
15
|
-
Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true
|
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
19
|
it 'downloads and installs and does not switch if --no-switch given' do
|
20
20
|
Installer.any_instance.expects(:download).with('6.3', true).returns('/some/path')
|
21
|
-
Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', false, true
|
21
|
+
Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', false, true)
|
22
22
|
Command::Install.run(['6.3', '--no-switch'])
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'downloads without progress if switch --no-progress is given' do
|
26
26
|
Installer.any_instance.expects(:download).with('6.3', false).returns('/some/path')
|
27
|
-
Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true
|
27
|
+
Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true)
|
28
28
|
Command::Install.run(['6.3', '--no-progress'])
|
29
29
|
end
|
30
|
-
|
31
|
-
it 'does not install components if switch --no-components is given' do
|
32
|
-
Installer.any_instance.expects(:download).with('6.3', true).returns('/some/path')
|
33
|
-
Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true, false)
|
34
|
-
Command::Install.run(['6.3', '--no-components'])
|
35
|
-
end
|
36
30
|
end
|
37
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcode-install
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
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-
|
11
|
+
date: 2015-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|