xcodeproject 0.3.6 → 0.3.8
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/lib/xcodeproject/pbx_group.rb +8 -2
- data/lib/xcodeproject/root_node.rb +4 -1
- data/lib/xcodeproject/version.rb +1 -1
- data/spec/pbx_group_spec.rb +14 -0
- metadata +3 -3
@@ -122,6 +122,11 @@ module XcodeProject
|
|
122
122
|
path.relative? ? path : path.relative_path_from(total_path)
|
123
123
|
end
|
124
124
|
|
125
|
+
def remove_file_ref (gpath)
|
126
|
+
obj = file(gpath)
|
127
|
+
obj.remove! unless obj.nil?
|
128
|
+
end
|
129
|
+
|
125
130
|
def remove_group (gpath)
|
126
131
|
obj = group(gpath)
|
127
132
|
obj.remove! unless obj.nil?
|
@@ -155,8 +160,9 @@ module XcodeProject
|
|
155
160
|
PBXGroup.new(root, uuid, data)
|
156
161
|
end
|
157
162
|
|
158
|
-
alias :file
|
159
|
-
alias :add_file
|
163
|
+
alias :file :file_ref
|
164
|
+
alias :add_file :add_file_ref
|
165
|
+
alias :remove_file :remove_file_ref
|
160
166
|
|
161
167
|
private
|
162
168
|
|
@@ -34,7 +34,10 @@ require 'xcodeproject/extend/hash'
|
|
34
34
|
module XcodeProject
|
35
35
|
class RootNode
|
36
36
|
def initialize (data, wd)
|
37
|
-
@data
|
37
|
+
@data = data
|
38
|
+
|
39
|
+
@wd = Pathname.new(wd)
|
40
|
+
@wd = Pathname.new(ENV['PWD']).join(@wd) if @wd.relative?
|
38
41
|
|
39
42
|
@objects = data['objects']
|
40
43
|
@uuid_generator = UUIDGenerator.new
|
data/lib/xcodeproject/version.rb
CHANGED
data/spec/pbx_group_spec.rb
CHANGED
@@ -246,6 +246,20 @@ describe XcodeProject::PBXGroup do
|
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
249
|
+
describe "#remove_file_ref" do
|
250
|
+
context "if the file reference exists" do
|
251
|
+
it "removes the object" do
|
252
|
+
obj.remove_file_ref('group1a/file2c.m')
|
253
|
+
obj.file_ref('group1a/file2c.m').should be_nil
|
254
|
+
end
|
255
|
+
end
|
256
|
+
context "if the file reference doesn't exist" do
|
257
|
+
it "returns nil" do
|
258
|
+
obj.remove_file_ref('group1a/file2c_ghost.m').should be_nil
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
249
263
|
describe "#remove_group" do
|
250
264
|
context "if the group exists" do
|
251
265
|
it "removes the object" do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 8
|
9
|
+
version: 0.3.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Andrey Nesterov
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-
|
17
|
+
date: 2012-08-22 00:00:00 +04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|