motion-yapper 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/.travis.yml +2 -0
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/lib/motion-yapper.rb +1 -0
- data/lib/yapper.rb +3 -5
- data/lib/yapper/config.rb +2 -0
- data/lib/yapper/db.rb +105 -40
- data/lib/yapper/document.rb +7 -4
- data/lib/yapper/document/callbacks.rb +0 -7
- data/lib/yapper/document/{persistance.rb → persistence.rb} +27 -21
- data/lib/yapper/document/relation.rb +29 -22
- data/lib/yapper/document/selection.rb +122 -54
- data/lib/yapper/extensions.rb +12 -24
- data/lib/yapper/settings.rb +43 -0
- data/lib/yapper/timestamps.rb +2 -0
- data/lib/yapper/version.rb +1 -1
- data/{yapper.gemspec → motion-yapper.gemspec} +0 -0
- data/spec/integration/{where_spec.rb → criteria_spec.rb} +78 -10
- data/spec/integration/db_spec.rb +70 -0
- data/spec/integration/defaults_spec.rb +37 -0
- data/spec/integration/extensions_spec.rb +14 -0
- data/spec/integration/{persistance_spec.rb → persistence_spec.rb} +0 -0
- data/spec/integration/relation_spec.rb +4 -4
- data/vendor/Podfile.lock +9 -11
- data/vendor/Pods/.build/libPods-CocoaLumberjack.a +0 -0
- data/vendor/Pods/.build/libPods-NSData+MD5Digest.a +0 -0
- data/vendor/Pods/.build/libPods-YapDatabase.a +0 -0
- data/vendor/Pods/.build/libPods.a +0 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/{CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h → BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +98 -65
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +30 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +8 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +1 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +3 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +1 -1
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +35 -31
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -2
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +8 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +43 -21
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +79 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +125 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +10 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +48 -107
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +18 -1
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +51 -50
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +546 -546
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1093 -907
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +98 -65
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +873 -748
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1284 -1243
- data/vendor/Pods/{BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h → CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{ContextFilterLogFormatter.m → DDContextFilterLogFormatter.m} +70 -70
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +253 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +30 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +127 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +1 -1
- data/vendor/Pods/CocoaLumberjack/README.markdown +52 -15
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/Headers/CocoaLumberjack/{ContextFilterLogFormatter.h → DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/Headers/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +98 -65
- data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +30 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +3 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +48 -107
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +2 -0
- data/vendor/Pods/Headers/____Pods-environment.h +15 -15
- data/vendor/Pods/Manifest.lock +9 -11
- data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +1 -1
- data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +2 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +1 -1
- data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +1 -1
- data/vendor/Pods/{Pods-Acknowledgements.markdown → Pods-acknowledgements.markdown} +0 -37
- data/vendor/Pods/{Pods-Acknowledgements.plist → Pods-acknowledgements.plist} +0 -45
- data/vendor/Pods/Pods-environment.h +15 -15
- data/vendor/Pods/Pods.xcconfig +3 -3
- data/vendor/Pods/Pods.xcodeproj/project.pbxproj +2426 -3155
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +31 -0
- data/vendor/Pods/YapDatabase/README.md +3 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -2
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +25 -41
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +403 -134
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +8 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +8 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +113 -62
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +35 -31
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +25 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +1 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +25 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +79 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +125 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +129 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +802 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +408 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +5254 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +10 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +9 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +62 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +148 -45
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +18 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +15 -9
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +211 -64
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +48 -107
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +10 -7
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +13 -22
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +725 -244
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +8 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +19 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +1 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +1 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +3 -3
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +43 -21
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +4 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +3 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +5 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +84 -93
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +381 -209
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +587 -267
- data/vendor/Pods/{Pods.bridgesupport → build-iPhoneSimulator/Pods.bridgesupport} +633 -2557
- data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +2 -1
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +2 -1
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +4 -2
- metadata +80 -108
- data/Gemfile.lock +0 -63
- data/lib/yapper/attachment.rb +0 -48
- data/lib/yapper/document/attachment.rb +0 -26
- data/lib/yapper/sync.rb +0 -134
- data/lib/yapper/sync/data.rb +0 -12
- data/lib/yapper/sync/event.rb +0 -194
- data/lib/yapper/sync/queue.rb +0 -164
- data/spec/integration/all_spec.rb +0 -40
- data/spec/integration/sync_spec.rb +0 -42
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +0 -1396
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +0 -327
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +0 -321
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +0 -150
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +0 -157
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +0 -143
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +0 -848
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +0 -167
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +0 -191
- data/vendor/Pods/AFNetworking/LICENSE +0 -19
- data/vendor/Pods/AFNetworking/README.md +0 -208
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +0 -109
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +0 -251
- data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/Headers/Reachability/Reachability.h +0 -109
- data/vendor/Pods/Headers/YapDatabase/YapCache.h +0 -90
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +0 -29
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +0 -37
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +0 -440
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -19
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -69
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +0 -158
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +0 -424
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -73
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +0 -13
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +0 -121
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +0 -36
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +0 -153
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +0 -74
- data/vendor/Pods/Headers/YapDatabase/YapNull.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapTouch.h +0 -15
- data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +0 -17
- data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +0 -5
- data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-AFNetworking-dummy.m +0 -5
- data/vendor/Pods/Pods-AFNetworking-prefix.pch +0 -17
- data/vendor/Pods/Pods-AFNetworking.xcconfig +0 -1
- data/vendor/Pods/Pods-Reachability-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-Reachability-dummy.m +0 -5
- data/vendor/Pods/Pods-Reachability-prefix.pch +0 -5
- data/vendor/Pods/Pods-Reachability.xcconfig +0 -1
- data/vendor/Pods/Reachability/LICENCE.txt +0 -24
- data/vendor/Pods/Reachability/README.md +0 -65
- data/vendor/Pods/Reachability/Reachability.h +0 -109
- data/vendor/Pods/Reachability/Reachability.m +0 -527
data/spec/integration/db_spec.rb
CHANGED
|
@@ -37,4 +37,74 @@ describe 'db' do
|
|
|
37
37
|
end
|
|
38
38
|
Document.all.count.should == 2
|
|
39
39
|
end
|
|
40
|
+
|
|
41
|
+
describe 'notifications' do
|
|
42
|
+
before { @notification_center = NSNotificationCenter.defaultCenter }
|
|
43
|
+
|
|
44
|
+
before do
|
|
45
|
+
@notified = false
|
|
46
|
+
@notified_docs = nil
|
|
47
|
+
@observer = @notification_center.observe 'yapper:document:save' do |data|
|
|
48
|
+
@notified = true
|
|
49
|
+
@notified_docs = data.object
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
after { @notification_center.unobserve(@observer) }
|
|
54
|
+
|
|
55
|
+
it 'notifies on creation' do
|
|
56
|
+
Document.create(:field_1 => 'field_1')
|
|
57
|
+
|
|
58
|
+
@notified.should == true
|
|
59
|
+
@notified_docs.count.should == 1
|
|
60
|
+
@notified_docs.first.field_1.should == 'field_1'
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
it 'notifies on updates' do
|
|
64
|
+
doc = Document.create(:field_1 => 'field_1')
|
|
65
|
+
doc.update_attributes(:field_1 => 'field_1_updated')
|
|
66
|
+
|
|
67
|
+
@notified.should == true
|
|
68
|
+
@notified_docs.count.should == 1
|
|
69
|
+
@notified_docs.first.field_1.should == 'field_1_updated'
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
it 'notifies on destroy' do
|
|
73
|
+
doc = Document.create(:field_1 => 'field_1')
|
|
74
|
+
doc.destroy
|
|
75
|
+
|
|
76
|
+
@notified.should == true
|
|
77
|
+
@notified_docs.count.should == 1
|
|
78
|
+
@notified_docs.first.destroyed.should == true
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
it 'queues updates that are part of a transaction' do
|
|
82
|
+
Yapper::DB.instance.execute do
|
|
83
|
+
doc = Document.create(:field_1 => 'field_1')
|
|
84
|
+
|
|
85
|
+
@notified.should == false
|
|
86
|
+
|
|
87
|
+
doc.update_attributes(:field_1 => 'field_1_updated')
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
@notified.should == true
|
|
91
|
+
@notified_docs.count.should == 2
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
describe 'when persisting on a different thread' do
|
|
95
|
+
before do
|
|
96
|
+
@query_observer = @notification_center.observe 'yapper:document:save' do |data|
|
|
97
|
+
Document.all.count
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
after { @notification_center.unobserve(@query_observer) }
|
|
102
|
+
|
|
103
|
+
it "doesn't deadlock" do
|
|
104
|
+
Dispatch::Queue.concurrent.sync { Document.create(:field_1 => 'field_1') }
|
|
105
|
+
|
|
106
|
+
@notified.should == true
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
40
110
|
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
describe 'Yapper document defaults' do
|
|
2
|
+
describe "when using a value as a default" do
|
|
3
|
+
before do
|
|
4
|
+
class DefaultsDocument
|
|
5
|
+
include Yapper::Document
|
|
6
|
+
|
|
7
|
+
field :field_1, :default => false
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
before { Yapper::DB.instance.purge }
|
|
11
|
+
after { Object.send(:remove_const, 'DefaultsDocument') }
|
|
12
|
+
|
|
13
|
+
it "sets the default" do
|
|
14
|
+
DefaultsDocument.create
|
|
15
|
+
|
|
16
|
+
DefaultsDocument.all.first.field_1.should == false
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
describe "when using a proc as a default" do
|
|
21
|
+
before do
|
|
22
|
+
class DefaultsDocument
|
|
23
|
+
include Yapper::Document
|
|
24
|
+
|
|
25
|
+
field :field_1, :default => proc { 10 }
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
before { Yapper::DB.instance.purge }
|
|
29
|
+
after { Object.send(:remove_const, 'DefaultsDocument') }
|
|
30
|
+
|
|
31
|
+
it "sets the default" do
|
|
32
|
+
DefaultsDocument.create
|
|
33
|
+
|
|
34
|
+
DefaultsDocument.all.first.field_1.should == 10
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
describe 'extensions' do
|
|
2
|
+
describe 'Hash#to_canonical' do
|
|
3
|
+
it 'generates the same hash regardless of hash order' do
|
|
4
|
+
{a: 'a', b: 'b'}.to_canonical.should == {b: 'b', a: 'a'}.to_canonical
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
it 'generates the same hash with embedded hashses' do
|
|
8
|
+
{a: 'a', b: { c: 'c'}}.to_canonical.should == {a: 'a', b: { c: 'c'}}.to_canonical
|
|
9
|
+
end
|
|
10
|
+
it 'generates the same hash with embedded arrays' do
|
|
11
|
+
{a: 'a', b: { c: ['c', 'b']}}.to_canonical.should == {a: 'a', b: { c: ['b', 'c']}}.to_canonical
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
File without changes
|
|
@@ -27,7 +27,7 @@ describe 'Yapper document 1:N relationship' do
|
|
|
27
27
|
])
|
|
28
28
|
|
|
29
29
|
@parent.field_1.should == 'parent'
|
|
30
|
-
@parent.child_documents.collect(&:field_1).should == ['child0', 'child1']
|
|
30
|
+
@parent.child_documents.to_a.collect(&:field_1).should == ['child0', 'child1']
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
it 'can accept an nested attributes with ids' do
|
|
@@ -46,7 +46,7 @@ describe 'Yapper document 1:N relationship' do
|
|
|
46
46
|
:child_documents => children)
|
|
47
47
|
|
|
48
48
|
@parent.field_1.should == 'parent'
|
|
49
|
-
@parent.child_documents.collect(&:field_1).should == ['child0', 'child1']
|
|
49
|
+
@parent.child_documents.to_a.collect(&:field_1).should == ['child0', 'child1']
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
it 'can accept array of created children' do
|
|
@@ -55,7 +55,7 @@ describe 'Yapper document 1:N relationship' do
|
|
|
55
55
|
:child_documents => children)
|
|
56
56
|
|
|
57
57
|
@parent.field_1.should == 'parent'
|
|
58
|
-
@parent.child_documents.collect(&:field_1).should == ['child0', 'child1']
|
|
58
|
+
@parent.child_documents.to_a.collect(&:field_1).should == ['child0', 'child1']
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
it 'can update a child document via nested attributes' do
|
|
@@ -109,7 +109,7 @@ describe 'Yapper document 1:N relationship' do
|
|
|
109
109
|
@parent.reload
|
|
110
110
|
|
|
111
111
|
@parent.child_documents.count.should == 2
|
|
112
|
-
@parent.child_documents.collect(&:id).each { |id| id.should.not == @last_id }
|
|
112
|
+
@parent.child_documents.to_a.collect(&:id).each { |id| id.should.not == @last_id }
|
|
113
113
|
end
|
|
114
114
|
end
|
|
115
115
|
end
|
data/vendor/Podfile.lock
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
PODS:
|
|
2
|
-
-
|
|
3
|
-
|
|
2
|
+
- CocoaLumberjack (1.8.1):
|
|
3
|
+
- CocoaLumberjack/Extensions
|
|
4
|
+
- CocoaLumberjack/Core (1.8.1)
|
|
5
|
+
- CocoaLumberjack/Extensions (1.8.1):
|
|
6
|
+
- CocoaLumberjack/Core
|
|
4
7
|
- NSData+MD5Digest (1.0.0)
|
|
5
|
-
-
|
|
6
|
-
- YapDatabase (2.3):
|
|
8
|
+
- YapDatabase (2.4):
|
|
7
9
|
- CocoaLumberjack (~> 1.6.3)
|
|
8
10
|
|
|
9
11
|
DEPENDENCIES:
|
|
10
|
-
- AFNetworking (~> 1.3.3)
|
|
11
12
|
- CocoaLumberjack
|
|
12
13
|
- CocoaLumberjack (~> 1.6.5)
|
|
13
14
|
- NSData+MD5Digest (~> 1.0.0)
|
|
14
|
-
-
|
|
15
|
-
- YapDatabase (~> 2.3)
|
|
15
|
+
- YapDatabase (~> 2.4)
|
|
16
16
|
|
|
17
17
|
SPEC CHECKSUMS:
|
|
18
|
-
|
|
19
|
-
CocoaLumberjack: 19dceba2d0360ed383cba983bc3ef0dd089c42a1
|
|
18
|
+
CocoaLumberjack: 020378ec400d658923bf5887178394f65f052c90
|
|
20
19
|
NSData+MD5Digest: 8275479b2a935e6caa8a92a9a814fb5abecba367
|
|
21
|
-
|
|
22
|
-
YapDatabase: b9b58b24092557adc59e3b86a167601c7733b8e7
|
|
20
|
+
YapDatabase: 3e1159ee9540859342bf2869a86dd9e434548c45
|
|
23
21
|
|
|
24
22
|
COCOAPODS: 0.29.0
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* Welcome to Cocoa Lumberjack!
|
|
8
8
|
*
|
|
9
9
|
* The project page has a wealth of documentation if you have any questions.
|
|
10
|
-
* https://github.com/
|
|
10
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
|
11
11
|
*
|
|
12
12
|
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
|
13
|
-
* https://github.com/
|
|
13
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
|
14
14
|
*
|
|
15
15
|
*
|
|
16
16
|
* This class provides a logger for the Apple System Log facility.
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
|
|
29
29
|
@interface DDASLLogger : DDAbstractLogger <DDLogger>
|
|
30
30
|
{
|
|
31
|
-
|
|
31
|
+
aslclient client;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
+ (
|
|
34
|
+
+ (instancetype)sharedInstance;
|
|
35
35
|
|
|
36
36
|
// Inherited from DDAbstractLogger
|
|
37
37
|
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* Welcome to Cocoa Lumberjack!
|
|
7
7
|
*
|
|
8
8
|
* The project page has a wealth of documentation if you have any questions.
|
|
9
|
-
* https://github.com/
|
|
9
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
|
10
10
|
*
|
|
11
11
|
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
|
12
|
-
* https://github.com/
|
|
12
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
|
13
13
|
*
|
|
14
14
|
*
|
|
15
15
|
* This class provides an abstract implementation of a database logger.
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
|
|
22
22
|
@interface DDAbstractDatabaseLogger : DDAbstractLogger {
|
|
23
23
|
@protected
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
NSUInteger saveThreshold;
|
|
25
|
+
NSTimeInterval saveInterval;
|
|
26
|
+
NSTimeInterval maxAge;
|
|
27
|
+
NSTimeInterval deleteInterval;
|
|
28
|
+
BOOL deleteOnEverySave;
|
|
29
|
+
|
|
30
|
+
BOOL saveTimerSuspended;
|
|
31
|
+
NSUInteger unsavedCount;
|
|
32
|
+
dispatch_time_t unsavedTime;
|
|
33
|
+
dispatch_source_t saveTimer;
|
|
34
|
+
dispatch_time_t lastDeleteTime;
|
|
35
|
+
dispatch_source_t deleteTimer;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
#import <Foundation/Foundation.h>
|
|
2
2
|
#import "DDLog.h"
|
|
3
3
|
|
|
4
|
-
@class ContextFilterLogFormatter;
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Welcome to Cocoa Lumberjack!
|
|
8
6
|
*
|
|
9
7
|
* The project page has a wealth of documentation if you have any questions.
|
|
10
|
-
* https://github.com/
|
|
8
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
|
11
9
|
*
|
|
12
10
|
* If you're new to the project you may wish to read the "Getting Started" page.
|
|
13
|
-
* https://github.com/
|
|
11
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
|
14
12
|
*
|
|
15
13
|
*
|
|
16
14
|
* This class provides a log formatter that filters log statements from a logging context not on the whitelist.
|
|
17
15
|
*
|
|
18
16
|
* A log formatter can be added to any logger to format and/or filter its output.
|
|
19
17
|
* You can learn more about log formatters here:
|
|
20
|
-
* https://github.com/
|
|
18
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
|
|
21
19
|
*
|
|
22
20
|
* You can learn more about logging context's here:
|
|
23
|
-
* https://github.com/
|
|
21
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomContext
|
|
24
22
|
*
|
|
25
23
|
* But here's a quick overview / refresher:
|
|
26
24
|
*
|
|
@@ -31,7 +29,7 @@
|
|
|
31
29
|
* For example, logically separate parts of your app each have a different logging context.
|
|
32
30
|
* Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context.
|
|
33
31
|
**/
|
|
34
|
-
@interface
|
|
32
|
+
@interface DDContextWhitelistFilterLogFormatter : NSObject <DDLogFormatter>
|
|
35
33
|
|
|
36
34
|
- (id)init;
|
|
37
35
|
|
|
@@ -51,7 +49,7 @@
|
|
|
51
49
|
/**
|
|
52
50
|
* This class provides a log formatter that filters log statements from a logging context on the blacklist.
|
|
53
51
|
**/
|
|
54
|
-
@interface
|
|
52
|
+
@interface DDContextBlacklistFilterLogFormatter : NSObject <DDLogFormatter>
|
|
55
53
|
|
|
56
54
|
- (id)init;
|
|
57
55
|
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
* Welcome to Cocoa Lumberjack!
|
|
8
8
|
*
|
|
9
9
|
* The project page has a wealth of documentation if you have any questions.
|
|
10
|
-
* https://github.com/
|
|
10
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
|
11
11
|
*
|
|
12
12
|
* If you're new to the project you may wish to read the "Getting Started" page.
|
|
13
|
-
* https://github.com/
|
|
13
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
|
14
14
|
*
|
|
15
15
|
*
|
|
16
16
|
* This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id.
|
|
17
17
|
*
|
|
18
18
|
* A log formatter can be added to any logger to format and/or filter its output.
|
|
19
19
|
* You can learn more about log formatters here:
|
|
20
|
-
* https://github.com/
|
|
20
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
|
|
21
21
|
*
|
|
22
22
|
* A typical NSLog (or DDTTYLogger) prints detailed info as [<process_id>:<thread_id>].
|
|
23
23
|
* For example:
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
* Note: If manually creating your own background threads (via NSThread/alloc/init or NSThread/detachNeThread),
|
|
50
50
|
* you can use [[NSThread currentThread] setName:(NSString *)].
|
|
51
51
|
**/
|
|
52
|
-
@interface
|
|
52
|
+
@interface DDDispatchQueueLogFormatter : NSObject <DDLogFormatter> {
|
|
53
53
|
@protected
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
|
|
55
|
+
NSString *dateFormatString;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -114,3 +114,15 @@
|
|
|
114
114
|
- (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel;
|
|
115
115
|
|
|
116
116
|
@end
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Method declarations that make it easier to extend/modify DDDispatchQueueLogFormatter
|
|
120
|
+
**/
|
|
121
|
+
@interface DDDispatchQueueLogFormatter (OverridableMethods)
|
|
122
|
+
|
|
123
|
+
- (NSString *)stringFromDate:(NSDate *)date;
|
|
124
|
+
- (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage;
|
|
125
|
+
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage;
|
|
126
|
+
|
|
127
|
+
@end
|
|
128
|
+
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* Welcome to Cocoa Lumberjack!
|
|
8
8
|
*
|
|
9
9
|
* The project page has a wealth of documentation if you have any questions.
|
|
10
|
-
* https://github.com/
|
|
10
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
|
11
11
|
*
|
|
12
12
|
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
|
13
|
-
* https://github.com/
|
|
13
|
+
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
|
14
14
|
*
|
|
15
15
|
*
|
|
16
16
|
* This class provides a logger to write log statements to a file.
|
|
@@ -108,19 +108,47 @@
|
|
|
108
108
|
* On Mac, this is in ~/Library/Logs/<Application Name>.
|
|
109
109
|
* On iPhone, this is in ~/Library/Caches/Logs.
|
|
110
110
|
*
|
|
111
|
-
* Log files are named "log
|
|
112
|
-
*
|
|
111
|
+
* Log files are named "<bundle identifier> <date> <time>.log"
|
|
112
|
+
* Example: com.organization.myapp 2013-12-03 17-14.log
|
|
113
113
|
*
|
|
114
114
|
* Archived log files are automatically deleted according to the maximumNumberOfLogFiles property.
|
|
115
115
|
**/
|
|
116
116
|
@interface DDLogFileManagerDefault : NSObject <DDLogFileManager>
|
|
117
117
|
{
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
NSUInteger maximumNumberOfLogFiles;
|
|
119
|
+
NSString *_logsDirectory;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
- (id)init;
|
|
123
|
-
- (
|
|
123
|
+
- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory;
|
|
124
|
+
|
|
125
|
+
/*
|
|
126
|
+
* Methods to override.
|
|
127
|
+
*
|
|
128
|
+
* Log files are named "<bundle identifier> <date> <time>.log"
|
|
129
|
+
* Example: com.organization.myapp 2013-12-03 17-14.log
|
|
130
|
+
*
|
|
131
|
+
* If you wish to change default filename, you can override following two methods.
|
|
132
|
+
* - newLogFileName method would be called on new logfile creation.
|
|
133
|
+
* - isLogFile: method would be called to filter logfiles from all other files in logsDirectory.
|
|
134
|
+
* You have to parse given filename and return YES if it is logFile.
|
|
135
|
+
*
|
|
136
|
+
* **NOTE**
|
|
137
|
+
* newLogFileName returns filename. If appropriate file already exists, number would be added
|
|
138
|
+
* to filename before extension. You have to handle this case in isLogFile: method.
|
|
139
|
+
*
|
|
140
|
+
* Example:
|
|
141
|
+
* - newLogFileName returns "com.organization.myapp 2013-12-03.log",
|
|
142
|
+
* file "com.organization.myapp 2013-12-03.log" would be created.
|
|
143
|
+
* - after some time "com.organization.myapp 2013-12-03.log" is archived
|
|
144
|
+
* - newLogFileName again returns "com.organization.myapp 2013-12-03.log",
|
|
145
|
+
* file "com.organization.myapp 2013-12-03 2.log" would be created.
|
|
146
|
+
* - after some time "com.organization.myapp 2013-12-03 1.log" is archived
|
|
147
|
+
* - newLogFileName again returns "com.organization.myapp 2013-12-03.log",
|
|
148
|
+
* file "com.organization.myapp 2013-12-03 3.log" would be created.
|
|
149
|
+
**/
|
|
150
|
+
- (NSString *)newLogFileName;
|
|
151
|
+
- (BOOL)isLogFile:(NSString *)fileName;
|
|
124
152
|
|
|
125
153
|
/* Inherited from DDLogFileManager protocol:
|
|
126
154
|
|
|
@@ -156,11 +184,11 @@
|
|
|
156
184
|
**/
|
|
157
185
|
@interface DDLogFileFormatterDefault : NSObject <DDLogFormatter>
|
|
158
186
|
{
|
|
159
|
-
|
|
187
|
+
NSDateFormatter *dateFormatter;
|
|
160
188
|
}
|
|
161
189
|
|
|
162
190
|
- (id)init;
|
|
163
|
-
- (
|
|
191
|
+
- (instancetype)initWithDateFormatter:(NSDateFormatter *)dateFormatter;
|
|
164
192
|
|
|
165
193
|
@end
|
|
166
194
|
|
|
@@ -170,19 +198,20 @@
|
|
|
170
198
|
|
|
171
199
|
@interface DDFileLogger : DDAbstractLogger <DDLogger>
|
|
172
200
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
201
|
+
__strong id <DDLogFileManager> logFileManager;
|
|
202
|
+
|
|
203
|
+
DDLogFileInfo *currentLogFileInfo;
|
|
204
|
+
NSFileHandle *currentLogFileHandle;
|
|
205
|
+
|
|
206
|
+
dispatch_source_t currentLogFileVnode;
|
|
207
|
+
dispatch_source_t rollingTimer;
|
|
208
|
+
|
|
209
|
+
unsigned long long maximumFileSize;
|
|
210
|
+
NSTimeInterval rollingFrequency;
|
|
182
211
|
}
|
|
183
212
|
|
|
184
213
|
- (id)init;
|
|
185
|
-
- (
|
|
214
|
+
- (instancetype)initWithLogFileManager:(id <DDLogFileManager>)logFileManager;
|
|
186
215
|
|
|
187
216
|
/**
|
|
188
217
|
* Log File Rolling:
|
|
@@ -228,8 +257,13 @@
|
|
|
228
257
|
|
|
229
258
|
|
|
230
259
|
// You can optionally force the current log file to be rolled with this method.
|
|
260
|
+
// CompletionBlock will be called on main queue.
|
|
261
|
+
|
|
262
|
+
- (void)rollLogFileWithCompletionBlock:(void (^)())completionBlock;
|
|
263
|
+
|
|
264
|
+
// Method is deprecated. Use rollLogFileWithCompletionBlock: method instead.
|
|
231
265
|
|
|
232
|
-
- (void)rollLogFile;
|
|
266
|
+
- (void)rollLogFile __attribute((deprecated));
|
|
233
267
|
|
|
234
268
|
// Inherited from DDAbstractLogger
|
|
235
269
|
|
|
@@ -258,15 +292,15 @@
|
|
|
258
292
|
**/
|
|
259
293
|
@interface DDLogFileInfo : NSObject
|
|
260
294
|
{
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
295
|
+
__strong NSString *filePath;
|
|
296
|
+
__strong NSString *fileName;
|
|
297
|
+
|
|
298
|
+
__strong NSDictionary *fileAttributes;
|
|
299
|
+
|
|
300
|
+
__strong NSDate *creationDate;
|
|
301
|
+
__strong NSDate *modificationDate;
|
|
302
|
+
|
|
303
|
+
unsigned long long fileSize;
|
|
270
304
|
}
|
|
271
305
|
|
|
272
306
|
@property (strong, nonatomic, readonly) NSString *filePath;
|
|
@@ -283,9 +317,9 @@
|
|
|
283
317
|
|
|
284
318
|
@property (nonatomic, readwrite) BOOL isArchived;
|
|
285
319
|
|
|
286
|
-
+ (
|
|
320
|
+
+ (instancetype)logFileWithPath:(NSString *)filePath;
|
|
287
321
|
|
|
288
|
-
- (
|
|
322
|
+
- (instancetype)initWithFilePath:(NSString *)filePath;
|
|
289
323
|
|
|
290
324
|
- (void)reset;
|
|
291
325
|
- (void)renameFile:(NSString *)newFileName;
|
|
@@ -309,7 +343,8 @@
|
|
|
309
343
|
// On the simulator we add an attribute by appending a filename extension.
|
|
310
344
|
//
|
|
311
345
|
// For example:
|
|
312
|
-
//
|
|
346
|
+
// "mylog.txt" -> "mylog.archived.txt"
|
|
347
|
+
// "mylog" -> "mylog.archived"
|
|
313
348
|
|
|
314
349
|
- (BOOL)hasExtensionAttributeWithName:(NSString *)attrName;
|
|
315
350
|
|