motion-yapper 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (348) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.travis.yml +6 -0
  4. data/Gemfile +5 -0
  5. data/Gemfile.lock +63 -0
  6. data/README.md +16 -0
  7. data/Rakefile +20 -0
  8. data/app/app_delegate.rb +5 -0
  9. data/lib/yapper.rb +30 -0
  10. data/lib/yapper/attachment.rb +48 -0
  11. data/lib/yapper/bson.rb +20 -0
  12. data/lib/yapper/config.rb +18 -0
  13. data/lib/yapper/db.rb +151 -0
  14. data/lib/yapper/document.rb +54 -0
  15. data/lib/yapper/document/attachment.rb +26 -0
  16. data/lib/yapper/document/callbacks.rb +86 -0
  17. data/lib/yapper/document/persistance.rb +171 -0
  18. data/lib/yapper/document/relation.rb +84 -0
  19. data/lib/yapper/document/selection.rb +100 -0
  20. data/lib/yapper/extensions.rb +80 -0
  21. data/lib/yapper/log.rb +5 -0
  22. data/lib/yapper/sync.rb +134 -0
  23. data/lib/yapper/sync/data.rb +12 -0
  24. data/lib/yapper/sync/event.rb +194 -0
  25. data/lib/yapper/sync/queue.rb +164 -0
  26. data/lib/yapper/timestamps.rb +16 -0
  27. data/lib/yapper/version.rb +3 -0
  28. data/lib/yapper/yapper.rb +2 -0
  29. data/spec/helpers/time_helper.rb +3 -0
  30. data/spec/integration/all_spec.rb +40 -0
  31. data/spec/integration/callback_spec.rb +87 -0
  32. data/spec/integration/db_spec.rb +40 -0
  33. data/spec/integration/find_spec.rb +51 -0
  34. data/spec/integration/persistance_spec.rb +118 -0
  35. data/spec/integration/relation_spec.rb +174 -0
  36. data/spec/integration/sync_spec.rb +42 -0
  37. data/spec/integration/timestamps_spec.rb +34 -0
  38. data/spec/integration/types_spec.rb +23 -0
  39. data/spec/integration/when_spec.rb +29 -0
  40. data/spec/integration/where_spec.rb +132 -0
  41. data/vendor/Podfile.lock +24 -0
  42. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +641 -0
  43. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +1396 -0
  44. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +133 -0
  45. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +327 -0
  46. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +113 -0
  47. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +321 -0
  48. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +71 -0
  49. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +150 -0
  50. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
  51. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +157 -0
  52. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +43 -0
  53. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +68 -0
  54. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +143 -0
  55. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +370 -0
  56. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +848 -0
  57. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +89 -0
  58. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +167 -0
  59. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +78 -0
  60. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +191 -0
  61. data/vendor/Pods/AFNetworking/LICENSE +19 -0
  62. data/vendor/Pods/AFNetworking/README.md +208 -0
  63. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +641 -0
  64. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +133 -0
  65. data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +113 -0
  66. data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +71 -0
  67. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
  68. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +43 -0
  69. data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +68 -0
  70. data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +370 -0
  71. data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +89 -0
  72. data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +78 -0
  73. data/vendor/Pods/BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
  74. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +41 -0
  75. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
  76. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +334 -0
  77. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +601 -0
  78. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +167 -0
  79. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
  80. data/vendor/Pods/BuildHeaders/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
  81. data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +109 -0
  82. data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +90 -0
  83. data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +20 -0
  84. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +547 -0
  85. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +447 -0
  86. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnectionState.h +29 -0
  87. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +37 -0
  88. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtension.h +15 -0
  89. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
  90. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
  91. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
  92. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +108 -0
  93. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
  94. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
  95. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
  96. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
  97. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
  98. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
  99. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
  100. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
  101. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseLogging.h +158 -0
  102. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseManager.h +17 -0
  103. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +424 -0
  104. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseQuery.h +42 -0
  105. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
  106. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
  107. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
  108. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
  109. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
  110. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseStatement.h +13 -0
  111. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseString.h +121 -0
  112. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +541 -0
  113. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +186 -0
  114. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +272 -0
  115. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
  116. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +115 -0
  117. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +825 -0
  118. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
  119. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +56 -0
  120. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPage.h +36 -0
  121. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
  122. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +153 -0
  123. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
  124. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
  125. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +447 -0
  126. data/vendor/Pods/BuildHeaders/YapDatabase/YapMemoryTable.h +74 -0
  127. data/vendor/Pods/BuildHeaders/YapDatabase/YapNull.h +17 -0
  128. data/vendor/Pods/BuildHeaders/YapDatabase/YapSet.h +41 -0
  129. data/vendor/Pods/BuildHeaders/YapDatabase/YapTouch.h +15 -0
  130. data/vendor/Pods/CocoaLumberjack/LICENSE.txt +18 -0
  131. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +41 -0
  132. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +99 -0
  133. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +102 -0
  134. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +727 -0
  135. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +334 -0
  136. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1353 -0
  137. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +601 -0
  138. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +1083 -0
  139. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +167 -0
  140. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1479 -0
  141. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h +65 -0
  142. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.m +191 -0
  143. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.h +116 -0
  144. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +251 -0
  145. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +7 -0
  146. data/vendor/Pods/CocoaLumberjack/README.markdown +37 -0
  147. data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +641 -0
  148. data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +133 -0
  149. data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +113 -0
  150. data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +71 -0
  151. data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
  152. data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +43 -0
  153. data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +68 -0
  154. data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +370 -0
  155. data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +89 -0
  156. data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +78 -0
  157. data/vendor/Pods/Headers/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
  158. data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +41 -0
  159. data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
  160. data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +334 -0
  161. data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +601 -0
  162. data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +167 -0
  163. data/vendor/Pods/Headers/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
  164. data/vendor/Pods/Headers/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
  165. data/vendor/Pods/Headers/Reachability/Reachability.h +109 -0
  166. data/vendor/Pods/Headers/YapDatabase/YapCache.h +90 -0
  167. data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +20 -0
  168. data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +547 -0
  169. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +447 -0
  170. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +29 -0
  171. data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +37 -0
  172. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtension.h +15 -0
  173. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
  174. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
  175. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
  176. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +108 -0
  177. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
  178. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
  179. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
  180. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
  181. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
  182. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
  183. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
  184. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
  185. data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +158 -0
  186. data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +17 -0
  187. data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +424 -0
  188. data/vendor/Pods/Headers/YapDatabase/YapDatabaseQuery.h +42 -0
  189. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
  190. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
  191. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
  192. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
  193. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
  194. data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +13 -0
  195. data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +121 -0
  196. data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +541 -0
  197. data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +186 -0
  198. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +272 -0
  199. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
  200. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +115 -0
  201. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +825 -0
  202. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
  203. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +56 -0
  204. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +36 -0
  205. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
  206. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +153 -0
  207. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
  208. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
  209. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +447 -0
  210. data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +74 -0
  211. data/vendor/Pods/Headers/YapDatabase/YapNull.h +17 -0
  212. data/vendor/Pods/Headers/YapDatabase/YapSet.h +41 -0
  213. data/vendor/Pods/Headers/YapDatabase/YapTouch.h +15 -0
  214. data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +17 -0
  215. data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +5 -0
  216. data/vendor/Pods/Headers/____Pods-NSData+MD5Digest-prefix.h +5 -0
  217. data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +5 -0
  218. data/vendor/Pods/Headers/____Pods-YapDatabase-prefix.h +5 -0
  219. data/vendor/Pods/Headers/____Pods-environment.h +38 -0
  220. data/vendor/Pods/Manifest.lock +24 -0
  221. data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
  222. data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.m +39 -0
  223. data/vendor/Pods/NSData+MD5Digest/README.md +11 -0
  224. data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +5 -0
  225. data/vendor/Pods/Pods-AFNetworking-dummy.m +5 -0
  226. data/vendor/Pods/Pods-AFNetworking-prefix.pch +17 -0
  227. data/vendor/Pods/Pods-AFNetworking.xcconfig +1 -0
  228. data/vendor/Pods/Pods-Acknowledgements.markdown +96 -0
  229. data/vendor/Pods/Pods-Acknowledgements.plist +142 -0
  230. data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +5 -0
  231. data/vendor/Pods/Pods-CocoaLumberjack-dummy.m +5 -0
  232. data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +5 -0
  233. data/vendor/Pods/Pods-CocoaLumberjack.xcconfig +0 -0
  234. data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +5 -0
  235. data/vendor/Pods/Pods-NSData+MD5Digest-dummy.m +5 -0
  236. data/vendor/Pods/Pods-NSData+MD5Digest-prefix.pch +5 -0
  237. data/vendor/Pods/Pods-NSData+MD5Digest.xcconfig +0 -0
  238. data/vendor/Pods/Pods-Reachability-Private.xcconfig +5 -0
  239. data/vendor/Pods/Pods-Reachability-dummy.m +5 -0
  240. data/vendor/Pods/Pods-Reachability-prefix.pch +5 -0
  241. data/vendor/Pods/Pods-Reachability.xcconfig +1 -0
  242. data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +5 -0
  243. data/vendor/Pods/Pods-YapDatabase-dummy.m +5 -0
  244. data/vendor/Pods/Pods-YapDatabase-prefix.pch +5 -0
  245. data/vendor/Pods/Pods-YapDatabase.xcconfig +1 -0
  246. data/vendor/Pods/Pods-dummy.m +5 -0
  247. data/vendor/Pods/Pods-environment.h +38 -0
  248. data/vendor/Pods/Pods-resources.sh +68 -0
  249. data/vendor/Pods/Pods.bridgesupport +5096 -0
  250. data/vendor/Pods/Pods.xcconfig +5 -0
  251. data/vendor/Pods/Pods.xcodeproj/project.pbxproj +5536 -0
  252. data/vendor/Pods/Reachability/LICENCE.txt +24 -0
  253. data/vendor/Pods/Reachability/README.md +65 -0
  254. data/vendor/Pods/Reachability/Reachability.h +109 -0
  255. data/vendor/Pods/Reachability/Reachability.m +527 -0
  256. data/vendor/Pods/YapDatabase/LICENSE.txt +18 -0
  257. data/vendor/Pods/YapDatabase/README.md +30 -0
  258. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +19 -0
  259. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +108 -0
  260. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +175 -0
  261. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.h +12 -0
  262. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.m +41 -0
  263. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +39 -0
  264. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +966 -0
  265. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +69 -0
  266. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.h +89 -0
  267. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.m +146 -0
  268. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.h +32 -0
  269. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +298 -0
  270. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
  271. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.m +95 -0
  272. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.h +68 -0
  273. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +1352 -0
  274. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +440 -0
  275. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.h +15 -0
  276. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +58 -0
  277. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.h +11 -0
  278. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +46 -0
  279. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.h +11 -0
  280. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +180 -0
  281. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +73 -0
  282. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +100 -0
  283. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +149 -0
  284. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.h +33 -0
  285. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +330 -0
  286. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.h +33 -0
  287. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +184 -0
  288. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h +58 -0
  289. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +1166 -0
  290. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewChangePrivate.h +94 -0
  291. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewMappingsPrivate.h +72 -0
  292. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.h +36 -0
  293. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.mm +296 -0
  294. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.h +27 -0
  295. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.m +28 -0
  296. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +153 -0
  297. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewRangeOptionsPrivate.h +17 -0
  298. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +272 -0
  299. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +2494 -0
  300. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +825 -0
  301. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +1567 -0
  302. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.h +330 -0
  303. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.m +141 -0
  304. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +186 -0
  305. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +191 -0
  306. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +115 -0
  307. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +897 -0
  308. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +56 -0
  309. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.m +27 -0
  310. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +447 -0
  311. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +4505 -0
  312. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +90 -0
  313. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +453 -0
  314. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.h +29 -0
  315. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m +48 -0
  316. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +37 -0
  317. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +83 -0
  318. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.h +158 -0
  319. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.m +73 -0
  320. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.h +17 -0
  321. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.m +56 -0
  322. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +424 -0
  323. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.h +13 -0
  324. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.m +26 -0
  325. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseString.h +121 -0
  326. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.h +74 -0
  327. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.m +603 -0
  328. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.h +17 -0
  329. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +31 -0
  330. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.h +15 -0
  331. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.m +31 -0
  332. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +20 -0
  333. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +194 -0
  334. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.h +42 -0
  335. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.m +96 -0
  336. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.h +41 -0
  337. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.m +82 -0
  338. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +547 -0
  339. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +2022 -0
  340. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +447 -0
  341. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +3874 -0
  342. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +541 -0
  343. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +5282 -0
  344. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +16 -0
  345. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +13 -0
  346. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +20 -0
  347. data/yapper.gemspec +24 -0
  348. metadata +458 -0
@@ -0,0 +1,29 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import "YapDatabaseConnection.h"
3
+
4
+
5
+ @interface YapDatabaseConnectionState : NSObject {
6
+ @private
7
+ dispatch_semaphore_t writeSemaphore;
8
+
9
+ @public
10
+ __weak YapDatabaseConnection *connection;
11
+
12
+ BOOL yapLevelSharedReadLock;
13
+ BOOL sqlLevelSharedReadLock;
14
+ BOOL longLivedReadTransaction;
15
+
16
+ BOOL yapLevelExclusiveWriteLock;
17
+ BOOL waitingForWriteLock;
18
+
19
+ uint64_t lastKnownSnapshot;
20
+ }
21
+
22
+ - (id)initWithConnection:(YapDatabaseConnection *)connection;
23
+
24
+ - (void)prepareWriteLock;
25
+
26
+ - (void)waitForWriteLock;
27
+ - (void)signalWriteLock;
28
+
29
+ @end
@@ -0,0 +1,48 @@
1
+ #import "YapDatabaseConnectionState.h"
2
+
3
+ #if ! __has_feature(objc_arc)
4
+ #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
5
+ #endif
6
+
7
+
8
+ @implementation YapDatabaseConnectionState
9
+
10
+ - (id)initWithConnection:(YapDatabaseConnection *)inConnection
11
+ {
12
+ if ((self = [super init]))
13
+ {
14
+ connection = inConnection;
15
+ }
16
+ return self;
17
+ }
18
+
19
+ - (void)dealloc
20
+ {
21
+ #if !OS_OBJECT_USE_OBJC
22
+ if (writeSemaphore)
23
+ dispatch_release(writeSemaphore);
24
+ #endif
25
+ }
26
+
27
+ - (void)prepareWriteLock;
28
+ {
29
+ if (writeSemaphore == NULL) {
30
+ writeSemaphore = dispatch_semaphore_create(0);
31
+ }
32
+ }
33
+
34
+ - (void)waitForWriteLock
35
+ {
36
+ if (writeSemaphore) {
37
+ dispatch_semaphore_wait(writeSemaphore, DISPATCH_TIME_FOREVER);
38
+ }
39
+ }
40
+
41
+ - (void)signalWriteLock
42
+ {
43
+ if (writeSemaphore) {
44
+ dispatch_semaphore_signal(writeSemaphore);
45
+ }
46
+ }
47
+
48
+ @end
@@ -0,0 +1,37 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ #import "YapDatabaseConnection.h"
4
+
5
+ /**
6
+ * When a connection is created via [database newConnection] is will be handed one of these objects.
7
+ * Thus the connection will inherit its initial configuration via the defaults configured for the parent database.
8
+ *
9
+ * Of course, the connection may then override these default configuration values, and configure itself as needed.
10
+ *
11
+ * @see YapDatabase defaultObjectCacheEnabled
12
+ * @see YapDatabase defaultObjectCacheLimit
13
+ *
14
+ * @see YapDatabase defaultMetadataCacheEnabled
15
+ * @see YapDatabase defaultMetadataCacheLimit
16
+ *
17
+ * @see YapDatabase defaultObjectPolicy
18
+ * @see YapDatabase defaultMetadataPolicy
19
+ *
20
+ * @see YapDatabase defaultAutoFlushMemoryLevel
21
+ **/
22
+ @interface YapDatabaseDefaults : NSObject <NSCopying>
23
+
24
+ @property (nonatomic, assign, readwrite) BOOL objectCacheEnabled;
25
+ @property (nonatomic, assign, readwrite) NSUInteger objectCacheLimit;
26
+
27
+ @property (nonatomic, assign, readwrite) BOOL metadataCacheEnabled;
28
+ @property (nonatomic, assign, readwrite) NSUInteger metadataCacheLimit;
29
+
30
+ @property (nonatomic, assign, readwrite) YapDatabasePolicy objectPolicy;
31
+ @property (nonatomic, assign, readwrite) YapDatabasePolicy metadataPolicy;
32
+
33
+ #if TARGET_OS_IPHONE
34
+ @property (nonatomic, assign, readwrite) int autoFlushMemoryLevel;
35
+ #endif
36
+
37
+ @end
@@ -0,0 +1,83 @@
1
+ #import "YapDatabaseDefaults.h"
2
+
3
+
4
+ @implementation YapDatabaseDefaults
5
+
6
+ @synthesize objectCacheEnabled = objectCacheEnabled;
7
+ @synthesize objectCacheLimit = objectCacheLimit;
8
+
9
+ @synthesize metadataCacheEnabled = metadataCacheEnabled;
10
+ @synthesize metadataCacheLimit = metadataCacheLimit;
11
+
12
+ @synthesize objectPolicy = objectPolicy;
13
+ @synthesize metadataPolicy = metadataPolicy;
14
+
15
+ #if TARGET_OS_IPHONE
16
+ @synthesize autoFlushMemoryLevel = autoFlushMemoryLevel;
17
+ #endif
18
+
19
+ - (id)init
20
+ {
21
+ if ((self = [super init]))
22
+ {
23
+ objectCacheEnabled = YES;
24
+ objectCacheLimit = 250;
25
+
26
+ metadataCacheEnabled = YES;
27
+ metadataCacheLimit = 500;
28
+
29
+ objectPolicy = YapDatabasePolicyContainment;
30
+ metadataPolicy = YapDatabasePolicyContainment;
31
+
32
+ #if TARGET_OS_IPHONE
33
+ autoFlushMemoryLevel = YapDatabaseConnectionFlushMemoryLevelMild;
34
+ #endif
35
+ }
36
+ return self;
37
+ }
38
+
39
+ - (id)copyWithZone:(NSZone *)zone
40
+ {
41
+ YapDatabaseDefaults *copy = [[[self class] alloc] init];
42
+
43
+ copy->objectCacheEnabled = objectCacheEnabled;
44
+ copy->objectCacheLimit = objectCacheLimit;
45
+
46
+ copy->metadataCacheEnabled = metadataCacheEnabled;
47
+ copy->metadataCacheLimit = metadataCacheLimit;
48
+
49
+ copy->objectPolicy = objectPolicy;
50
+ copy->metadataPolicy = metadataPolicy;
51
+
52
+ #if TARGET_OS_IPHONE
53
+ copy->autoFlushMemoryLevel = autoFlushMemoryLevel;
54
+ #endif
55
+
56
+ return copy;
57
+ }
58
+
59
+ - (void)setObjectPolicy:(YapDatabasePolicy)newObjectPolicy
60
+ {
61
+ // sanity check
62
+ switch (newObjectPolicy)
63
+ {
64
+ case YapDatabasePolicyContainment :
65
+ case YapDatabasePolicyShare :
66
+ case YapDatabasePolicyCopy : objectPolicy = newObjectPolicy; break;
67
+ default : objectPolicy = YapDatabasePolicyContainment; // revert to default
68
+ }
69
+ }
70
+
71
+ - (void)setMetadataPolicy:(YapDatabasePolicy)newMetadataPolicy
72
+ {
73
+ // sanity check
74
+ switch (newMetadataPolicy)
75
+ {
76
+ case YapDatabasePolicyContainment :
77
+ case YapDatabasePolicyShare :
78
+ case YapDatabasePolicyCopy : metadataPolicy = newMetadataPolicy; break;
79
+ default : metadataPolicy = YapDatabasePolicyContainment; // revert to default
80
+ }
81
+ }
82
+
83
+ @end
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Logging plays a very important role in open-source libraries.
3
+ *
4
+ * Good documentation and comments decrease the learning time required to use a library.
5
+ * But proper logging takes this futher by:
6
+ * - Providing a way to trace the execution of the library
7
+ * - Allowing developers to quickly identify subsets of the code that need analysis
8
+ * - Making it easier for developers to find potential bugs, either in their code or the library
9
+ * - Drawing attention to potential mis-configurations or mis-uses of the API
10
+ *
11
+ * Ultimately logging is an interactive extension to comments.
12
+ **/
13
+
14
+ /**
15
+ * Define log levels.
16
+ * YapDatabase uses 4 log levels:
17
+ *
18
+ * error - For critical errors that will likely break functionality
19
+ * warn - For problems that are concerning, but not quite critical
20
+ * info - For general, but important, information such as performing a database upgrade
21
+ * verbose - For all the other low-level debugging type information
22
+ *
23
+ * Notice that the levels are actually defined using bitwise flags.
24
+ * This means you have full control to flip individual logs on/off.
25
+ * For example, you could enable errors and info, but not warnings, if you wanted.
26
+ **/
27
+
28
+ #define YDB_LOG_FLAG_ERROR (1 << 0) // 0...00001
29
+ #define YDB_LOG_FLAG_WARN (1 << 1) // 0...00010
30
+ #define YDB_LOG_FLAG_INFO (1 << 2) // 0...00100
31
+ #define YDB_LOG_FLAG_VERBOSE (1 << 3) // 0...01000
32
+
33
+ #define YDB_LOG_LEVEL_OFF 0 // 0...00000
34
+ #define YDB_LOG_LEVEL_ERROR (YDB_LOG_LEVEL_OFF | YDB_LOG_FLAG_ERROR) // 0...00001
35
+ #define YDB_LOG_LEVEL_WARN (YDB_LOG_LEVEL_ERROR | YDB_LOG_FLAG_WARN) // 0...00011
36
+ #define YDB_LOG_LEVEL_INFO (YDB_LOG_LEVEL_WARN | YDB_LOG_FLAG_INFO) // 0...00111
37
+ #define YDB_LOG_LEVEL_VERBOSE (YDB_LOG_LEVEL_INFO | YDB_LOG_FLAG_VERBOSE) // 0...01111
38
+
39
+ #define YDB_LOG_ERROR (ydbLogLevel & YDB_LOG_LEVEL_ERROR)
40
+ #define YDB_LOG_WARN (ydbLogLevel & YDB_LOG_LEVEL_WARN)
41
+ #define YDB_LOG_INFO (ydbLogLevel & YDB_LOG_LEVEL_INFO)
42
+ #define YDB_LOG_VERBOSE (ydbLogLevel & YDB_LOG_LEVEL_VERBOSE)
43
+
44
+ /**
45
+ * Define trace, which is in addition to log levels.
46
+ * It may be turned on/off independent of the log level.
47
+ **/
48
+
49
+ #define YDB_LOG_FLAG_TRACE (1 << 4) // 0...10000
50
+
51
+ /**
52
+ * YapDatabase supports multiple logging techniques.
53
+ *
54
+ * YapDatabase supports the CocoaLumberjack logging framework.
55
+ * This is a professional open-source logging library for Mac and iOS development.
56
+ *
57
+ * If you're not using Lumberjack then you can downgrade to NSLog.
58
+ * You can also completely disable logging throughout the entire library.
59
+ *
60
+ * You are strongly discouraged from modifying this file.
61
+ * If you do, you make it more difficult on yourself to merge future bug fixes and improvements from the project.
62
+ * Instead, you should override the default values in your own application.
63
+ **/
64
+
65
+ #define YapDatabaseLoggingTechnique_Lumberjack 2 // optimal
66
+ #define YapDatabaseLoggingTechnique_NSLog 1 // slower
67
+ #define YapDatabaseLoggingTechnique_Disabled 0 // disabled
68
+
69
+ #ifndef YapDatabaseLoggingTechnique
70
+ #define YapDatabaseLoggingTechnique YapDatabaseLoggingTechnique_Lumberjack
71
+ #endif
72
+
73
+ /**
74
+ * CocoaLumberjack has several useful macros and functions.
75
+ * If not using Lumberjack, we re-define these macros for our own use.
76
+ **/
77
+
78
+ #if YapDatabaseLoggingTechnique != YapDatabaseLoggingTechnique_Lumberjack
79
+
80
+ #ifndef THIS_METHOD
81
+ #define THIS_METHOD NSStringFromSelector(_cmd)
82
+ #endif
83
+
84
+ #ifndef THIS_FILE
85
+ NSString *YDBExtractFileNameWithoutExtension(const char *filePath);
86
+ #define THIS_FILE (YDBExtractFileNameWithoutExtension(__FILE__))
87
+ #endif
88
+
89
+ #endif
90
+
91
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
92
+ #if (YapDatabaseLoggingTechnique == YapDatabaseLoggingTechnique_Lumberjack)
93
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
94
+
95
+ // Logging Enabled.
96
+ // Logging uses the CocoaLumberjack framework. (optimal)
97
+ //
98
+ // There is a TON of documentation available from the project page:
99
+ // https://github.com/robbiehanson/CocoaLumberjack
100
+
101
+ #import "DDLog.h"
102
+
103
+ #define YDBLogAsync NO
104
+ #define YDBLogContext 27017
105
+
106
+ #define YDBLogMaybe(flg, frmt, ...) LOG_OBJC_MAYBE(YDBLogAsync, ydbLogLevel, flg, YDBLogContext, frmt, ##__VA_ARGS__)
107
+
108
+ #define YDBLogError(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_ERROR, (@"%@: " frmt), THIS_FILE, ##__VA_ARGS__)
109
+ #define YDBLogWarn(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_WARN, (@"%@: " frmt), THIS_FILE, ##__VA_ARGS__)
110
+ #define YDBLogInfo(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_INFO, (@"%@: " frmt), THIS_FILE, ##__VA_ARGS__)
111
+ #define YDBLogVerbose(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_VERBOSE, (@"%@: " frmt), THIS_FILE, ##__VA_ARGS__)
112
+
113
+ #define YDBLogTrace(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_TRACE, (@"%@: " frmt), THIS_FILE, ##__VA_ARGS__)
114
+ #define YDBLogAutoTrace() YDBLogMaybe(YDB_LOG_FLAG_TRACE, @"%@: %@", THIS_FILE, THIS_METHOD)
115
+
116
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
117
+ #elif (YapDatabaseLoggingTechnique == YapDatabaseLoggingTechnique_NSLog)
118
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
119
+
120
+ // Logging Enabled.
121
+ // Logging uses plain old NSLog. (slower)
122
+
123
+ #define YDBLogMaybe(flg, frmt, ...) \
124
+ do{ if(ydbLogLevel & flg) NSLog((@"%@: " frmt), THIS_FILE, ##__VA_ARGS__); } while(0)
125
+
126
+ #define YDBLogError(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_ERROR, frmt, ##__VA_ARGS__)
127
+ #define YDBLogWarn(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_WARN, frmt, ##__VA_ARGS__)
128
+ #define YDBLogInfo(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_INFO, frmt, ##__VA_ARGS__)
129
+ #define YDBLogVerbose(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_VERBOSE, frmt, ##__VA_ARGS__)
130
+
131
+ #define YDBLogTrace(frmt, ...) YDBLogMaybe(YDB_LOG_FLAG_TRACE, (@"%@: " frmt), THIS_FILE, ##__VA_ARGS__)
132
+ #define YDBLogAutoTrace() YDBLogMaybe(YDB_LOG_FLAG_TRACE, @"%@: %@", THIS_FILE, THIS_METHOD)
133
+
134
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
135
+ #else
136
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
137
+
138
+ // Logging Disabled
139
+
140
+ #undef YDB_LOG_ERROR
141
+ #undef YDB_LOG_WARN
142
+ #undef YDB_LOG_INFO
143
+ #undef YDB_LOG_VERBOSE
144
+
145
+ #define YDB_LOG_ERROR (NO)
146
+ #define YDB_LOG_WARN (NO)
147
+ #define YDB_LOG_INFO (NO)
148
+ #define YDB_LOG_VERBOSE (NO)
149
+
150
+ #define YDBLogError(frmt, ...) {}
151
+ #define YDBLogWarn(frmt, ...) {}
152
+ #define YDBLogInfo(frmt, ...) {}
153
+ #define YDBLogVerbose(frmt, ...) {}
154
+
155
+ #define YDBLogTrace(frmt, ...) {}
156
+ #define YDBLogAutoTrace() {}
157
+
158
+ #endif
@@ -0,0 +1,73 @@
1
+ #import "YapDatabaseLogging.h"
2
+
3
+
4
+ #if YapDatabaseLoggingTechnique != YapDatabaseLoggingTechnique_Lumberjack
5
+
6
+ /**
7
+ * This method is based on CocoaLumberjack's DDExtractFileNameWithoutExtension function.
8
+ * The copy option has been removed, as we only use __FILE__ as the filePath parameter.
9
+ **/
10
+ NSString *YDBExtractFileNameWithoutExtension(const char *filePath)
11
+ {
12
+ if (filePath == NULL) return nil;
13
+
14
+ char *lastSlash = NULL;
15
+ char *lastDot = NULL;
16
+
17
+ char *p = (char *)filePath;
18
+
19
+ while (*p != '\0')
20
+ {
21
+ if (*p == '/')
22
+ lastSlash = p;
23
+ else if (*p == '.')
24
+ lastDot = p;
25
+
26
+ p++;
27
+ }
28
+
29
+ char *subStr;
30
+ NSUInteger subLen;
31
+
32
+ if (lastSlash)
33
+ {
34
+ if (lastDot)
35
+ {
36
+ // lastSlash -> lastDot
37
+ subStr = lastSlash + 1;
38
+ subLen = lastDot - subStr;
39
+ }
40
+ else
41
+ {
42
+ // lastSlash -> endOfString
43
+ subStr = lastSlash + 1;
44
+ subLen = p - subStr;
45
+ }
46
+ }
47
+ else
48
+ {
49
+ if (lastDot)
50
+ {
51
+ // startOfString -> lastDot
52
+ subStr = (char *)filePath;
53
+ subLen = lastDot - subStr;
54
+ }
55
+ else
56
+ {
57
+ // startOfString -> endOfString
58
+ subStr = (char *)filePath;
59
+ subLen = p - subStr;
60
+ }
61
+ }
62
+
63
+ // We can take advantage of the fact that __FILE__ is a string literal.
64
+ // Specifically, we don't need to waste time copying the string.
65
+ // We can just tell NSString to point to a range within the string literal.
66
+
67
+ return [[NSString alloc] initWithBytesNoCopy:subStr
68
+ length:subLen
69
+ encoding:NSUTF8StringEncoding
70
+ freeWhenDone:NO];
71
+ }
72
+
73
+ #endif
@@ -0,0 +1,17 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ /**
4
+ * There should only be one YapDatabase or YapCollectionDatabase per file.
5
+ *
6
+ * The architecture design is to create a single parent database instance,
7
+ * and then spawn connections to the database as needed from the parent.
8
+ *
9
+ * The architecture is built around this restriction, and is dependent upon it for proper operation.
10
+ * This class simply helps maintain this requirement.
11
+ **/
12
+ @interface YapDatabaseManager : NSObject
13
+
14
+ + (BOOL)registerDatabaseForPath:(NSString *)path;
15
+ + (void)deregisterDatabaseForPath:(NSString *)path;
16
+
17
+ @end