xcode-install 2.4.2 → 2.4.4
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 +16 -2
- data/lib/xcode/install/install.rb +4 -1
- data/lib/xcode/install/version.rb +1 -1
- data/spec/list_spec.rb +25 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c43c13e228edd82063837dec15bef00af49fb63
|
4
|
+
data.tar.gz: f64ad23b9c1f0170f105a545d6d961bc4aafb11b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c879eb96b5d2e6dbe2ee8f804d59453a13885a41a317c3e21dcb78f08d99a67a492f0d90e1365516cd593ff0ebd17e868cf1b78cae097ba7ae0cc1fb442c793
|
7
|
+
data.tar.gz: 8c3db34c1552b25f9b37dc30f2776932f57633151978efdfefc02064e79b6306ea9e7b6b7c679dd819f33be1327860791352756c6699c1ac2a29bcdc6f0ed85f
|
data/lib/xcode/install.rb
CHANGED
@@ -293,7 +293,12 @@ HELP
|
|
293
293
|
|
294
294
|
def list_annotated(xcodes_list)
|
295
295
|
installed = installed_versions.map(&:version)
|
296
|
-
xcodes_list.map
|
296
|
+
xcodes_list.map do |x|
|
297
|
+
xcode_version = x.split(' ').first # exclude "beta N", "for Lion".
|
298
|
+
xcode_version << '.0' unless xcode_version.include?('.')
|
299
|
+
|
300
|
+
installed.include?(xcode_version) ? "#{x} (installed)" : x
|
301
|
+
end.join("\n")
|
297
302
|
end
|
298
303
|
|
299
304
|
def list
|
@@ -589,7 +594,7 @@ HELP
|
|
589
594
|
end
|
590
595
|
|
591
596
|
def bundle_version
|
592
|
-
@bundle_version ||= Gem::Version.new(
|
597
|
+
@bundle_version ||= Gem::Version.new(bundle_version_string)
|
593
598
|
end
|
594
599
|
|
595
600
|
def uuid
|
@@ -652,6 +657,15 @@ HELP
|
|
652
657
|
|
653
658
|
:private
|
654
659
|
|
660
|
+
def bundle_version_string
|
661
|
+
digits = plist_entry(':DTXcode').to_i.to_s
|
662
|
+
if digits.length < 3
|
663
|
+
digits.split(//).join('.')
|
664
|
+
else
|
665
|
+
"#{digits[0..-3]}.#{digits[-2]}.#{digits[-1]}"
|
666
|
+
end
|
667
|
+
end
|
668
|
+
|
655
669
|
def plist_entry(keypath)
|
656
670
|
`/usr/libexec/PlistBuddy -c "Print :#{keypath}" "#{path}/Contents/Info.plist"`.chomp
|
657
671
|
end
|
@@ -37,7 +37,10 @@ module XcodeInstall
|
|
37
37
|
super
|
38
38
|
|
39
39
|
help! 'A VERSION argument is required.' unless @version
|
40
|
-
|
40
|
+
if @installer.installed?(@version) && !@force
|
41
|
+
print "Version #{@version} already installed."
|
42
|
+
exit(0)
|
43
|
+
end
|
41
44
|
fail Informative, "Version #{@version} doesn't exist." unless @url || @installer.exist?(@version)
|
42
45
|
fail Informative, "Invalid URL: `#{@url}`" unless !@url || @url =~ /\A#{URI.regexp}\z/
|
43
46
|
end
|
data/spec/list_spec.rb
CHANGED
@@ -4,7 +4,6 @@ module XcodeInstall
|
|
4
4
|
describe Command::List do
|
5
5
|
before do
|
6
6
|
installer.stubs(:exists).returns(true)
|
7
|
-
installer.stubs(:installed_versions).returns([])
|
8
7
|
end
|
9
8
|
|
10
9
|
def installer
|
@@ -23,11 +22,36 @@ module XcodeInstall
|
|
23
22
|
installer.stubs(:xcodes).returns(xcodes)
|
24
23
|
end
|
25
24
|
|
25
|
+
def fake_installed_xcode(name)
|
26
|
+
xcode_path = "/Applications/Xcode-#{name}.app"
|
27
|
+
xcode_version = name
|
28
|
+
xcode_version << '.0' unless name.include? '.'
|
29
|
+
|
30
|
+
installed_xcode = InstalledXcode.new(xcode_path)
|
31
|
+
installed_xcode.stubs(:version).returns(xcode_version)
|
32
|
+
installed_xcode.stubs(:bundle_version).returns(Gem::Version.new(xcode_version))
|
33
|
+
installed_xcode
|
34
|
+
end
|
35
|
+
|
36
|
+
def fake_installed_xcodes(*names)
|
37
|
+
xcodes = names.map { |name| fake_installed_xcode(name) }
|
38
|
+
installer.stubs(:installed_versions).returns(xcodes)
|
39
|
+
end
|
40
|
+
|
26
41
|
describe '#list' do
|
27
42
|
it 'lists all versions' do
|
28
43
|
fake_xcodes '1', '2.3', '2.3.1', '2.3.2', '3 some', '4 beta', '10 beta'
|
44
|
+
fake_installed_xcodes
|
29
45
|
installer.list.should == "1\n2.3\n2.3.1\n2.3.2\n3 some\n4 beta\n10 beta"
|
30
46
|
end
|
31
47
|
end
|
48
|
+
|
49
|
+
describe '#list_annotated' do
|
50
|
+
it 'lists all versions with annotations' do
|
51
|
+
fake_xcodes '1', '2.3', '2.3.1', '2.3.2', '3 some', '4.3.1 for Lion', '9.4.1', '10 beta'
|
52
|
+
fake_installed_xcodes '2.3', '4.3.1', '10'
|
53
|
+
installer.list.should == "1\n2.3 (installed)\n2.3.1\n2.3.2\n3 some\n4.3.1 for Lion (installed)\n9.4.1\n10 beta (installed)"
|
54
|
+
end
|
55
|
+
end
|
32
56
|
end
|
33
57
|
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: 2.4.
|
4
|
+
version: 2.4.4
|
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: 2018-07-
|
11
|
+
date: 2018-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
162
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.6.
|
163
|
+
rubygems_version: 2.6.10
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: Xcode installation manager.
|