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
def self.has_many(plural_attr_name, options)
klass = options[:class]
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)
define_method(plural_attr_name) do
uuids = send(uuid_list_name)
......@@ -26,9 +26,9 @@ module Pod
end
end
def self.has_one(singular_attr_name, options = {})
uuid_name = options[:uuid] || "#{singular_attr_name}UUID" # TODO change UUID to Reference?
attribute(options[:uuid] || singular_attr_name, uuid_name)
def self.has_one(singular_attr_name)
uuid_name = "#{singular_attr_name}Reference"
attribute(singular_attr_name, uuid_name)
define_method(singular_attr_name) do
uuid = send(uuid_name)
@project.objects[uuid]
......@@ -167,7 +167,7 @@ module Pod
def initialize(*)
super
self.fileUUIDs ||= []
self.fileReferences ||= []
# These are always the same, no idea what they are.
self.buildActionMask ||= "2147483647"
self.runOnlyForDeploymentPostprocessing ||= "0"
......@@ -202,7 +202,7 @@ module Pod
def initialize(project, uuid, attributes)
super
self.buildPhaseUUIDs ||= []
self.buildPhaseReferences ||= []
# TODO self.buildConfigurationList ||= new list?
#self.buildRules ||= []
#self.dependencies ||= []
......@@ -210,7 +210,7 @@ module Pod
end
class XCBuildConfiguration < PBXObject
has_one :baseConfiguration, :uuid => :baseConfigurationReference
has_one :baseConfiguration
end
class XCConfigurationList < PBXObject
......@@ -218,7 +218,7 @@ module Pod
def initialize(*)
super
self.buildConfigurationUUIDs ||= []
self.buildConfigurationReferences ||= []
end
end
......
......@@ -128,7 +128,7 @@ describe "Pod::Xcode::Project" do
configuration = @project.objects.add(Pod::Xcode::Project::XCBuildConfiguration)
@list.buildConfigurations.to_a.should == []
@list.buildConfigurations = [configuration]
@list.buildConfigurationUUIDs.should == [configuration.uuid]
@list.buildConfigurationReferences.should == [configuration.uuid]
end
end
......@@ -153,9 +153,9 @@ describe "Pod::Xcode::Project" do
it "returns the buildConfigurationList" do
list = @target.buildConfigurationList
list.should.be.instance_of Pod::Xcode::Project::XCConfigurationList
@target.buildConfigurationListUUID = nil
@target.buildConfigurationListReference = nil
@target.buildConfigurationList.should == nil
@target.buildConfigurationListUUID = list.uuid
@target.buildConfigurationListReference = list.uuid
@target.buildConfigurationList.attributes.should == list.attributes
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