removed Nimble

This commit is contained in:
John Rommel Estropia
2016-03-13 11:10:09 +09:00
parent 603dffffb0
commit ea8412ab93
10 changed files with 116 additions and 492 deletions

View File

@@ -64,7 +64,7 @@ public final class LegacySQLiteStore: SQLiteStore {
public required init(fileName: String, configuration: String? = nil, mappingModelBundles: [NSBundle] = NSBundle.allBundles(), resetStoreOnModelMismatch: Bool = false) {
super.init(
fileURL: LegacySQLiteStore.legacyDefaultRootDirectory.URLByAppendingPathComponent(
fileURL: LegacySQLiteStore.defaultRootDirectory.URLByAppendingPathComponent(
fileName,
isDirectory: false
),
@@ -75,6 +75,30 @@ public final class LegacySQLiteStore: SQLiteStore {
}
// MARK: SQLiteStore
internal override class var defaultRootDirectory: NSURL {
#if os(tvOS)
let systemDirectorySearchPath = NSSearchPathDirectory.CachesDirectory
#else
let systemDirectorySearchPath = NSSearchPathDirectory.ApplicationSupportDirectory
#endif
return NSFileManager.defaultManager().URLsForDirectory(
systemDirectorySearchPath,
inDomains: .UserDomainMask
).first!
}
internal override class var defaultFileURL: NSURL {
return LegacySQLiteStore.defaultRootDirectory
.URLByAppendingPathComponent(DataStack.applicationName, isDirectory: false)
.URLByAppendingPathExtension("sqlite")
}
// MARK: DefaultInitializableStore
/**
@@ -83,24 +107,6 @@ public final class LegacySQLiteStore: SQLiteStore {
*/
public required init() {
super.init(fileURL: LegacySQLiteStore.legacyDefaultFileURL)
super.init(fileURL: LegacySQLiteStore.defaultFileURL)
}
// MARK: Internal
#if os(tvOS)
internal static let systemDirectorySearchPath = NSSearchPathDirectory.CachesDirectory
#else
internal static let systemDirectorySearchPath = NSSearchPathDirectory.ApplicationSupportDirectory
#endif
internal static let legacyDefaultRootDirectory = NSFileManager.defaultManager().URLsForDirectory(
LegacySQLiteStore.systemDirectorySearchPath,
inDomains: .UserDomainMask
).first!
internal static let legacyDefaultFileURL = LegacySQLiteStore.legacyDefaultRootDirectory
.URLByAppendingPathComponent(DataStack.applicationName, isDirectory: false)
.URLByAppendingPathExtension("sqlite")
}

View File

@@ -147,7 +147,7 @@ public class SQLiteStore: LocalStorage, DefaultInitializableStore {
// MARK: Internal
internal static let defaultRootDirectory: NSURL = {
internal class var defaultRootDirectory: NSURL {
#if os(tvOS)
let systemDirectorySearchPath = NSSearchPathDirectory.CachesDirectory
@@ -163,14 +163,14 @@ public class SQLiteStore: LocalStorage, DefaultInitializableStore {
NSBundle.mainBundle().bundleIdentifier ?? "com.CoreStore.DataStack",
isDirectory: true
)
}()
}
internal static let defaultFileURL: NSURL = {
internal class var defaultFileURL: NSURL {
let applicationName = (NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleName") as? String) ?? "CoreData"
return SQLiteStore.defaultRootDirectory
.URLByAppendingPathComponent(applicationName, isDirectory: false)
.URLByAppendingPathExtension("sqlite")
}()
}
}