From 08eb2dab7032418f5b6c81fd72251499244a5662 Mon Sep 17 00:00:00 2001 From: Daniel Dahan Date: Sat, 26 Mar 2016 11:52:01 -0400 Subject: [PATCH] updated internal naming from GraphObject to GraphNode --- Graph.podspec | 2 +- Graph.xcodeproj/project.pbxproj | 20 +++++++++---------- .../{GraphObject.swift => GraphNode.swift} | 14 ++----------- Sources/Info.plist | 2 +- Sources/ManagedNode.swift | 4 ++-- Sources/ManagedNodeGroup.swift | 2 +- Sources/ManagedNodeProperty.swift | 2 +- 7 files changed, 18 insertions(+), 28 deletions(-) rename Sources/{GraphObject.swift => GraphNode.swift} (88%) diff --git a/Graph.podspec b/Graph.podspec index 666b16e8..76cd124e 100755 --- a/Graph.podspec +++ b/Graph.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Graph' - s.version = '1.0.9' + s.version = '1.0.10' s.license = 'BSD' s.summary = 'An elegant data-driven framework for CoreData in Swift.' s.homepage = 'http://cosmicmind.io' diff --git a/Graph.xcodeproj/project.pbxproj b/Graph.xcodeproj/project.pbxproj index 85439319..398f97bf 100644 --- a/Graph.xcodeproj/project.pbxproj +++ b/Graph.xcodeproj/project.pbxproj @@ -49,8 +49,8 @@ 961F9B801C10ED5400ACF5DD /* Graph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F9B531C10ED5400ACF5DD /* Graph.swift */; }; 961F9B811C10ED5400ACF5DD /* Graph.h in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B541C10ED5400ACF5DD /* Graph.h */; settings = {ATTRIBUTES = (Public, ); }; }; 961F9B821C10ED5400ACF5DD /* Graph.h in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B541C10ED5400ACF5DD /* Graph.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 961F9B831C10ED5400ACF5DD /* GraphObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F9B551C10ED5400ACF5DD /* GraphObject.swift */; }; - 961F9B841C10ED5400ACF5DD /* GraphObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F9B551C10ED5400ACF5DD /* GraphObject.swift */; }; + 961F9B831C10ED5400ACF5DD /* GraphNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F9B551C10ED5400ACF5DD /* GraphNode.swift */; }; + 961F9B841C10ED5400ACF5DD /* GraphNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F9B551C10ED5400ACF5DD /* GraphNode.swift */; }; 961F9B851C10ED5400ACF5DD /* GraphSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F9B561C10ED5400ACF5DD /* GraphSearch.swift */; }; 961F9B861C10ED5400ACF5DD /* GraphSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F9B561C10ED5400ACF5DD /* GraphSearch.swift */; }; 961F9B871C10ED5400ACF5DD /* GraphWatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961F9B571C10ED5400ACF5DD /* GraphWatch.swift */; }; @@ -97,7 +97,7 @@ 96E135D31C10F16D00E0BF44 /* Relationship.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B501C10ED5400ACF5DD /* Relationship.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135D41C10F16D00E0BF44 /* Entity.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B521C10ED5400ACF5DD /* Entity.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135D51C10F16D00E0BF44 /* Graph.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B531C10ED5400ACF5DD /* Graph.swift */; settings = {ATTRIBUTES = (Public, ); }; }; - 96E135D61C10F16D00E0BF44 /* GraphObject.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B551C10ED5400ACF5DD /* GraphObject.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96E135D61C10F16D00E0BF44 /* GraphNode.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B551C10ED5400ACF5DD /* GraphNode.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135D71C10F16D00E0BF44 /* GraphSearch.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B561C10ED5400ACF5DD /* GraphSearch.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135D81C10F16D00E0BF44 /* GraphWatch.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B571C10ED5400ACF5DD /* GraphWatch.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135D91C10F16D00E0BF44 /* ManagedAction.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B5E1C10ED5400ACF5DD /* ManagedAction.swift */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -117,7 +117,7 @@ 96E135F31C10F22800E0BF44 /* Relationship.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B501C10ED5400ACF5DD /* Relationship.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135F41C10F22800E0BF44 /* Entity.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B521C10ED5400ACF5DD /* Entity.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135F51C10F22800E0BF44 /* Graph.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B531C10ED5400ACF5DD /* Graph.swift */; settings = {ATTRIBUTES = (Public, ); }; }; - 96E135F61C10F22800E0BF44 /* GraphObject.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B551C10ED5400ACF5DD /* GraphObject.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96E135F61C10F22800E0BF44 /* GraphNode.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B551C10ED5400ACF5DD /* GraphNode.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135F71C10F22800E0BF44 /* GraphSearch.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B561C10ED5400ACF5DD /* GraphSearch.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135F81C10F22800E0BF44 /* GraphWatch.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B571C10ED5400ACF5DD /* GraphWatch.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E135F91C10F22800E0BF44 /* ManagedAction.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961F9B5E1C10ED5400ACF5DD /* ManagedAction.swift */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -176,7 +176,7 @@ 961F9B521C10ED5400ACF5DD /* Entity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Entity.swift; sourceTree = ""; }; 961F9B531C10ED5400ACF5DD /* Graph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.swift; sourceTree = ""; }; 961F9B541C10ED5400ACF5DD /* Graph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Graph.h; sourceTree = ""; }; - 961F9B551C10ED5400ACF5DD /* GraphObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphObject.swift; sourceTree = ""; }; + 961F9B551C10ED5400ACF5DD /* GraphNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphNode.swift; sourceTree = ""; }; 961F9B561C10ED5400ACF5DD /* GraphSearch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphSearch.swift; sourceTree = ""; }; 961F9B571C10ED5400ACF5DD /* GraphWatch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphWatch.swift; sourceTree = ""; }; 961F9B581C10ED5400ACF5DD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -265,7 +265,7 @@ 96607D741C3DB14A008D47D8 /* NodeClass.swift */, 961F9B531C10ED5400ACF5DD /* Graph.swift */, 96815B271C9F44A50006CBE2 /* GraphModel.swift */, - 961F9B551C10ED5400ACF5DD /* GraphObject.swift */, + 961F9B551C10ED5400ACF5DD /* GraphNode.swift */, 961F9B561C10ED5400ACF5DD /* GraphSearch.swift */, 961F9B571C10ED5400ACF5DD /* GraphWatch.swift */, 961F9B6A1C10ED5400ACF5DD /* Node.swift */, @@ -344,7 +344,7 @@ 96E135F31C10F22800E0BF44 /* Relationship.swift in Headers */, 96E135F41C10F22800E0BF44 /* Entity.swift in Headers */, 96E135F51C10F22800E0BF44 /* Graph.swift in Headers */, - 96E135F61C10F22800E0BF44 /* GraphObject.swift in Headers */, + 96E135F61C10F22800E0BF44 /* GraphNode.swift in Headers */, 96E135F71C10F22800E0BF44 /* GraphSearch.swift in Headers */, 96E135F81C10F22800E0BF44 /* GraphWatch.swift in Headers */, 96E135F91C10F22800E0BF44 /* ManagedAction.swift in Headers */, @@ -374,7 +374,7 @@ 96E135D31C10F16D00E0BF44 /* Relationship.swift in Headers */, 96E135D41C10F16D00E0BF44 /* Entity.swift in Headers */, 96E135D51C10F16D00E0BF44 /* Graph.swift in Headers */, - 96E135D61C10F16D00E0BF44 /* GraphObject.swift in Headers */, + 96E135D61C10F16D00E0BF44 /* GraphNode.swift in Headers */, 96E135D71C10F16D00E0BF44 /* GraphSearch.swift in Headers */, 96E135D81C10F16D00E0BF44 /* GraphWatch.swift in Headers */, 96E135D91C10F16D00E0BF44 /* ManagedAction.swift in Headers */, @@ -561,7 +561,7 @@ 961F9B781C10ED5400ACF5DD /* Action.swift in Sources */, 961F9BA01C10ED5400ACF5DD /* ManagedRelationshipProperty.swift in Sources */, 961F9B961C10ED5400ACF5DD /* ManagedAction.swift in Sources */, - 961F9B841C10ED5400ACF5DD /* GraphObject.swift in Sources */, + 961F9B841C10ED5400ACF5DD /* GraphNode.swift in Sources */, 961F9BA61C10ED5400ACF5DD /* ManagedEntityProperty.swift in Sources */, 961F9B881C10ED5400ACF5DD /* GraphWatch.swift in Sources */, 96815B291C9F44A50006CBE2 /* GraphModel.swift in Sources */, @@ -615,7 +615,7 @@ 961F9B771C10ED5400ACF5DD /* Action.swift in Sources */, 961F9B9F1C10ED5400ACF5DD /* ManagedRelationshipProperty.swift in Sources */, 961F9B951C10ED5400ACF5DD /* ManagedAction.swift in Sources */, - 961F9B831C10ED5400ACF5DD /* GraphObject.swift in Sources */, + 961F9B831C10ED5400ACF5DD /* GraphNode.swift in Sources */, 961F9BA51C10ED5400ACF5DD /* ManagedEntityProperty.swift in Sources */, 961F9B871C10ED5400ACF5DD /* GraphWatch.swift in Sources */, 96815B281C9F44A50006CBE2 /* GraphModel.swift in Sources */, diff --git a/Sources/GraphObject.swift b/Sources/GraphNode.swift similarity index 88% rename from Sources/GraphObject.swift rename to Sources/GraphNode.swift index b7fb7710..dbb17542 100644 --- a/Sources/GraphObject.swift +++ b/Sources/GraphNode.swift @@ -30,27 +30,17 @@ import CoreData -internal class GraphObject : NSManagedObject { +internal class GraphNode : NSManagedObject { // // :name: context // internal var context: NSManagedObjectContext? - // - // :name: worker - // - internal var worker: NSManagedObjectContext? { - if nil == context { - context = Graph.context - } - return context - } - // // :name: delete // internal func delete() { - worker?.deleteObject(self) + Graph.context?.deleteObject(self) } } diff --git a/Sources/Info.plist b/Sources/Info.plist index 8cac1784..b174d9c3 100644 --- a/Sources/Info.plist +++ b/Sources/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0.9 + 1.0.10 CFBundleSignature ???? CFBundleVersion diff --git a/Sources/ManagedNode.swift b/Sources/ManagedNode.swift index e4e50cfe..1658453c 100644 --- a/Sources/ManagedNode.swift +++ b/Sources/ManagedNode.swift @@ -30,7 +30,7 @@ import CoreData -internal class ManagedNode : GraphObject { +internal class ManagedNode : GraphNode { @NSManaged internal var nodeClass: NSNumber @NSManaged internal var type: String @NSManaged internal var createdDate: NSDate @@ -42,7 +42,7 @@ internal class ManagedNode : GraphObject { // internal var id: String { do { - try worker?.obtainPermanentIDsForObjects([self]) + try Graph.context?.obtainPermanentIDsForObjects([self]) } catch {} return String(stringInterpolationSegment: nodeClass) + type + objectID.URIRepresentation().lastPathComponent! } diff --git a/Sources/ManagedNodeGroup.swift b/Sources/ManagedNodeGroup.swift index ef85cc87..daa6824d 100644 --- a/Sources/ManagedNodeGroup.swift +++ b/Sources/ManagedNodeGroup.swift @@ -30,6 +30,6 @@ import CoreData -internal class ManagedNodeGroup : GraphObject { +internal class ManagedNodeGroup : GraphNode { @NSManaged internal var name: String } diff --git a/Sources/ManagedNodeProperty.swift b/Sources/ManagedNodeProperty.swift index 84ef2fdf..cd5f479a 100644 --- a/Sources/ManagedNodeProperty.swift +++ b/Sources/ManagedNodeProperty.swift @@ -30,7 +30,7 @@ import CoreData -internal class ManagedNodeProperty : GraphObject { +internal class ManagedNodeProperty : GraphNode { @NSManaged internal var name: String @NSManaged internal var object: AnyObject }