motion-yapper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/.travis.yml +2 -0
  4. data/Gemfile +1 -0
  5. data/README.md +1 -1
  6. data/Rakefile +1 -1
  7. data/lib/motion-yapper.rb +1 -0
  8. data/lib/yapper.rb +3 -5
  9. data/lib/yapper/config.rb +2 -0
  10. data/lib/yapper/db.rb +105 -40
  11. data/lib/yapper/document.rb +7 -4
  12. data/lib/yapper/document/callbacks.rb +0 -7
  13. data/lib/yapper/document/{persistance.rb → persistence.rb} +27 -21
  14. data/lib/yapper/document/relation.rb +29 -22
  15. data/lib/yapper/document/selection.rb +122 -54
  16. data/lib/yapper/extensions.rb +12 -24
  17. data/lib/yapper/settings.rb +43 -0
  18. data/lib/yapper/timestamps.rb +2 -0
  19. data/lib/yapper/version.rb +1 -1
  20. data/{yapper.gemspec → motion-yapper.gemspec} +0 -0
  21. data/spec/integration/{where_spec.rb → criteria_spec.rb} +78 -10
  22. data/spec/integration/db_spec.rb +70 -0
  23. data/spec/integration/defaults_spec.rb +37 -0
  24. data/spec/integration/extensions_spec.rb +14 -0
  25. data/spec/integration/{persistance_spec.rb → persistence_spec.rb} +0 -0
  26. data/spec/integration/relation_spec.rb +4 -4
  27. data/vendor/Podfile.lock +9 -11
  28. data/vendor/Pods/.build/libPods-CocoaLumberjack.a +0 -0
  29. data/vendor/Pods/.build/libPods-NSData+MD5Digest.a +0 -0
  30. data/vendor/Pods/.build/libPods-YapDatabase.a +0 -0
  31. data/vendor/Pods/.build/libPods.a +0 -0
  32. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +4 -4
  33. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
  34. data/vendor/Pods/{CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h → BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h} +6 -8
  35. data/vendor/Pods/BuildHeaders/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
  36. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +67 -32
  37. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +99 -0
  38. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +98 -65
  39. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +30 -0
  40. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +39 -25
  41. data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +8 -0
  42. data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +1 -0
  43. data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +3 -0
  44. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +4 -4
  45. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +21 -19
  46. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +1 -1
  47. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +35 -31
  48. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +8 -35
  49. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -2
  50. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
  51. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
  52. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +8 -0
  53. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +43 -21
  54. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +35 -0
  55. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
  56. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
  57. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +79 -0
  58. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
  59. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
  60. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +125 -0
  61. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
  62. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
  63. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +10 -0
  64. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
  65. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +131 -21
  66. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +48 -107
  67. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +2 -2
  68. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +1 -0
  69. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +17 -0
  70. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +10 -3
  71. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +18 -1
  72. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +75 -24
  73. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +99 -0
  74. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +4 -4
  75. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +51 -50
  76. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +14 -14
  77. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +546 -546
  78. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +67 -32
  79. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1093 -907
  80. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +99 -0
  81. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +98 -65
  82. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +873 -748
  83. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +39 -25
  84. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1284 -1243
  85. data/vendor/Pods/{BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h → CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h} +6 -8
  86. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{ContextFilterLogFormatter.m → DDContextFilterLogFormatter.m} +70 -70
  87. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
  88. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +253 -0
  89. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +30 -0
  90. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +127 -0
  91. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +1 -1
  92. data/vendor/Pods/CocoaLumberjack/README.markdown +52 -15
  93. data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +4 -4
  94. data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
  95. data/vendor/Pods/Headers/CocoaLumberjack/{ContextFilterLogFormatter.h → DDContextFilterLogFormatter.h} +6 -8
  96. data/vendor/Pods/Headers/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
  97. data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +67 -32
  98. data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +99 -0
  99. data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +98 -65
  100. data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +30 -0
  101. data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +39 -25
  102. data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +3 -0
  103. data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +4 -4
  104. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +21 -19
  105. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +8 -35
  106. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
  107. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
  108. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +35 -0
  109. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
  110. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
  111. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
  112. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
  113. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
  114. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
  115. data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +131 -21
  116. data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +48 -107
  117. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +2 -2
  118. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +1 -0
  119. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +17 -0
  120. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +10 -3
  121. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +75 -24
  122. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +99 -0
  123. data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +2 -0
  124. data/vendor/Pods/Headers/____Pods-environment.h +15 -15
  125. data/vendor/Pods/Manifest.lock +9 -11
  126. data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +1 -1
  127. data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +2 -0
  128. data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +1 -1
  129. data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +1 -1
  130. data/vendor/Pods/{Pods-Acknowledgements.markdown → Pods-acknowledgements.markdown} +0 -37
  131. data/vendor/Pods/{Pods-Acknowledgements.plist → Pods-acknowledgements.plist} +0 -45
  132. data/vendor/Pods/Pods-environment.h +15 -15
  133. data/vendor/Pods/Pods.xcconfig +3 -3
  134. data/vendor/Pods/Pods.xcodeproj/project.pbxproj +2426 -3155
  135. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +59 -0
  136. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +59 -0
  137. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +59 -0
  138. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +59 -0
  139. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +31 -0
  140. data/vendor/Pods/YapDatabase/README.md +3 -1
  141. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -2
  142. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +8 -35
  143. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +25 -41
  144. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +17 -17
  145. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +403 -134
  146. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +32 -0
  147. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +8 -0
  148. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +8 -8
  149. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +113 -62
  150. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +35 -31
  151. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +25 -0
  152. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +1 -1
  153. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +25 -1
  154. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +79 -0
  155. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +125 -0
  156. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +35 -0
  157. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +129 -0
  158. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +29 -0
  159. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +802 -0
  160. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +163 -0
  161. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +408 -0
  162. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +99 -0
  163. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +59 -0
  164. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +29 -0
  165. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +384 -0
  166. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +5254 -0
  167. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +10 -0
  168. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
  169. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +49 -0
  170. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +12 -0
  171. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +9 -8
  172. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +62 -1
  173. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +148 -45
  174. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +18 -1
  175. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +2 -2
  176. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +15 -9
  177. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +17 -0
  178. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +211 -64
  179. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +48 -107
  180. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +10 -7
  181. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +1 -0
  182. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +13 -22
  183. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +10 -3
  184. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +75 -24
  185. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +725 -244
  186. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +99 -0
  187. data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +8 -0
  188. data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +19 -0
  189. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +1 -0
  190. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +12 -0
  191. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +1 -1
  192. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +3 -3
  193. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +43 -21
  194. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +4 -0
  195. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +3 -0
  196. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +5 -0
  197. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +4 -4
  198. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +84 -93
  199. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +21 -19
  200. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +381 -209
  201. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +131 -21
  202. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +587 -267
  203. data/vendor/Pods/{Pods.bridgesupport → build-iPhoneSimulator/Pods.bridgesupport} +633 -2557
  204. data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
  205. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +2 -1
  206. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +2 -1
  207. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +4 -2
  208. metadata +80 -108
  209. data/Gemfile.lock +0 -63
  210. data/lib/yapper/attachment.rb +0 -48
  211. data/lib/yapper/document/attachment.rb +0 -26
  212. data/lib/yapper/sync.rb +0 -134
  213. data/lib/yapper/sync/data.rb +0 -12
  214. data/lib/yapper/sync/event.rb +0 -194
  215. data/lib/yapper/sync/queue.rb +0 -164
  216. data/spec/integration/all_spec.rb +0 -40
  217. data/spec/integration/sync_spec.rb +0 -42
  218. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +0 -641
  219. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +0 -1396
  220. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +0 -133
  221. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +0 -327
  222. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +0 -113
  223. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +0 -321
  224. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +0 -71
  225. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +0 -150
  226. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
  227. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +0 -157
  228. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +0 -43
  229. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +0 -68
  230. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +0 -143
  231. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +0 -370
  232. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +0 -848
  233. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +0 -89
  234. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +0 -167
  235. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +0 -78
  236. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +0 -191
  237. data/vendor/Pods/AFNetworking/LICENSE +0 -19
  238. data/vendor/Pods/AFNetworking/README.md +0 -208
  239. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +0 -641
  240. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +0 -133
  241. data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +0 -113
  242. data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +0 -71
  243. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
  244. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +0 -43
  245. data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +0 -68
  246. data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +0 -370
  247. data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +0 -89
  248. data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +0 -78
  249. data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +0 -109
  250. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +0 -251
  251. data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +0 -641
  252. data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +0 -133
  253. data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +0 -113
  254. data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +0 -71
  255. data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
  256. data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +0 -43
  257. data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +0 -68
  258. data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +0 -370
  259. data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +0 -89
  260. data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +0 -78
  261. data/vendor/Pods/Headers/Reachability/Reachability.h +0 -109
  262. data/vendor/Pods/Headers/YapDatabase/YapCache.h +0 -90
  263. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +0 -29
  264. data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +0 -37
  265. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +0 -440
  266. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -19
  267. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -69
  268. data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +0 -158
  269. data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +0 -17
  270. data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +0 -424
  271. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -73
  272. data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +0 -13
  273. data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +0 -121
  274. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
  275. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
  276. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +0 -36
  277. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
  278. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +0 -153
  279. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
  280. data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +0 -74
  281. data/vendor/Pods/Headers/YapDatabase/YapNull.h +0 -17
  282. data/vendor/Pods/Headers/YapDatabase/YapTouch.h +0 -15
  283. data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +0 -17
  284. data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +0 -5
  285. data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +0 -5
  286. data/vendor/Pods/Pods-AFNetworking-dummy.m +0 -5
  287. data/vendor/Pods/Pods-AFNetworking-prefix.pch +0 -17
  288. data/vendor/Pods/Pods-AFNetworking.xcconfig +0 -1
  289. data/vendor/Pods/Pods-Reachability-Private.xcconfig +0 -5
  290. data/vendor/Pods/Pods-Reachability-dummy.m +0 -5
  291. data/vendor/Pods/Pods-Reachability-prefix.pch +0 -5
  292. data/vendor/Pods/Pods-Reachability.xcconfig +0 -1
  293. data/vendor/Pods/Reachability/LICENCE.txt +0 -24
  294. data/vendor/Pods/Reachability/README.md +0 -65
  295. data/vendor/Pods/Reachability/Reachability.h +0 -109
  296. data/vendor/Pods/Reachability/Reachability.m +0 -527
