xcode-install 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +5 -0
- data/README.md +9 -5
- data/lib/xcode/install.rb +28 -1
- data/lib/xcode/install/cli.rb +1 -2
- data/lib/xcode/install/uninstall.rb +2 -0
- data/lib/xcode/install/version.rb +1 -1
- data/spec/uninstall_spec.rb +12 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d904f76f82e27723aeacb38c130533ca14c911d
|
4
|
+
data.tar.gz: 4f986c4cb029a6b29812d84a811d24ebdf87c5cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e28575b83b56a5a76352fe1fa31768ecf19482ba98b386fda0c54923ba99760b2042b9015d8898b4cceef69284a833a891cf46926533703c940c210a5f06ebb
|
7
|
+
data.tar.gz: 4904ca25e427a493ca1f1d5131572681412bbc89e61e5e49cc854862ee72471e88bc38d485d6f8b3d0e5a708598beed90a804f96a35b63ae5d282f0ab05987d9
|
data/.rubocop_todo.yml
CHANGED
data/README.md
CHANGED
@@ -75,22 +75,26 @@ XcodeInstall can also manage your local simulators using the `simulators` comman
|
|
75
75
|
|
76
76
|
```
|
77
77
|
$ xcversion simulators
|
78
|
-
Xcode 6.4
|
78
|
+
Xcode 6.4 (/Applications/Xcode-6.4.app)
|
79
79
|
iOS 7.1 Simulator (installed)
|
80
80
|
iOS 8.1 Simulator (not installed)
|
81
81
|
iOS 8.2 Simulator (not installed)
|
82
82
|
iOS 8.3 Simulator (installed)
|
83
|
-
Xcode 7.
|
83
|
+
Xcode 7.2.1 (/Applications/Xcode-7.2.1.app)
|
84
84
|
iOS 8.1 Simulator (not installed)
|
85
85
|
iOS 8.2 Simulator (not installed)
|
86
86
|
iOS 8.3 Simulator (installed)
|
87
|
-
iOS 8.4 Simulator (installed)
|
87
|
+
iOS 8.4 Simulator (not installed)
|
88
|
+
iOS 9.0 Simulator (not installed)
|
89
|
+
iOS 9.1 Simulator (not installed)
|
90
|
+
tvOS 9.0 Simulator (not installed)
|
91
|
+
watchOS 2.0 Simulator (installed)
|
88
92
|
```
|
89
93
|
|
90
|
-
To install a simulator,
|
94
|
+
To install a simulator, use `--install` and the beginning of a simulator name:
|
91
95
|
|
92
96
|
```
|
93
|
-
$ xcversion simulators --install=8.4
|
97
|
+
$ xcversion simulators --install='iOS 8.4'
|
94
98
|
########################################################### 82.1%
|
95
99
|
######################################################################## 100.0%
|
96
100
|
Please authenticate to install iOS 8.4 Simulator...
|
data/lib/xcode/install.rb
CHANGED
@@ -7,6 +7,33 @@ require 'rubygems/version'
|
|
7
7
|
require 'xcode/install/command'
|
8
8
|
require 'xcode/install/version'
|
9
9
|
|
10
|
+
module Spaceship
|
11
|
+
class PortalClient
|
12
|
+
# 🐒🔧 to change `landing_url` 😢
|
13
|
+
# see <https://github.com/neonichu/xcode-install/issues/122>
|
14
|
+
def api_key
|
15
|
+
cache_path = '/tmp/spaceship_api_key.txt'
|
16
|
+
begin
|
17
|
+
cached = File.read(cache_path)
|
18
|
+
rescue Errno::ENOENT
|
19
|
+
end
|
20
|
+
return cached if cached
|
21
|
+
|
22
|
+
landing_url = 'https://developer.apple.com/account/'
|
23
|
+
logger.info('GET: ' + landing_url)
|
24
|
+
headers = @client.get(landing_url).headers
|
25
|
+
results = headers['location'].match(/.*appIdKey=(\h+)/)
|
26
|
+
if (results || []).length > 1
|
27
|
+
api_key = results[1]
|
28
|
+
File.write(cache_path, api_key) if api_key.length == 64
|
29
|
+
return api_key
|
30
|
+
else
|
31
|
+
fail 'Could not find latest API Key from the Dev Portal - the server might be slow right now'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
10
37
|
module XcodeInstall
|
11
38
|
CACHE_DIR = Pathname.new("#{ENV['HOME']}/Library/Caches/XcodeInstall")
|
12
39
|
class Curl
|
@@ -53,7 +80,7 @@ module XcodeInstall
|
|
53
80
|
xcode = seedlist.find { |x| x.name == version }
|
54
81
|
dmg_file = Pathname.new(File.basename(url || xcode.path))
|
55
82
|
|
56
|
-
result = Curl.new.fetch(url || xcode.url, CACHE_DIR, spaceship.cookie, dmg_file, progress)
|
83
|
+
result = Curl.new.fetch(url || xcode.url, CACHE_DIR, url ? nil : spaceship.cookie, dmg_file, progress)
|
57
84
|
result ? CACHE_DIR + dmg_file : nil
|
58
85
|
end
|
59
86
|
|
data/lib/xcode/install/cli.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
require File.expand_path('../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
module XcodeInstall
|
4
|
+
describe Command::Uninstall do
|
5
|
+
describe 'when invoked' do
|
6
|
+
it 'raise error when the version is not specified' do
|
7
|
+
Command::Uninstall.any_instance.expects(:help!)
|
8
|
+
-> { Command::Uninstall.run([]) }.should.raise(Exception)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
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: 1.2.
|
4
|
+
version: 1.2.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: 2016-
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- spec/list_spec.rb
|
125
125
|
- spec/prerelease_spec.rb
|
126
126
|
- spec/spec_helper.rb
|
127
|
+
- spec/uninstall_spec.rb
|
127
128
|
- xcode-install.gemspec
|
128
129
|
homepage: https://github.com/neonichu/xcode-install
|
129
130
|
licenses:
|
@@ -169,4 +170,5 @@ test_files:
|
|
169
170
|
- spec/list_spec.rb
|
170
171
|
- spec/prerelease_spec.rb
|
171
172
|
- spec/spec_helper.rb
|
173
|
+
- spec/uninstall_spec.rb
|
172
174
|
has_rdoc:
|