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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 192dc46594552b9f7ef13f59410e344bbcdf526f
|
4
|
+
data.tar.gz: 8ce16e389789992902014ed549b9859236ec1d20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e5d6e72e955a40a422695d554e1cb9fe8e7cec0021c19047149f3c0d4ec44408d57ff7a9f6bef5f32ddc5fde2ddb1281b53446cac943a136f61a05ad97dd7e9
|
7
|
+
data.tar.gz: 23d02d150fabb995dba2d27b38db0f3e859fe98a0d7994cf1409b9cf11901bad987daaa5b49dd9ad9d4283321bbd45bd229d6645c25e41e5e824fd30cd981e10
|
data/lib/xcodeproj/constants.rb
CHANGED
@@ -24,14 +24,45 @@ module Xcodeproj
|
|
24
24
|
else
|
25
25
|
if type == :lower
|
26
26
|
cache = plist_cache[:lower] ||= {}
|
27
|
-
cache[name] ||=
|
27
|
+
cache[name] ||= camelize(name, :uppercase_first_letter => false)
|
28
28
|
else
|
29
29
|
cache = plist_cache[:normal] ||= {}
|
30
|
-
cache[name] ||= name
|
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.
|
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.
|
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.
|
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-
|
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.
|
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.
|