mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-24 09:38:30 +02:00
Merge branch 'prototype/Swift_4_0' into prototype/queryBuilders
This commit is contained in:
@@ -1093,15 +1093,6 @@ fileprivate extension String {
|
|||||||
return String(repeating: " ", count: level * 4)
|
return String(repeating: " ", count: level * 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate func trimSwiftModuleName() -> String {
|
|
||||||
|
|
||||||
if self.hasPrefix("Swift.") {
|
|
||||||
|
|
||||||
return self.substring(from: "Swift.".endIndex)
|
|
||||||
}
|
|
||||||
return self
|
|
||||||
}
|
|
||||||
|
|
||||||
fileprivate mutating func indent(_ level: Int) {
|
fileprivate mutating func indent(_ level: Int) {
|
||||||
|
|
||||||
self = self.replacingOccurrences(of: "\n", with: "\n\(String.indention(level))")
|
self = self.replacingOccurrences(of: "\n", with: "\n\(String.indention(level))")
|
||||||
|
|||||||
@@ -538,7 +538,7 @@ public final class CoreStoreSchema: DynamicSchema {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
let newMethod = class_getClassMethod(managedObjectClass, newSelector)
|
let newMethod = class_getClassMethod(managedObjectClass, newSelector)!
|
||||||
method_exchangeImplementations(origMethod, newMethod)
|
method_exchangeImplementations(origMethod, newMethod)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ public final class XcodeDataModelSchema: DynamicSchema {
|
|||||||
public required init(modelName: ModelVersion, modelVersionFileURL: URL) {
|
public required init(modelName: ModelVersion, modelVersionFileURL: URL) {
|
||||||
|
|
||||||
CoreStore.assert(
|
CoreStore.assert(
|
||||||
NSManagedObjectModel(contentsOf: modelVersionFileURL) != nil,
|
FileManager.default.fileExists(atPath: modelVersionFileURL.path),
|
||||||
"Could not find the \"\(modelName).mom\" version file for the model at URL \"\(modelVersionFileURL)\"."
|
"Could not find the \"\(modelName).mom\" version file for the model at URL \"\(modelVersionFileURL)\"."
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -164,12 +164,13 @@ public final class XcodeDataModelSchema: DynamicSchema {
|
|||||||
|
|
||||||
return cachedRawModel
|
return cachedRawModel
|
||||||
}
|
}
|
||||||
if let rawModel = NSManagedObjectModel(contentsOf: self.modelVersionFileURL) {
|
CoreStore.assert(
|
||||||
|
FileManager.default.fileExists(atPath: self.modelVersionFileURL.path),
|
||||||
self.cachedRawModel = rawModel
|
"Could not find the \"\(self.modelVersion).mom\" version file for the model at URL \"\(self.modelVersionFileURL)\"."
|
||||||
return rawModel
|
)
|
||||||
}
|
let rawModel = NSManagedObjectModel(contentsOf: self.modelVersionFileURL)
|
||||||
CoreStore.abort("Could not create an \(cs_typeName(NSManagedObjectModel.self)) from the model at URL \"\(self.modelVersionFileURL)\".")
|
self.cachedRawModel = rawModel
|
||||||
|
return rawModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user