sprokovuln 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (578) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +6 -0
  4. data/Gemfile.lock +26 -0
  5. data/README.md +35 -0
  6. data/Rakefile +2 -0
  7. data/bin/console +14 -0
  8. data/bin/setup +8 -0
  9. data/lib/sprokovuln/version.rb +3 -0
  10. data/lib/sprokovuln.rb +5 -0
  11. data/sprokovuln.gemspec +26 -0
  12. data/vendor/ruby/bin/rackup +27 -0
  13. data/vendor/ruby/bin/rake +27 -0
  14. data/vendor/ruby/bin/sprockets +27 -0
  15. data/vendor/ruby/cache/concurrent-ruby-1.0.5.gem +0 -0
  16. data/vendor/ruby/cache/rack-2.0.5.gem +0 -0
  17. data/vendor/ruby/cache/rake-10.5.0.gem +0 -0
  18. data/vendor/ruby/cache/sprockets-3.7.1.gem +0 -0
  19. data/vendor/ruby/gems/concurrent-ruby-1.0.5/CHANGELOG.md +387 -0
  20. data/vendor/ruby/gems/concurrent-ruby-1.0.5/LICENSE.txt +21 -0
  21. data/vendor/ruby/gems/concurrent-ruby-1.0.5/README.md +247 -0
  22. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/agent.rb +587 -0
  23. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb +39 -0
  24. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/async.rb +445 -0
  25. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atom.rb +222 -0
  26. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/abstract_thread_local_var.rb +66 -0
  27. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/atomic_boolean.rb +122 -0
  28. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/atomic_fixnum.rb +139 -0
  29. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/atomic_reference.rb +51 -0
  30. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/count_down_latch.rb +100 -0
  31. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/cyclic_barrier.rb +128 -0
  32. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/event.rb +109 -0
  33. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/java_count_down_latch.rb +39 -0
  34. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/java_thread_local_var.rb +37 -0
  35. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/mutex_atomic_boolean.rb +60 -0
  36. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/mutex_atomic_fixnum.rb +75 -0
  37. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/mutex_count_down_latch.rb +43 -0
  38. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/mutex_semaphore.rb +115 -0
  39. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/read_write_lock.rb +253 -0
  40. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/reentrant_read_write_lock.rb +377 -0
  41. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb +161 -0
  42. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/semaphore.rb +145 -0
  43. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/thread_local_var.rb +104 -0
  44. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/concurrent_update_error.rb +8 -0
  45. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/direct_update.rb +81 -0
  46. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/jruby+truffle.rb +2 -0
  47. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/jruby.rb +16 -0
  48. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/mutex_atomic.rb +61 -0
  49. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/numeric_cas_wrapper.rb +28 -0
  50. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/rbx.rb +22 -0
  51. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/ruby.rb +32 -0
  52. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomics.rb +53 -0
  53. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/copy_on_notify_observer_set.rb +107 -0
  54. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/copy_on_write_observer_set.rb +111 -0
  55. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/java_non_concurrent_priority_queue.rb +84 -0
  56. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/map/atomic_reference_map_backend.rb +927 -0
  57. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/map/mri_map_backend.rb +66 -0
  58. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/map/non_concurrent_map_backend.rb +141 -0
  59. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/map/synchronized_map_backend.rb +82 -0
  60. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/non_concurrent_priority_queue.rb +143 -0
  61. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/ruby_non_concurrent_priority_queue.rb +150 -0
  62. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/deprecation.rb +34 -0
  63. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/dereferenceable.rb +73 -0
  64. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb +27 -0
  65. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/obligation.rb +220 -0
  66. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/observable.rb +110 -0
  67. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/configuration.rb +188 -0
  68. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/constants.rb +8 -0
  69. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/dataflow.rb +80 -0
  70. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/delay.rb +197 -0
  71. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/edge.rb +26 -0
  72. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/errors.rb +69 -0
  73. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/exchanger.rb +356 -0
  74. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/abstract_executor_service.rb +134 -0
  75. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/cached_thread_pool.rb +62 -0
  76. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/executor_service.rb +185 -0
  77. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/fixed_thread_pool.rb +206 -0
  78. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/immediate_executor.rb +66 -0
  79. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/indirect_immediate_executor.rb +44 -0
  80. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/java_executor_service.rb +100 -0
  81. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/java_single_thread_executor.rb +29 -0
  82. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/java_thread_pool_executor.rb +120 -0
  83. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_executor_service.rb +78 -0
  84. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_single_thread_executor.rb +22 -0
  85. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb +362 -0
  86. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb +35 -0
  87. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/serial_executor_service.rb +34 -0
  88. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/serialized_execution.rb +107 -0
  89. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/serialized_execution_delegator.rb +28 -0
  90. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/simple_executor_service.rb +100 -0
  91. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/single_thread_executor.rb +56 -0
  92. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/thread_pool_executor.rb +87 -0
  93. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/timer_set.rb +175 -0
  94. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executors.rb +20 -0
  95. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/future.rb +138 -0
  96. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/hash.rb +36 -0
  97. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/immutable_struct.rb +93 -0
  98. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/ivar.rb +208 -0
  99. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/lazy_register.rb +81 -0
  100. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/map.rb +240 -0
  101. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/maybe.rb +229 -0
  102. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/mutable_struct.rb +228 -0
  103. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/mvar.rb +242 -0
  104. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/options.rb +42 -0
  105. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/promise.rb +547 -0
  106. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/scheduled_task.rb +318 -0
  107. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/settable_struct.rb +128 -0
  108. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/abstract_lockable_object.rb +98 -0
  109. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/abstract_object.rb +24 -0
  110. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/abstract_struct.rb +157 -0
  111. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/condition.rb +58 -0
  112. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/jruby_lockable_object.rb +13 -0
  113. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/jruby_object.rb +44 -0
  114. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/lock.rb +34 -0
  115. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/lockable_object.rb +74 -0
  116. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb +71 -0
  117. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_object.rb +43 -0
  118. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/object.rb +153 -0
  119. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/rbx_lockable_object.rb +65 -0
  120. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/rbx_object.rb +48 -0
  121. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/truffle_lockable_object.rb +9 -0
  122. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/truffle_object.rb +31 -0
  123. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/volatile.rb +34 -0
  124. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization.rb +31 -0
  125. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/synchronized_delegator.rb +50 -0
  126. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/adder.rb +74 -0
  127. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb +30 -0
  128. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/cheap_lockable.rb +118 -0
  129. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/power_of_two_tuple.rb +38 -0
  130. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/striped64.rb +241 -0
  131. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/volatile.rb +75 -0
  132. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/xor_shift_random.rb +50 -0
  133. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util.rb +16 -0
  134. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/timer_task.rb +331 -0
  135. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/tuple.rb +86 -0
  136. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/tvar.rb +258 -0
  137. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/at_exit.rb +97 -0
  138. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/engine.rb +56 -0
  139. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/monotonic_time.rb +58 -0
  140. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/native_extension_loader.rb +73 -0
  141. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/native_integer.rb +53 -0
  142. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/processor_counter.rb +160 -0
  143. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/version.rb +4 -0
  144. data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent.rb +130 -0
  145. data/vendor/ruby/gems/rack-2.0.5/COPYING +18 -0
  146. data/vendor/ruby/gems/rack-2.0.5/HISTORY.md +505 -0
  147. data/vendor/ruby/gems/rack-2.0.5/README.rdoc +302 -0
  148. data/vendor/ruby/gems/rack-2.0.5/Rakefile +116 -0
  149. data/vendor/ruby/gems/rack-2.0.5/SPEC +263 -0
  150. data/vendor/ruby/gems/rack-2.0.5/bin/rackup +4 -0
  151. data/vendor/ruby/gems/rack-2.0.5/contrib/rack.png +0 -0
  152. data/vendor/ruby/gems/rack-2.0.5/contrib/rack.svg +150 -0
  153. data/vendor/ruby/gems/rack-2.0.5/contrib/rack_logo.svg +164 -0
  154. data/vendor/ruby/gems/rack-2.0.5/contrib/rdoc.css +412 -0
  155. data/vendor/ruby/gems/rack-2.0.5/example/lobster.ru +4 -0
  156. data/vendor/ruby/gems/rack-2.0.5/example/protectedlobster.rb +14 -0
  157. data/vendor/ruby/gems/rack-2.0.5/example/protectedlobster.ru +8 -0
  158. data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/abstract/handler.rb +37 -0
  159. data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/abstract/request.rb +47 -0
  160. data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/basic.rb +58 -0
  161. data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/digest/md5.rb +129 -0
  162. data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/digest/nonce.rb +51 -0
  163. data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/digest/params.rb +52 -0
  164. data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/digest/request.rb +41 -0
  165. data/vendor/ruby/gems/rack-2.0.5/lib/rack/body_proxy.rb +44 -0
  166. data/vendor/ruby/gems/rack-2.0.5/lib/rack/builder.rb +164 -0
  167. data/vendor/ruby/gems/rack-2.0.5/lib/rack/cascade.rb +52 -0
  168. data/vendor/ruby/gems/rack-2.0.5/lib/rack/chunked.rb +69 -0
  169. data/vendor/ruby/gems/rack-2.0.5/lib/rack/common_logger.rb +72 -0
  170. data/vendor/ruby/gems/rack-2.0.5/lib/rack/conditional_get.rb +79 -0
  171. data/vendor/ruby/gems/rack-2.0.5/lib/rack/config.rb +20 -0
  172. data/vendor/ruby/gems/rack-2.0.5/lib/rack/content_length.rb +37 -0
  173. data/vendor/ruby/gems/rack-2.0.5/lib/rack/content_type.rb +29 -0
  174. data/vendor/ruby/gems/rack-2.0.5/lib/rack/deflater.rb +119 -0
  175. data/vendor/ruby/gems/rack-2.0.5/lib/rack/directory.rb +179 -0
  176. data/vendor/ruby/gems/rack-2.0.5/lib/rack/etag.rb +74 -0
  177. data/vendor/ruby/gems/rack-2.0.5/lib/rack/events.rb +154 -0
  178. data/vendor/ruby/gems/rack-2.0.5/lib/rack/file.rb +176 -0
  179. data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/cgi.rb +60 -0
  180. data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/fastcgi.rb +100 -0
  181. data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/lsws.rb +61 -0
  182. data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/scgi.rb +70 -0
  183. data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/thin.rb +36 -0
  184. data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/webrick.rb +120 -0
  185. data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler.rb +99 -0
  186. data/vendor/ruby/gems/rack-2.0.5/lib/rack/head.rb +25 -0
  187. data/vendor/ruby/gems/rack-2.0.5/lib/rack/lint.rb +760 -0
  188. data/vendor/ruby/gems/rack-2.0.5/lib/rack/lobster.rb +70 -0
  189. data/vendor/ruby/gems/rack-2.0.5/lib/rack/lock.rb +31 -0
  190. data/vendor/ruby/gems/rack-2.0.5/lib/rack/logger.rb +18 -0
  191. data/vendor/ruby/gems/rack-2.0.5/lib/rack/media_type.rb +38 -0
  192. data/vendor/ruby/gems/rack-2.0.5/lib/rack/method_override.rb +50 -0
  193. data/vendor/ruby/gems/rack-2.0.5/lib/rack/mime.rb +677 -0
  194. data/vendor/ruby/gems/rack-2.0.5/lib/rack/mock.rb +196 -0
  195. data/vendor/ruby/gems/rack-2.0.5/lib/rack/multipart/generator.rb +93 -0
  196. data/vendor/ruby/gems/rack-2.0.5/lib/rack/multipart/parser.rb +369 -0
  197. data/vendor/ruby/gems/rack-2.0.5/lib/rack/multipart/uploaded_file.rb +33 -0
  198. data/vendor/ruby/gems/rack-2.0.5/lib/rack/multipart.rb +63 -0
  199. data/vendor/ruby/gems/rack-2.0.5/lib/rack/null_logger.rb +37 -0
  200. data/vendor/ruby/gems/rack-2.0.5/lib/rack/query_parser.rb +192 -0
  201. data/vendor/ruby/gems/rack-2.0.5/lib/rack/recursive.rb +62 -0
  202. data/vendor/ruby/gems/rack-2.0.5/lib/rack/reloader.rb +110 -0
  203. data/vendor/ruby/gems/rack-2.0.5/lib/rack/request.rb +487 -0
  204. data/vendor/ruby/gems/rack-2.0.5/lib/rack/response.rb +235 -0
  205. data/vendor/ruby/gems/rack-2.0.5/lib/rack/rewindable_input.rb +93 -0
  206. data/vendor/ruby/gems/rack-2.0.5/lib/rack/runtime.rb +32 -0
  207. data/vendor/ruby/gems/rack-2.0.5/lib/rack/sendfile.rb +158 -0
  208. data/vendor/ruby/gems/rack-2.0.5/lib/rack/server.rb +395 -0
  209. data/vendor/ruby/gems/rack-2.0.5/lib/rack/session/abstract/id.rb +445 -0
  210. data/vendor/ruby/gems/rack-2.0.5/lib/rack/session/cookie.rb +195 -0
  211. data/vendor/ruby/gems/rack-2.0.5/lib/rack/session/memcache.rb +93 -0
  212. data/vendor/ruby/gems/rack-2.0.5/lib/rack/session/pool.rb +76 -0
  213. data/vendor/ruby/gems/rack-2.0.5/lib/rack/show_exceptions.rb +386 -0
  214. data/vendor/ruby/gems/rack-2.0.5/lib/rack/show_status.rb +113 -0
  215. data/vendor/ruby/gems/rack-2.0.5/lib/rack/static.rb +175 -0
  216. data/vendor/ruby/gems/rack-2.0.5/lib/rack/tempfile_reaper.rb +22 -0
  217. data/vendor/ruby/gems/rack-2.0.5/lib/rack/urlmap.rb +91 -0
  218. data/vendor/ruby/gems/rack-2.0.5/lib/rack/utils.rb +620 -0
  219. data/vendor/ruby/gems/rack-2.0.5/lib/rack.rb +147 -0
  220. data/vendor/ruby/gems/rack-2.0.5/rack.gemspec +34 -0
  221. data/vendor/ruby/gems/rack-2.0.5/test/builder/an_underscore_app.rb +5 -0
  222. data/vendor/ruby/gems/rack-2.0.5/test/builder/anything.rb +5 -0
  223. data/vendor/ruby/gems/rack-2.0.5/test/builder/comment.ru +4 -0
  224. data/vendor/ruby/gems/rack-2.0.5/test/builder/end.ru +5 -0
  225. data/vendor/ruby/gems/rack-2.0.5/test/builder/line.ru +1 -0
  226. data/vendor/ruby/gems/rack-2.0.5/test/builder/options.ru +2 -0
  227. data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/folder/test.js +1 -0
  228. data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/fonts/font.eot +1 -0
  229. data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/images/image.png +1 -0
  230. data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/index.html +1 -0
  231. data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/javascripts/app.js +1 -0
  232. data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/stylesheets/app.css +1 -0
  233. data/vendor/ruby/gems/rack-2.0.5/test/cgi/lighttpd.conf +26 -0
  234. data/vendor/ruby/gems/rack-2.0.5/test/cgi/rackup_stub.rb +6 -0
  235. data/vendor/ruby/gems/rack-2.0.5/test/cgi/sample_rackup.ru +5 -0
  236. data/vendor/ruby/gems/rack-2.0.5/test/cgi/test +9 -0
  237. data/vendor/ruby/gems/rack-2.0.5/test/cgi/test+directory/test+file +1 -0
  238. data/vendor/ruby/gems/rack-2.0.5/test/cgi/test.fcgi +9 -0
  239. data/vendor/ruby/gems/rack-2.0.5/test/cgi/test.gz +0 -0
  240. data/vendor/ruby/gems/rack-2.0.5/test/cgi/test.ru +5 -0
  241. data/vendor/ruby/gems/rack-2.0.5/test/gemloader.rb +10 -0
  242. data/vendor/ruby/gems/rack-2.0.5/test/helper.rb +34 -0
  243. data/vendor/ruby/gems/rack-2.0.5/test/multipart/bad_robots +259 -0
  244. data/vendor/ruby/gems/rack-2.0.5/test/multipart/binary +0 -0
  245. data/vendor/ruby/gems/rack-2.0.5/test/multipart/content_type_and_no_filename +6 -0
  246. data/vendor/ruby/gems/rack-2.0.5/test/multipart/empty +10 -0
  247. data/vendor/ruby/gems/rack-2.0.5/test/multipart/fail_16384_nofile +814 -0
  248. data/vendor/ruby/gems/rack-2.0.5/test/multipart/file1.txt +1 -0
  249. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_and_modification_param +7 -0
  250. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_and_no_name +6 -0
  251. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_encoded_words +7 -0
  252. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_escaped_quotes +6 -0
  253. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_escaped_quotes_and_modification_param +7 -0
  254. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_null_byte +7 -0
  255. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_percent_escaped_quotes +6 -0
  256. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_single_quote +7 -0
  257. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_unescaped_percentages +6 -0
  258. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_unescaped_percentages2 +6 -0
  259. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_unescaped_percentages3 +6 -0
  260. data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_unescaped_quotes +6 -0
  261. data/vendor/ruby/gems/rack-2.0.5/test/multipart/ie +6 -0
  262. data/vendor/ruby/gems/rack-2.0.5/test/multipart/invalid_character +6 -0
  263. data/vendor/ruby/gems/rack-2.0.5/test/multipart/mixed_files +21 -0
  264. data/vendor/ruby/gems/rack-2.0.5/test/multipart/nested +10 -0
  265. data/vendor/ruby/gems/rack-2.0.5/test/multipart/none +9 -0
  266. data/vendor/ruby/gems/rack-2.0.5/test/multipart/quoted +15 -0
  267. data/vendor/ruby/gems/rack-2.0.5/test/multipart/rack-logo.png +0 -0
  268. data/vendor/ruby/gems/rack-2.0.5/test/multipart/semicolon +6 -0
  269. data/vendor/ruby/gems/rack-2.0.5/test/multipart/text +15 -0
  270. data/vendor/ruby/gems/rack-2.0.5/test/multipart/three_files_three_fields +31 -0
  271. data/vendor/ruby/gems/rack-2.0.5/test/multipart/unity3d_wwwform +11 -0
  272. data/vendor/ruby/gems/rack-2.0.5/test/multipart/webkit +32 -0
  273. data/vendor/ruby/gems/rack-2.0.5/test/rackup/config.ru +31 -0
  274. data/vendor/ruby/gems/rack-2.0.5/test/registering_handler/rack/handler/registering_myself.rb +8 -0
  275. data/vendor/ruby/gems/rack-2.0.5/test/spec_auth_basic.rb +89 -0
  276. data/vendor/ruby/gems/rack-2.0.5/test/spec_auth_digest.rb +260 -0
  277. data/vendor/ruby/gems/rack-2.0.5/test/spec_body_proxy.rb +85 -0
  278. data/vendor/ruby/gems/rack-2.0.5/test/spec_builder.rb +233 -0
  279. data/vendor/ruby/gems/rack-2.0.5/test/spec_cascade.rb +63 -0
  280. data/vendor/ruby/gems/rack-2.0.5/test/spec_cgi.rb +84 -0
  281. data/vendor/ruby/gems/rack-2.0.5/test/spec_chunked.rb +103 -0
  282. data/vendor/ruby/gems/rack-2.0.5/test/spec_common_logger.rb +95 -0
  283. data/vendor/ruby/gems/rack-2.0.5/test/spec_conditional_get.rb +103 -0
  284. data/vendor/ruby/gems/rack-2.0.5/test/spec_config.rb +23 -0
  285. data/vendor/ruby/gems/rack-2.0.5/test/spec_content_length.rb +86 -0
  286. data/vendor/ruby/gems/rack-2.0.5/test/spec_content_type.rb +46 -0
  287. data/vendor/ruby/gems/rack-2.0.5/test/spec_deflater.rb +375 -0
  288. data/vendor/ruby/gems/rack-2.0.5/test/spec_directory.rb +148 -0
  289. data/vendor/ruby/gems/rack-2.0.5/test/spec_etag.rb +108 -0
  290. data/vendor/ruby/gems/rack-2.0.5/test/spec_events.rb +133 -0
  291. data/vendor/ruby/gems/rack-2.0.5/test/spec_fastcgi.rb +85 -0
  292. data/vendor/ruby/gems/rack-2.0.5/test/spec_file.rb +264 -0
  293. data/vendor/ruby/gems/rack-2.0.5/test/spec_handler.rb +57 -0
  294. data/vendor/ruby/gems/rack-2.0.5/test/spec_head.rb +46 -0
  295. data/vendor/ruby/gems/rack-2.0.5/test/spec_lint.rb +515 -0
  296. data/vendor/ruby/gems/rack-2.0.5/test/spec_lobster.rb +59 -0
  297. data/vendor/ruby/gems/rack-2.0.5/test/spec_lock.rb +204 -0
  298. data/vendor/ruby/gems/rack-2.0.5/test/spec_logger.rb +24 -0
  299. data/vendor/ruby/gems/rack-2.0.5/test/spec_media_type.rb +42 -0
  300. data/vendor/ruby/gems/rack-2.0.5/test/spec_method_override.rb +110 -0
  301. data/vendor/ruby/gems/rack-2.0.5/test/spec_mime.rb +51 -0
  302. data/vendor/ruby/gems/rack-2.0.5/test/spec_mock.rb +359 -0
  303. data/vendor/ruby/gems/rack-2.0.5/test/spec_multipart.rb +722 -0
  304. data/vendor/ruby/gems/rack-2.0.5/test/spec_null_logger.rb +21 -0
  305. data/vendor/ruby/gems/rack-2.0.5/test/spec_recursive.rb +75 -0
  306. data/vendor/ruby/gems/rack-2.0.5/test/spec_request.rb +1393 -0
  307. data/vendor/ruby/gems/rack-2.0.5/test/spec_response.rb +510 -0
  308. data/vendor/ruby/gems/rack-2.0.5/test/spec_rewindable_input.rb +128 -0
  309. data/vendor/ruby/gems/rack-2.0.5/test/spec_runtime.rb +50 -0
  310. data/vendor/ruby/gems/rack-2.0.5/test/spec_sendfile.rb +125 -0
  311. data/vendor/ruby/gems/rack-2.0.5/test/spec_server.rb +193 -0
  312. data/vendor/ruby/gems/rack-2.0.5/test/spec_session_abstract_id.rb +31 -0
  313. data/vendor/ruby/gems/rack-2.0.5/test/spec_session_abstract_session_hash.rb +45 -0
  314. data/vendor/ruby/gems/rack-2.0.5/test/spec_session_cookie.rb +442 -0
  315. data/vendor/ruby/gems/rack-2.0.5/test/spec_session_memcache.rb +320 -0
  316. data/vendor/ruby/gems/rack-2.0.5/test/spec_session_pool.rb +210 -0
  317. data/vendor/ruby/gems/rack-2.0.5/test/spec_show_exceptions.rb +80 -0
  318. data/vendor/ruby/gems/rack-2.0.5/test/spec_show_status.rb +104 -0
  319. data/vendor/ruby/gems/rack-2.0.5/test/spec_static.rb +184 -0
  320. data/vendor/ruby/gems/rack-2.0.5/test/spec_tempfile_reaper.rb +64 -0
  321. data/vendor/ruby/gems/rack-2.0.5/test/spec_thin.rb +96 -0
  322. data/vendor/ruby/gems/rack-2.0.5/test/spec_urlmap.rb +237 -0
  323. data/vendor/ruby/gems/rack-2.0.5/test/spec_utils.rb +742 -0
  324. data/vendor/ruby/gems/rack-2.0.5/test/spec_version.rb +11 -0
  325. data/vendor/ruby/gems/rack-2.0.5/test/spec_webrick.rb +206 -0
  326. data/vendor/ruby/gems/rack-2.0.5/test/static/another/index.html +1 -0
  327. data/vendor/ruby/gems/rack-2.0.5/test/static/foo.html +1 -0
  328. data/vendor/ruby/gems/rack-2.0.5/test/static/index.html +1 -0
  329. data/vendor/ruby/gems/rack-2.0.5/test/testrequest.rb +78 -0
  330. data/vendor/ruby/gems/rack-2.0.5/test/unregistered_handler/rack/handler/unregistered.rb +7 -0
  331. data/vendor/ruby/gems/rack-2.0.5/test/unregistered_handler/rack/handler/unregistered_long_one.rb +7 -0
  332. data/vendor/ruby/gems/rake-10.5.0/.autotest +7 -0
  333. data/vendor/ruby/gems/rake-10.5.0/.rubocop.yml +27 -0
  334. data/vendor/ruby/gems/rake-10.5.0/.togglerc +7 -0
  335. data/vendor/ruby/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
  336. data/vendor/ruby/gems/rake-10.5.0/History.rdoc +659 -0
  337. data/vendor/ruby/gems/rake-10.5.0/MIT-LICENSE +21 -0
  338. data/vendor/ruby/gems/rake-10.5.0/Manifest.txt +166 -0
  339. data/vendor/ruby/gems/rake-10.5.0/README.rdoc +139 -0
  340. data/vendor/ruby/gems/rake-10.5.0/Rakefile +81 -0
  341. data/vendor/ruby/gems/rake-10.5.0/bin/rake +33 -0
  342. data/vendor/ruby/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
  343. data/vendor/ruby/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
  344. data/vendor/ruby/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
  345. data/vendor/ruby/gems/rake-10.5.0/doc/example/a.c +6 -0
  346. data/vendor/ruby/gems/rake-10.5.0/doc/example/b.c +6 -0
  347. data/vendor/ruby/gems/rake-10.5.0/doc/example/main.c +11 -0
  348. data/vendor/ruby/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
  349. data/vendor/ruby/gems/rake-10.5.0/doc/jamis.rb +591 -0
  350. data/vendor/ruby/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
  351. data/vendor/ruby/gems/rake-10.5.0/doc/rake.1 +141 -0
  352. data/vendor/ruby/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
  353. data/vendor/ruby/gems/rake-10.5.0/doc/rational.rdoc +151 -0
  354. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
  355. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
  356. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
  357. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
  358. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
  359. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
  360. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
  361. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
  362. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
  363. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
  364. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
  365. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
  366. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
  367. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
  368. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
  369. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
  370. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
  371. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
  372. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
  373. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
  374. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
  375. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
  376. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
  377. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
  378. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
  379. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
  380. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
  381. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
  382. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
  383. data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
  384. data/vendor/ruby/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
  385. data/vendor/ruby/gems/rake-10.5.0/lib/rake/application.rb +790 -0
  386. data/vendor/ruby/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
  387. data/vendor/ruby/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
  388. data/vendor/ruby/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
  389. data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
  390. data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
  391. data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
  392. data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
  393. data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  394. data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
  395. data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
  396. data/vendor/ruby/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
  397. data/vendor/ruby/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
  398. data/vendor/ruby/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
  399. data/vendor/ruby/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
  400. data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
  401. data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
  402. data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
  403. data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
  404. data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
  405. data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
  406. data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
  407. data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
  408. data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
  409. data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
  410. data/vendor/ruby/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
  411. data/vendor/ruby/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
  412. data/vendor/ruby/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
  413. data/vendor/ruby/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
  414. data/vendor/ruby/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
  415. data/vendor/ruby/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
  416. data/vendor/ruby/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
  417. data/vendor/ruby/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
  418. data/vendor/ruby/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
  419. data/vendor/ruby/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
  420. data/vendor/ruby/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
  421. data/vendor/ruby/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
  422. data/vendor/ruby/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
  423. data/vendor/ruby/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
  424. data/vendor/ruby/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
  425. data/vendor/ruby/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
  426. data/vendor/ruby/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
  427. data/vendor/ruby/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
  428. data/vendor/ruby/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
  429. data/vendor/ruby/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
  430. data/vendor/ruby/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
  431. data/vendor/ruby/gems/rake-10.5.0/lib/rake/task.rb +383 -0
  432. data/vendor/ruby/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
  433. data/vendor/ruby/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
  434. data/vendor/ruby/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
  435. data/vendor/ruby/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
  436. data/vendor/ruby/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
  437. data/vendor/ruby/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
  438. data/vendor/ruby/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
  439. data/vendor/ruby/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
  440. data/vendor/ruby/gems/rake-10.5.0/lib/rake/version.rb +7 -0
  441. data/vendor/ruby/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
  442. data/vendor/ruby/gems/rake-10.5.0/lib/rake.rb +79 -0
  443. data/vendor/ruby/gems/rake-10.5.0/rakelib/publish.rake +20 -0
  444. data/vendor/ruby/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
  445. data/vendor/ruby/gems/rake-10.5.0/test/file_creation.rb +34 -0
  446. data/vendor/ruby/gems/rake-10.5.0/test/helper.rb +129 -0
  447. data/vendor/ruby/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
  448. data/vendor/ruby/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
  449. data/vendor/ruby/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
  450. data/vendor/ruby/gems/rake-10.5.0/test/test_rake.rb +40 -0
  451. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
  452. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
  453. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
  454. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
  455. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
  456. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
  457. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
  458. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
  459. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
  460. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
  461. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
  462. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
  463. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
  464. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
  465. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
  466. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
  467. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
  468. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
  469. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
  470. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
  471. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
  472. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
  473. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
  474. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
  475. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
  476. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
  477. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
  478. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
  479. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
  480. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
  481. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
  482. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
  483. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
  484. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
  485. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
  486. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
  487. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
  488. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
  489. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
  490. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
  491. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
  492. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
  493. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
  494. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
  495. data/vendor/ruby/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
  496. data/vendor/ruby/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
  497. data/vendor/ruby/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
  498. data/vendor/ruby/gems/sprockets-3.7.1/CHANGELOG.md +292 -0
  499. data/vendor/ruby/gems/sprockets-3.7.1/LICENSE +21 -0
  500. data/vendor/ruby/gems/sprockets-3.7.1/README.md +509 -0
  501. data/vendor/ruby/gems/sprockets-3.7.1/bin/sprockets +89 -0
  502. data/vendor/ruby/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb +152 -0
  503. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/asset.rb +200 -0
  504. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/closure.rb +7 -0
  505. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/coffee_script.rb +7 -0
  506. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/eco.rb +7 -0
  507. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/ejs.rb +7 -0
  508. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/sass.rb +7 -0
  509. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/uglifier.rb +7 -0
  510. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/yui.rb +7 -0
  511. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload.rb +11 -0
  512. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/base.rb +110 -0
  513. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/bower.rb +58 -0
  514. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/bundle.rb +69 -0
  515. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cache/file_store.rb +186 -0
  516. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cache/memory_store.rb +66 -0
  517. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cache/null_store.rb +46 -0
  518. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cache.rb +236 -0
  519. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb +69 -0
  520. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/closure_compressor.rb +47 -0
  521. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/coffee_script_processor.rb +25 -0
  522. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/coffee_script_template.rb +17 -0
  523. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/compressing.rb +94 -0
  524. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/configuration.rb +83 -0
  525. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/context.rb +231 -0
  526. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/dependencies.rb +73 -0
  527. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/deprecation.rb +90 -0
  528. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/digest_utils.rb +180 -0
  529. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/directive_processor.rb +404 -0
  530. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/eco_processor.rb +32 -0
  531. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/eco_template.rb +17 -0
  532. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/ejs_processor.rb +31 -0
  533. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/ejs_template.rb +17 -0
  534. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/encoding_utils.rb +261 -0
  535. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/engines.rb +92 -0
  536. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/environment.rb +41 -0
  537. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/erb_processor.rb +30 -0
  538. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/erb_template.rb +11 -0
  539. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/errors.rb +11 -0
  540. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/file_reader.rb +15 -0
  541. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/http_utils.rb +117 -0
  542. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/jst_processor.rb +49 -0
  543. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/legacy.rb +330 -0
  544. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/legacy_proc_processor.rb +35 -0
  545. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb +29 -0
  546. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/loader.rb +325 -0
  547. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/manifest.rb +335 -0
  548. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/manifest_utils.rb +45 -0
  549. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/mime.rb +130 -0
  550. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/path_dependency_utils.rb +85 -0
  551. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/path_digest_utils.rb +47 -0
  552. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb +287 -0
  553. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/paths.rb +81 -0
  554. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/processing.rb +258 -0
  555. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb +180 -0
  556. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/resolve.rb +211 -0
  557. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_cache_store.rb +34 -0
  558. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_compressor.rb +51 -0
  559. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_functions.rb +2 -0
  560. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_importer.rb +2 -0
  561. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_processor.rb +292 -0
  562. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_template.rb +19 -0
  563. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/server.rb +292 -0
  564. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/transformers.rb +145 -0
  565. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb +56 -0
  566. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/unloaded_asset.rb +137 -0
  567. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/uri_tar.rb +98 -0
  568. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/uri_utils.rb +188 -0
  569. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/utils/gzip.rb +67 -0
  570. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/utils.rb +235 -0
  571. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/version.rb +3 -0
  572. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/yui_compressor.rb +55 -0
  573. data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets.rb +169 -0
  574. data/vendor/ruby/specifications/concurrent-ruby-1.0.5.gemspec +23 -0
  575. data/vendor/ruby/specifications/rack-2.0.5.gemspec +42 -0
  576. data/vendor/ruby/specifications/rake-10.5.0.gemspec +43 -0
  577. data/vendor/ruby/specifications/sprockets-3.7.1.gemspec +78 -0
  578. metadata +660 -0
