xcode-install 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2b948df58ca7b2f2c720472b89214775f134d23
4
- data.tar.gz: 15aa407f7d766643d655e2a80df65e90498ddb24
3
+ metadata.gz: b7ba5033bc9c7837468a6579fbcf957d5e5e9f46
4
+ data.tar.gz: 09b92821948c600fc8bf6f5bb317f709bd50890e
5
5
  SHA512:
6
- metadata.gz: 1bebaacc5640edecaa090ab1cfd80a381c2c50564f2af37cfc148b8b734d74019b967fd0f4ec17041e3a4018ada81868872e1bb9d180eee4264894c079bb1bd7
7
- data.tar.gz: c1dddfc1b74d0da06784eeb4c0a12f0afed8be3dcd072e5f6ef366976e563292f01163cee594ece527d904c195eed7db0da370e940b060009088b4797b0f6e84
6
+ metadata.gz: 19bf9ad9bd1f501769d2953a02c37d57e4c019e5fea462758d3a5751a648168549dfcd94832536cf66cac91828779e761c71238f5875728f1254b3853ec0dcfd
7
+ data.tar.gz: 170995f06db15fc32642dee98b68a4a461bd34a594721b2b15124a014ab2e78bf22f27849fe92b60866970e87d51d1904929038a52c7c0f7b5b00caeaf91f358
data/Gemfile CHANGED
@@ -6,6 +6,6 @@ group :development do
6
6
  gem 'bacon'
7
7
  gem 'mocha-on-bacon'
8
8
  gem 'mocha', '~> 0.11.4'
9
- gem 'prettybacon', git: 'https://github.com/irrationalfab/PrettyBacon.git', branch: 'master'
9
+ gem 'prettybacon'
10
10
  gem 'coveralls', require: false
11
11
  end
data/lib/xcode/install.rb CHANGED
@@ -62,7 +62,7 @@ module XcodeInstall
62
62
  end
63
63
 
64
64
  def installed_versions
65
- @installed ||= installed.map { |x| InstalledXcode.new(x) }.sort do |a, b|
65
+ installed.map { |x| InstalledXcode.new(x) }.sort do |a, b|
66
66
  Gem::Version.new(a.version) <=> Gem::Version.new(b.version)
67
67
  end
68
68
  end
@@ -93,7 +93,9 @@ HELP
93
93
  end
94
94
 
95
95
  enable_developer_mode
96
- InstalledXcode.new(xcode_path).approve_license
96
+ xcode = InstalledXcode.new(xcode_path)
97
+ xcode.approve_license
98
+ xcode.install_components
97
99
 
98
100
  if switch
99
101
  `sudo rm -f #{SYMLINK_PATH}` unless current_symlink.nil?
@@ -271,7 +273,7 @@ HELP
271
273
 
272
274
  def initialize(path)
273
275
  @path = Pathname.new(path)
274
- @version = get_version(path)
276
+ @version = get_version
275
277
  end
276
278
 
277
279
  def approve_license
@@ -283,10 +285,18 @@ HELP
283
285
  `sudo /usr/libexec/PlistBuddy -c "add :IDEXcodeVersionForAgreedToGMLicense string #{@version}" #{license_plist_path}`
284
286
  end
285
287
 
288
+ def install_components
289
+ `sudo installer -pkg #{@path}/Contents/Resources/Packages/MobileDevice.pkg -target /`
290
+ osx_build_version = `sw_vers -buildVersion`.chomp
291
+ tools_version = `/usr/libexec/PlistBuddy -c "Print :ProductBuildVersion" "#{@path}/Contents/version.plist"`.chomp
292
+ cache_dir = `getconf DARWIN_USER_CACHE_DIR`.chomp
293
+ `touch #{cache_dir}com.apple.dt.Xcode.InstallCheckCache_#{osx_build_version}_#{tools_version}`
294
+ end
295
+
286
296
  :private
287
297
 
288
- def get_version(xcode_path)
289
- output = `DEVELOPER_DIR='' "#{xcode_path}/Contents/Developer/usr/bin/xcodebuild" -version`
298
+ def get_version
299
+ output = `DEVELOPER_DIR='' "#{@path}/Contents/Developer/usr/bin/xcodebuild" -version`
290
300
  return '0.0' if output.nil? # ¯\_(ツ)_/¯
291
301
  output.split("\n").first.split(' ')[1]
292
302
  end
@@ -1,3 +1,3 @@
1
1
  module XcodeInstall
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcode-install
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Bügling