@@ -1,78 +0,0 @@
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
@@ -1,109 +0,0 @@
1
- /*
2
- Copyright (c) 2011, Tony Million.
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are met:
7
-
8
- 1. Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
-
11
- 2. Redistributions in binary form must reproduce the above copyright notice,
12
- this list of conditions and the following disclaimer in the documentation
13
- and/or other materials provided with the distribution.
14
-
15
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
- POSSIBILITY OF SUCH DAMAGE.
26
- */
27
-
28
- #import <Foundation/Foundation.h>
29
- #import <SystemConfiguration/SystemConfiguration.h>
30
-
31
- #import <sys/socket.h>
32
- #import <netinet/in.h>
33
- #import <netinet6/in6.h>
34
- #import <arpa/inet.h>
35
- #import <ifaddrs.h>
36
- #import <netdb.h>
37
-
38
- /**
39
- * Does ARC support GCD objects?
40
- * It does if the minimum deployment target is iOS 6+ or Mac OS X 8+
41
- *
42
- * @see http://opensource.apple.com/source/libdispatch/libdispatch-228.18/os/object.h
43
- **/
44
- #if OS_OBJECT_USE_OBJC
45
- #define NEEDS_DISPATCH_RETAIN_RELEASE 0
46
- #else
47
- #define NEEDS_DISPATCH_RETAIN_RELEASE 1
48
- #endif
49
-
50
- /**
51
- * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X.
52
- *
53
- * @see http://nshipster.com/ns_enum-ns_options/
54
- **/
55
- #ifndef NS_ENUM
56
- #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
57
- #endif
58
-
59
- extern NSString *const kReachabilityChangedNotification;
60
-
61
- typedef NS_ENUM(NSInteger, NetworkStatus) {
62
- // Apple NetworkStatus Compatible Names.
63
- NotReachable = 0,
64
- ReachableViaWiFi = 2,
65
- ReachableViaWWAN = 1
66
- };
67
-
68
- @class Reachability;
69
-
70
- typedef void (^NetworkReachable)(Reachability * reachability);
71
- typedef void (^NetworkUnreachable)(Reachability * reachability);
72
-
73
- @interface Reachability : NSObject
74
-
75
- @property (nonatomic, copy) NetworkReachable reachableBlock;
76
- @property (nonatomic, copy) NetworkUnreachable unreachableBlock;
77
-
78
-
79
- @property (nonatomic, assign) BOOL reachableOnWWAN;
80
-
81
- +(Reachability*)reachabilityWithHostname:(NSString*)hostname;
82
- +(Reachability*)reachabilityForInternetConnection;
83
- +(Reachability*)reachabilityWithAddress:(const struct sockaddr_in*)hostAddress;
84
- +(Reachability*)reachabilityForLocalWiFi;
85
-
86
- -(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref;
87
-
88
- -(BOOL)startNotifier;
89
- -(void)stopNotifier;
90
-
91
- -(BOOL)isReachable;
92
- -(BOOL)isReachableViaWWAN;
93
- -(BOOL)isReachableViaWiFi;
94
-
95
- // WWAN may be available, but not active until a connection has been established.
96
- // WiFi may require a connection for VPN on Demand.
97
- -(BOOL)isConnectionRequired; // Identical DDG variant.
98
- -(BOOL)connectionRequired; // Apple's routine.
99
- // Dynamic, on demand connection?
100
- -(BOOL)isConnectionOnDemand;
101
- // Is user intervention required?
102
- -(BOOL)isInterventionRequired;
103
-
104
- -(NetworkStatus)currentReachabilityStatus;
105
- -(SCNetworkReachabilityFlags)reachabilityFlags;
106
- -(NSString*)currentReachabilityString;
107
- -(NSString*)currentReachabilityFlags;
108
-
109
- @end
@@ -1,90 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- #define YAP_CACHE_STATISTICS 0
4
-
5
- /**
6
- * YapCache implements a simple strict cache.
7
- *
8
- * It is very similar to NSCache and shares a similar API.
9
- * However, YapCache implements a strict countLimit and monitors usage so eviction is properly ordered.
10
- *
11
- * For example:
12
- * If you set a countLimit of 4, then when you add the 5th item to the cache, another item is automatically evicted.
13
- * It doesn't happen at a later time as with NSCache. It happens atomically during the addition of the 5th item.
14
-
15
- * Which item gets evicted? That depends entirely on usage.
16
- * YapCache maintains a doubly linked-list of keys ordered by access.
17
- * The most recently accessed key is at the front of the linked-list,
18
- * and the least recently accessed key is at the back.
19
- * So it's very quick and efficient to evict items based on recent usage.
20
- *
21
- * YapCache is NOT thread-safe.
22
- * It is designed to be used by the various YapDatabase classes, which inherently serialize access to the cache.
23
- **/
24
-
25
- @interface YapCache : NSObject
26
-
27
- /**
28
- * Initializes a cache.
29
- *
30
- * Since the countLimit is a common configuration, it may optionally be passed during initialization.
31
- * This is also used as a hint internally when initializing components (i.e. [NSMutableDictionary initWithCapacity:]).
32
- **/
33
- - (id)initWithKeyClass:(Class)keyClass;
34
- - (id)initWithKeyClass:(Class)keyClass countLimit:(NSUInteger)countLimit;
35
-
36
- /**
37
- * The countLimit specifies the maximum number of items to keep in the cache.
38
- * This limit is strictly enforced.
39
- *
40
- * The default countLimit is 40.
41
- *
42
- * You may optionally disable the countLimit by setting it to zero.
43
- *
44
- * You may change the countLimit at any time.
45
- * Changes to the countLimit take immediate effect on the cache (before the set method returns).
46
- * Thus, if needed, you can temporarily increase the cache size for certain operations.
47
- **/
48
- @property (nonatomic, assign, readwrite) NSUInteger countLimit;
49
-
50
- //
51
- // The normal cache stuff...
52
- //
53
-
54
- - (void)setObject:(id)object forKey:(id)key;
55
-
56
- - (id)objectForKey:(id)key;
57
- - (BOOL)containsKey:(id)key;
58
-
59
- - (NSUInteger)count;
60
-
61
- - (void)removeAllObjects;
62
- - (void)removeObjectForKey:(id)key;
63
- - (void)removeObjectsForKeys:(NSArray *)keys;
64
-
65
- - (void)enumerateKeysWithBlock:(void (^)(id key, BOOL *stop))block;
66
-
67
- //
68
- // Some debugging stuff that gets compiled out
69
- //
70
-
71
- #if YAP_CACHE_STATISTICS
72
-
73
- /**
74
- * When querying the cache for an object via objectForKey,
75
- * the hitCount is incremented if the object is in the cache,
76
- * and the missCount is incremented if the object is not in the cache.
77
- **/
78
- @property (nonatomic, readonly) NSUInteger hitCount;
79
- @property (nonatomic, readonly) NSUInteger missCount;
80
-
81
- /**
82
- * When adding objects to the cache via setObject:forKey:,
83
- * the evictionCount is incremented if the cache is full,
84
- * and the added object causes another object (the least recently used object) to be evicted.
85
- **/
86
- @property (nonatomic, readonly) NSUInteger evictionCount;
87
-
88
- #endif
89
-
90
- @end
@@ -1,29 +0,0 @@
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
@@ -1,37 +0,0 @@
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
@@ -1,440 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- #import "YapDatabaseExtension.h"
4
- #import "YapDatabaseExtensionConnection.h"
5
- #import "YapDatabaseExtensionTransaction.h"
6
-
7
- #import "YapDatabase.h"
8
- #import "YapDatabaseConnection.h"
9
- #import "YapDatabaseTransaction.h"
10
-
11
- #import "sqlite3.h"
12
-
13
-
14
- @interface YapDatabaseExtension ()
15
-
16
- /**
17
- * Subclasses MUST implement this method.
18
- *
19
- * This method is used when unregistering an extension in order to drop the related tables.
20
- **/
21
- + (void)dropTablesForRegisteredName:(NSString *)registeredName
22
- withTransaction:(YapDatabaseReadWriteTransaction *)transaction;
23
-
24
- /**
25
- * Subclasses may OPTIONALLY implement this method.
26
- *
27
- * If an extension class is renamed this method should be used to properly transition.
28
- * The extension architecture will verify that a re-registered extension is using the same
29
- * extension class that it was previously using. If the class names differ, then the extension architecture
30
- * will automatically try to unregister the previous extension using the previous extension class.
31
- *
32
- * That is, it will attempt to invoke [PreviousExtensionClass dropTablesForRegisteredName: withTransaction:].
33
- * Of course this won't work because the PreviousExtensionClass no longer exists.
34
- * So the end result is that you will likely see the database spit out a warning like this:
35
- *
36
- * - Dropping tables for previously registered extension with name(order),
37
- * class(YapDatabaseQuack) for new class(YapDatabaseDuck)
38
- * - Unable to drop tables for previously registered extension with name(order),
39
- * unknown class(YapDatabaseQuack)
40
- *
41
- * This method helps the extension architecture to understand what's happening, and it won't spit out any warnings.
42
- *
43
- * The default implementation returns nil.
44
- **/
45
- + (NSArray *)previousClassNames;
46
-
47
- /**
48
- * After an extension has been successfully registered with a database,
49
- * the registeredName property will be set by the database.
50
- *
51
- * This property is set by YapDatabase after a successful registration.
52
- * It should be considered read-only once set.
53
- **/
54
- @property (atomic, copy, readwrite) NSString *registeredName;
55
-
56
- /**
57
- * Subclasses MUST implement this method.
58
- * This method is called during the view registration process to enusre the extension supports the database type.
59
- * The registered extensions are passed too, in case dependencies need to be checked.
60
- *
61
- * Return YES if the class/instance supports the database configuration.
62
- **/
63
- - (BOOL)supportsDatabase:(YapDatabase *)database withRegisteredExtensions:(NSDictionary *)registeredExtensions;
64
-
65
- /**
66
- * Subclasses MUST implement this method IF they have dependencies.
67
- * This method is called during the view registration simply to record the needed dependencies.
68
- * If any of the dependencies are unregistered, this extension will automatically be unregistered.
69
- *
70
- * Return a set of NSString objects, representing the name(s) of registered extensions
71
- * that this extension is dependent upon.
72
- *
73
- * If there are no dependencies, return nil (or an empty set).
74
- * The default implementation returns nil.
75
- **/
76
- - (NSSet *)dependencies;
77
-
78
- /**
79
- * Subclasses MUST implement this method.
80
- * Returns a proper instance of the YapDatabaseExtensionConnection subclass.
81
- **/
82
- - (YapDatabaseExtensionConnection *)newConnection:(YapDatabaseConnection *)databaseConnection;
83
-
84
- @end
85
-
86
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
87
- #pragma mark -
88
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
89
-
90
- @interface YapDatabaseExtensionConnection () {
91
-
92
- // You MUST store a strong reference to the parent.
93
- // You MUST store an unretained reference to the corresponding database connection.
94
- //
95
- // The architecture of the database, throughout the database classes and extensions,
96
- // is such that connections retain their parents, which are the base classes.
97
- // This is needed so the base classes cannot disappear until their connections have all finished.
98
- // Otherwise a connection might get orphaned, and a crash would ensue.
99
- //
100
- // Your custom extension implementation should be similar to the example below, but typed according to your needs.
101
-
102
- /* Example from YapDatabaseViewConnection
103
-
104
- @public
105
- __strong YapDatabaseView *view;
106
- __unsafe_unretained YapDatabaseConnection *databaseConnection;
107
-
108
- */
109
- }
110
-
111
- /**
112
- * Subclasses MUST implement this method.
113
- * Returns a reference to the parent (base class).
114
- *
115
- * This method is used by various general utility classes in order to
116
- * walk-the-chain: extension <-> extConnection <-> extTransaction.
117
- *
118
- * For example:
119
- * Given an extTransaction, the utility method can walk up to the base extension class, and fetch the registeredName.
120
- **/
121
- - (YapDatabaseExtension *)extension;
122
-
123
- /**
124
- * Subclasses MUST implement these methods.
125
- * They are to create and return a proper instance of the YapDatabaseExtensionTransaction subclass.
126
- *
127
- * They may optionally use different subclasses for read-only vs read-write transactions.
128
- * Alternatively they can just store an ivar to determine the type of the transaction in order to protect as needed.
129
- **/
130
- - (id)newReadTransaction:(YapDatabaseReadTransaction *)databaseTransaction;
131
- - (id)newReadWriteTransaction:(YapDatabaseReadWriteTransaction *)databaseTransaction;
132
-
133
- /**
134
- * Subclasses MUST implement this method.
135
- *
136
- * This method will be invoked in order to flush memory.
137
- * Subclasses are encouraged to do something similar to the following:
138
- *
139
- * if (level >= YapDatabaseConnectionFlushMemoryLevelMild)
140
- * {
141
- * // Dump all caches
142
- * }
143
- *
144
- * if (level >= YapDatabaseConnectionFlushMemoryLevelModerate)
145
- * {
146
- * // Release any prepared statements that aren't constantly used.
147
- * //
148
- * // For example, any statements that make modifications to the database,
149
- * // and any other statements that are likely to be used infrequently.
150
- *
151
- * sqlite_finalize_null(&myStatement);
152
- * }
153
- *
154
- * if (level >= YapDatabaseConnectionFlushMemoryLevelFull)
155
- * {
156
- * // Release all other prepared statements
157
- *
158
- * sqlite_finalize_null(&myOtherStatement);
159
- *
160
- * // And flush any state that may have been prepared via
161
- * // the extTransaction's prepareIfNeeded method.
162
- *
163
- * viewGroups = nil;
164
- * }
165
- **/
166
- - (void)_flushMemoryWithLevel:(int)level;
167
-
168
- /**
169
- * Subclasses MUST implement this method.
170
- * This method is only called if within a readwrite transaction.
171
- *
172
- * This method is invoked in order to get the internal and external changesets.
173
- * The internal changeset will be passed to sibling connections via processChangeset:.
174
- * The external changeset will be embedded within YapDatabaseModifiedNotification.
175
- *
176
- * This is one of the primary methods within the architecture to keep multiple connections up-to-date
177
- * as they move from one snapshot to the next. It is the responsibility of this method to provide
178
- * all the information necessary for other connections to properly update their state,
179
- * as well as provide the ability to extract information from YapDatabaseModifiedNotification's.
180
- *
181
- * The internal changeset will be passed directly to other connections.
182
- * It should contain any information necessary to ensure that other connections can update their state
183
- * to reflect the changes that were made during this transaction.
184
- *
185
- * The external changeset will be embedded within the YapDatabaseModifiedNotification.
186
- * Thus, it can be used to provide support for things such as querying to see if something changed,
187
- * or generating information necessary for UI update animations.
188
- *
189
- * If needed, "return" a internal changeset to be passed to other connections.
190
- * If not needed, you can "return" a nil internal changeset.
191
- *
192
- * If needed, "return" an external changeset to be embedded within YapDatabaseModifiedNotification.
193
- *
194
- * If any changes to the database file were made made during this transaction,
195
- * the hasDiskChangesPtr should be set to YES.
196
- *
197
- * For the most part, extensions update themselves in relation to changes within the main database table.
198
- * However, sometimes extensions may update the database file independently. For example, the FullTextSearch extension
199
- * has a method that optimizes the search tables by merging a bunch of different internal b-trees.
200
- * If an extension makes changes to the database file outside the context of the normal changes to the main database
201
- * table (such as the optimize command), then it MUST be sure to set the hasDiskChangesPtr to YES.
202
- * This is because the internal architecture has optimizations if no disk changes occurred.
203
- **/
204
- - (void)getInternalChangeset:(NSMutableDictionary **)internalPtr
205
- externalChangeset:(NSMutableDictionary **)externalPtr
206
- hasDiskChanges:(BOOL *)hasDiskChangesPtr;
207
-
208
- /**
209
- * Subclasses MUST implement this method.
210
- *
211
- * This method processes an internal changeset from another connection.
212
- * The internal changeset was generated from getInternalChangeset:externalChangeset:: on a sibling connection.
213
- *
214
- * This is one of the primary methods within the architecture to keep multiple connections up-to-date
215
- * as they move from one snapshot to the next. It is the responsibility of this method to process
216
- * the changeset to ensure the connection's state is properly updated.
217
- **/
218
- - (void)processChangeset:(NSDictionary *)changeset;
219
-
220
- @end
221
-
222
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
223
- #pragma mark -
224
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
225
-
226
- /**
227
- * An extension transaction is where a majority of the action happens.
228
- * Subclasses will list the majority of their public API within the transaction.
229
- *
230
- * [databaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction){
231
- *
232
- * object = [[transaction ext:@"view"] objectAtIndex:index inGroup:@"sales"];
233
- * // ^^^^^^^^^^^^^^^^^^^^^^^
234
- * // ^ Returns a YapDatabaseExtensionTransaction subclass instance.
235
- * }];
236
- *
237
- * An extension transaction has a reference to the database transction (and therefore to sqlite),
238
- * as well as a reference to its parent extension connection. It is the same in architecture as
239
- * database connections and transactions. That is, all access (read-only or read-write) goes
240
- * through a transaction. Further, each connection only has a single transaction at a time.
241
- * Thus transactions are optimized by storing a majority of their state within their respective connection.
242
- *
243
- * An extension transaction is created on-demand (or as needed) from within a database transaction.
244
- *
245
- * During a read-only transaction:
246
- * - If the extension is not requested, then it is not created.
247
- * - If the extension is requested, it is created once per transaction.
248
- * - Additional requests for the same extension return the existing instance.
249
- *
250
- * During a read-write transaction:
251
- * - If a modification to the database is initiated,
252
- * every registered extension has an associated transaction created in order to handle the associated hook calls.
253
- * - If the extension is requested, it is created once per transaction.
254
- * - Additional requests for the same extension return the existing instance.
255
- *
256
- * The extension transaction is only valid from within the database transaction.
257
- **/
258
- @interface YapDatabaseExtensionTransaction () {
259
-
260
- // You should store an unretained reference to the parent,
261
- // and an unretained reference to the corresponding database transaction.
262
- //
263
- // Yours should be similar to the example below, but typed according to your needs.
264
-
265
- /* Example from YapDatabaseViewTransaction
266
-
267
- @private
268
- __unsafe_unretained YapDatabaseViewConnection *viewConnection;
269
- __unsafe_unretained YapDatabaseTransaction *databaseTransaction;
270
-
271
- */
272
- }
273
-
274
- /**
275
- * Subclasses MUST implement this method.
276
- *
277
- * This method is called during the registration process.
278
- * Subclasses should perform any tasks needed in order to setup the extension for use by other connections.
279
- *
280
- * This includes creating any necessary tables,
281
- * as well as possibly populating the tables by enumerating over the existing rows in the database.
282
- *
283
- * The method should check to see if it has already been created.
284
- * That is, is this a re-registration from a subsequent app launch,
285
- * or is this the first time the extension has been registered under this name?
286
- *
287
- * The recommended way of accomplishing this is via the yap2 table (which was designed for this purpose).
288
- * There are various convenience methods that allow you store various settings about your extension in this table.
289
- * See 'intValueForExtensionKey:' and other related methods.
290
- *
291
- * Note: This method is invoked on a special readWriteTransaction that is created internally
292
- * within YapDatabase for the sole purpose of registering and unregistering extensions.
293
- * So this method need not setup itself for regular use.
294
- * It is designed only to do the prep work of creating the extension dependencies (such as tables)
295
- * so that regular instances (possibly read-only) can operate normally.
296
- *
297
- * See YapDatabaseViewTransaction for a reference implementation.
298
- *
299
- * Return YES if completed successfully, or if already created.
300
- * Return NO if some kind of error occured.
301
- **/
302
- - (BOOL)createIfNeeded;
303
-
304
- /**
305
- * Subclasses MUST implement this method.
306
- *
307
- * This method is invoked in order to prepare an extension transaction for use.
308
- * Remember, transactions are short lived instances.
309
- * So an extension transaction should store the vast majority of its state information within the extension connection.
310
- * Thus an extension transaction instance should generally only need to prepare itself once. (*)
311
- * It should store preparation info in the connection.
312
- * And future invocations of this method will see that the connection has all the prepared state it needs,
313
- * and then this method will return immediately.
314
- *
315
- * (*) an exception to this rule may occur if the user aborts a read-write transaction (via rollback),
316
- * and the extension connection must dump all its prepared state.
317
- *
318
- * Changes that occur on other connections should get incorporated via the changeset architecture
319
- * from within the extension connection subclass.
320
- *
321
- * This method may be invoked on a read-only OR read-write transaction.
322
- *
323
- * Return YES if completed successfully, or if already prepared.
324
- * Return NO if some kind of error occured.
325
- **/
326
- - (BOOL)prepareIfNeeded;
327
-
328
- /**
329
- * Subclasses may OPTIONALLY implement this method.
330
- * This method is only called if within a readwrite transaction.
331
- *
332
- * Subclasses may implement it to perform any "cleanup" before the changeset is requested.
333
- * Remember, the changeset is requested before the commitTransaction method is invoked.
334
- **/
335
- - (void)preCommitReadWriteTransaction;
336
-
337
- /**
338
- * Subclasses MUST implement this method.
339
- * This method is only called if within a readwrite transaction.
340
- **/
341
- - (void)commitTransaction;
342
-
343
- /**
344
- * Subclasses MUST implement this method.
345
- * This method is only called if within a readwrite transaction.
346
- **/
347
- - (void)rollbackTransaction;
348
-
349
- /**
350
- * Subclasses MUST implement these methods.
351
- * They are needed by various utility methods.
352
- **/
353
- - (YapDatabaseReadTransaction *)databaseTransaction;
354
- - (YapDatabaseExtensionConnection *)extensionConnection;
355
-
356
- /**
357
- * The following method are implemented by YapDatabaseExtensionTransaction.
358
- *
359
- * They are convenience methods for getting and setting persistent configuration values for the extension.
360
- * The persistent values are stored in the yap2 table, which is specifically designed for this use.
361
- *
362
- * The yap2 table is structured like this:
363
- *
364
- * CREATE TABLE IF NOT EXISTS "yap2" (
365
- * "extension" CHAR NOT NULL,
366
- * "key" CHAR NOT NULL,
367
- * "data" BLOB,
368
- * PRIMARY KEY ("extension", "key")
369
- * );
370
- *
371
- * You pass the "key" and the "data" (which can be typed however you want it to be such as int, string, etc).
372
- * The "extension" value is automatically set to the registeredName.
373
- *
374
- * Usage example:
375
- *
376
- * The View extension stores a "version" which is given to it during the init method by the user.
377
- * If the "version" changes, this signifies that the user has changed something about the view,
378
- * such as the sortingBlock or groupingBlock. The view then knows to flush its tables and re-populate them.
379
- * It stores the "version" in the yap2 table via the methods below.
380
- *
381
- * When an extension is unregistered, either manually or automatically (if orphaned),
382
- * then the database system automatically deletes all values from the yap2 table where extension == registeredName.
383
- **/
384
-
385
- - (BOOL)getBoolValue:(BOOL *)valuePtr forExtensionKey:(NSString *)key;
386
- - (BOOL)boolValueForExtensionKey:(NSString *)key;
387
- - (void)setBoolValue:(BOOL)value forExtensionKey:(NSString *)key;
388
-
389
- - (BOOL)getIntValue:(int *)valuePtr forExtensionKey:(NSString *)key;
390
- - (int)intValueForExtensionKey:(NSString *)key;
391
- - (void)setIntValue:(int)value forExtensionKey:(NSString *)key;
392
-
393
- - (BOOL)getDoubleValue:(double *)valuePtr forExtensionKey:(NSString *)key;
394
- - (double)doubleValueForExtensionKey:(NSString *)key;
395
- - (void)setDoubleValue:(double)value forExtensionKey:(NSString *)key;
396
-
397
- - (NSString *)stringValueForExtensionKey:(NSString *)key;
398
- - (void)setStringValue:(NSString *)value forExtensionKey:(NSString *)key;
399
-
400
- - (NSData *)dataValueForExtensionKey:(NSString *)key;
401
- - (void)setDataValue:(NSData *)value forExtensionKey:(NSString *)key;
402
-
403
- @end
404
-
405
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
406
- #pragma mark -
407
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
408
-
409
- /**
410
- * The YapDatabaseExtensionTransaction subclass MUST implement the methods in this protocol.
411
- **/
412
- @protocol YapDatabaseExtensionTransaction_Hooks
413
- @required
414
-
415
- - (void)handleInsertObject:(id)object
416
- forKey:(NSString *)key
417
- inCollection:(NSString *)collection
418
- withMetadata:(id)metadata
419
- rowid:(int64_t)rowid;
420
-
421
- - (void)handleUpdateObject:(id)object
422
- forKey:(NSString *)key
423
- inCollection:(NSString *)collection
424
- withMetadata:(id)metadata
425
- rowid:(int64_t)rowid;
426
-
427
- - (void)handleUpdateMetadata:(id)metadata
428
- forKey:(NSString *)key
429
- inCollection:(NSString *)collection
430
- withRowid:(int64_t)rowid;
431
-
432
- - (void)handleTouchObjectForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
433
- - (void)handleTouchMetadataForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
434
-
435
- - (void)handleRemoveObjectForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
436
- - (void)handleRemoveObjectsForKeys:(NSArray *)keys inCollection:(NSString *)collection withRowids:(NSArray *)rowids;
437
-
438
- - (void)handleRemoveAllObjectsInAllCollections;
439
-
440
- @end