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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0cb5346a3d13b6710a60b68ca9099b0f2a55a8f
4
- data.tar.gz: 99e5071dcd26f18f76d8d82c52e1bb46f5a4a161
3
+ metadata.gz: 2d904f76f82e27723aeacb38c130533ca14c911d
4
+ data.tar.gz: 4f986c4cb029a6b29812d84a811d24ebdf87c5cf
5
5
  SHA512:
6
- metadata.gz: 3c547031019e7cd391bb33cebe55298204ad3494bc36f2a1e9bf88d58986fc009645d6671285db7f862d3b3e2a1a997e080f9c948128bd0ecb22de97a3f04a4c
7
- data.tar.gz: 6108652858c7e60ba5d25d19ef9b974ecaf117175ecf754d545a2a19461f13bf97e18ed41937b907bf1bd9bde1d118d82f3400bdd7614db0b0bc3ae81f8bcc57
6
+ metadata.gz: 7e28575b83b56a5a76352fe1fa31768ecf19482ba98b386fda0c54923ba99760b2042b9015d8898b4cceef69284a833a891cf46926533703c940c210a5f06ebb
7
+ data.tar.gz: 4904ca25e427a493ca1f1d5131572681412bbc89e61e5e49cc854862ee72471e88bc38d485d6f8b3d0e5a708598beed90a804f96a35b63ae5d282f0ab05987d9
data/.rubocop_todo.yml CHANGED
@@ -28,3 +28,8 @@ Metrics/MethodLength:
28
28
  # Configuration parameters: CountKeywordArgs.
29
29
  Metrics/ParameterLists:
30
30
  Max: 6
31
+
32
+ # FIXME: for spaceship workaround
33
+ Lint/HandleExceptions:
34
+ Exclude:
35
+ - 'lib/xcode/install.rb'
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.0 (/Applications/Xcode.app)
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.0.0 (/Applications/Xcode-beta.app)
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, simply:
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
 
@@ -10,8 +10,7 @@ module XcodeInstall
10
10
  end
11
11
 
12
12
  def installed?
13
- `xcode-select -p`
14
- $?.success?
13
+ File.exist?('/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib')
15
14
  end
16
15
 
17
16
  def install
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module XcodeInstall
2
- VERSION = '1.2.5'
2
+ VERSION = '1.2.6'.freeze
3
3
  end
@@ -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.5
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-01-05 00:00:00.000000000 Z
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: