motion-yapper 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/.travis.yml +6 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +63 -0
- data/README.md +16 -0
- data/Rakefile +20 -0
- data/app/app_delegate.rb +5 -0
- data/lib/yapper.rb +30 -0
- data/lib/yapper/attachment.rb +48 -0
- data/lib/yapper/bson.rb +20 -0
- data/lib/yapper/config.rb +18 -0
- data/lib/yapper/db.rb +151 -0
- data/lib/yapper/document.rb +54 -0
- data/lib/yapper/document/attachment.rb +26 -0
- data/lib/yapper/document/callbacks.rb +86 -0
- data/lib/yapper/document/persistance.rb +171 -0
- data/lib/yapper/document/relation.rb +84 -0
- data/lib/yapper/document/selection.rb +100 -0
- data/lib/yapper/extensions.rb +80 -0
- data/lib/yapper/log.rb +5 -0
- data/lib/yapper/sync.rb +134 -0
- data/lib/yapper/sync/data.rb +12 -0
- data/lib/yapper/sync/event.rb +194 -0
- data/lib/yapper/sync/queue.rb +164 -0
- data/lib/yapper/timestamps.rb +16 -0
- data/lib/yapper/version.rb +3 -0
- data/lib/yapper/yapper.rb +2 -0
- data/spec/helpers/time_helper.rb +3 -0
- data/spec/integration/all_spec.rb +40 -0
- data/spec/integration/callback_spec.rb +87 -0
- data/spec/integration/db_spec.rb +40 -0
- data/spec/integration/find_spec.rb +51 -0
- data/spec/integration/persistance_spec.rb +118 -0
- data/spec/integration/relation_spec.rb +174 -0
- data/spec/integration/sync_spec.rb +42 -0
- data/spec/integration/timestamps_spec.rb +34 -0
- data/spec/integration/types_spec.rb +23 -0
- data/spec/integration/when_spec.rb +29 -0
- data/spec/integration/where_spec.rb +132 -0
- data/vendor/Podfile.lock +24 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +641 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +1396 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +133 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +327 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +113 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +321 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +71 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +150 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +157 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +43 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +68 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +143 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +370 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +848 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +89 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +167 -0
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +78 -0
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +191 -0
- data/vendor/Pods/AFNetworking/LICENSE +19 -0
- data/vendor/Pods/AFNetworking/README.md +208 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +641 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +133 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +113 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +71 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +43 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +68 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +370 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +89 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +78 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +41 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +334 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +601 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +167 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
- data/vendor/Pods/BuildHeaders/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
- data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +109 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +90 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +20 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +547 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +447 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnectionState.h +29 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +37 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtension.h +15 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +108 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseLogging.h +158 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseManager.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +424 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseQuery.h +42 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseStatement.h +13 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseString.h +121 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +541 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +186 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +272 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +115 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +825 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +56 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPage.h +36 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +153 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +447 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapMemoryTable.h +74 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapNull.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapSet.h +41 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapTouch.h +15 -0
- data/vendor/Pods/CocoaLumberjack/LICENSE.txt +18 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +41 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +727 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +334 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1353 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +601 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +1083 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +167 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1479 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h +65 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.m +191 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.h +116 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +251 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +7 -0
- data/vendor/Pods/CocoaLumberjack/README.markdown +37 -0
- data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +641 -0
- data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +133 -0
- data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +113 -0
- data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +71 -0
- data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
- data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +43 -0
- data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +68 -0
- data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +370 -0
- data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +89 -0
- data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +78 -0
- data/vendor/Pods/Headers/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +41 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +334 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +601 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +167 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
- data/vendor/Pods/Headers/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
- data/vendor/Pods/Headers/Reachability/Reachability.h +109 -0
- data/vendor/Pods/Headers/YapDatabase/YapCache.h +90 -0
- data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +20 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +547 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +447 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +29 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +37 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtension.h +15 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +108 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +158 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +424 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseQuery.h +42 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +13 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +121 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +541 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +186 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +272 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +115 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +825 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +56 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +36 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +153 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +447 -0
- data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +74 -0
- data/vendor/Pods/Headers/YapDatabase/YapNull.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapSet.h +41 -0
- data/vendor/Pods/Headers/YapDatabase/YapTouch.h +15 -0
- data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +17 -0
- data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-NSData+MD5Digest-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-YapDatabase-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-environment.h +38 -0
- data/vendor/Pods/Manifest.lock +24 -0
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.m +39 -0
- data/vendor/Pods/NSData+MD5Digest/README.md +11 -0
- data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-AFNetworking-dummy.m +5 -0
- data/vendor/Pods/Pods-AFNetworking-prefix.pch +17 -0
- data/vendor/Pods/Pods-AFNetworking.xcconfig +1 -0
- data/vendor/Pods/Pods-Acknowledgements.markdown +96 -0
- data/vendor/Pods/Pods-Acknowledgements.plist +142 -0
- data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-CocoaLumberjack-dummy.m +5 -0
- data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +5 -0
- data/vendor/Pods/Pods-CocoaLumberjack.xcconfig +0 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-dummy.m +5 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-prefix.pch +5 -0
- data/vendor/Pods/Pods-NSData+MD5Digest.xcconfig +0 -0
- data/vendor/Pods/Pods-Reachability-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-Reachability-dummy.m +5 -0
- data/vendor/Pods/Pods-Reachability-prefix.pch +5 -0
- data/vendor/Pods/Pods-Reachability.xcconfig +1 -0
- data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-YapDatabase-dummy.m +5 -0
- data/vendor/Pods/Pods-YapDatabase-prefix.pch +5 -0
- data/vendor/Pods/Pods-YapDatabase.xcconfig +1 -0
- data/vendor/Pods/Pods-dummy.m +5 -0
- data/vendor/Pods/Pods-environment.h +38 -0
- data/vendor/Pods/Pods-resources.sh +68 -0
- data/vendor/Pods/Pods.bridgesupport +5096 -0
- data/vendor/Pods/Pods.xcconfig +5 -0
- data/vendor/Pods/Pods.xcodeproj/project.pbxproj +5536 -0
- data/vendor/Pods/Reachability/LICENCE.txt +24 -0
- data/vendor/Pods/Reachability/README.md +65 -0
- data/vendor/Pods/Reachability/Reachability.h +109 -0
- data/vendor/Pods/Reachability/Reachability.m +527 -0
- data/vendor/Pods/YapDatabase/LICENSE.txt +18 -0
- data/vendor/Pods/YapDatabase/README.md +30 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +19 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +108 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +175 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.h +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.m +41 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +39 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +966 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +69 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.h +89 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.m +146 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.h +32 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +298 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.m +95 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.h +68 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +1352 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +440 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.h +15 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +58 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.h +11 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +46 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.h +11 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +180 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +73 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +100 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +149 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.h +33 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +330 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.h +33 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +184 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h +58 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +1166 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewChangePrivate.h +94 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewMappingsPrivate.h +72 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.h +36 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.mm +296 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.h +27 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.m +28 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +153 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewRangeOptionsPrivate.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +272 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +2494 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +825 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +1567 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.h +330 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.m +141 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +186 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +191 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +115 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +897 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +56 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.m +27 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +447 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +4505 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +90 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +453 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.h +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m +48 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +37 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +83 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.h +158 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.m +73 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.m +56 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +424 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.h +13 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.m +26 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseString.h +121 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.h +74 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.m +603 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +31 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.h +15 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.m +31 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +20 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +194 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.h +42 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.m +96 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.h +41 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.m +82 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +547 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +2022 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +447 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +3874 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +541 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +5282 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +16 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +13 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +20 -0
- data/yapper.gemspec +24 -0
- metadata +458 -0
@@ -0,0 +1,78 @@
|
|
1
|
+
// UIImageView+AFNetworking.h
|
2
|
+
//
|
3
|
+
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
4
|
+
//
|
5
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
// of this software and associated documentation files (the "Software"), to deal
|
7
|
+
// in the Software without restriction, including without limitation the rights
|
8
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
// copies of the Software, and to permit persons to whom the Software is
|
10
|
+
// furnished to do so, subject to the following conditions:
|
11
|
+
//
|
12
|
+
// The above copyright notice and this permission notice shall be included in
|
13
|
+
// all copies or substantial portions of the Software.
|
14
|
+
//
|
15
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
// THE SOFTWARE.
|
22
|
+
|
23
|
+
#import <Foundation/Foundation.h>
|
24
|
+
#import "AFImageRequestOperation.h"
|
25
|
+
|
26
|
+
#import <Availability.h>
|
27
|
+
|
28
|
+
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
29
|
+
#import <UIKit/UIKit.h>
|
30
|
+
|
31
|
+
/**
|
32
|
+
This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL.
|
33
|
+
*/
|
34
|
+
@interface UIImageView (AFNetworking)
|
35
|
+
|
36
|
+
/**
|
37
|
+
Creates and enqueues an image request operation, which asynchronously downloads the image from the specified URL, and sets it the request is finished. Any previous image request for the receiver will be cancelled. If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
38
|
+
|
39
|
+
By default, URL requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
40
|
+
|
41
|
+
@param url The URL used for the image request.
|
42
|
+
*/
|
43
|
+
- (void)setImageWithURL:(NSURL *)url;
|
44
|
+
|
45
|
+
/**
|
46
|
+
Creates and enqueues an image request operation, which asynchronously downloads the image from the specified URL. Any previous image request for the receiver will be cancelled. If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
47
|
+
|
48
|
+
By default, URL requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
49
|
+
|
50
|
+
@param url The URL used for the image request.
|
51
|
+
@param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
|
52
|
+
*/
|
53
|
+
- (void)setImageWithURL:(NSURL *)url
|
54
|
+
placeholderImage:(UIImage *)placeholderImage;
|
55
|
+
|
56
|
+
/**
|
57
|
+
Creates and enqueues an image request operation, which asynchronously downloads the image with the specified URL request object. Any previous image request for the receiver will be cancelled. If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
58
|
+
|
59
|
+
If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is executed.
|
60
|
+
|
61
|
+
@param urlRequest The URL request used for the image request.
|
62
|
+
@param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
|
63
|
+
@param success A block to be executed when the image request operation finishes successfully, with a status code in the 2xx range, and with an acceptable content type (e.g. `image/png`). This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the request and response parameters will be `nil`.
|
64
|
+
@param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
|
65
|
+
*/
|
66
|
+
- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
|
67
|
+
placeholderImage:(UIImage *)placeholderImage
|
68
|
+
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
|
69
|
+
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure;
|
70
|
+
|
71
|
+
/**
|
72
|
+
Cancels any executing image request operation for the receiver, if one exists.
|
73
|
+
*/
|
74
|
+
- (void)cancelImageRequestOperation;
|
75
|
+
|
76
|
+
@end
|
77
|
+
|
78
|
+
#endif
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
#import "DDLog.h"
|
3
|
+
|
4
|
+
@class ContextFilterLogFormatter;
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Welcome to Cocoa Lumberjack!
|
8
|
+
*
|
9
|
+
* The project page has a wealth of documentation if you have any questions.
|
10
|
+
* https://github.com/robbiehanson/CocoaLumberjack
|
11
|
+
*
|
12
|
+
* If you're new to the project you may wish to read the "Getting Started" page.
|
13
|
+
* https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
|
14
|
+
*
|
15
|
+
*
|
16
|
+
* This class provides a log formatter that filters log statements from a logging context not on the whitelist.
|
17
|
+
*
|
18
|
+
* A log formatter can be added to any logger to format and/or filter its output.
|
19
|
+
* You can learn more about log formatters here:
|
20
|
+
* https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomFormatters
|
21
|
+
*
|
22
|
+
* You can learn more about logging context's here:
|
23
|
+
* https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomContext
|
24
|
+
*
|
25
|
+
* But here's a quick overview / refresher:
|
26
|
+
*
|
27
|
+
* Every log statement has a logging context.
|
28
|
+
* These come from the underlying logging macros defined in DDLog.h.
|
29
|
+
* The default logging context is zero.
|
30
|
+
* You can define multiple logging context's for use in your application.
|
31
|
+
* For example, logically separate parts of your app each have a different logging context.
|
32
|
+
* Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context.
|
33
|
+
**/
|
34
|
+
@interface ContextWhitelistFilterLogFormatter : NSObject <DDLogFormatter>
|
35
|
+
|
36
|
+
- (id)init;
|
37
|
+
|
38
|
+
- (void)addToWhitelist:(int)loggingContext;
|
39
|
+
- (void)removeFromWhitelist:(int)loggingContext;
|
40
|
+
|
41
|
+
- (NSArray *)whitelist;
|
42
|
+
|
43
|
+
- (BOOL)isOnWhitelist:(int)loggingContext;
|
44
|
+
|
45
|
+
@end
|
46
|
+
|
47
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
48
|
+
#pragma mark -
|
49
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
50
|
+
|
51
|
+
/**
|
52
|
+
* This class provides a log formatter that filters log statements from a logging context on the blacklist.
|
53
|
+
**/
|
54
|
+
@interface ContextBlacklistFilterLogFormatter : NSObject <DDLogFormatter>
|
55
|
+
|
56
|
+
- (id)init;
|
57
|
+
|
58
|
+
- (void)addToBlacklist:(int)loggingContext;
|
59
|
+
- (void)removeFromBlacklist:(int)loggingContext;
|
60
|
+
|
61
|
+
- (NSArray *)blacklist;
|
62
|
+
|
63
|
+
- (BOOL)isOnBlacklist:(int)loggingContext;
|
64
|
+
|
65
|
+
@end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
#import <asl.h>
|
3
|
+
|
4
|
+
#import "DDLog.h"
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Welcome to Cocoa Lumberjack!
|
8
|
+
*
|
9
|
+
* The project page has a wealth of documentation if you have any questions.
|
10
|
+
* https://github.com/robbiehanson/CocoaLumberjack
|
11
|
+
*
|
12
|
+
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
13
|
+
* https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
|
14
|
+
*
|
15
|
+
*
|
16
|
+
* This class provides a logger for the Apple System Log facility.
|
17
|
+
*
|
18
|
+
* As described in the "Getting Started" page,
|
19
|
+
* the traditional NSLog() function directs it's output to two places:
|
20
|
+
*
|
21
|
+
* - Apple System Log
|
22
|
+
* - StdErr (if stderr is a TTY) so log statements show up in Xcode console
|
23
|
+
*
|
24
|
+
* To duplicate NSLog() functionality you can simply add this logger and a tty logger.
|
25
|
+
* However, if you instead choose to use file logging (for faster performance),
|
26
|
+
* you may choose to use a file logger and a tty logger.
|
27
|
+
**/
|
28
|
+
|
29
|
+
@interface DDASLLogger : DDAbstractLogger <DDLogger>
|
30
|
+
{
|
31
|
+
aslclient client;
|
32
|
+
}
|
33
|
+
|
34
|
+
+ (DDASLLogger *)sharedInstance;
|
35
|
+
|
36
|
+
// Inherited from DDAbstractLogger
|
37
|
+
|
38
|
+
// - (id <DDLogFormatter>)logFormatter;
|
39
|
+
// - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
|
40
|
+
|
41
|
+
@end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
#import "DDLog.h"
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Welcome to Cocoa Lumberjack!
|
7
|
+
*
|
8
|
+
* The project page has a wealth of documentation if you have any questions.
|
9
|
+
* https://github.com/robbiehanson/CocoaLumberjack
|
10
|
+
*
|
11
|
+
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
12
|
+
* https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
|
13
|
+
*
|
14
|
+
*
|
15
|
+
* This class provides an abstract implementation of a database logger.
|
16
|
+
*
|
17
|
+
* That is, it provides the base implementation for a database logger to build atop of.
|
18
|
+
* All that is needed for a concrete database logger is to extend this class
|
19
|
+
* and override the methods in the implementation file that are prefixed with "db_".
|
20
|
+
**/
|
21
|
+
|
22
|
+
@interface DDAbstractDatabaseLogger : DDAbstractLogger {
|
23
|
+
@protected
|
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
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Specifies how often to save the data to disk.
|
40
|
+
* Since saving is an expensive operation (disk io) it is not done after every log statement.
|
41
|
+
* These properties allow you to configure how/when the logger saves to disk.
|
42
|
+
*
|
43
|
+
* A save is done when either (whichever happens first):
|
44
|
+
*
|
45
|
+
* - The number of unsaved log entries reaches saveThreshold
|
46
|
+
* - The amount of time since the oldest unsaved log entry was created reaches saveInterval
|
47
|
+
*
|
48
|
+
* You can optionally disable the saveThreshold by setting it to zero.
|
49
|
+
* If you disable the saveThreshold you are entirely dependent on the saveInterval.
|
50
|
+
*
|
51
|
+
* You can optionally disable the saveInterval by setting it to zero (or a negative value).
|
52
|
+
* If you disable the saveInterval you are entirely dependent on the saveThreshold.
|
53
|
+
*
|
54
|
+
* It's not wise to disable both saveThreshold and saveInterval.
|
55
|
+
*
|
56
|
+
* The default saveThreshold is 500.
|
57
|
+
* The default saveInterval is 60 seconds.
|
58
|
+
**/
|
59
|
+
@property (assign, readwrite) NSUInteger saveThreshold;
|
60
|
+
@property (assign, readwrite) NSTimeInterval saveInterval;
|
61
|
+
|
62
|
+
/**
|
63
|
+
* It is likely you don't want the log entries to persist forever.
|
64
|
+
* Doing so would allow the database to grow infinitely large over time.
|
65
|
+
*
|
66
|
+
* The maxAge property provides a way to specify how old a log statement can get
|
67
|
+
* before it should get deleted from the database.
|
68
|
+
*
|
69
|
+
* The deleteInterval specifies how often to sweep for old log entries.
|
70
|
+
* Since deleting is an expensive operation (disk io) is is done on a fixed interval.
|
71
|
+
*
|
72
|
+
* An alternative to the deleteInterval is the deleteOnEverySave option.
|
73
|
+
* This specifies that old log entries should be deleted during every save operation.
|
74
|
+
*
|
75
|
+
* You can optionally disable the maxAge by setting it to zero (or a negative value).
|
76
|
+
* If you disable the maxAge then old log statements are not deleted.
|
77
|
+
*
|
78
|
+
* You can optionally disable the deleteInterval by setting it to zero (or a negative value).
|
79
|
+
*
|
80
|
+
* If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted.
|
81
|
+
*
|
82
|
+
* It's not wise to enable both deleteInterval and deleteOnEverySave.
|
83
|
+
*
|
84
|
+
* The default maxAge is 7 days.
|
85
|
+
* The default deleteInterval is 5 minutes.
|
86
|
+
* The default deleteOnEverySave is NO.
|
87
|
+
**/
|
88
|
+
@property (assign, readwrite) NSTimeInterval maxAge;
|
89
|
+
@property (assign, readwrite) NSTimeInterval deleteInterval;
|
90
|
+
@property (assign, readwrite) BOOL deleteOnEverySave;
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Forces a save of any pending log entries (flushes log entries to disk).
|
94
|
+
**/
|
95
|
+
- (void)savePendingLogEntries;
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Removes any log entries that are older than maxAge.
|
99
|
+
**/
|
100
|
+
- (void)deleteOldLogEntries;
|
101
|
+
|
102
|
+
@end
|
@@ -0,0 +1,334 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
#import "DDLog.h"
|
3
|
+
|
4
|
+
@class DDLogFileInfo;
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Welcome to Cocoa Lumberjack!
|
8
|
+
*
|
9
|
+
* The project page has a wealth of documentation if you have any questions.
|
10
|
+
* https://github.com/robbiehanson/CocoaLumberjack
|
11
|
+
*
|
12
|
+
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
13
|
+
* https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
|
14
|
+
*
|
15
|
+
*
|
16
|
+
* This class provides a logger to write log statements to a file.
|
17
|
+
**/
|
18
|
+
|
19
|
+
|
20
|
+
// Default configuration and safety/sanity values.
|
21
|
+
//
|
22
|
+
// maximumFileSize -> DEFAULT_LOG_MAX_FILE_SIZE
|
23
|
+
// rollingFrequency -> DEFAULT_LOG_ROLLING_FREQUENCY
|
24
|
+
// maximumNumberOfLogFiles -> DEFAULT_LOG_MAX_NUM_LOG_FILES
|
25
|
+
//
|
26
|
+
// You should carefully consider the proper configuration values for your application.
|
27
|
+
|
28
|
+
#define DEFAULT_LOG_MAX_FILE_SIZE (1024 * 1024) // 1 MB
|
29
|
+
#define DEFAULT_LOG_ROLLING_FREQUENCY (60 * 60 * 24) // 24 Hours
|
30
|
+
#define DEFAULT_LOG_MAX_NUM_LOG_FILES (5) // 5 Files
|
31
|
+
|
32
|
+
|
33
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
34
|
+
#pragma mark -
|
35
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
36
|
+
|
37
|
+
// The LogFileManager protocol is designed to allow you to control all aspects of your log files.
|
38
|
+
//
|
39
|
+
// The primary purpose of this is to allow you to do something with the log files after they have been rolled.
|
40
|
+
// Perhaps you want to compress them to save disk space.
|
41
|
+
// Perhaps you want to upload them to an FTP server.
|
42
|
+
// Perhaps you want to run some analytics on the file.
|
43
|
+
//
|
44
|
+
// A default LogFileManager is, of course, provided.
|
45
|
+
// The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property.
|
46
|
+
//
|
47
|
+
// This protocol provides various methods to fetch the list of log files.
|
48
|
+
//
|
49
|
+
// There are two variants: sorted and unsorted.
|
50
|
+
// If sorting is not necessary, the unsorted variant is obviously faster.
|
51
|
+
// The sorted variant will return an array sorted by when the log files were created,
|
52
|
+
// with the most recently created log file at index 0, and the oldest log file at the end of the array.
|
53
|
+
//
|
54
|
+
// You can fetch only the log file paths (full path including name), log file names (name only),
|
55
|
+
// or an array of DDLogFileInfo objects.
|
56
|
+
// The DDLogFileInfo class is documented below, and provides a handy wrapper that
|
57
|
+
// gives you easy access to various file attributes such as the creation date or the file size.
|
58
|
+
|
59
|
+
@protocol DDLogFileManager <NSObject>
|
60
|
+
@required
|
61
|
+
|
62
|
+
// Public properties
|
63
|
+
|
64
|
+
/**
|
65
|
+
* The maximum number of archived log files to keep on disk.
|
66
|
+
* For example, if this property is set to 3,
|
67
|
+
* then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk.
|
68
|
+
* Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted.
|
69
|
+
*
|
70
|
+
* You may optionally disable deleting old/rolled/archived log files by setting this property to zero.
|
71
|
+
**/
|
72
|
+
@property (readwrite, assign) NSUInteger maximumNumberOfLogFiles;
|
73
|
+
|
74
|
+
// Public methods
|
75
|
+
|
76
|
+
- (NSString *)logsDirectory;
|
77
|
+
|
78
|
+
- (NSArray *)unsortedLogFilePaths;
|
79
|
+
- (NSArray *)unsortedLogFileNames;
|
80
|
+
- (NSArray *)unsortedLogFileInfos;
|
81
|
+
|
82
|
+
- (NSArray *)sortedLogFilePaths;
|
83
|
+
- (NSArray *)sortedLogFileNames;
|
84
|
+
- (NSArray *)sortedLogFileInfos;
|
85
|
+
|
86
|
+
// Private methods (only to be used by DDFileLogger)
|
87
|
+
|
88
|
+
- (NSString *)createNewLogFile;
|
89
|
+
|
90
|
+
@optional
|
91
|
+
|
92
|
+
// Notifications from DDFileLogger
|
93
|
+
|
94
|
+
- (void)didArchiveLogFile:(NSString *)logFilePath;
|
95
|
+
- (void)didRollAndArchiveLogFile:(NSString *)logFilePath;
|
96
|
+
|
97
|
+
@end
|
98
|
+
|
99
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
100
|
+
#pragma mark -
|
101
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Default log file manager.
|
105
|
+
*
|
106
|
+
* All log files are placed inside the logsDirectory.
|
107
|
+
* If a specific logsDirectory isn't specified, the default directory is used.
|
108
|
+
* On Mac, this is in ~/Library/Logs/<Application Name>.
|
109
|
+
* On iPhone, this is in ~/Library/Caches/Logs.
|
110
|
+
*
|
111
|
+
* Log files are named "log-<uuid>.txt",
|
112
|
+
* where uuid is a 6 character hexadecimal consisting of the set [0123456789ABCDEF].
|
113
|
+
*
|
114
|
+
* Archived log files are automatically deleted according to the maximumNumberOfLogFiles property.
|
115
|
+
**/
|
116
|
+
@interface DDLogFileManagerDefault : NSObject <DDLogFileManager>
|
117
|
+
{
|
118
|
+
NSUInteger maximumNumberOfLogFiles;
|
119
|
+
NSString *_logsDirectory;
|
120
|
+
}
|
121
|
+
|
122
|
+
- (id)init;
|
123
|
+
- (id)initWithLogsDirectory:(NSString *)logsDirectory;
|
124
|
+
|
125
|
+
/* Inherited from DDLogFileManager protocol:
|
126
|
+
|
127
|
+
@property (readwrite, assign) NSUInteger maximumNumberOfLogFiles;
|
128
|
+
|
129
|
+
- (NSString *)logsDirectory;
|
130
|
+
|
131
|
+
- (NSArray *)unsortedLogFilePaths;
|
132
|
+
- (NSArray *)unsortedLogFileNames;
|
133
|
+
- (NSArray *)unsortedLogFileInfos;
|
134
|
+
|
135
|
+
- (NSArray *)sortedLogFilePaths;
|
136
|
+
- (NSArray *)sortedLogFileNames;
|
137
|
+
- (NSArray *)sortedLogFileInfos;
|
138
|
+
|
139
|
+
*/
|
140
|
+
|
141
|
+
@end
|
142
|
+
|
143
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
144
|
+
#pragma mark -
|
145
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Most users will want file log messages to be prepended with the date and time.
|
149
|
+
* Rather than forcing the majority of users to write their own formatter,
|
150
|
+
* we will supply a logical default formatter.
|
151
|
+
* Users can easily replace this formatter with their own by invoking the setLogFormatter method.
|
152
|
+
* It can also be removed by calling setLogFormatter, and passing a nil parameter.
|
153
|
+
*
|
154
|
+
* In addition to the convenience of having a logical default formatter,
|
155
|
+
* it will also provide a template that makes it easy for developers to copy and change.
|
156
|
+
**/
|
157
|
+
@interface DDLogFileFormatterDefault : NSObject <DDLogFormatter>
|
158
|
+
{
|
159
|
+
NSDateFormatter *dateFormatter;
|
160
|
+
}
|
161
|
+
|
162
|
+
- (id)init;
|
163
|
+
- (id)initWithDateFormatter:(NSDateFormatter *)dateFormatter;
|
164
|
+
|
165
|
+
@end
|
166
|
+
|
167
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
168
|
+
#pragma mark -
|
169
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
170
|
+
|
171
|
+
@interface DDFileLogger : DDAbstractLogger <DDLogger>
|
172
|
+
{
|
173
|
+
__strong id <DDLogFileManager> logFileManager;
|
174
|
+
|
175
|
+
DDLogFileInfo *currentLogFileInfo;
|
176
|
+
NSFileHandle *currentLogFileHandle;
|
177
|
+
|
178
|
+
dispatch_source_t rollingTimer;
|
179
|
+
|
180
|
+
unsigned long long maximumFileSize;
|
181
|
+
NSTimeInterval rollingFrequency;
|
182
|
+
}
|
183
|
+
|
184
|
+
- (id)init;
|
185
|
+
- (id)initWithLogFileManager:(id <DDLogFileManager>)logFileManager;
|
186
|
+
|
187
|
+
/**
|
188
|
+
* Log File Rolling:
|
189
|
+
*
|
190
|
+
* maximumFileSize:
|
191
|
+
* The approximate maximum size to allow log files to grow.
|
192
|
+
* If a log file is larger than this value after a log statement is appended,
|
193
|
+
* then the log file is rolled.
|
194
|
+
*
|
195
|
+
* rollingFrequency
|
196
|
+
* How often to roll the log file.
|
197
|
+
* The frequency is given as an NSTimeInterval, which is a double that specifies the interval in seconds.
|
198
|
+
* Once the log file gets to be this old, it is rolled.
|
199
|
+
*
|
200
|
+
* Both the maximumFileSize and the rollingFrequency are used to manage rolling.
|
201
|
+
* Whichever occurs first will cause the log file to be rolled.
|
202
|
+
*
|
203
|
+
* For example:
|
204
|
+
* The rollingFrequency is 24 hours,
|
205
|
+
* but the log file surpasses the maximumFileSize after only 20 hours.
|
206
|
+
* The log file will be rolled at that 20 hour mark.
|
207
|
+
* A new log file will be created, and the 24 hour timer will be restarted.
|
208
|
+
*
|
209
|
+
* You may optionally disable rolling due to filesize by setting maximumFileSize to zero.
|
210
|
+
* If you do so, rolling is based solely on rollingFrequency.
|
211
|
+
*
|
212
|
+
* You may optionally disable rolling due to time by setting rollingFrequency to zero (or any non-positive number).
|
213
|
+
* If you do so, rolling is based solely on maximumFileSize.
|
214
|
+
*
|
215
|
+
* If you disable both maximumFileSize and rollingFrequency, then the log file won't ever be rolled.
|
216
|
+
* This is strongly discouraged.
|
217
|
+
**/
|
218
|
+
@property (readwrite, assign) unsigned long long maximumFileSize;
|
219
|
+
@property (readwrite, assign) NSTimeInterval rollingFrequency;
|
220
|
+
|
221
|
+
/**
|
222
|
+
* The DDLogFileManager instance can be used to retrieve the list of log files,
|
223
|
+
* and configure the maximum number of archived log files to keep.
|
224
|
+
*
|
225
|
+
* @see DDLogFileManager.maximumNumberOfLogFiles
|
226
|
+
**/
|
227
|
+
@property (strong, nonatomic, readonly) id <DDLogFileManager> logFileManager;
|
228
|
+
|
229
|
+
|
230
|
+
// You can optionally force the current log file to be rolled with this method.
|
231
|
+
|
232
|
+
- (void)rollLogFile;
|
233
|
+
|
234
|
+
// Inherited from DDAbstractLogger
|
235
|
+
|
236
|
+
// - (id <DDLogFormatter>)logFormatter;
|
237
|
+
// - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
|
238
|
+
|
239
|
+
@end
|
240
|
+
|
241
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
242
|
+
#pragma mark -
|
243
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
244
|
+
|
245
|
+
/**
|
246
|
+
* DDLogFileInfo is a simple class that provides access to various file attributes.
|
247
|
+
* It provides good performance as it only fetches the information if requested,
|
248
|
+
* and it caches the information to prevent duplicate fetches.
|
249
|
+
*
|
250
|
+
* It was designed to provide quick snapshots of the current state of log files,
|
251
|
+
* and to help sort log files in an array.
|
252
|
+
*
|
253
|
+
* This class does not monitor the files, or update it's cached attribute values if the file changes on disk.
|
254
|
+
* This is not what the class was designed for.
|
255
|
+
*
|
256
|
+
* If you absolutely must get updated values,
|
257
|
+
* you can invoke the reset method which will clear the cache.
|
258
|
+
**/
|
259
|
+
@interface DDLogFileInfo : NSObject
|
260
|
+
{
|
261
|
+
__strong NSString *filePath;
|
262
|
+
__strong NSString *fileName;
|
263
|
+
|
264
|
+
__strong NSDictionary *fileAttributes;
|
265
|
+
|
266
|
+
__strong NSDate *creationDate;
|
267
|
+
__strong NSDate *modificationDate;
|
268
|
+
|
269
|
+
unsigned long long fileSize;
|
270
|
+
}
|
271
|
+
|
272
|
+
@property (strong, nonatomic, readonly) NSString *filePath;
|
273
|
+
@property (strong, nonatomic, readonly) NSString *fileName;
|
274
|
+
|
275
|
+
@property (strong, nonatomic, readonly) NSDictionary *fileAttributes;
|
276
|
+
|
277
|
+
@property (strong, nonatomic, readonly) NSDate *creationDate;
|
278
|
+
@property (strong, nonatomic, readonly) NSDate *modificationDate;
|
279
|
+
|
280
|
+
@property (nonatomic, readonly) unsigned long long fileSize;
|
281
|
+
|
282
|
+
@property (nonatomic, readonly) NSTimeInterval age;
|
283
|
+
|
284
|
+
@property (nonatomic, readwrite) BOOL isArchived;
|
285
|
+
|
286
|
+
+ (id)logFileWithPath:(NSString *)filePath;
|
287
|
+
|
288
|
+
- (id)initWithFilePath:(NSString *)filePath;
|
289
|
+
|
290
|
+
- (void)reset;
|
291
|
+
- (void)renameFile:(NSString *)newFileName;
|
292
|
+
|
293
|
+
#if TARGET_IPHONE_SIMULATOR
|
294
|
+
|
295
|
+
// So here's the situation.
|
296
|
+
// Extended attributes are perfect for what we're trying to do here (marking files as archived).
|
297
|
+
// This is exactly what extended attributes were designed for.
|
298
|
+
//
|
299
|
+
// But Apple screws us over on the simulator.
|
300
|
+
// Everytime you build-and-go, they copy the application into a new folder on the hard drive,
|
301
|
+
// and as part of the process they strip extended attributes from our log files.
|
302
|
+
// Normally, a copy of a file preserves extended attributes.
|
303
|
+
// So obviously Apple has gone to great lengths to piss us off.
|
304
|
+
//
|
305
|
+
// Thus we use a slightly different tactic for marking log files as archived in the simulator.
|
306
|
+
// That way it "just works" and there's no confusion when testing.
|
307
|
+
//
|
308
|
+
// The difference in method names is indicative of the difference in functionality.
|
309
|
+
// On the simulator we add an attribute by appending a filename extension.
|
310
|
+
//
|
311
|
+
// For example:
|
312
|
+
// log-ABC123.txt -> log-ABC123.archived.txt
|
313
|
+
|
314
|
+
- (BOOL)hasExtensionAttributeWithName:(NSString *)attrName;
|
315
|
+
|
316
|
+
- (void)addExtensionAttributeWithName:(NSString *)attrName;
|
317
|
+
- (void)removeExtensionAttributeWithName:(NSString *)attrName;
|
318
|
+
|
319
|
+
#else
|
320
|
+
|
321
|
+
// Normal use of extended attributes used everywhere else,
|
322
|
+
// such as on Macs and on iPhone devices.
|
323
|
+
|
324
|
+
- (BOOL)hasExtendedAttributeWithName:(NSString *)attrName;
|
325
|
+
|
326
|
+
- (void)addExtendedAttributeWithName:(NSString *)attrName;
|
327
|
+
- (void)removeExtendedAttributeWithName:(NSString *)attrName;
|
328
|
+
|
329
|
+
#endif
|
330
|
+
|
331
|
+
- (NSComparisonResult)reverseCompareByCreationDate:(DDLogFileInfo *)another;
|
332
|
+
- (NSComparisonResult)reverseCompareByModificationDate:(DDLogFileInfo *)another;
|
333
|
+
|
334
|
+
@end
|