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,133 +0,0 @@
1
- // AFHTTPRequestOperation.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 "AFURLConnectionOperation.h"
25
-
26
- /**
27
- `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request.
28
- */
29
- @interface AFHTTPRequestOperation : AFURLConnectionOperation
30
-
31
- ///----------------------------------------------
32
- /// @name Getting HTTP URL Connection Information
33
- ///----------------------------------------------
34
-
35
- /**
36
- The last HTTP response received by the operation's connection.
37
- */
38
- @property (readonly, nonatomic, strong) NSHTTPURLResponse *response;
39
-
40
- ///----------------------------------------------------------
41
- /// @name Managing And Checking For Acceptable HTTP Responses
42
- ///----------------------------------------------------------
43
-
44
- /**
45
- A Boolean value that corresponds to whether the status code of the response is within the specified set of acceptable status codes. Returns `YES` if `acceptableStatusCodes` is `nil`.
46
- */
47
- @property (nonatomic, readonly) BOOL hasAcceptableStatusCode;
48
-
49
- /**
50
- A Boolean value that corresponds to whether the MIME type of the response is among the specified set of acceptable content types. Returns `YES` if `acceptableContentTypes` is `nil`.
51
- */
52
- @property (nonatomic, readonly) BOOL hasAcceptableContentType;
53
-
54
- /**
55
- The callback dispatch queue on success. If `NULL` (default), the main queue is used.
56
- */
57
- @property (nonatomic, assign) dispatch_queue_t successCallbackQueue;
58
-
59
- /**
60
- The callback dispatch queue on failure. If `NULL` (default), the main queue is used.
61
- */
62
- @property (nonatomic, assign) dispatch_queue_t failureCallbackQueue;
63
-
64
- ///------------------------------------------------------------
65
- /// @name Managing Acceptable HTTP Status Codes & Content Types
66
- ///------------------------------------------------------------
67
-
68
- /**
69
- Returns an `NSIndexSet` object containing the ranges of acceptable HTTP status codes. When non-`nil`, the operation will set the `error` property to an error in `AFErrorDomain`. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
70
-
71
- By default, this is the range 200 to 299, inclusive.
72
- */
73
- + (NSIndexSet *)acceptableStatusCodes;
74
-
75
- /**
76
- Adds status codes to the set of acceptable HTTP status codes returned by `+acceptableStatusCodes` in subsequent calls by this class and its descendants.
77
-
78
- @param statusCodes The status codes to be added to the set of acceptable HTTP status codes
79
- */
80
- + (void)addAcceptableStatusCodes:(NSIndexSet *)statusCodes;
81
-
82
- /**
83
- Returns an `NSSet` object containing the acceptable MIME types. When non-`nil`, the operation will set the `error` property to an error in `AFErrorDomain`. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
84
-
85
- By default, this is `nil`.
86
- */
87
- + (NSSet *)acceptableContentTypes;
88
-
89
- /**
90
- Adds content types to the set of acceptable MIME types returned by `+acceptableContentTypes` in subsequent calls by this class and its descendants.
91
-
92
- @param contentTypes The content types to be added to the set of acceptable MIME types
93
- */
94
- + (void)addAcceptableContentTypes:(NSSet *)contentTypes;
95
-
96
-
97
- ///-----------------------------------------------------
98
- /// @name Determining Whether A Request Can Be Processed
99
- ///-----------------------------------------------------
100
-
101
- /**
102
- A Boolean value determining whether or not the class can process the specified request. For example, `AFJSONRequestOperation` may check to make sure the content type was `application/json` or the URL path extension was `.json`.
103
-
104
- @param urlRequest The request that is determined to be supported or not supported for this class.
105
- */
106
- + (BOOL)canProcessRequest:(NSURLRequest *)urlRequest;
107
-
108
- ///-----------------------------------------------------------
109
- /// @name Setting Completion Block Success / Failure Callbacks
110
- ///-----------------------------------------------------------
111
-
112
- /**
113
- Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed.
114
-
115
- This method should be overridden in subclasses in order to specify the response object passed into the success block.
116
-
117
- @param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request.
118
- @param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request.
119
- */
120
- - (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
121
- failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
122
-
123
- @end
124
-
125
- ///----------------
126
- /// @name Functions
127
- ///----------------
128
-
129
- /**
130
- Returns a set of MIME types detected in an HTTP `Accept` or `Content-Type` header.
131
- */
132
- extern NSSet * AFContentTypesFromHTTPHeader(NSString *string);
133
-
@@ -1,327 +0,0 @@
1
- // AFHTTPRequestOperation.m
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 "AFHTTPRequestOperation.h"
24
- #import <objc/runtime.h>
25
-
26
- // Workaround for change in imp_implementationWithBlock() with Xcode 4.5
27
- #if defined(__IPHONE_6_0) || defined(__MAC_10_8)
28
- #define AF_CAST_TO_BLOCK id
29
- #else
30
- #define AF_CAST_TO_BLOCK __bridge void *
31
- #endif
32
-
33
- #pragma clang diagnostic push
34
- #pragma clang diagnostic ignored "-Wstrict-selector-match"
35
-
36
- NSSet * AFContentTypesFromHTTPHeader(NSString *string) {
37
- if (!string) {
38
- return nil;
39
- }
40
-
41
- NSArray *mediaRanges = [string componentsSeparatedByString:@","];
42
- NSMutableSet *mutableContentTypes = [NSMutableSet setWithCapacity:mediaRanges.count];
43
-
44
- [mediaRanges enumerateObjectsUsingBlock:^(NSString *mediaRange, __unused NSUInteger idx, __unused BOOL *stop) {
45
- NSRange parametersRange = [mediaRange rangeOfString:@";"];
46
- if (parametersRange.location != NSNotFound) {
47
- mediaRange = [mediaRange substringToIndex:parametersRange.location];
48
- }
49
-
50
- mediaRange = [mediaRange stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
51
-
52
- if (mediaRange.length > 0) {
53
- [mutableContentTypes addObject:mediaRange];
54
- }
55
- }];
56
-
57
- return [NSSet setWithSet:mutableContentTypes];
58
- }
59
-
60
- static void AFGetMediaTypeAndSubtypeWithString(NSString *string, NSString **type, NSString **subtype) {
61
- if (!string) {
62
- return;
63
- }
64
-
65
- NSScanner *scanner = [NSScanner scannerWithString:string];
66
- [scanner setCharactersToBeSkipped:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
67
- [scanner scanUpToString:@"/" intoString:type];
68
- [scanner scanString:@"/" intoString:nil];
69
- [scanner scanUpToString:@";" intoString:subtype];
70
- }
71
-
72
- static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
73
- NSMutableString *string = [NSMutableString string];
74
-
75
- NSRange range = NSMakeRange([indexSet firstIndex], 1);
76
- while (range.location != NSNotFound) {
77
- NSUInteger nextIndex = [indexSet indexGreaterThanIndex:range.location];
78
- while (nextIndex == range.location + range.length) {
79
- range.length++;
80
- nextIndex = [indexSet indexGreaterThanIndex:nextIndex];
81
- }
82
-
83
- if (string.length) {
84
- [string appendString:@","];
85
- }
86
-
87
- if (range.length == 1) {
88
- [string appendFormat:@"%lu", (long)range.location];
89
- } else {
90
- NSUInteger firstIndex = range.location;
91
- NSUInteger lastIndex = firstIndex + range.length - 1;
92
- [string appendFormat:@"%lu-%lu", (long)firstIndex, (long)lastIndex];
93
- }
94
-
95
- range.location = nextIndex;
96
- range.length = 1;
97
- }
98
-
99
- return string;
100
- }
101
-
102
- static void AFSwizzleClassMethodWithClassAndSelectorUsingBlock(Class klass, SEL selector, id block) {
103
- Method originalMethod = class_getClassMethod(klass, selector);
104
- IMP implementation = imp_implementationWithBlock((AF_CAST_TO_BLOCK)block);
105
- class_replaceMethod(objc_getMetaClass([NSStringFromClass(klass) UTF8String]), selector, implementation, method_getTypeEncoding(originalMethod));
106
- }
107
-
108
- #pragma mark -
109
-
110
- @interface AFHTTPRequestOperation ()
111
- @property (readwrite, nonatomic, strong) NSURLRequest *request;
112
- @property (readwrite, nonatomic, strong) NSHTTPURLResponse *response;
113
- @property (readwrite, nonatomic, strong) NSError *HTTPError;
114
- @property (readwrite, nonatomic, strong) NSRecursiveLock *lock;
115
- @end
116
-
117
- @implementation AFHTTPRequestOperation
118
- @synthesize HTTPError = _HTTPError;
119
- @synthesize successCallbackQueue = _successCallbackQueue;
120
- @synthesize failureCallbackQueue = _failureCallbackQueue;
121
- @dynamic lock;
122
- @dynamic request;
123
- @dynamic response;
124
-
125
- - (void)dealloc {
126
- if (_successCallbackQueue) {
127
- #if !OS_OBJECT_USE_OBJC
128
- dispatch_release(_successCallbackQueue);
129
- #endif
130
- _successCallbackQueue = NULL;
131
- }
132
-
133
- if (_failureCallbackQueue) {
134
- #if !OS_OBJECT_USE_OBJC
135
- dispatch_release(_failureCallbackQueue);
136
- #endif
137
- _failureCallbackQueue = NULL;
138
- }
139
- }
140
-
141
- - (NSError *)error {
142
- [self.lock lock];
143
- if (!self.HTTPError && self.response) {
144
- if (![self hasAcceptableStatusCode] || ![self hasAcceptableContentType]) {
145
- NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
146
- [userInfo setValue:self.responseString forKey:NSLocalizedRecoverySuggestionErrorKey];
147
- [userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
148
- [userInfo setValue:self.request forKey:AFNetworkingOperationFailingURLRequestErrorKey];
149
- [userInfo setValue:self.response forKey:AFNetworkingOperationFailingURLResponseErrorKey];
150
-
151
- if (![self hasAcceptableStatusCode]) {
152
- NSUInteger statusCode = ([self.response isKindOfClass:[NSHTTPURLResponse class]]) ? (NSUInteger)[self.response statusCode] : 200;
153
- [userInfo setValue:[NSString stringWithFormat:NSLocalizedStringFromTable(@"Expected status code in (%@), got %d", @"AFNetworking", nil), AFStringFromIndexSet([[self class] acceptableStatusCodes]), statusCode] forKey:NSLocalizedDescriptionKey];
154
- self.HTTPError = [[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorBadServerResponse userInfo:userInfo];
155
- } else if (![self hasAcceptableContentType]) {
156
- // Don't invalidate content type if there is no content
157
- if ([self.responseData length] > 0) {
158
- [userInfo setValue:[NSString stringWithFormat:NSLocalizedStringFromTable(@"Expected content type %@, got %@", @"AFNetworking", nil), [[self class] acceptableContentTypes], [self.response MIMEType]] forKey:NSLocalizedDescriptionKey];
159
- self.HTTPError = [[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo];
160
- }
161
- }
162
- }
163
- }
164
- [self.lock unlock];
165
-
166
- if (self.HTTPError) {
167
- return self.HTTPError;
168
- } else {
169
- return [super error];
170
- }
171
- }
172
-
173
- - (NSStringEncoding)responseStringEncoding {
174
- // When no explicit charset parameter is provided by the sender, media subtypes of the "text" type are defined to have a default charset value of "ISO-8859-1" when received via HTTP. Data in character sets other than "ISO-8859-1" or its subsets MUST be labeled with an appropriate charset value.
175
- // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.4.1
176
- if (self.response && !self.response.textEncodingName && self.responseData && [self.response respondsToSelector:@selector(allHeaderFields)]) {
177
- NSString *type = nil;
178
- AFGetMediaTypeAndSubtypeWithString([[self.response allHeaderFields] valueForKey:@"Content-Type"], &type, nil);
179
-
180
- if ([type isEqualToString:@"text"]) {
181
- return NSISOLatin1StringEncoding;
182
- }
183
- }
184
-
185
- return [super responseStringEncoding];
186
- }
187
-
188
- - (void)pause {
189
- unsigned long long offset = 0;
190
- if ([self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey]) {
191
- offset = [[self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey] unsignedLongLongValue];
192
- } else {
193
- offset = [[self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey] length];
194
- }
195
-
196
- NSMutableURLRequest *mutableURLRequest = [self.request mutableCopy];
197
- if ([self.response respondsToSelector:@selector(allHeaderFields)] && [[self.response allHeaderFields] valueForKey:@"ETag"]) {
198
- [mutableURLRequest setValue:[[self.response allHeaderFields] valueForKey:@"ETag"] forHTTPHeaderField:@"If-Range"];
199
- }
200
- [mutableURLRequest setValue:[NSString stringWithFormat:@"bytes=%llu-", offset] forHTTPHeaderField:@"Range"];
201
- self.request = mutableURLRequest;
202
-
203
- [super pause];
204
- }
205
-
206
- - (BOOL)hasAcceptableStatusCode {
207
- if (!self.response) {
208
- return NO;
209
- }
210
-
211
- NSUInteger statusCode = ([self.response isKindOfClass:[NSHTTPURLResponse class]]) ? (NSUInteger)[self.response statusCode] : 200;
212
- return ![[self class] acceptableStatusCodes] || [[[self class] acceptableStatusCodes] containsIndex:statusCode];
213
- }
214
-
215
- - (BOOL)hasAcceptableContentType {
216
- if (!self.response) {
217
- return NO;
218
- }
219
-
220
- // Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
221
- // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html
222
- NSString *contentType = [self.response MIMEType];
223
- if (!contentType) {
224
- contentType = @"application/octet-stream";
225
- }
226
-
227
- return ![[self class] acceptableContentTypes] || [[[self class] acceptableContentTypes] containsObject:contentType];
228
- }
229
-
230
- - (void)setSuccessCallbackQueue:(dispatch_queue_t)successCallbackQueue {
231
- if (successCallbackQueue != _successCallbackQueue) {
232
- if (_successCallbackQueue) {
233
- #if !OS_OBJECT_USE_OBJC
234
- dispatch_release(_successCallbackQueue);
235
- #endif
236
- _successCallbackQueue = NULL;
237
- }
238
-
239
- if (successCallbackQueue) {
240
- #if !OS_OBJECT_USE_OBJC
241
- dispatch_retain(successCallbackQueue);
242
- #endif
243
- _successCallbackQueue = successCallbackQueue;
244
- }
245
- }
246
- }
247
-
248
- - (void)setFailureCallbackQueue:(dispatch_queue_t)failureCallbackQueue {
249
- if (failureCallbackQueue != _failureCallbackQueue) {
250
- if (_failureCallbackQueue) {
251
- #if !OS_OBJECT_USE_OBJC
252
- dispatch_release(_failureCallbackQueue);
253
- #endif
254
- _failureCallbackQueue = NULL;
255
- }
256
-
257
- if (failureCallbackQueue) {
258
- #if !OS_OBJECT_USE_OBJC
259
- dispatch_retain(failureCallbackQueue);
260
- #endif
261
- _failureCallbackQueue = failureCallbackQueue;
262
- }
263
- }
264
- }
265
-
266
- - (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
267
- failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
268
- {
269
- // completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle.
270
- #pragma clang diagnostic push
271
- #pragma clang diagnostic ignored "-Warc-retain-cycles"
272
- #pragma clang diagnostic ignored "-Wgnu"
273
- self.completionBlock = ^{
274
- if (self.error) {
275
- if (failure) {
276
- dispatch_async(self.failureCallbackQueue ?: dispatch_get_main_queue(), ^{
277
- failure(self, self.error);
278
- });
279
- }
280
- } else {
281
- if (success) {
282
- dispatch_async(self.successCallbackQueue ?: dispatch_get_main_queue(), ^{
283
- success(self, self.responseData);
284
- });
285
- }
286
- }
287
- };
288
- #pragma clang diagnostic pop
289
- }
290
-
291
- #pragma mark - AFHTTPRequestOperation
292
-
293
- + (NSIndexSet *)acceptableStatusCodes {
294
- return [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)];
295
- }
296
-
297
- + (void)addAcceptableStatusCodes:(NSIndexSet *)statusCodes {
298
- NSMutableIndexSet *mutableStatusCodes = [[NSMutableIndexSet alloc] initWithIndexSet:[self acceptableStatusCodes]];
299
- [mutableStatusCodes addIndexes:statusCodes];
300
- AFSwizzleClassMethodWithClassAndSelectorUsingBlock([self class], @selector(acceptableStatusCodes), ^(__unused id _self) {
301
- return mutableStatusCodes;
302
- });
303
- }
304
-
305
- + (NSSet *)acceptableContentTypes {
306
- return nil;
307
- }
308
-
309
- + (void)addAcceptableContentTypes:(NSSet *)contentTypes {
310
- NSMutableSet *mutableContentTypes = [[NSMutableSet alloc] initWithSet:[self acceptableContentTypes] copyItems:YES];
311
- [mutableContentTypes unionSet:contentTypes];
312
- AFSwizzleClassMethodWithClassAndSelectorUsingBlock([self class], @selector(acceptableContentTypes), ^(__unused id _self) {
313
- return mutableContentTypes;
314
- });
315
- }
316
-
317
- + (BOOL)canProcessRequest:(NSURLRequest *)request {
318
- if ([[self class] isEqual:[AFHTTPRequestOperation class]]) {
319
- return YES;
320
- }
321
-
322
- return [[self acceptableContentTypes] intersectsSet:AFContentTypesFromHTTPHeader([request valueForHTTPHeaderField:@"Accept"])];
323
- }
324
-
325
- @end
326
-
327
- #pragma clang diagnostic pop