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,17 +0,0 @@
1
- #import "YapDatabaseViewRangeOptions.h"
2
-
3
- /**
4
- * This header file is PRIVATE, and is only to be used by the YapDatabaseView classes.
5
- **/
6
-
7
- @interface YapDatabaseViewRangeOptions ()
8
-
9
- /**
10
- * This method returns a copy with the pin value switched.
11
- *
12
- * That is, if the range was pinned to the beginning, the returned copy will be pinned to the end.
13
- * And vice versa.
14
- **/
15
- - (id)copyAndReverse;
16
-
17
- @end
@@ -1,74 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- @class YapMemoryTableTransaction;
4
-
5
-
6
- /**
7
- * A "memory table" is a dictionary that supports versioning.
8
- * There may be multiple values for a single key, with each value associated with a different snapshot.
9
- *
10
- * The memory table is accessed via a YapMemoryTableTransaction instance,
11
- * which is itself associated with a particular timestamp. Thus the transaction is able to properly identify
12
- * which version is appropriate for itself.
13
- **/
14
- @interface YapMemoryTable : NSObject
15
-
16
- /**
17
- * Initializes a memory table.
18
- *
19
- * The keyClass is used for debugging, to ensure the proper key type is always used when accessing the table.
20
- * The keyClass is used within NSAssert statements that typically get compiled out for release builds.
21
- **/
22
- - (id)initWithKeyClass:(Class)keyClass;
23
-
24
- /**
25
- * Creates and returns a new connection associated with the shared cache.
26
- **/
27
- - (YapMemoryTableTransaction *)newReadTransactionWithSnapshot:(uint64_t)snapshot;
28
- - (YapMemoryTableTransaction *)newReadWriteTransactionWithSnapshot:(uint64_t)snapshot;
29
-
30
- /**
31
- * Invoked automatically by YapDatabase architecture.
32
- **/
33
- - (void)asyncCheckpoint:(int64_t)minSnapshot;
34
-
35
- @end
36
-
37
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
38
- #pragma mark -
39
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
40
-
41
- @interface YapMemoryTableTransaction : NSObject
42
-
43
- @property (nonatomic, readonly) uint64_t snapshot;
44
- @property (nonatomic, readonly) BOOL isReadWriteTransaction;
45
-
46
- - (id)objectForKey:(id)key;
47
-
48
- - (void)enumerateKeysWithBlock:(void (^)(id key, BOOL *stop))block;
49
-
50
- - (void)enumerateKeysAndObjectsWithBlock:(void (^)(id key, id obj, BOOL *stop))block;
51
-
52
- //
53
- // For ReadWrite transactions:
54
-
55
- - (void)setObject:(id)object forKey:(id)key;
56
-
57
- - (void)removeObjectForKey:(id)key;
58
- - (void)removeObjectsForKeys:(NSArray *)keys;
59
-
60
- - (void)removeAllObjects;
61
-
62
- //
63
- // Batch access / modifications
64
-
65
- - (void)accessWithBlock:(dispatch_block_t)block;
66
- - (void)modifyWithBlock:(dispatch_block_t)block;
67
-
68
- //
69
- // Transaction state
70
-
71
- - (void)commit;
72
- - (void)rollback;
73
-
74
- @end
@@ -1,17 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- /**
4
- * There are various situations in which we need to add a placeholder to signify a nil value.
5
- * For example, we need to cache the fact that the metadata for a given key is nil.
6
- *
7
- * However, we cannot add a nil object to a dictionary.
8
- * And we cannot use NSNull, or we prevent the user from using NSNull for their own purposes.
9
- *
10
- * And thus, we replicate NSNull, and use it instead.
11
- * And now the user is free to use NSNull if needed.
12
- **/
13
- @interface YapNull : NSObject
14
-
15
- + (id)null;
16
-
17
- @end
@@ -1,15 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- /**
4
- * Singleton class to represent the "value" for a key that was touched. (i.e. value didn't change)
5
- *
6
- * YapDatabase stores changesets in dictionaries, where the object represents the updated value for a key.
7
- * When an item is touched, we use this singleton as the value to signify internally that the item didn't change.
8
- * This allows us to act as if the item did change in most all respects,
9
- * but internally won't cause us to flush the item from the caches.
10
- **/
11
- @interface YapTouch : NSObject
12
-
13
- + (id)touch;
14
-
15
- @end
@@ -1,17 +0,0 @@
1
- #ifdef __OBJC__
2
- #import <UIKit/UIKit.h>
3
- #endif
4
-
5
- #import "Pods-environment.h"
6
- #import <Availability.h>
7
-
8
- #if __IPHONE_OS_VERSION_MIN_REQUIRED
9
- #import <SystemConfiguration/SystemConfiguration.h>
10
- #import <MobileCoreServices/MobileCoreServices.h>
11
- #import <Security/Security.h>
12
- #else
13
- #import <SystemConfiguration/SystemConfiguration.h>
14
- #import <CoreServices/CoreServices.h>
15
- #import <Security/Security.h>
16
- #endif
17
-
@@ -1,5 +0,0 @@
1
- #ifdef __OBJC__
2
- #import <UIKit/UIKit.h>
3
- #endif
4
-
5
- #import "Pods-environment.h"
@@ -1,5 +0,0 @@
1
- #include "Pods-AFNetworking.xcconfig"
2
- GCC_PREPROCESSOR_DEFINITIONS = COCOAPODS=1
3
- HEADER_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/AFNetworking" "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/AFNetworking" "${PODS_ROOT}/Headers/CocoaLumberjack" "${PODS_ROOT}/Headers/NSData+MD5Digest" "${PODS_ROOT}/Headers/Reachability" "${PODS_ROOT}/Headers/YapDatabase"
4
- OTHER_LDFLAGS = -ObjC ${PODS_AFNETWORKING_OTHER_LDFLAGS}
5
- PODS_ROOT = ${SRCROOT}
@@ -1,5 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- @interface PodsDummy_Pods_AFNetworking : NSObject
3
- @end
4
- @implementation PodsDummy_Pods_AFNetworking
5
- @end
@@ -1,17 +0,0 @@
1
- #ifdef __OBJC__
2
- #import <UIKit/UIKit.h>
3
- #endif
4
-
5
- #import "Pods-environment.h"
6
- #import <Availability.h>
7
-
8
- #if __IPHONE_OS_VERSION_MIN_REQUIRED
9
- #import <SystemConfiguration/SystemConfiguration.h>
10
- #import <MobileCoreServices/MobileCoreServices.h>
11
- #import <Security/Security.h>
12
- #else
13
- #import <SystemConfiguration/SystemConfiguration.h>
14
- #import <CoreServices/CoreServices.h>
15
- #import <Security/Security.h>
16
- #endif
17
-
@@ -1 +0,0 @@
1
- PODS_AFNETWORKING_OTHER_LDFLAGS = -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration
@@ -1,5 +0,0 @@
1
- #include "Pods-Reachability.xcconfig"
2
- GCC_PREPROCESSOR_DEFINITIONS = COCOAPODS=1
3
- HEADER_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/Reachability" "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/AFNetworking" "${PODS_ROOT}/Headers/CocoaLumberjack" "${PODS_ROOT}/Headers/NSData+MD5Digest" "${PODS_ROOT}/Headers/Reachability" "${PODS_ROOT}/Headers/YapDatabase"
4
- OTHER_LDFLAGS = -ObjC ${PODS_REACHABILITY_OTHER_LDFLAGS}
5
- PODS_ROOT = ${SRCROOT}
@@ -1,5 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- @interface PodsDummy_Pods_Reachability : NSObject
3
- @end
4
- @implementation PodsDummy_Pods_Reachability
5
- @end
@@ -1,5 +0,0 @@
1
- #ifdef __OBJC__
2
- #import <UIKit/UIKit.h>
3
- #endif
4
-
5
- #import "Pods-environment.h"
@@ -1 +0,0 @@
1
- PODS_REACHABILITY_OTHER_LDFLAGS = -framework SystemConfiguration
@@ -1,24 +0,0 @@
1
- Copyright (c) 2011-2013, Tony Million.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
-
7
- 1. Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
-
10
- 2. Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
13
-
14
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
- POSSIBILITY OF SUCH DAMAGE.
@@ -1,65 +0,0 @@
1
- # Reachability
2
-
3
- This is a drop-in replacement for Apple's `Reachability` class. It is ARC-compatible, and it uses the new GCD methods to notify of network interface changes.
4
-
5
- In addition to the standard `NSNotification`, it supports the use of blocks for when the network becomes reachable and unreachable.
6
-
7
- Finally, you can specify whether a WWAN connection is considered "reachable".
8
-
9
- ## Requirements
10
-
11
- Once you have added the `.h/m` files to your project, simply:
12
-
13
- * Go to the `Project->TARGETS->Build Phases->Link Binary With Libraries`.
14
- * Press the plus in the lower left of the list.
15
- * Add `SystemConfiguration.framework`.
16
-
17
- Boom, you're done.
18
-
19
- ## Examples
20
-
21
- ### Block Example
22
-
23
- This sample uses blocks to notify when the interface state has changed. The blocks will be called on a **BACKGROUND THREAD**, so you need to dispatch UI updates onto the main thread.
24
-
25
- // Allocate a reachability object
26
- Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];
27
-
28
- // Set the blocks
29
- reach.reachableBlock = ^(Reachability*reach)
30
- {
31
- NSLog(@"REACHABLE!");
32
- };
33
-
34
- reach.unreachableBlock = ^(Reachability*reach)
35
- {
36
- NSLog(@"UNREACHABLE!");
37
- };
38
-
39
- // Start the notifier, which will cause the reachability object to retain itself!
40
- [reach startNotifier];
41
-
42
- ### `NSNotification` Example
43
-
44
- This sample will use `NSNotification`s to notify when the interface has changed. They will be delivered on the **MAIN THREAD**, so you *can* do UI updates from within the function.
45
-
46
- In addition, it asks the `Reachability` object to consider the WWAN (3G/EDGE/CDMA) as a non-reachable connection (you might use this if you are writing a video streaming app, for example, to save the user's data plan).
47
-
48
- // Allocate a reachability object
49
- Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];
50
-
51
- // Tell the reachability that we DON'T want to be reachable on 3G/EDGE/CDMA
52
- reach.reachableOnWWAN = NO;
53
-
54
- // Here we set up a NSNotification observer. The Reachability that caused the notification
55
- // is passed in the object parameter
56
- [[NSNotificationCenter defaultCenter] addObserver:self
57
- selector:@selector(reachabilityChanged:)
58
- name:kReachabilityChangedNotification
59
- object:nil];
60
-
61
- [reach startNotifier]
62
-
63
- ## Tell the world
64
-
65
- Head over to [Projects using Reachability](https://github.com/tonymillion/Reachability/wiki/Projects-using-Reachability) and add your project for "Maximum Wins!".
@@ -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,527 +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 "Reachability.h"
29
-
30
-
31
- NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification";
32
-
33
- @interface Reachability ()
34
-
35
- @property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef;
36
-
37
-
38
- #if NEEDS_DISPATCH_RETAIN_RELEASE
39
- @property (nonatomic, assign) dispatch_queue_t reachabilitySerialQueue;
40
- #else
41
- @property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue;
42
- #endif
43
-
44
-
45
- @property (nonatomic, strong) id reachabilityObject;
46
-
47
- -(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags;
48
- -(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags;
49
-
50
- @end
51
-
52
- static NSString *reachabilityFlags(SCNetworkReachabilityFlags flags)
53
- {
54
- return [NSString stringWithFormat:@"%c%c %c%c%c%c%c%c%c",
55
- #if TARGET_OS_IPHONE
56
- (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-',
57
- #else
58
- 'X',
59
- #endif
60
- (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-',
61
- (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-',
62
- (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-',
63
- (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-',
64
- (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-',
65
- (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-',
66
- (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-',
67
- (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-'];
68
- }
69
-
70
- // Start listening for reachability notifications on the current run loop
71
- static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
72
- {
73
- #pragma unused (target)
74
- #if __has_feature(objc_arc)
75
- Reachability *reachability = ((__bridge Reachability*)info);
76
- #else
77
- Reachability *reachability = ((Reachability*)info);
78
- #endif
79
-
80
- // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool,
81
- // but what the heck eh?
82
- @autoreleasepool
83
- {
84
- [reachability reachabilityChanged:flags];
85
- }
86
- }
87
-
88
-
89
- @implementation Reachability
90
-
91
- @synthesize reachabilityRef;
92
- @synthesize reachabilitySerialQueue;
93
-
94
- @synthesize reachableOnWWAN;
95
-
96
- @synthesize reachableBlock;
97
- @synthesize unreachableBlock;
98
-
99
- @synthesize reachabilityObject;
100
-
101
- #pragma mark - Class Constructor Methods
102
-
103
- +(Reachability*)reachabilityWithHostName:(NSString*)hostname
104
- {
105
- return [Reachability reachabilityWithHostname:hostname];
106
- }
107
-
108
- +(Reachability*)reachabilityWithHostname:(NSString*)hostname
109
- {
110
- SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]);
111
- if (ref)
112
- {
113
- id reachability = [[self alloc] initWithReachabilityRef:ref];
114
-
115
- #if __has_feature(objc_arc)
116
- return reachability;
117
- #else
118
- return [reachability autorelease];
119
- #endif
120
-
121
- }
122
-
123
- return nil;
124
- }
125
-
126
- +(Reachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress
127
- {
128
- SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress);
129
- if (ref)
130
- {
131
- id reachability = [[self alloc] initWithReachabilityRef:ref];
132
-
133
- #if __has_feature(objc_arc)
134
- return reachability;
135
- #else
136
- return [reachability autorelease];
137
- #endif
138
- }
139
-
140
- return nil;
141
- }
142
-
143
- +(Reachability *)reachabilityForInternetConnection
144
- {
145
- struct sockaddr_in zeroAddress;
146
- bzero(&zeroAddress, sizeof(zeroAddress));
147
- zeroAddress.sin_len = sizeof(zeroAddress);
148
- zeroAddress.sin_family = AF_INET;
149
-
150
- return [self reachabilityWithAddress:&zeroAddress];
151
- }
152
-
153
- +(Reachability*)reachabilityForLocalWiFi
154
- {
155
- struct sockaddr_in localWifiAddress;
156
- bzero(&localWifiAddress, sizeof(localWifiAddress));
157
- localWifiAddress.sin_len = sizeof(localWifiAddress);
158
- localWifiAddress.sin_family = AF_INET;
159
- // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0
160
- localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);
161
-
162
- return [self reachabilityWithAddress:&localWifiAddress];
163
- }
164
-
165
-
166
- // Initialization methods
167
-
168
- -(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref
169
- {
170
- self = [super init];
171
- if (self != nil)
172
- {
173
- self.reachableOnWWAN = YES;
174
- self.reachabilityRef = ref;
175
- }
176
-
177
- return self;
178
- }
179
-
180
- -(void)dealloc
181
- {
182
- [self stopNotifier];
183
-
184
- if(self.reachabilityRef)
185
- {
186
- CFRelease(self.reachabilityRef);
187
- self.reachabilityRef = nil;
188
- }
189
-
190
- self.reachableBlock = nil;
191
- self.unreachableBlock = nil;
192
-
193
- #if !(__has_feature(objc_arc))
194
- [super dealloc];
195
- #endif
196
-
197
-
198
- }
199
-
200
- #pragma mark - Notifier Methods
201
-
202
- // Notifier
203
- // NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD
204
- // - In other words DO NOT DO ANY UI UPDATES IN THE BLOCKS.
205
- // INSTEAD USE dispatch_async(dispatch_get_main_queue(), ^{UISTUFF}) (or dispatch_sync if you want)
206
-
207
- -(BOOL)startNotifier
208
- {
209
- SCNetworkReachabilityContext context = { 0, NULL, NULL, NULL, NULL };
210
-
211
- // this should do a retain on ourself, so as long as we're in notifier mode we shouldn't disappear out from under ourselves
212
- // woah
213
- self.reachabilityObject = self;
214
-
215
-
216
-
217
- // First, we need to create a serial queue.
218
- // We allocate this once for the lifetime of the notifier.
219
- self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL);
220
- if(!self.reachabilitySerialQueue)
221
- {
222
- return NO;
223
- }
224
-
225
- #if __has_feature(objc_arc)
226
- context.info = (__bridge void *)self;
227
- #else
228
- context.info = (void *)self;
229
- #endif
230
-
231
- if (!SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context))
232
- {
233
- #ifdef DEBUG
234
- NSLog(@"SCNetworkReachabilitySetCallback() failed: %s", SCErrorString(SCError()));
235
- #endif
236
-
237
- // Clear out the dispatch queue
238
- if(self.reachabilitySerialQueue)
239
- {
240
- #if NEEDS_DISPATCH_RETAIN_RELEASE
241
- dispatch_release(self.reachabilitySerialQueue);
242
- #endif
243
- self.reachabilitySerialQueue = nil;
244
- }
245
-
246
- self.reachabilityObject = nil;
247
-
248
- return NO;
249
- }
250
-
251
- // Set it as our reachability queue, which will retain the queue
252
- if(!SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue))
253
- {
254
- #ifdef DEBUG
255
- NSLog(@"SCNetworkReachabilitySetDispatchQueue() failed: %s", SCErrorString(SCError()));
256
- #endif
257
-
258
- // UH OH - FAILURE!
259
-
260
- // First stop, any callbacks!
261
- SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL);
262
-
263
- // Then clear out the dispatch queue.
264
- if(self.reachabilitySerialQueue)
265
- {
266
- #if NEEDS_DISPATCH_RETAIN_RELEASE
267
- dispatch_release(self.reachabilitySerialQueue);
268
- #endif
269
- self.reachabilitySerialQueue = nil;
270
- }
271
-
272
- self.reachabilityObject = nil;
273
-
274
- return NO;
275
- }
276
-
277
- return YES;
278
- }
279
-
280
- -(void)stopNotifier
281
- {
282
- // First stop, any callbacks!
283
- SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL);
284
-
285
- // Unregister target from the GCD serial dispatch queue.
286
- SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, NULL);
287
-
288
- if(self.reachabilitySerialQueue)
289
- {
290
- #if NEEDS_DISPATCH_RETAIN_RELEASE
291
- dispatch_release(self.reachabilitySerialQueue);
292
- #endif
293
- self.reachabilitySerialQueue = nil;
294
- }
295
-
296
- self.reachabilityObject = nil;
297
- }
298
-
299
- #pragma mark - reachability tests
300
-
301
- // This is for the case where you flick the airplane mode;
302
- // you end up getting something like this:
303
- //Reachability: WR ct-----
304
- //Reachability: -- -------
305
- //Reachability: WR ct-----
306
- //Reachability: -- -------
307
- // We treat this as 4 UNREACHABLE triggers - really apple should do better than this
308
-
309
- #define testcase (kSCNetworkReachabilityFlagsConnectionRequired | kSCNetworkReachabilityFlagsTransientConnection)
310
-
311
- -(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags
312
- {
313
- BOOL connectionUP = YES;
314
-
315
- if(!(flags & kSCNetworkReachabilityFlagsReachable))
316
- connectionUP = NO;
317
-
318
- if( (flags & testcase) == testcase )
319
- connectionUP = NO;
320
-
321
- #if TARGET_OS_IPHONE
322
- if(flags & kSCNetworkReachabilityFlagsIsWWAN)
323
- {
324
- // We're on 3G.
325
- if(!self.reachableOnWWAN)
326
- {
327
- // We don't want to connect when on 3G.
328
- connectionUP = NO;
329
- }
330
- }
331
- #endif
332
-
333
- return connectionUP;
334
- }
335
-
336
- -(BOOL)isReachable
337
- {
338
- SCNetworkReachabilityFlags flags;
339
-
340
- if(!SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags))
341
- return NO;
342
-
343
- return [self isReachableWithFlags:flags];
344
- }
345
-
346
- -(BOOL)isReachableViaWWAN
347
- {
348
- #if TARGET_OS_IPHONE
349
-
350
- SCNetworkReachabilityFlags flags = 0;
351
-
352
- if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
353
- {
354
- // Check we're REACHABLE
355
- if(flags & kSCNetworkReachabilityFlagsReachable)
356
- {
357
- // Now, check we're on WWAN
358
- if(flags & kSCNetworkReachabilityFlagsIsWWAN)
359
- {
360
- return YES;
361
- }
362
- }
363
- }
364
- #endif
365
-
366
- return NO;
367
- }
368
-
369
- -(BOOL)isReachableViaWiFi
370
- {
371
- SCNetworkReachabilityFlags flags = 0;
372
-
373
- if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
374
- {
375
- // Check we're reachable
376
- if((flags & kSCNetworkReachabilityFlagsReachable))
377
- {
378
- #if TARGET_OS_IPHONE
379
- // Check we're NOT on WWAN
380
- if((flags & kSCNetworkReachabilityFlagsIsWWAN))
381
- {
382
- return NO;
383
- }
384
- #endif
385
- return YES;
386
- }
387
- }
388
-
389
- return NO;
390
- }
391
-
392
-
393
- // WWAN may be available, but not active until a connection has been established.
394
- // WiFi may require a connection for VPN on Demand.
395
- -(BOOL)isConnectionRequired
396
- {
397
- return [self connectionRequired];
398
- }
399
-
400
- -(BOOL)connectionRequired
401
- {
402
- SCNetworkReachabilityFlags flags;
403
-
404
- if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
405
- {
406
- return (flags & kSCNetworkReachabilityFlagsConnectionRequired);
407
- }
408
-
409
- return NO;
410
- }
411
-
412
- // Dynamic, on demand connection?
413
- -(BOOL)isConnectionOnDemand
414
- {
415
- SCNetworkReachabilityFlags flags;
416
-
417
- if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
418
- {
419
- return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) &&
420
- (flags & (kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand)));
421
- }
422
-
423
- return NO;
424
- }
425
-
426
- // Is user intervention required?
427
- -(BOOL)isInterventionRequired
428
- {
429
- SCNetworkReachabilityFlags flags;
430
-
431
- if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
432
- {
433
- return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) &&
434
- (flags & kSCNetworkReachabilityFlagsInterventionRequired));
435
- }
436
-
437
- return NO;
438
- }
439
-
440
-
441
- #pragma mark - reachability status stuff
442
-
443
- -(NetworkStatus)currentReachabilityStatus
444
- {
445
- if([self isReachable])
446
- {
447
- if([self isReachableViaWiFi])
448
- return ReachableViaWiFi;
449
-
450
- #if TARGET_OS_IPHONE
451
- return ReachableViaWWAN;
452
- #endif
453
- }
454
-
455
- return NotReachable;
456
- }
457
-
458
- -(SCNetworkReachabilityFlags)reachabilityFlags
459
- {
460
- SCNetworkReachabilityFlags flags = 0;
461
-
462
- if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
463
- {
464
- return flags;
465
- }
466
-
467
- return 0;
468
- }
469
-
470
- -(NSString*)currentReachabilityString
471
- {
472
- NetworkStatus temp = [self currentReachabilityStatus];
473
-
474
- if(temp == reachableOnWWAN)
475
- {
476
- // Updated for the fact that we have CDMA phones now!
477
- return NSLocalizedString(@"Cellular", @"");
478
- }
479
- if (temp == ReachableViaWiFi)
480
- {
481
- return NSLocalizedString(@"WiFi", @"");
482
- }
483
-
484
- return NSLocalizedString(@"No Connection", @"");
485
- }
486
-
487
- -(NSString*)currentReachabilityFlags
488
- {
489
- return reachabilityFlags([self reachabilityFlags]);
490
- }
491
-
492
- #pragma mark - Callback function calls this method
493
-
494
- -(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags
495
- {
496
- if([self isReachableWithFlags:flags])
497
- {
498
- if(self.reachableBlock)
499
- {
500
- self.reachableBlock(self);
501
- }
502
- }
503
- else
504
- {
505
- if(self.unreachableBlock)
506
- {
507
- self.unreachableBlock(self);
508
- }
509
- }
510
-
511
- // this makes sure the change notification happens on the MAIN THREAD
512
- dispatch_async(dispatch_get_main_queue(), ^{
513
- [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification
514
- object:self];
515
- });
516
- }
517
-
518
- #pragma mark - Debug Description
519
-
520
- - (NSString *) description;
521
- {
522
- NSString *description = [NSString stringWithFormat:@"<%@: %#x>",
523
- NSStringFromClass([self class]), (unsigned int) self];
524
- return description;
525
- }
526
-
527
- @end