Commit 971586ce authored by Eloy Duran's avatar Eloy Duran

Use 'reference' instead of 'UUID', which is what it already uses to indicate foreign keys.

parent bf963342
...@@ -15,7 +15,7 @@ module Pod ...@@ -15,7 +15,7 @@ module Pod
def self.has_many(plural_attr_name, options) def self.has_many(plural_attr_name, options)
klass = options[:class] klass = options[:class]
singular_attr_name = plural_attr_name.to_s[0..-2] # strip off 's' singular_attr_name = plural_attr_name.to_s[0..-2] # strip off 's'
uuid_list_name = "#{singular_attr_name}UUIDs" uuid_list_name = "#{singular_attr_name}References"
attribute(plural_attr_name, uuid_list_name) attribute(plural_attr_name, uuid_list_name)
define_method(plural_attr_name) do define_method(plural_attr_name) do
uuids = send(uuid_list_name) uuids = send(uuid_list_name)
...@@ -26,9 +26,9 @@ module Pod ...@@ -26,9 +26,9 @@ module Pod
end end
end end
def self.has_one(singular_attr_name, options = {}) def self.has_one(singular_attr_name)
uuid_name = options[:uuid] || "#{singular_attr_name}UUID" # TODO change UUID to Reference? uuid_name = "#{singular_attr_name}Reference"
attribute(options[:uuid] || singular_attr_name, uuid_name) attribute(singular_attr_name, uuid_name)
define_method(singular_attr_name) do define_method(singular_attr_name) do
uuid = send(uuid_name) uuid = send(uuid_name)
@project.objects[uuid] @project.objects[uuid]
...@@ -167,7 +167,7 @@ module Pod ...@@ -167,7 +167,7 @@ module Pod
def initialize(*) def initialize(*)
super super
self.fileUUIDs ||= [] self.fileReferences ||= []
# These are always the same, no idea what they are. # These are always the same, no idea what they are.
self.buildActionMask ||= "2147483647" self.buildActionMask ||= "2147483647"
self.runOnlyForDeploymentPostprocessing ||= "0" self.runOnlyForDeploymentPostprocessing ||= "0"
...@@ -202,7 +202,7 @@ module Pod ...@@ -202,7 +202,7 @@ module Pod
def initialize(project, uuid, attributes) def initialize(project, uuid, attributes)
super super
self.buildPhaseUUIDs ||= [] self.buildPhaseReferences ||= []
# TODO self.buildConfigurationList ||= new list? # TODO self.buildConfigurationList ||= new list?
#self.buildRules ||= [] #self.buildRules ||= []
#self.dependencies ||= [] #self.dependencies ||= []
...@@ -210,7 +210,7 @@ module Pod ...@@ -210,7 +210,7 @@ module Pod
end end
class XCBuildConfiguration < PBXObject class XCBuildConfiguration < PBXObject
has_one :baseConfiguration, :uuid => :baseConfigurationReference has_one :baseConfiguration
end end
class XCConfigurationList < PBXObject class XCConfigurationList < PBXObject
...@@ -218,7 +218,7 @@ module Pod ...@@ -218,7 +218,7 @@ module Pod
def initialize(*) def initialize(*)
super super
self.buildConfigurationUUIDs ||= [] self.buildConfigurationReferences ||= []
end end
end end
......
...@@ -128,7 +128,7 @@ describe "Pod::Xcode::Project" do ...@@ -128,7 +128,7 @@ describe "Pod::Xcode::Project" do
configuration = @project.objects.add(Pod::Xcode::Project::XCBuildConfiguration) configuration = @project.objects.add(Pod::Xcode::Project::XCBuildConfiguration)
@list.buildConfigurations.to_a.should == [] @list.buildConfigurations.to_a.should == []
@list.buildConfigurations = [configuration] @list.buildConfigurations = [configuration]
@list.buildConfigurationUUIDs.should == [configuration.uuid] @list.buildConfigurationReferences.should == [configuration.uuid]
end end
end end
...@@ -153,9 +153,9 @@ describe "Pod::Xcode::Project" do ...@@ -153,9 +153,9 @@ describe "Pod::Xcode::Project" do
it "returns the buildConfigurationList" do it "returns the buildConfigurationList" do
list = @target.buildConfigurationList list = @target.buildConfigurationList
list.should.be.instance_of Pod::Xcode::Project::XCConfigurationList list.should.be.instance_of Pod::Xcode::Project::XCConfigurationList
@target.buildConfigurationListUUID = nil @target.buildConfigurationListReference = nil
@target.buildConfigurationList.should == nil @target.buildConfigurationList.should == nil
@target.buildConfigurationListUUID = list.uuid @target.buildConfigurationListReference = list.uuid
@target.buildConfigurationList.attributes.should == list.attributes @target.buildConfigurationList.attributes.should == list.attributes
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment