nixenvironment 0.0.29 → 0.0.30

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: 092e4ce61b47a6f9bd5e8a4c684fd1180dce53a2
4
- data.tar.gz: e8d6c13c96985e7092e8834299d3dbc183a15ab5
3
+ metadata.gz: 3a32b09ec813f8563ff6bcf655eb28f38b82ec91
4
+ data.tar.gz: fa8efd162bd84c818d022a085241a031a6c003bd
5
5
  SHA512:
6
- metadata.gz: c8dbc35d21457c6761461b399ac3282e090f8db7aa67410bebeff982076ab33d6c101119d94928bec48905b99792b26a4c9f92531db150806daff4ca6c21fc47
7
- data.tar.gz: a51ca595561b76fe72d8c670695725b1d547725bb03c27ed582662872be15fb4854fa28165974cf84015ed4eadd839892b95e509405a0a1cc0c6320d4892f61d
6
+ metadata.gz: 427baa4b633a73a6b32b9e51f819346307a0c599af9da91f6d5ffc3d01905a2de6611620e3814973bbcf25ab8546f081af0033be701ed789d9d69c443474ff24
7
+ data.tar.gz: 4d4f574aaf7237ce1b3d081bcb6e4efcee3c2254775e15bce5970ddeb1a79a29a42c5f359712d5c9056edba0883d5524a9fb3be26abd7b0ca736cf67bb4e38b4
data/bin/nixenvironment CHANGED
@@ -326,6 +326,12 @@ def supplement_config_settings(config)
326
326
  if key and value
327
327
  stripped_key = key.strip
328
328
  stripped_value = value.strip
329
+
330
+ # TODO: investigate and fix me! Brutal hack with PRODUCT_SETTINGS_PATH because ruby File & FileUtils can't work with escaped paths
331
+ if stripped_key == 'PRODUCT_SETTINGS_PATH'
332
+ @unescaped_product_settings_path = stripped_value
333
+ end
334
+
329
335
  @config_settings[stripped_key] ||= stripped_value.shellescape # Assign new value only if assignee is nil
330
336
  end
331
337
  end
@@ -521,8 +527,8 @@ end
521
527
  def backup_info_plist
522
528
  p('Backuping Info.plist ...')
523
529
 
524
- @info_plist_backup_name = @config_settings['PRODUCT_SETTINGS_PATH'] + '.backup'
525
- FileUtils.cp(@config_settings['PRODUCT_SETTINGS_PATH'], @info_plist_backup_name)
530
+ @info_plist_backup_name = @unescaped_product_settings_path + '.backup'
531
+ FileUtils.cp(@unescaped_product_settings_path, @info_plist_backup_name)
526
532
 
527
533
  p('Info.plist was backuped.')
528
534
  end
@@ -533,10 +539,10 @@ def update_info_plist(config)
533
539
  revision = %x[ source _last_revision.sh && echo ${REVISION} ].strip!
534
540
  monotonic_revision = %x[ source _last_revision.sh && echo ${MONOTONIC_REVISION} ].strip!
535
541
 
536
- update_success = system("/usr/libexec/PlistBuddy -c 'Set :CFBundleIdentifier \"#{@config_settings['BUNDLE_ID']}\"' \"#{@config_settings['PRODUCT_SETTINGS_PATH']}\"")
537
- update_success &&= system("/usr/libexec/PlistBuddy -c 'Set :CFBundleVersion \"#{monotonic_revision}\"' \"#{@config_settings['PRODUCT_SETTINGS_PATH']}\"")
538
- update_success &&= system("/usr/libexec/PlistBuddy -c 'Add :Configuration string \"#{config}\"' \"#{@config_settings['PRODUCT_SETTINGS_PATH']}\"")
539
- update_success &&= system("/usr/libexec/PlistBuddy -c 'Add :RevisionNumber string \"#{revision}\"' \"#{@config_settings['PRODUCT_SETTINGS_PATH']}\"")
542
+ update_success = system("/usr/libexec/PlistBuddy -c 'Set :CFBundleIdentifier \"#{@config_settings['BUNDLE_ID']}\"' \"#{@unescaped_product_settings_path}\"")
543
+ update_success &&= system("/usr/libexec/PlistBuddy -c 'Set :CFBundleVersion \"#{monotonic_revision}\"' \"#{@unescaped_product_settings_path}\"")
544
+ update_success &&= system("/usr/libexec/PlistBuddy -c 'Add :Configuration string \"#{config}\"' \"#{@unescaped_product_settings_path}\"")
545
+ update_success &&= system("/usr/libexec/PlistBuddy -c 'Add :RevisionNumber string \"#{revision}\"' \"#{@unescaped_product_settings_path}\"")
540
546
 
541
547
  unless update_success
542
548
  restore_info_plist
@@ -549,8 +555,8 @@ end
549
555
  def restore_info_plist
550
556
  p('Restoring Info.plist ...')
551
557
 
552
- File.delete(@config_settings['PRODUCT_SETTINGS_PATH'])
553
- File.rename(@info_plist_backup_name, @config_settings['PRODUCT_SETTINGS_PATH'])
558
+ File.delete(@unescaped_product_settings_path)
559
+ File.rename(@info_plist_backup_name, @unescaped_product_settings_path)
554
560
 
555
561
  p('Info.plist was restored.')
556
562
  end
@@ -1,3 +1,3 @@
1
1
  module Nixenvironment
2
- VERSION = '0.0.29'
2
+ VERSION = '0.0.30'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nixenvironment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen Arzumanian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-23 00:00:00.000000000 Z
11
+ date: 2015-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler