pbxproject 0.1.1 → 0.1.2
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.
- data/VERSION +1 -1
- data/lib/pbxproject/pbxproject.rb +24 -5
- data/lib/pbxproject/pbxtypes.rb +1 -1
- data/pbxproject.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -10,7 +10,21 @@ module PBXProject
|
|
10
10
|
@filename = args[:file]
|
11
11
|
|
12
12
|
# initialize our class
|
13
|
-
|
13
|
+
# make sure that our sections are on proper order
|
14
|
+
@sections = {
|
15
|
+
:PBXBuildFile => nil,
|
16
|
+
:PBXFileReference => nil,
|
17
|
+
:PBXFrameworksBuildPhase => nil,
|
18
|
+
:PBXGroup => nil,
|
19
|
+
:PBXNativeTarget => nil,
|
20
|
+
:PBXProject => nil,
|
21
|
+
:PBXResourcesBuildPhase => nil,
|
22
|
+
:PBXShellScriptBuildPhase => nil,
|
23
|
+
:PBXSourcesBuildPhase => nil,
|
24
|
+
:PBXVariantGroup => nil,
|
25
|
+
:XCBuildConfiguration => nil,
|
26
|
+
:XCConfigurationList => nil
|
27
|
+
}
|
14
28
|
|
15
29
|
# and set that we're ready for parsing
|
16
30
|
@state = :ready
|
@@ -36,7 +50,7 @@ module PBXProject
|
|
36
50
|
# Read our file
|
37
51
|
pbx.each_line do |line|
|
38
52
|
if (line_num == 0 && !line.match(Regexp.new(Regexp.escape('// !$*UTF8*$!'))))
|
39
|
-
raise "
|
53
|
+
raise "Unknown file format"
|
40
54
|
end
|
41
55
|
|
42
56
|
# Main level Attributes
|
@@ -201,11 +215,15 @@ module PBXProject
|
|
201
215
|
args.delete(:type)
|
202
216
|
@sections.each do |t, arr|
|
203
217
|
next unless t == type_name
|
204
|
-
|
218
|
+
|
205
219
|
arr.each do |item|
|
206
220
|
args.each do |k,v|
|
207
|
-
|
208
|
-
|
221
|
+
val = item.instance_variable_get("@#{k}")
|
222
|
+
val = (val.respond_to?(:value) ? val.value : val)
|
223
|
+
|
224
|
+
next unless val
|
225
|
+
|
226
|
+
if (val.match(Regexp.new("\"?#{v}\"?")))
|
209
227
|
return item
|
210
228
|
end
|
211
229
|
end
|
@@ -239,6 +257,7 @@ module PBXProject
|
|
239
257
|
pbx += "\tobjects = {\n"
|
240
258
|
|
241
259
|
@sections.each do |type, val|
|
260
|
+
next if val.nil? # skip section if it's empty
|
242
261
|
pbx += "\n/* Begin %s section */\n" % type
|
243
262
|
|
244
263
|
val.each do |item|
|
data/lib/pbxproject/pbxtypes.rb
CHANGED
data/pbxproject.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: pbxproject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mikko Kokkonen
|
@@ -99,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
hash:
|
102
|
+
hash: -3725904592710847939
|
103
103
|
segments:
|
104
104
|
- 0
|
105
105
|
version: "0"
|