xcode-install 0.3.0 → 0.3.1
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/.rubocop.yml +20 -0
- data/Gemfile +2 -2
- data/Rakefile +2 -2
- data/bin/xcode-install +5 -5
- data/lib/xcode/install/cleanup.rb +11 -11
- data/lib/xcode/install/command.rb +22 -22
- data/lib/xcode/install/install.rb +29 -29
- data/lib/xcode/install/installed.rb +12 -12
- data/lib/xcode/install/list.rb +22 -22
- data/lib/xcode/install/uninstall.rb +26 -26
- data/lib/xcode/install/update.rb +11 -11
- data/lib/xcode/install/version.rb +1 -1
- data/lib/xcode/install.rb +292 -277
- data/spec/fixtures/devcenter/xcode-20150601.html +212 -0
- data/spec/fixtures/devcenter/xcode-20150608.html +315 -0
- data/spec/fixtures/yolo.json +1 -1
- data/spec/install_spec.rb +19 -19
- data/spec/installed_spec.rb +7 -6
- data/spec/json_spec.rb +18 -18
- data/spec/prerelease_spec.rb +37 -30
- data/spec/spec_helper.rb +5 -5
- data/xcode-install.gemspec +13 -13
- metadata +7 -2
data/spec/install_spec.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
require File.expand_path('../spec_helper', __FILE__)
|
2
2
|
|
3
3
|
module XcodeInstall
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
describe Command::Install do
|
5
|
+
before do
|
6
|
+
Installer.any_instance.stubs(:exists).returns(true)
|
7
|
+
Installer.any_instance.stubs(:installed).returns([])
|
8
|
+
fixture = Pathname.new('spec/fixtures/xcode_63.json').read
|
9
|
+
xcode = Xcode.new(JSON.parse(fixture))
|
10
|
+
Installer.any_instance.stubs(:seedlist).returns([xcode])
|
11
|
+
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
it 'downloads and installs' do
|
14
|
+
Installer.any_instance.expects(:download).with('6.3').returns('/some/path')
|
15
|
+
Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true)
|
16
|
+
Command::Install.run(['6.3'])
|
17
|
+
end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
it 'downloads and installs and does not switch if --no-switch given' do
|
20
|
+
Installer.any_instance.expects(:download).with('6.3').returns('/some/path')
|
21
|
+
Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', false, true)
|
22
|
+
Command::Install.run(['6.3', '--no-switch'])
|
23
|
+
end
|
24
|
+
end
|
25
25
|
end
|
data/spec/installed_spec.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
require File.expand_path('../spec_helper', __FILE__)
|
2
2
|
|
3
3
|
module XcodeInstall
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
describe InstalledXcode do
|
5
|
+
it 'finds the current Xcode version with whitespace chars' do
|
6
|
+
InstalledXcode.any_instance.expects(:`).with("DEVELOPER_DIR='' \"/Volumes/Macintosh HD/Applications/Xcode Beta/Contents/Developer/usr/bin/xcodebuild\" -version").returns("Xcode 6.3.1\nBuild version 6D1002")
|
7
|
+
installed = InstalledXcode.new('/Volumes/Macintosh HD/Applications/Xcode Beta')
|
8
|
+
installed.version.should == '6.3.1'
|
9
|
+
end
|
10
|
+
end
|
10
11
|
end
|
data/spec/json_spec.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
require File.expand_path('../spec_helper', __FILE__)
|
2
2
|
|
3
3
|
module XcodeInstall
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
describe JSON do
|
5
|
+
it 'can parse Xcode JSON' do
|
6
|
+
fixture = Pathname.new('spec/fixtures/xcode.json').read
|
7
|
+
xcode = Xcode.new(JSON.parse(fixture))
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
xcode.date_modified.should == 1_413_472_373_000
|
10
|
+
xcode.name.should == 'Command Line Tools (OS X 10.9) for Xcode - Xcode 6.1'
|
11
|
+
xcode.url.should == 'https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/command_line_tools_os_x_10.9_for_xcode__xcode_6.1/command_line_tools_for_osx_10.9_for_xcode_6.1.dmg'
|
12
|
+
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
it 'can parse list of all Xcodes' do
|
15
|
+
fixture = Pathname.new('spec/fixtures/yolo.json').read
|
16
|
+
installer = Installer.new
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
seedlist = installer.send(:parse_seedlist, JSON.parse(fixture))
|
19
|
+
installer.stubs(:installed_versions).returns([])
|
20
|
+
installer.stubs(:xcodes).returns(seedlist)
|
21
|
+
|
22
|
+
installer.list.should == "6.1\n6.1.1\n6.2"
|
23
|
+
end
|
24
|
+
end
|
25
25
|
end
|
data/spec/prerelease_spec.rb
CHANGED
@@ -1,43 +1,50 @@
|
|
1
1
|
require File.expand_path('../spec_helper', __FILE__)
|
2
2
|
|
3
3
|
module XcodeInstall
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
describe Installer do
|
5
|
+
def fixture(date)
|
6
|
+
Nokogiri::HTML.parse(File.read("spec/fixtures/devcenter/xcode-#{date}.html"))
|
7
|
+
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
def parse_prereleases(date)
|
10
|
+
fixture = fixture(date)
|
11
|
+
Nokogiri::HTML.stubs(:parse).returns(fixture)
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
installer = Installer.new
|
14
|
+
installer.send(:prereleases)
|
15
|
+
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
before do
|
18
|
+
devcenter = mock
|
19
|
+
devcenter.stubs(:download_file).returns(nil)
|
20
|
+
Installer.any_instance.stubs(:devcenter).returns(devcenter)
|
21
|
+
end
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
it 'can parse prereleases from 20150414' do
|
24
|
+
prereleases = parse_prereleases('20150414')
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
prereleases.should == [Xcode.new_prelease('6.4', '/Developer_Tools/Xcode_6.4_Beta/Xcode_6.4_beta.dmg')]
|
27
|
+
end
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
it 'can parse prereleases from 20150427' do
|
30
|
+
prereleases = parse_prereleases('20150427')
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
prereleases.should == [Xcode.new_prelease('6.4 beta 2', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2.dmg')]
|
33
|
+
end
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
it 'can parse prereleases from 20150508' do
|
36
|
+
prereleases = parse_prereleases('20150508')
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
prereleases.count.should == 2
|
39
|
+
prereleases.first.should == Xcode.new_prelease('6.3.2 GM seed', '/Developer_Tools/Xcode_6.3.2_GM_seed/Xcode_6.3.2_GM_seed.dmg')
|
40
|
+
prereleases.last.should == Xcode.new_prelease('6.4 beta 2', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2.dmg')
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'can parse prereleases from 20150608' do
|
44
|
+
prereleases = parse_prereleases('20150608')
|
45
|
+
|
46
|
+
prereleases.count.should == 2
|
47
|
+
puts prereleases
|
48
|
+
end
|
49
|
+
end
|
43
50
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,14 +3,14 @@ Coveralls.wear!
|
|
3
3
|
|
4
4
|
require 'pathname'
|
5
5
|
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
6
|
-
|
7
|
-
|
6
|
+
$LOAD_PATH.unshift((ROOT + 'lib').to_s)
|
7
|
+
$LOAD_PATH.unshift((ROOT + 'spec').to_s)
|
8
8
|
|
9
|
-
ENV['DELIVER_USER'] =
|
10
|
-
ENV['DELIVER_PASSWORD'] =
|
9
|
+
ENV['DELIVER_USER'] = 'xcode-install'
|
10
|
+
ENV['DELIVER_PASSWORD'] = '12345password'
|
11
11
|
|
12
12
|
require 'bundler/setup'
|
13
13
|
require 'bacon'
|
14
14
|
require 'mocha-on-bacon'
|
15
15
|
require 'pretty_bacon'
|
16
|
-
require 'xcode/install'
|
16
|
+
require 'xcode/install'
|
data/xcode-install.gemspec
CHANGED
@@ -4,24 +4,24 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'xcode/install/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'xcode-install'
|
8
8
|
spec.version = XcodeInstall::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
9
|
+
spec.authors = ['Boris Bügling']
|
10
|
+
spec.email = ['boris@icculus.org']
|
11
|
+
spec.summary = 'Xcode installation manager.'
|
12
|
+
spec.description = 'Download, install and upgrade Xcodes with ease.'
|
13
|
+
spec.homepage = 'https://github.com/neonichu/xcode-install'
|
14
|
+
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = [
|
19
|
+
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency
|
22
|
-
spec.add_dependency
|
23
|
-
spec.add_dependency
|
21
|
+
spec.add_dependency 'claide', '~> 0.8.1'
|
22
|
+
spec.add_dependency 'fastlane_core', '~> 0.5.0'
|
23
|
+
spec.add_dependency 'nokogiri', '~> 1.3'
|
24
24
|
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
27
|
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.3.
|
4
|
+
version: 0.3.1
|
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-
|
11
|
+
date: 2015-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|
@@ -89,6 +89,7 @@ extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
91
|
- .gitignore
|
92
|
+
- .rubocop.yml
|
92
93
|
- .travis.yml
|
93
94
|
- Gemfile
|
94
95
|
- LICENSE.txt
|
@@ -107,6 +108,8 @@ files:
|
|
107
108
|
- spec/fixtures/devcenter/xcode-20150414.html
|
108
109
|
- spec/fixtures/devcenter/xcode-20150427.html
|
109
110
|
- spec/fixtures/devcenter/xcode-20150508.html
|
111
|
+
- spec/fixtures/devcenter/xcode-20150601.html
|
112
|
+
- spec/fixtures/devcenter/xcode-20150608.html
|
110
113
|
- spec/fixtures/xcode.json
|
111
114
|
- spec/fixtures/xcode_63.json
|
112
115
|
- spec/fixtures/yolo.json
|
@@ -144,6 +147,8 @@ test_files:
|
|
144
147
|
- spec/fixtures/devcenter/xcode-20150414.html
|
145
148
|
- spec/fixtures/devcenter/xcode-20150427.html
|
146
149
|
- spec/fixtures/devcenter/xcode-20150508.html
|
150
|
+
- spec/fixtures/devcenter/xcode-20150601.html
|
151
|
+
- spec/fixtures/devcenter/xcode-20150608.html
|
147
152
|
- spec/fixtures/xcode.json
|
148
153
|
- spec/fixtures/xcode_63.json
|
149
154
|
- spec/fixtures/yolo.json
|