xcodeproj 1.4.3 → 1.4.4

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: 6a97737e8e4f72673d7dcfe9c3f0874773ee0c46
4
- data.tar.gz: e889540bfc2c0ca20cf4cbd72646040b23980184
3
+ metadata.gz: 192dc46594552b9f7ef13f59410e344bbcdf526f
4
+ data.tar.gz: 8ce16e389789992902014ed549b9859236ec1d20
5
5
  SHA512:
6
- metadata.gz: 637b003c953cac894c738ca9063b844c23356c11282f74c6353b3f267eac8ce6611ac263d62bbebeb20cf4dd806179002f6af4700bee6696e8405ebbcf4d07fa
7
- data.tar.gz: 6a86277c46f8e4fb571064a1c9d9ad0ad0b06428e66264b52fb5f646e37449573f3e748925266fa3d7fa37ac66a92302f51e310755fb17154a99ced81b1228e7
6
+ metadata.gz: 1e5d6e72e955a40a422695d554e1cb9fe8e7cec0021c19047149f3c0d4ec44408d57ff7a9f6bef5f32ddc5fde2ddb1281b53446cac943a136f61a05ad97dd7e9
7
+ data.tar.gz: 23d02d150fabb995dba2d27b38db0f3e859fe98a0d7994cf1409b9cf11901bad987daaa5b49dd9ad9d4283321bbd45bd229d6645c25e41e5e824fd30cd981e10
@@ -149,6 +149,7 @@ module Xcodeproj
149
149
  :bundle => 'bundle',
150
150
  :octest_bundle => 'octest',
151
151
  :unit_test_bundle => 'xctest',
152
+ :ui_test_bundle => 'xctest',
152
153
  :app_extension => 'appex',
153
154
  :watch2_extension => 'appex',
154
155
  :watch2_app => 'app',
@@ -1,5 +1,5 @@
1
1
  module Xcodeproj
2
2
  # The version of the xcodeproj gem.
3
3
  #
4
- VERSION = '1.4.3'.freeze unless defined? Xcodeproj::VERSION
4
+ VERSION = '1.4.4'.freeze unless defined? Xcodeproj::VERSION
5
5
  end
@@ -24,14 +24,45 @@ module Xcodeproj
24
24
  else
25
25
  if type == :lower
26
26
  cache = plist_cache[:lower] ||= {}
27
- cache[name] ||= name.to_s.camelize(:lower)
27
+ cache[name] ||= camelize(name, :uppercase_first_letter => false)
28
28
  else
29
29
  cache = plist_cache[:normal] ||= {}
30
- cache[name] ||= name.to_s.camelize
30
+ cache[name] ||= camelize(name)
31
31
  end
32
32
  end
33
33
  end
34
34
 
35
+ # The following two methods are taken from activesupport,
36
+ # https://github.com/rails/rails/blob/v5.0.2/activesupport/lib/active_support/inflector/methods.rb
37
+ # all credit for them goes to the original authors.
38
+ #
39
+ # The code is used under the MIT license.
40
+
41
+ def self.camelize(term, uppercase_first_letter: true)
42
+ string = term.to_s
43
+ string = if uppercase_first_letter
44
+ string.sub(/^[a-z\d]*/, &:capitalize)
45
+ else
46
+ string.sub(/^(?:(?=a)b(?=\b|[A-Z_])|\w)/, &:downcase)
47
+ end
48
+ string.gsub!(%r{(?:_|(/))([a-z\d]*)}i) { "#{Regexp.last_match(1)}#{Regexp.last_match(2).capitalize}" }
49
+ string.gsub!('/'.freeze, '::'.freeze)
50
+ string
51
+ end
52
+ private_class_method :camelize
53
+
54
+ def self.underscore(camel_cased_word)
55
+ return camel_cased_word unless camel_cased_word =~ /[A-Z-]|::/
56
+ word = camel_cased_word.to_s.gsub('::'.freeze, '/'.freeze)
57
+ word.gsub!(/(?:(?<=([A-Za-z\d]))|\b)((?=a)b)(?=\b|[^a-z])/) { "#{Regexp.last_match(1) && '_'.freeze}#{Regexp.last_match(2).downcase}" }
58
+ word.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2'.freeze)
59
+ word.gsub!(/([a-z\d])([A-Z])/, '\1_\2'.freeze)
60
+ word.tr!('-'.freeze, '_'.freeze)
61
+ word.downcase!
62
+ word
63
+ end
64
+ private_class_method :underscore
65
+
35
66
  # @return [Symbol] The Ruby equivalent of the given plist name.
36
67
  #
37
68
  # @param [String] name
@@ -41,7 +72,7 @@ module Xcodeproj
41
72
  # CaseConverter.convert_to_ruby('ProjectRef') #=> :project_ref
42
73
  #
43
74
  def self.convert_to_ruby(name)
44
- name.to_s.underscore.to_sym
75
+ underscore(name.to_s).to_sym
45
76
  end
46
77
 
47
78
  # @return [Hash] A cache for the conversion to the Plist format.
@@ -12,8 +12,6 @@ module Xcodeproj
12
12
  # validated before serialization ?
13
13
  #
14
14
  class AbstractObjectAttribute
15
- require 'active_support/inflector'
16
-
17
15
  # @return [Symbol] the type of the attribute. It can be `:simple`,
18
16
  # `:to_one`, `:to_many`.
19
17
  #
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodeproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-31 00:00:00.000000000 Z
11
+ date: 2017-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '3'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '3'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: CFPropertyList
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -173,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
159
  version: '0'
174
160
  requirements: []
175
161
  rubyforge_project:
176
- rubygems_version: 2.4.5.1
162
+ rubygems_version: 2.6.11
177
163
  signing_key:
178
164
  specification_version: 3
179
165
  summary: Create and modify Xcode projects from Ruby.