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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbe119d0e500ca2bd3f40878365d9feccc766d78
4
- data.tar.gz: 8e910ab1e30bbc5b66b21ea20a25b40647ebc646
3
+ metadata.gz: d60d0d71fe266fff0ea23311a158463ac4a5c651
4
+ data.tar.gz: bf22abf6675d40970ae51a1b2a13a40b18659ce8
5
5
  SHA512:
6
- metadata.gz: 7d3de0a500322bc15c834d00093a05cf206e0040b7dbd71a7d722dda859e9349e9a76f5fb8a65afdb11977c120c623bacc4721a7d512e9b0b9e94d30ac47984f
7
- data.tar.gz: a890daa46eddcfdb241b2dc07fef0fda2f3683ca056f7d36d62a75683374d50942ce0229619776331b4307e268f1bfc5fb1fdb4792f2dec46f530cc7ee445a7f
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 2015-11-04 13:49:25 +0100 using RuboCop version 0.34.2.
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: 250
16
+ Max: 206
17
17
 
18
- # Offense count: 1
18
+ # Offense count: 3
19
19
  Metrics/CyclomaticComplexity:
20
- Max: 7
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
- # FIXME: for spaceship workaround
33
- Lint/HandleExceptions:
34
- Exclude:
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) || url
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
- `sudo ditto "#{source}" "#{xcode_path}"`
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
- `sudo installer -pkg #{@path}/Contents/Resources/Packages/MobileDevice.pkg -target /`
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
@@ -1,3 +1,3 @@
1
1
  module XcodeInstall
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  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.3.0
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 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide