xcode-install 1.3.0 → 1.4.0
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 +7 -8
- data/lib/xcode/install.rb +8 -6
- data/lib/xcode/install/install.rb +1 -1
- data/lib/xcode/install/installed.rb +10 -1
- data/lib/xcode/install/version.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: d60d0d71fe266fff0ea23311a158463ac4a5c651
|
4
|
+
data.tar.gz: bf22abf6675d40970ae51a1b2a13a40b18659ce8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ac4de5ae34601cf0295aceda5c0f0d2923baf4856def93bb687a52c7cc7475ea68326daa39313810d5997e6e8f4e16877924f29e9f630aac2ad61c63fba1ba2
|
7
|
+
data.tar.gz: 1d9d696ea778b7c91c62d30d10ecfc1d4932a20d518b723ffdf2fc1c7ab4c101c9662dad286663e44b5135159fada9077fb785a671e098f4ac0c2093874f54e8
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2016-04-26 22:45:06 -0700 using RuboCop version 0.35.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -13,11 +13,11 @@ Metrics/AbcSize:
|
|
13
13
|
# Offense count: 1
|
14
14
|
# Configuration parameters: CountComments.
|
15
15
|
Metrics/ClassLength:
|
16
|
-
Max:
|
16
|
+
Max: 206
|
17
17
|
|
18
|
-
# Offense count:
|
18
|
+
# Offense count: 3
|
19
19
|
Metrics/CyclomaticComplexity:
|
20
|
-
Max:
|
20
|
+
Max: 8
|
21
21
|
|
22
22
|
# Offense count: 10
|
23
23
|
# Configuration parameters: CountComments.
|
@@ -29,7 +29,6 @@ Metrics/MethodLength:
|
|
29
29
|
Metrics/ParameterLists:
|
30
30
|
Max: 6
|
31
31
|
|
32
|
-
#
|
33
|
-
|
34
|
-
|
35
|
-
- 'lib/xcode/install.rb'
|
32
|
+
# Offense count: 2
|
33
|
+
Metrics/PerceivedComplexity:
|
34
|
+
Max: 8
|
data/lib/xcode/install.rb
CHANGED
@@ -49,8 +49,8 @@ module XcodeInstall
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def download(version, progress, url = nil)
|
52
|
-
return unless exist?(version)
|
53
|
-
xcode = seedlist.find { |x| x.name == version }
|
52
|
+
return unless url || exist?(version)
|
53
|
+
xcode = seedlist.find { |x| x.name == version } unless url
|
54
54
|
dmg_file = Pathname.new(File.basename(url || xcode.path))
|
55
55
|
|
56
56
|
result = Curl.new.fetch(url || xcode.url, CACHE_DIR, url ? nil : spaceship.cookie, dmg_file, progress)
|
@@ -75,7 +75,6 @@ module XcodeInstall
|
|
75
75
|
xcode_path = "/Applications/Xcode#{suffix}.app"
|
76
76
|
|
77
77
|
mount_dir = mount(dmg_path)
|
78
|
-
puts 'Please authenticate for Xcode installation...'
|
79
78
|
source = Dir.glob(File.join(mount_dir, 'Xcode*.app')).first
|
80
79
|
|
81
80
|
if source.nil?
|
@@ -88,7 +87,8 @@ HELP
|
|
88
87
|
return
|
89
88
|
end
|
90
89
|
|
91
|
-
|
90
|
+
prompt = "Please authenticate for Xcode installation.\nPassword: "
|
91
|
+
`sudo -p "#{prompt}" ditto "#{source}" "#{xcode_path}"`
|
92
92
|
`umount "/Volumes/Xcode"`
|
93
93
|
|
94
94
|
unless verify_integrity(xcode_path)
|
@@ -118,7 +118,7 @@ HELP
|
|
118
118
|
|
119
119
|
install_dmg(dmg_path, "-#{version.split(' ')[0]}", switch, clean) if install
|
120
120
|
|
121
|
-
open_release_notes_url(version)
|
121
|
+
open_release_notes_url(version) unless url
|
122
122
|
end
|
123
123
|
|
124
124
|
def open_release_notes_url(version)
|
@@ -436,7 +436,9 @@ HELP
|
|
436
436
|
end
|
437
437
|
|
438
438
|
def install_components
|
439
|
-
|
439
|
+
Dir.glob("#{@path}/Contents/Resources/Packages/*.pkg").each do |pkg|
|
440
|
+
`sudo installer -pkg #{pkg} -target /`
|
441
|
+
end
|
440
442
|
osx_build_version = `sw_vers -buildVersion`.chomp
|
441
443
|
tools_version = `/usr/libexec/PlistBuddy -c "Print :ProductBuildVersion" "#{@path}/Contents/version.plist"`.chomp
|
442
444
|
cache_dir = `getconf DARWIN_USER_CACHE_DIR`.chomp
|
@@ -36,7 +36,7 @@ module XcodeInstall
|
|
36
36
|
|
37
37
|
help! 'A VERSION argument is required.' unless @version
|
38
38
|
fail Informative, "Version #{@version} already installed." if @installer.installed?(@version) && !@force
|
39
|
-
fail Informative, "Version #{@version} doesn't exist." unless @installer.exist?(@version)
|
39
|
+
fail Informative, "Version #{@version} doesn't exist." unless @url || @installer.exist?(@version)
|
40
40
|
fail Informative, "Invalid URL: `#{@url}`" unless !@url || @url =~ /\A#{URI.regexp}\z/
|
41
41
|
end
|
42
42
|
|
@@ -4,10 +4,19 @@ module XcodeInstall
|
|
4
4
|
self.command = 'installed'
|
5
5
|
self.summary = 'List installed Xcodes.'
|
6
6
|
|
7
|
+
def self.options
|
8
|
+
[['--uuid', 'Show DVTPlugInCompatibilityUUIDs in the list.']].concat(super)
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(argv)
|
12
|
+
@uuid = argv.flag?('uuid', false)
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
7
16
|
def run
|
8
17
|
installer = XcodeInstall::Installer.new
|
9
18
|
installer.installed_versions.each do |xcode|
|
10
|
-
puts "#{xcode.version}\t(#{xcode.path})"
|
19
|
+
puts "#{xcode.version}\t(#{xcode.path})\t#{@uuid ? xcode.uuid : ''}"
|
11
20
|
end
|
12
21
|
end
|
13
22
|
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.
|
4
|
+
version: 1.4.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: 2016-04
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|