@@ -0,0 +1,445 @@
1
+ require 'concurrent/configuration'
2
+ require 'concurrent/ivar'
3
+ require 'concurrent/synchronization/lockable_object'
4
+
5
+ module Concurrent
6
+
7
+ # A mixin module that provides simple asynchronous behavior to a class,
8
+ # turning it into a simple actor. Loosely based on Erlang's
9
+ # [gen_server](http://www.erlang.org/doc/man/gen_server.html), but without
10
+ # supervision or linking.
11
+ #
12
+ # A more feature-rich {Concurrent::Actor} is also available when the
13
+ # capabilities of `Async` are too limited.
14
+ #
15
+ # ```cucumber
16
+ # Feature:
17
+ # As a stateful, plain old Ruby class
18
+ # I want safe, asynchronous behavior
19
+ # So my long-running methods don't block the main thread
20
+ # ```
21
+ #
22
+ # The `Async` module is a way to mix simple yet powerful asynchronous
23
+ # capabilities into any plain old Ruby object or class, turning each object
24
+ # into a simple Actor. Method calls are processed on a background thread. The
25
+ # caller is free to perform other actions while processing occurs in the
26
+ # background.
27
+ #
28
+ # Method calls to the asynchronous object are made via two proxy methods:
29
+ # `async` (alias `cast`) and `await` (alias `call`). These proxy methods post
30
+ # the method call to the object's background thread and return a "future"
31
+ # which will eventually contain the result of the method call.
32
+ #
33
+ # This behavior is loosely patterned after Erlang's `gen_server` behavior.
34
+ # When an Erlang module implements the `gen_server` behavior it becomes
35
+ # inherently asynchronous. The `start` or `start_link` function spawns a
36
+ # process (similar to a thread but much more lightweight and efficient) and
37
+ # returns the ID of the process. Using the process ID, other processes can
38
+ # send messages to the `gen_server` via the `cast` and `call` methods. Unlike
39
+ # Erlang's `gen_server`, however, `Async` classes do not support linking or
40
+ # supervision trees.
41
+ #
42
+ # ## Basic Usage
43
+ #
44
+ # When this module is mixed into a class, objects of the class become inherently
45
+ # asynchronous. Each object gets its own background thread on which to post
46
+ # asynchronous method calls. Asynchronous method calls are executed in the
47
+ # background one at a time in the order they are received.
48
+ #
49
+ # To create an asynchronous class, simply mix in the `Concurrent::Async` module:
50
+ #
51
+ # ```
52
+ # class Hello
53
+ # include Concurrent::Async
54
+ #
55
+ # def hello(name)
56
+ # "Hello, #{name}!"
57
+ # end
58
+ # end
59
+ # ```
60
+ #
61
+ # When defining a constructor it is critical that the first line be a call to
62
+ # `super` with no arguments. The `super` method initializes the background
63
+ # thread and other asynchronous components.
64
+ #
65
+ # ```
66
+ # class BackgroundLogger
67
+ # include Concurrent::Async
68
+ #
69
+ # def initialize(level)
70
+ # super()
71
+ # @logger = Logger.new(STDOUT)
72
+ # @logger.level = level
73
+ # end
74
+ #
75
+ # def info(msg)
76
+ # @logger.info(msg)
77
+ # end
78
+ # end
79
+ # ```
80
+ #
81
+ # Mixing this module into a class provides each object two proxy methods:
82
+ # `async` and `await`. These methods are thread safe with respect to the
83
+ # enclosing object. The former proxy allows methods to be called
84
+ # asynchronously by posting to the object's internal thread. The latter proxy
85
+ # allows a method to be called synchronously but does so safely with respect
86
+ # to any pending asynchronous method calls and ensures proper ordering. Both
87
+ # methods return a {Concurrent::IVar} which can be inspected for the result
88
+ # of the proxied method call. Calling a method with `async` will return a
89
+ # `:pending` `IVar` whereas `await` will return a `:complete` `IVar`.
90
+ #
91
+ # ```
92
+ # class Echo
93
+ # include Concurrent::Async
94
+ #
95
+ # def echo(msg)
96
+ # print "#{msg}\n"
97
+ # end
98
+ # end
99
+ #
100
+ # horn = Echo.new
101
+ # horn.echo('zero') # synchronous, not thread-safe
102
+ # # returns the actual return value of the method
103
+ #
104
+ # horn.async.echo('one') # asynchronous, non-blocking, thread-safe
105
+ # # returns an IVar in the :pending state
106
+ #
107
+ # horn.await.echo('two') # synchronous, blocking, thread-safe
108
+ # # returns an IVar in the :complete state
109
+ # ```
110
+ #
111
+ # ## Let It Fail
112
+ #
113
+ # The `async` and `await` proxy methods have built-in error protection based
114
+ # on Erlang's famous "let it fail" philosophy. Instance methods should not be
115
+ # programmed defensively. When an exception is raised by a delegated method
116
+ # the proxy will rescue the exception, expose it to the caller as the `reason`
117
+ # attribute of the returned future, then process the next method call.
118
+ #
119
+ # ## Calling Methods Internally
120
+ #
121
+ # External method calls should *always* use the `async` and `await` proxy
122
+ # methods. When one method calls another method, the `async` proxy should
123
+ # rarely be used and the `await` proxy should *never* be used.
124
+ #
125
+ # When an object calls one of its own methods using the `await` proxy the
126
+ # second call will be enqueued *behind* the currently running method call.
127
+ # Any attempt to wait on the result will fail as the second call will never
128
+ # run until after the current call completes.
129
+ #
130
+ # Calling a method using the `await` proxy from within a method that was
131
+ # itself called using `async` or `await` will irreversibly deadlock the
132
+ # object. Do *not* do this, ever.
133
+ #
134
+ # ## Instance Variables and Attribute Accessors
135
+ #
136
+ # Instance variables do not need to be thread-safe so long as they are private.
137
+ # Asynchronous method calls are processed in the order they are received and
138
+ # are processed one at a time. Therefore private instance variables can only
139
+ # be accessed by one thread at a time. This is inherently thread-safe.
140
+ #
141
+ # When using private instance variables within asynchronous methods, the best
142
+ # practice is to read the instance variable into a local variable at the start
143
+ # of the method then update the instance variable at the *end* of the method.
144
+ # This way, should an exception be raised during method execution the internal
145
+ # state of the object will not have been changed.
146
+ #
147
+ # ### Reader Attributes
148
+ #
149
+ # The use of `attr_reader` is discouraged. Internal state exposed externally,
150
+ # when necessary, should be done through accessor methods. The instance
151
+ # variables exposed by these methods *must* be thread-safe, or they must be
152
+ # called using the `async` and `await` proxy methods. These two approaches are
153
+ # subtly different.
154
+ #
155
+ # When internal state is accessed via the `async` and `await` proxy methods,
156
+ # the returned value represents the object's state *at the time the call is
157
+ # processed*, which may *not* be the state of the object at the time the call
158
+ # is made.
159
+ #
160
+ # To get the state *at the current* time, irrespective of an enqueued method
161
+ # calls, a reader method must be called directly. This is inherently unsafe
162
+ # unless the instance variable is itself thread-safe, preferrably using one
163
+ # of the thread-safe classes within this library. Because the thread-safe
164
+ # classes within this library are internally-locking or non-locking, they can
165
+ # be safely used from within asynchronous methods without causing deadlocks.
166
+ #
167
+ # Generally speaking, the best practice is to *not* expose internal state via
168
+ # reader methods. The best practice is to simply use the method's return value.
169
+ #
170
+ # ### Writer Attributes
171
+ #
172
+ # Writer attributes should never be used with asynchronous classes. Changing
173
+ # the state externally, even when done in the thread-safe way, is not logically
174
+ # consistent. Changes to state need to be timed with respect to all asynchronous
175
+ # method calls which my be in-process or enqueued. The only safe practice is to
176
+ # pass all necessary data to each method as arguments and let the method update
177
+ # the internal state as necessary.
178
+ #
179
+ # ## Class Constants, Variables, and Methods
180
+ #
181
+ # ### Class Constants
182
+ #
183
+ # Class constants do not need to be thread-safe. Since they are read-only and
184
+ # immutable they may be safely read both externally and from within
185
+ # asynchronous methods.
186
+ #
187
+ # ### Class Variables
188
+ #
189
+ # Class variables should be avoided. Class variables represent shared state.
190
+ # Shared state is anathema to concurrency. Should there be a need to share
191
+ # state using class variables they *must* be thread-safe, preferrably
192
+ # using the thread-safe classes within this library. When updating class
193
+ # variables, never assign a new value/object to the variable itself. Assignment
194
+ # is not thread-safe in Ruby. Instead, use the thread-safe update functions
195
+ # of the variable itself to change the value.
196
+ #
197
+ # The best practice is to *never* use class variables with `Async` classes.
198
+ #
199
+ # ### Class Methods
200
+ #
201
+ # Class methods which are pure functions are safe. Class methods which modify
202
+ # class variables should be avoided, for all the reasons listed above.
203
+ #
204
+ # ## An Important Note About Thread Safe Guarantees
205
+ #
206
+ # > Thread safe guarantees can only be made when asynchronous method calls
207
+ # > are not mixed with direct method calls. Use only direct method calls
208
+ # > when the object is used exclusively on a single thread. Use only
209
+ # > `async` and `await` when the object is shared between threads. Once you
210
+ # > call a method using `async` or `await`, you should no longer call methods
211
+ # > directly on the object. Use `async` and `await` exclusively from then on.
212
+ #
213
+ # @example
214
+ #
215
+ # class Echo
216
+ # include Concurrent::Async
217
+ #
218
+ # def echo(msg)
219
+ # print "#{msg}\n"
220
+ # end
221
+ # end
222
+ #
223
+ # horn = Echo.new
224
+ # horn.echo('zero') # synchronous, not thread-safe
225
+ # # returns the actual return value of the method
226
+ #
227
+ # horn.async.echo('one') # asynchronous, non-blocking, thread-safe
228
+ # # returns an IVar in the :pending state
229
+ #
230
+ # horn.await.echo('two') # synchronous, blocking, thread-safe
231
+ # # returns an IVar in the :complete state
232
+ #
233
+ # @see Concurrent::Actor
234
+ # @see https://en.wikipedia.org/wiki/Actor_model "Actor Model" at Wikipedia
235
+ # @see http://www.erlang.org/doc/man/gen_server.html Erlang gen_server
236
+ # @see http://c2.com/cgi/wiki?LetItCrash "Let It Crash" at http://c2.com/
237
+ module Async
238
+
239
+ # @!method self.new(*args, &block)
240
+ #
241
+ # Instanciate a new object and ensure proper initialization of the
242
+ # synchronization mechanisms.
243
+ #
244
+ # @param [Array<Object>] args Zero or more arguments to be passed to the
245
+ # object's initializer.
246
+ # @param [Proc] block Optional block to pass to the object's initializer.
247
+ # @return [Object] A properly initialized object of the asynchronous class.
248
+
249
+ # Check for the presence of a method on an object and determine if a given
250
+ # set of arguments matches the required arity.
251
+ #
252
+ # @param [Object] obj the object to check against
253
+ # @param [Symbol] method the method to check the object for
254
+ # @param [Array] args zero or more arguments for the arity check
255
+ #
256
+ # @raise [NameError] the object does not respond to `method` method
257
+ # @raise [ArgumentError] the given `args` do not match the arity of `method`
258
+ #
259
+ # @note This check is imperfect because of the way Ruby reports the arity of
260
+ # methods with a variable number of arguments. It is possible to determine
261
+ # if too few arguments are given but impossible to determine if too many
262
+ # arguments are given. This check may also fail to recognize dynamic behavior
263
+ # of the object, such as methods simulated with `method_missing`.
264
+ #
265
+ # @see http://www.ruby-doc.org/core-2.1.1/Method.html#method-i-arity Method#arity
266
+ # @see http://ruby-doc.org/core-2.1.0/Object.html#method-i-respond_to-3F Object#respond_to?
267
+ # @see http://www.ruby-doc.org/core-2.1.0/BasicObject.html#method-i-method_missing BasicObject#method_missing
268
+ #
269
+ # @!visibility private
270
+ def self.validate_argc(obj, method, *args)
271
+ argc = args.length
272
+ arity = obj.method(method).arity
273
+
274
+ if arity >= 0 && argc != arity
275
+ raise ArgumentError.new("wrong number of arguments (#{argc} for #{arity})")
276
+ elsif arity < 0 && (arity = (arity + 1).abs) > argc
277
+ raise ArgumentError.new("wrong number of arguments (#{argc} for #{arity}..*)")
278
+ end
279
+ end
280
+
281
+ # @!visibility private
282
+ def self.included(base)
283
+ base.singleton_class.send(:alias_method, :original_new, :new)
284
+ base.extend(ClassMethods)
285
+ super(base)
286
+ end
287
+
288
+ # @!visibility private
289
+ module ClassMethods
290
+ def new(*args, &block)
291
+ obj = original_new(*args, &block)
292
+ obj.send(:init_synchronization)
293
+ obj
294
+ end
295
+ end
296
+ private_constant :ClassMethods
297
+
298
+ # Delegates asynchronous, thread-safe method calls to the wrapped object.
299
+ #
300
+ # @!visibility private
301
+ class AsyncDelegator < Synchronization::LockableObject
302
+ safe_initialization!
303
+
304
+ # Create a new delegator object wrapping the given delegate.
305
+ #
306
+ # @param [Object] delegate the object to wrap and delegate method calls to
307
+ def initialize(delegate)
308
+ super()
309
+ @delegate = delegate
310
+ @queue = []
311
+ @executor = Concurrent.global_io_executor
312
+ end
313
+
314
+ # Delegates method calls to the wrapped object.
315
+ #
316
+ # @param [Symbol] method the method being called
317
+ # @param [Array] args zero or more arguments to the method
318
+ #
319
+ # @return [IVar] the result of the method call
320
+ #
321
+ # @raise [NameError] the object does not respond to `method` method
322
+ # @raise [ArgumentError] the given `args` do not match the arity of `method`
323
+ def method_missing(method, *args, &block)
324
+ super unless @delegate.respond_to?(method)
325
+ Async::validate_argc(@delegate, method, *args)
326
+
327
+ ivar = Concurrent::IVar.new
328
+ synchronize do
329
+ @queue.push [ivar, method, args, block]
330
+ @executor.post { perform } if @queue.length == 1
331
+ end
332
+
333
+ ivar
334
+ end
335
+
336
+ # Perform all enqueued tasks.
337
+ #
338
+ # This method must be called from within the executor. It must not be
339
+ # called while already running. It will loop until the queue is empty.
340
+ def perform
341
+ loop do
342
+ ivar, method, args, block = synchronize { @queue.first }
343
+ break unless ivar # queue is empty
344
+
345
+ begin
346
+ ivar.set(@delegate.send(method, *args, &block))
347
+ rescue => error
348
+ ivar.fail(error)
349
+ end
350
+
351
+ synchronize do
352
+ @queue.shift
353
+ return if @queue.empty?
354
+ end
355
+ end
356
+ end
357
+ end
358
+ private_constant :AsyncDelegator
359
+
360
+ # Delegates synchronous, thread-safe method calls to the wrapped object.
361
+ #
362
+ # @!visibility private
363
+ class AwaitDelegator
364
+
365
+ # Create a new delegator object wrapping the given delegate.
366
+ #
367
+ # @param [AsyncDelegator] delegate the object to wrap and delegate method calls to
368
+ def initialize(delegate)
369
+ @delegate = delegate
370
+ end
371
+
372
+ # Delegates method calls to the wrapped object.
373
+ #
374
+ # @param [Symbol] method the method being called
375
+ # @param [Array] args zero or more arguments to the method
376
+ #
377
+ # @return [IVar] the result of the method call
378
+ #
379
+ # @raise [NameError] the object does not respond to `method` method
380
+ # @raise [ArgumentError] the given `args` do not match the arity of `method`
381
+ def method_missing(method, *args, &block)
382
+ ivar = @delegate.send(method, *args, &block)
383
+ ivar.wait
384
+ ivar
385
+ end
386
+ end
387
+ private_constant :AwaitDelegator
388
+
389
+ # Causes the chained method call to be performed asynchronously on the
390
+ # object's thread. The delegated method will return a future in the
391
+ # `:pending` state and the method call will have been scheduled on the
392
+ # object's thread. The final disposition of the method call can be obtained
393
+ # by inspecting the returned future.
394
+ #
395
+ # @!macro [attach] async_thread_safety_warning
396
+ # @note The method call is guaranteed to be thread safe with respect to
397
+ # all other method calls against the same object that are called with
398
+ # either `async` or `await`. The mutable nature of Ruby references
399
+ # (and object orientation in general) prevent any other thread safety
400
+ # guarantees. Do NOT mix direct method calls with delegated method calls.
401
+ # Use *only* delegated method calls when sharing the object between threads.
402
+ #
403
+ # @return [Concurrent::IVar] the pending result of the asynchronous operation
404
+ #
405
+ # @raise [NameError] the object does not respond to the requested method
406
+ # @raise [ArgumentError] the given `args` do not match the arity of
407
+ # the requested method
408
+ def async
409
+ @__async_delegator__
410
+ end
411
+ alias_method :cast, :async
412
+
413
+ # Causes the chained method call to be performed synchronously on the
414
+ # current thread. The delegated will return a future in either the
415
+ # `:fulfilled` or `:rejected` state and the delegated method will have
416
+ # completed. The final disposition of the delegated method can be obtained
417
+ # by inspecting the returned future.
418
+ #
419
+ # @!macro async_thread_safety_warning
420
+ #
421
+ # @return [Concurrent::IVar] the completed result of the synchronous operation
422
+ #
423
+ # @raise [NameError] the object does not respond to the requested method
424
+ # @raise [ArgumentError] the given `args` do not match the arity of the
425
+ # requested method
426
+ def await
427
+ @__await_delegator__
428
+ end
429
+ alias_method :call, :await
430
+
431
+ # Initialize the internal serializer and other stnchronization mechanisms.
432
+ #
433
+ # @note This method *must* be called immediately upon object construction.
434
+ # This is the only way thread-safe initialization can be guaranteed.
435
+ #
436
+ # @!visibility private
437
+ def init_synchronization
438
+ return self if @__async_initialized__
439
+ @__async_initialized__ = true
440
+ @__async_delegator__ = AsyncDelegator.new(self)
441
+ @__await_delegator__ = AwaitDelegator.new(@__async_delegator__)
442
+ self
443
+ end
444
+ end
445
+ end
@@ -0,0 +1,222 @@
1
+ require 'concurrent/atomic/atomic_reference'
2
+ require 'concurrent/collection/copy_on_notify_observer_set'
3
+ require 'concurrent/concern/observable'
4
+ require 'concurrent/synchronization'
5
+
6
+ # @!macro [new] thread_safe_variable_comparison
7
+ #
8
+ # ## Thread-safe Variable Classes
9
+ #
10
+ # Each of the thread-safe variable classes is designed to solve a different
11
+ # problem. In general:
12
+ #
13
+ # * *{Concurrent::Agent}:* Shared, mutable variable providing independent,
14
+ # uncoordinated, *asynchronous* change of individual values. Best used when
15
+ # the value will undergo frequent, complex updates. Suitable when the result
16
+ # of an update does not need to be known immediately.
17
+ # * *{Concurrent::Atom}:* Shared, mutable variable providing independent,
18
+ # uncoordinated, *synchronous* change of individual values. Best used when
19
+ # the value will undergo frequent reads but only occasional, though complex,
20
+ # updates. Suitable when the result of an update must be known immediately.
21
+ # * *{Concurrent::AtomicReference}:* A simple object reference that can be
22
+ # atomically. Updates are synchronous but fast. Best used when updates a
23
+ # simple set operations. Not suitable when updates are complex.
24
+ # {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar
25
+ # but optimized for the given data type.
26
+ # * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used
27
+ # when two or more threads need to exchange data. The threads will pair then
28
+ # block on each other until the exchange is complete.
29
+ # * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread
30
+ # must give a value to another, which must take the value. The threads will
31
+ # block on each other until the exchange is complete.
32
+ # * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which
33
+ # holds a different value for each thread which has access. Often used as
34
+ # an instance variable in objects which must maintain different state
35
+ # for different threads.
36
+ # * *{Concurrent::TVar}:* Shared, mutable variables which provide
37
+ # *coordinated*, *synchronous*, change of *many* stated. Used when multiple
38
+ # value must change together, in an all-or-nothing transaction.
39
+
40
+
41
+ module Concurrent
42
+
43
+ # Atoms provide a way to manage shared, synchronous, independent state.
44
+ #
45
+ # An atom is initialized with an initial value and an optional validation
46
+ # proc. At any time the value of the atom can be synchronously and safely
47
+ # changed. If a validator is given at construction then any new value
48
+ # will be checked against the validator and will be rejected if the
49
+ # validator returns false or raises an exception.
50
+ #
51
+ # There are two ways to change the value of an atom: {#compare_and_set} and
52
+ # {#swap}. The former will set the new value if and only if it validates and
53
+ # the current value matches the new value. The latter will atomically set the
54
+ # new value to the result of running the given block if and only if that
55
+ # value validates.
56
+ #
57
+ # ## Example
58
+ #
59
+ # ```
60
+ # def next_fibonacci(set = nil)
61
+ # return [0, 1] if set.nil?
62
+ # set + [set[-2..-1].reduce{|sum,x| sum + x }]
63
+ # end
64
+ #
65
+ # # create an atom with an initial value
66
+ # atom = Concurrent::Atom.new(next_fibonacci)
67
+ #
68
+ # # send a few update requests
69
+ # 5.times do
70
+ # atom.swap{|set| next_fibonacci(set) }
71
+ # end
72
+ #
73
+ # # get the current value
74
+ # atom.value #=> [0, 1, 1, 2, 3, 5, 8]
75
+ # ```
76
+ #
77
+ # ## Observation
78
+ #
79
+ # Atoms support observers through the {Concurrent::Observable} mixin module.
80
+ # Notification of observers occurs every time the value of the Atom changes.
81
+ # When notified the observer will receive three arguments: `time`, `old_value`,
82
+ # and `new_value`. The `time` argument is the time at which the value change
83
+ # occurred. The `old_value` is the value of the Atom when the change began
84
+ # The `new_value` is the value to which the Atom was set when the change
85
+ # completed. Note that `old_value` and `new_value` may be the same. This is
86
+ # not an error. It simply means that the change operation returned the same
87
+ # value.
88
+ #
89
+ # Unlike in Clojure, `Atom` cannot participate in {Concurrent::TVar} transactions.
90
+ #
91
+ # @!macro thread_safe_variable_comparison
92
+ #
93
+ # @see http://clojure.org/atoms Clojure Atoms
94
+ # @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State
95
+ class Atom < Synchronization::Object
96
+ include Concern::Observable
97
+
98
+ safe_initialization!
99
+ private(*attr_atomic(:value))
100
+ public :value
101
+
102
+ # Create a new atom with the given initial value.
103
+ #
104
+ # @param [Object] value The initial value
105
+ # @param [Hash] opts The options used to configure the atom
106
+ # @option opts [Proc] :validator (nil) Optional proc used to validate new
107
+ # values. It must accept one and only one argument which will be the
108
+ # intended new value. The validator will return true if the new value
109
+ # is acceptable else return false (preferrably) or raise an exception.
110
+ #
111
+ # @!macro deref_options
112
+ #
113
+ # @raise [ArgumentError] if the validator is not a `Proc` (when given)
114
+ def initialize(value, opts = {})
115
+ super()
116
+ @Validator = opts.fetch(:validator, -> v { true })
117
+ self.observers = Collection::CopyOnNotifyObserverSet.new
118
+ self.value = value
119
+ end
120
+
121
+ # @!method value
122
+ # The current value of the atom.
123
+ #
124
+ # @return [Object] The current value.
125
+
126
+ alias_method :deref, :value
127
+
128
+ # Atomically swaps the value of atom using the given block. The current
129
+ # value will be passed to the block, as will any arguments passed as
130
+ # arguments to the function. The new value will be validated against the
131
+ # (optional) validator proc given at construction. If validation fails the
132
+ # value will not be changed.
133
+ #
134
+ # Internally, {#swap} reads the current value, applies the block to it, and
135
+ # attempts to compare-and-set it in. Since another thread may have changed
136
+ # the value in the intervening time, it may have to retry, and does so in a
137
+ # spin loop. The net effect is that the value will always be the result of
138
+ # the application of the supplied block to a current value, atomically.
139
+ # However, because the block might be called multiple times, it must be free
140
+ # of side effects.
141
+ #
142
+ # @note The given block may be called multiple times, and thus should be free
143
+ # of side effects.
144
+ #
145
+ # @param [Object] args Zero or more arguments passed to the block.
146
+ #
147
+ # @yield [value, args] Calculates a new value for the atom based on the
148
+ # current value and any supplied arguments.
149
+ # @yieldparam value [Object] The current value of the atom.
150
+ # @yieldparam args [Object] All arguments passed to the function, in order.
151
+ # @yieldreturn [Object] The intended new value of the atom.
152
+ #
153
+ # @return [Object] The final value of the atom after all operations and
154
+ # validations are complete.
155
+ #
156
+ # @raise [ArgumentError] When no block is given.
157
+ def swap(*args)
158
+ raise ArgumentError.new('no block given') unless block_given?
159
+
160
+ loop do
161
+ old_value = value
162
+ new_value = yield(old_value, *args)
163
+ begin
164
+ break old_value unless valid?(new_value)
165
+ break new_value if compare_and_set(old_value, new_value)
166
+ rescue
167
+ break old_value
168
+ end
169
+ end
170
+ end
171
+
172
+ # Atomically sets the value of atom to the new value if and only if the
173
+ # current value of the atom is identical to the old value and the new
174
+ # value successfully validates against the (optional) validator given
175
+ # at construction.
176
+ #
177
+ # @param [Object] old_value The expected current value.
178
+ # @param [Object] new_value The intended new value.
179
+ #
180
+ # @return [Boolean] True if the value is changed else false.
181
+ def compare_and_set(old_value, new_value)
182
+ if valid?(new_value) && compare_and_set_value(old_value, new_value)
183
+ observers.notify_observers(Time.now, old_value, new_value)
184
+ true
185
+ else
186
+ false
187
+ end
188
+ end
189
+
190
+ # Atomically sets the value of atom to the new value without regard for the
191
+ # current value so long as the new value successfully validates against the
192
+ # (optional) validator given at construction.
193
+ #
194
+ # @param [Object] new_value The intended new value.
195
+ #
196
+ # @return [Object] The final value of the atom after all operations and
197
+ # validations are complete.
198
+ def reset(new_value)
199
+ old_value = value
200
+ if valid?(new_value)
201
+ self.value = new_value
202
+ observers.notify_observers(Time.now, old_value, new_value)
203
+ new_value
204
+ else
205
+ old_value
206
+ end
207
+ end
208
+
209
+ private
210
+
211
+ # Is the new value valid?
212
+ #
213
+ # @param [Object] new_value The intended new value.
214
+ # @return [Boolean] false if the validator function returns false or raises
215
+ # an exception else true
216
+ def valid?(new_value)
217
+ @Validator.call(new_value)
218
+ rescue
219
+ false
220
+ end
221
+ end
222
+ end