xcode-install 0.2.0 → 0.3.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/lib/xcode/install.rb +24 -5
- data/lib/xcode/install/install.rb +1 -4
- data/lib/xcode/install/version.rb +1 -1
- data/spec/prerelease_spec.rb +1 -1
- 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: fc28280820fe62413795965ee4b361d46b7aaff7
|
4
|
+
data.tar.gz: df8eab78dbaf502ac3006c2dc8d070a0562e4c70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7aa0c1185455dc2edf0f2e63fd4b49262202e36a2941c74d8cc16eaf7b237ffddac48cbffd2331338efc310d558038ea0fb5c49ecfe22abd06d3998f45004cd
|
7
|
+
data.tar.gz: 299a9e10235efe65b101330cbfae0f8c1016c89d9c2d7fdf6fba67812acf5e8be498517e1c960ba52b5953f6a2d6ddb198782e2454ec642c4b458653462714e2
|
data/lib/xcode/install.rb
CHANGED
@@ -18,11 +18,11 @@ module FastlaneCore
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def download_seedlist
|
21
|
-
# categories: Applications%2CDeveloper%20Tools%2CiOS%2COS%20X%2COS%20X%20Server%2CSafari
|
22
21
|
JSON.parse(page.evaluate_script("$.ajax({data: { start: \"0\", limit: \"1000\", " +
|
23
22
|
"sort: \"dateModified\", dir: \"DESC\", searchTextField: \"\", " +
|
24
|
-
"searchCategories: \"\", search: \"false\" } , type: '
|
25
|
-
"url: '/
|
23
|
+
"searchCategories: \"\", search: \"false\" } , type: 'GET', " +
|
24
|
+
"url: '/services-account/QH65B2/downloadws/listDownloads.action', " +
|
25
|
+
"async: false})")['responseText'])
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -123,6 +123,14 @@ module XcodeInstall
|
|
123
123
|
FileUtils.rm_f(dmgPath) if clean
|
124
124
|
end
|
125
125
|
|
126
|
+
def install_version(version, switch = true, clean = true)
|
127
|
+
return if version.nil?
|
128
|
+
dmg_path = get_dmg(version)
|
129
|
+
raise Informative, "Failed to download Xcode #{version}." if dmg_path.nil?
|
130
|
+
|
131
|
+
install_dmg(dmg_path, "-#{version.split(' ')[0]}", switch, clean)
|
132
|
+
end
|
133
|
+
|
126
134
|
def list_current
|
127
135
|
majors = list_versions.map { |v| v.split('.')[0] }.select { |v| v.length == 1 }.uniq
|
128
136
|
list_versions.select { |v| v.start_with?(majors.last) }.join("\n")
|
@@ -146,7 +154,7 @@ module XcodeInstall
|
|
146
154
|
File.absolute_path(File.readlink(current_symlink), SYMLINK_PATH.dirname) if current_symlink
|
147
155
|
end
|
148
156
|
|
149
|
-
|
157
|
+
private
|
150
158
|
|
151
159
|
CACHE_DIR = Pathname.new("#{ENV['HOME']}/Library/Caches/XcodeInstall")
|
152
160
|
LIST_FILE = CACHE_DIR + Pathname.new('xcodes.bin')
|
@@ -162,6 +170,17 @@ module XcodeInstall
|
|
162
170
|
`sudo /usr/sbin/dseditgroup -o edit -t group -a staff _developer`
|
163
171
|
end
|
164
172
|
|
173
|
+
def get_dmg(version)
|
174
|
+
if ENV.key?("XCODE_INSTALL_CACHE_DIR")
|
175
|
+
cache_path = Pathname.new(ENV["XCODE_INSTALL_CACHE_DIR"]) + Pathname.new("xcode-#{version}.dmg")
|
176
|
+
if cache_path.exist?
|
177
|
+
return cache_path
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
return download(version)
|
182
|
+
end
|
183
|
+
|
165
184
|
def get_seedlist
|
166
185
|
@xcodes = parse_seedlist(devcenter.download_seedlist)
|
167
186
|
|
@@ -180,7 +199,7 @@ module XcodeInstall
|
|
180
199
|
end
|
181
200
|
|
182
201
|
def parse_seedlist(seedlist)
|
183
|
-
seedlist['
|
202
|
+
seedlist['downloads'].select {
|
184
203
|
|t| /^Xcode [0-9]/.match(t['name'])
|
185
204
|
}.map { |x| Xcode.new(x) }.reject { |x| x.version < MINIMUM_VERSION }.sort {
|
186
205
|
|a,b| a.dateModified <=> b.dateModified
|
@@ -29,10 +29,7 @@ module XcodeInstall
|
|
29
29
|
|
30
30
|
def run
|
31
31
|
return if @version.nil?
|
32
|
-
|
33
|
-
raise Informative, "Failed to download Xcode #{@version}." if dmgPath.nil?
|
34
|
-
|
35
|
-
@installer.install_dmg(dmgPath, "-#{@version.split(' ')[0]}", @should_switch, @should_clean)
|
32
|
+
@installer.install_version(@version, @should_switch, @should_clean)
|
36
33
|
end
|
37
34
|
end
|
38
35
|
end
|
data/spec/prerelease_spec.rb
CHANGED
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.
|
4
|
+
version: 0.3.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-05-
|
11
|
+
date: 2015-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|