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.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +26 -0
- data/README.md +35 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/sprokovuln/version.rb +3 -0
- data/lib/sprokovuln.rb +5 -0
- data/sprokovuln.gemspec +26 -0
- data/vendor/ruby/bin/rackup +27 -0
- data/vendor/ruby/bin/rake +27 -0
- data/vendor/ruby/bin/sprockets +27 -0
- data/vendor/ruby/cache/concurrent-ruby-1.0.5.gem +0 -0
- data/vendor/ruby/cache/rack-2.0.5.gem +0 -0
- data/vendor/ruby/cache/rake-10.5.0.gem +0 -0
- data/vendor/ruby/cache/sprockets-3.7.1.gem +0 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/CHANGELOG.md +387 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/LICENSE.txt +21 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/README.md +247 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/agent.rb +587 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb +39 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/async.rb +445 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atom.rb +222 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/abstract_thread_local_var.rb +66 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/atomic_boolean.rb +122 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/atomic_fixnum.rb +139 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/atomic_reference.rb +51 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/count_down_latch.rb +100 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/cyclic_barrier.rb +128 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/event.rb +109 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/java_count_down_latch.rb +39 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/java_thread_local_var.rb +37 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/mutex_atomic_boolean.rb +60 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/mutex_atomic_fixnum.rb +75 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/mutex_count_down_latch.rb +43 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/mutex_semaphore.rb +115 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/read_write_lock.rb +253 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/reentrant_read_write_lock.rb +377 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb +161 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/semaphore.rb +145 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/thread_local_var.rb +104 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/concurrent_update_error.rb +8 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/direct_update.rb +81 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/jruby+truffle.rb +2 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/jruby.rb +16 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/mutex_atomic.rb +61 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/numeric_cas_wrapper.rb +28 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/rbx.rb +22 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic_reference/ruby.rb +32 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/atomics.rb +53 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/copy_on_notify_observer_set.rb +107 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/copy_on_write_observer_set.rb +111 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/java_non_concurrent_priority_queue.rb +84 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/map/atomic_reference_map_backend.rb +927 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/map/mri_map_backend.rb +66 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/map/non_concurrent_map_backend.rb +141 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/map/synchronized_map_backend.rb +82 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/non_concurrent_priority_queue.rb +143 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/collection/ruby_non_concurrent_priority_queue.rb +150 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/deprecation.rb +34 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/dereferenceable.rb +73 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb +27 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/obligation.rb +220 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/observable.rb +110 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/configuration.rb +188 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/constants.rb +8 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/dataflow.rb +80 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/delay.rb +197 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/edge.rb +26 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/errors.rb +69 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/exchanger.rb +356 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/abstract_executor_service.rb +134 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/cached_thread_pool.rb +62 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/executor_service.rb +185 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/fixed_thread_pool.rb +206 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/immediate_executor.rb +66 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/indirect_immediate_executor.rb +44 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/java_executor_service.rb +100 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/java_single_thread_executor.rb +29 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/java_thread_pool_executor.rb +120 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_executor_service.rb +78 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_single_thread_executor.rb +22 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb +362 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb +35 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/serial_executor_service.rb +34 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/serialized_execution.rb +107 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/serialized_execution_delegator.rb +28 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/simple_executor_service.rb +100 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/single_thread_executor.rb +56 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/thread_pool_executor.rb +87 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/timer_set.rb +175 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/executors.rb +20 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/future.rb +138 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/hash.rb +36 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/immutable_struct.rb +93 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/ivar.rb +208 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/lazy_register.rb +81 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/map.rb +240 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/maybe.rb +229 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/mutable_struct.rb +228 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/mvar.rb +242 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/options.rb +42 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/promise.rb +547 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/scheduled_task.rb +318 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/settable_struct.rb +128 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/abstract_lockable_object.rb +98 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/abstract_object.rb +24 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/abstract_struct.rb +157 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/condition.rb +58 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/jruby_lockable_object.rb +13 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/jruby_object.rb +44 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/lock.rb +34 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/lockable_object.rb +74 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb +71 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_object.rb +43 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/object.rb +153 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/rbx_lockable_object.rb +65 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/rbx_object.rb +48 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/truffle_lockable_object.rb +9 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/truffle_object.rb +31 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/volatile.rb +34 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization.rb +31 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/synchronized_delegator.rb +50 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/adder.rb +74 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb +30 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/cheap_lockable.rb +118 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/power_of_two_tuple.rb +38 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/striped64.rb +241 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/volatile.rb +75 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/xor_shift_random.rb +50 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util.rb +16 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/timer_task.rb +331 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/tuple.rb +86 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/tvar.rb +258 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/at_exit.rb +97 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/engine.rb +56 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/monotonic_time.rb +58 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/native_extension_loader.rb +73 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/native_integer.rb +53 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/utility/processor_counter.rb +160 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/version.rb +4 -0
- data/vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent.rb +130 -0
- data/vendor/ruby/gems/rack-2.0.5/COPYING +18 -0
- data/vendor/ruby/gems/rack-2.0.5/HISTORY.md +505 -0
- data/vendor/ruby/gems/rack-2.0.5/README.rdoc +302 -0
- data/vendor/ruby/gems/rack-2.0.5/Rakefile +116 -0
- data/vendor/ruby/gems/rack-2.0.5/SPEC +263 -0
- data/vendor/ruby/gems/rack-2.0.5/bin/rackup +4 -0
- data/vendor/ruby/gems/rack-2.0.5/contrib/rack.png +0 -0
- data/vendor/ruby/gems/rack-2.0.5/contrib/rack.svg +150 -0
- data/vendor/ruby/gems/rack-2.0.5/contrib/rack_logo.svg +164 -0
- data/vendor/ruby/gems/rack-2.0.5/contrib/rdoc.css +412 -0
- data/vendor/ruby/gems/rack-2.0.5/example/lobster.ru +4 -0
- data/vendor/ruby/gems/rack-2.0.5/example/protectedlobster.rb +14 -0
- data/vendor/ruby/gems/rack-2.0.5/example/protectedlobster.ru +8 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/abstract/handler.rb +37 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/abstract/request.rb +47 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/basic.rb +58 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/digest/md5.rb +129 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/digest/nonce.rb +51 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/digest/params.rb +52 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/auth/digest/request.rb +41 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/body_proxy.rb +44 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/builder.rb +164 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/cascade.rb +52 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/chunked.rb +69 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/common_logger.rb +72 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/conditional_get.rb +79 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/config.rb +20 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/content_length.rb +37 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/content_type.rb +29 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/deflater.rb +119 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/directory.rb +179 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/etag.rb +74 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/events.rb +154 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/file.rb +176 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/cgi.rb +60 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/fastcgi.rb +100 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/lsws.rb +61 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/scgi.rb +70 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/thin.rb +36 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler/webrick.rb +120 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/handler.rb +99 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/head.rb +25 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/lint.rb +760 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/lobster.rb +70 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/lock.rb +31 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/logger.rb +18 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/media_type.rb +38 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/method_override.rb +50 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/mime.rb +677 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/mock.rb +196 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/multipart/generator.rb +93 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/multipart/parser.rb +369 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/multipart/uploaded_file.rb +33 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/multipart.rb +63 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/null_logger.rb +37 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/query_parser.rb +192 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/recursive.rb +62 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/reloader.rb +110 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/request.rb +487 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/response.rb +235 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/rewindable_input.rb +93 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/runtime.rb +32 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/sendfile.rb +158 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/server.rb +395 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/session/abstract/id.rb +445 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/session/cookie.rb +195 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/session/memcache.rb +93 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/session/pool.rb +76 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/show_exceptions.rb +386 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/show_status.rb +113 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/static.rb +175 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/tempfile_reaper.rb +22 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/urlmap.rb +91 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack/utils.rb +620 -0
- data/vendor/ruby/gems/rack-2.0.5/lib/rack.rb +147 -0
- data/vendor/ruby/gems/rack-2.0.5/rack.gemspec +34 -0
- data/vendor/ruby/gems/rack-2.0.5/test/builder/an_underscore_app.rb +5 -0
- data/vendor/ruby/gems/rack-2.0.5/test/builder/anything.rb +5 -0
- data/vendor/ruby/gems/rack-2.0.5/test/builder/comment.ru +4 -0
- data/vendor/ruby/gems/rack-2.0.5/test/builder/end.ru +5 -0
- data/vendor/ruby/gems/rack-2.0.5/test/builder/line.ru +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/builder/options.ru +2 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/folder/test.js +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/fonts/font.eot +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/images/image.png +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/index.html +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/javascripts/app.js +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/assets/stylesheets/app.css +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/lighttpd.conf +26 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/rackup_stub.rb +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/sample_rackup.ru +5 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/test +9 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/test+directory/test+file +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/test.fcgi +9 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/test.gz +0 -0
- data/vendor/ruby/gems/rack-2.0.5/test/cgi/test.ru +5 -0
- data/vendor/ruby/gems/rack-2.0.5/test/gemloader.rb +10 -0
- data/vendor/ruby/gems/rack-2.0.5/test/helper.rb +34 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/bad_robots +259 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/binary +0 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/content_type_and_no_filename +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/empty +10 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/fail_16384_nofile +814 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/file1.txt +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_and_modification_param +7 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_and_no_name +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_encoded_words +7 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_escaped_quotes +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_escaped_quotes_and_modification_param +7 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_null_byte +7 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_percent_escaped_quotes +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_single_quote +7 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_unescaped_percentages +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_unescaped_percentages2 +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_unescaped_percentages3 +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/filename_with_unescaped_quotes +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/ie +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/invalid_character +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/mixed_files +21 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/nested +10 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/none +9 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/quoted +15 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/rack-logo.png +0 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/semicolon +6 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/text +15 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/three_files_three_fields +31 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/unity3d_wwwform +11 -0
- data/vendor/ruby/gems/rack-2.0.5/test/multipart/webkit +32 -0
- data/vendor/ruby/gems/rack-2.0.5/test/rackup/config.ru +31 -0
- data/vendor/ruby/gems/rack-2.0.5/test/registering_handler/rack/handler/registering_myself.rb +8 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_auth_basic.rb +89 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_auth_digest.rb +260 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_body_proxy.rb +85 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_builder.rb +233 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_cascade.rb +63 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_cgi.rb +84 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_chunked.rb +103 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_common_logger.rb +95 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_conditional_get.rb +103 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_config.rb +23 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_content_length.rb +86 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_content_type.rb +46 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_deflater.rb +375 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_directory.rb +148 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_etag.rb +108 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_events.rb +133 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_fastcgi.rb +85 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_file.rb +264 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_handler.rb +57 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_head.rb +46 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_lint.rb +515 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_lobster.rb +59 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_lock.rb +204 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_logger.rb +24 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_media_type.rb +42 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_method_override.rb +110 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_mime.rb +51 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_mock.rb +359 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_multipart.rb +722 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_null_logger.rb +21 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_recursive.rb +75 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_request.rb +1393 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_response.rb +510 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_rewindable_input.rb +128 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_runtime.rb +50 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_sendfile.rb +125 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_server.rb +193 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_session_abstract_id.rb +31 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_session_abstract_session_hash.rb +45 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_session_cookie.rb +442 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_session_memcache.rb +320 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_session_pool.rb +210 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_show_exceptions.rb +80 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_show_status.rb +104 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_static.rb +184 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_tempfile_reaper.rb +64 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_thin.rb +96 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_urlmap.rb +237 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_utils.rb +742 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_version.rb +11 -0
- data/vendor/ruby/gems/rack-2.0.5/test/spec_webrick.rb +206 -0
- data/vendor/ruby/gems/rack-2.0.5/test/static/another/index.html +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/static/foo.html +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/static/index.html +1 -0
- data/vendor/ruby/gems/rack-2.0.5/test/testrequest.rb +78 -0
- data/vendor/ruby/gems/rack-2.0.5/test/unregistered_handler/rack/handler/unregistered.rb +7 -0
- data/vendor/ruby/gems/rack-2.0.5/test/unregistered_handler/rack/handler/unregistered_long_one.rb +7 -0
- data/vendor/ruby/gems/rake-10.5.0/.autotest +7 -0
- data/vendor/ruby/gems/rake-10.5.0/.rubocop.yml +27 -0
- data/vendor/ruby/gems/rake-10.5.0/.togglerc +7 -0
- data/vendor/ruby/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
- data/vendor/ruby/gems/rake-10.5.0/History.rdoc +659 -0
- data/vendor/ruby/gems/rake-10.5.0/MIT-LICENSE +21 -0
- data/vendor/ruby/gems/rake-10.5.0/Manifest.txt +166 -0
- data/vendor/ruby/gems/rake-10.5.0/README.rdoc +139 -0
- data/vendor/ruby/gems/rake-10.5.0/Rakefile +81 -0
- data/vendor/ruby/gems/rake-10.5.0/bin/rake +33 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/example/a.c +6 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/example/b.c +6 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/example/main.c +11 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/jamis.rb +591 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/rake.1 +141 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/rational.rdoc +151 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
- data/vendor/ruby/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/application.rb +790 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/task.rb +383 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/version.rb +7 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
- data/vendor/ruby/gems/rake-10.5.0/lib/rake.rb +79 -0
- data/vendor/ruby/gems/rake-10.5.0/rakelib/publish.rake +20 -0
- data/vendor/ruby/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
- data/vendor/ruby/gems/rake-10.5.0/test/file_creation.rb +34 -0
- data/vendor/ruby/gems/rake-10.5.0/test/helper.rb +129 -0
- data/vendor/ruby/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
- data/vendor/ruby/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake.rb +40 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
- data/vendor/ruby/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
- data/vendor/ruby/gems/sprockets-3.7.1/CHANGELOG.md +292 -0
- data/vendor/ruby/gems/sprockets-3.7.1/LICENSE +21 -0
- data/vendor/ruby/gems/sprockets-3.7.1/README.md +509 -0
- data/vendor/ruby/gems/sprockets-3.7.1/bin/sprockets +89 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb +152 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/asset.rb +200 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/closure.rb +7 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/coffee_script.rb +7 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/eco.rb +7 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/ejs.rb +7 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/sass.rb +7 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/uglifier.rb +7 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload/yui.rb +7 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/autoload.rb +11 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/base.rb +110 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/bower.rb +58 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/bundle.rb +69 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cache/file_store.rb +186 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cache/memory_store.rb +66 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cache/null_store.rb +46 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cache.rb +236 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb +69 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/closure_compressor.rb +47 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/coffee_script_processor.rb +25 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/coffee_script_template.rb +17 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/compressing.rb +94 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/configuration.rb +83 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/context.rb +231 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/dependencies.rb +73 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/deprecation.rb +90 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/digest_utils.rb +180 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/directive_processor.rb +404 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/eco_processor.rb +32 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/eco_template.rb +17 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/ejs_processor.rb +31 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/ejs_template.rb +17 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/encoding_utils.rb +261 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/engines.rb +92 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/environment.rb +41 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/erb_processor.rb +30 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/erb_template.rb +11 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/errors.rb +11 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/file_reader.rb +15 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/http_utils.rb +117 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/jst_processor.rb +49 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/legacy.rb +330 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/legacy_proc_processor.rb +35 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb +29 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/loader.rb +325 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/manifest.rb +335 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/manifest_utils.rb +45 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/mime.rb +130 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/path_dependency_utils.rb +85 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/path_digest_utils.rb +47 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb +287 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/paths.rb +81 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/processing.rb +258 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb +180 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/resolve.rb +211 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_cache_store.rb +34 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_compressor.rb +51 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_functions.rb +2 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_importer.rb +2 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_processor.rb +292 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/sass_template.rb +19 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/server.rb +292 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/transformers.rb +145 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb +56 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/unloaded_asset.rb +137 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/uri_tar.rb +98 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/uri_utils.rb +188 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/utils/gzip.rb +67 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/utils.rb +235 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/version.rb +3 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/yui_compressor.rb +55 -0
- data/vendor/ruby/gems/sprockets-3.7.1/lib/sprockets.rb +169 -0
- data/vendor/ruby/specifications/concurrent-ruby-1.0.5.gemspec +23 -0
- data/vendor/ruby/specifications/rack-2.0.5.gemspec +42 -0
- data/vendor/ruby/specifications/rake-10.5.0.gemspec +43 -0
- data/vendor/ruby/specifications/sprockets-3.7.1.gemspec +78 -0
- metadata +660 -0
@@ -0,0 +1,240 @@
|
|
1
|
+
require 'thread'
|
2
|
+
require 'concurrent/constants'
|
3
|
+
require 'concurrent/synchronization'
|
4
|
+
|
5
|
+
module Concurrent
|
6
|
+
# @!visibility private
|
7
|
+
module Collection
|
8
|
+
|
9
|
+
# @!visibility private
|
10
|
+
MapImplementation = if Concurrent.java_extensions_loaded?
|
11
|
+
# noinspection RubyResolve
|
12
|
+
JRubyMapBackend
|
13
|
+
elsif defined?(RUBY_ENGINE)
|
14
|
+
case RUBY_ENGINE
|
15
|
+
when 'ruby'
|
16
|
+
require 'concurrent/collection/map/mri_map_backend'
|
17
|
+
MriMapBackend
|
18
|
+
when 'rbx'
|
19
|
+
require 'concurrent/collection/map/atomic_reference_map_backend'
|
20
|
+
AtomicReferenceMapBackend
|
21
|
+
when 'jruby+truffle'
|
22
|
+
require 'concurrent/collection/map/atomic_reference_map_backend'
|
23
|
+
AtomicReferenceMapBackend
|
24
|
+
else
|
25
|
+
warn 'Concurrent::Map: unsupported Ruby engine, using a fully synchronized Concurrent::Map implementation' if $VERBOSE
|
26
|
+
require 'concurrent/collection/map/synchronized_map_backend'
|
27
|
+
SynchronizedMapBackend
|
28
|
+
end
|
29
|
+
else
|
30
|
+
MriMapBackend
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# `Concurrent::Map` is a hash-like object and should have much better performance
|
35
|
+
# characteristics, especially under high concurrency, than `Concurrent::Hash`.
|
36
|
+
# However, `Concurrent::Map `is not strictly semantically equivalent to a ruby `Hash`
|
37
|
+
# -- for instance, it does not necessarily retain ordering by insertion time as `Hash`
|
38
|
+
# does. For most uses it should do fine though, and we recommend you consider
|
39
|
+
# `Concurrent::Map` instead of `Concurrent::Hash` for your concurrency-safe hash needs.
|
40
|
+
#
|
41
|
+
# > require 'concurrent'
|
42
|
+
# >
|
43
|
+
# > map = Concurrent::Map.new
|
44
|
+
class Map < Collection::MapImplementation
|
45
|
+
|
46
|
+
# @!macro [new] map_method_is_atomic
|
47
|
+
# This method is atomic. Atomic methods of `Map` which accept a block
|
48
|
+
# do not allow the `self` instance to be used within the block. Doing
|
49
|
+
# so will cause a deadlock.
|
50
|
+
|
51
|
+
# @!method put_if_absent
|
52
|
+
# @!macro map_method_is_atomic
|
53
|
+
|
54
|
+
# @!method compute_if_absent
|
55
|
+
# @!macro map_method_is_atomic
|
56
|
+
|
57
|
+
# @!method compute_if_present
|
58
|
+
# @!macro map_method_is_atomic
|
59
|
+
|
60
|
+
# @!method compute
|
61
|
+
# @!macro map_method_is_atomic
|
62
|
+
|
63
|
+
# @!method merge_pair
|
64
|
+
# @!macro map_method_is_atomic
|
65
|
+
|
66
|
+
# @!method replace_pair
|
67
|
+
# @!macro map_method_is_atomic
|
68
|
+
|
69
|
+
# @!method replace_if_exists
|
70
|
+
# @!macro map_method_is_atomic
|
71
|
+
|
72
|
+
# @!method get_and_set
|
73
|
+
# @!macro map_method_is_atomic
|
74
|
+
|
75
|
+
# @!method delete
|
76
|
+
# @!macro map_method_is_atomic
|
77
|
+
|
78
|
+
# @!method delete_pair
|
79
|
+
# @!macro map_method_is_atomic
|
80
|
+
|
81
|
+
def initialize(options = nil, &block)
|
82
|
+
if options.kind_of?(::Hash)
|
83
|
+
validate_options_hash!(options)
|
84
|
+
else
|
85
|
+
options = nil
|
86
|
+
end
|
87
|
+
|
88
|
+
super(options)
|
89
|
+
@default_proc = block
|
90
|
+
end
|
91
|
+
|
92
|
+
def [](key)
|
93
|
+
if value = super # non-falsy value is an existing mapping, return it right away
|
94
|
+
value
|
95
|
+
# re-check is done with get_or_default(key, NULL) instead of a simple !key?(key) in order to avoid a race condition, whereby by the time the current thread gets to the key?(key) call
|
96
|
+
# a key => value mapping might have already been created by a different thread (key?(key) would then return true, this elsif branch wouldn't be taken and an incorrent +nil+ value
|
97
|
+
# would be returned)
|
98
|
+
# note: nil == value check is not technically necessary
|
99
|
+
elsif @default_proc && nil == value && NULL == (value = get_or_default(key, NULL))
|
100
|
+
@default_proc.call(self, key)
|
101
|
+
else
|
102
|
+
value
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
alias_method :get, :[]
|
107
|
+
alias_method :put, :[]=
|
108
|
+
|
109
|
+
# @!macro [attach] map_method_not_atomic
|
110
|
+
# The "fetch-then-act" methods of `Map` are not atomic. `Map` is intended
|
111
|
+
# to be use as a concurrency primitive with strong happens-before
|
112
|
+
# guarantees. It is not intended to be used as a high-level abstraction
|
113
|
+
# supporting complex operations. All read and write operations are
|
114
|
+
# thread safe, but no guarantees are made regarding race conditions
|
115
|
+
# between the fetch operation and yielding to the block. Additionally,
|
116
|
+
# this method does not support recursion. This is due to internal
|
117
|
+
# constraints that are very unlikely to change in the near future.
|
118
|
+
def fetch(key, default_value = NULL)
|
119
|
+
if NULL != (value = get_or_default(key, NULL))
|
120
|
+
value
|
121
|
+
elsif block_given?
|
122
|
+
yield key
|
123
|
+
elsif NULL != default_value
|
124
|
+
default_value
|
125
|
+
else
|
126
|
+
raise_fetch_no_key
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# @!macro map_method_not_atomic
|
131
|
+
def fetch_or_store(key, default_value = NULL)
|
132
|
+
fetch(key) do
|
133
|
+
put(key, block_given? ? yield(key) : (NULL == default_value ? raise_fetch_no_key : default_value))
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
# @!macro map_method_is_atomic
|
138
|
+
def put_if_absent(key, value)
|
139
|
+
computed = false
|
140
|
+
result = compute_if_absent(key) do
|
141
|
+
computed = true
|
142
|
+
value
|
143
|
+
end
|
144
|
+
computed ? nil : result
|
145
|
+
end unless method_defined?(:put_if_absent)
|
146
|
+
|
147
|
+
def value?(value)
|
148
|
+
each_value do |v|
|
149
|
+
return true if value.equal?(v)
|
150
|
+
end
|
151
|
+
false
|
152
|
+
end
|
153
|
+
|
154
|
+
def keys
|
155
|
+
arr = []
|
156
|
+
each_pair {|k, v| arr << k}
|
157
|
+
arr
|
158
|
+
end unless method_defined?(:keys)
|
159
|
+
|
160
|
+
def values
|
161
|
+
arr = []
|
162
|
+
each_pair {|k, v| arr << v}
|
163
|
+
arr
|
164
|
+
end unless method_defined?(:values)
|
165
|
+
|
166
|
+
def each_key
|
167
|
+
each_pair {|k, v| yield k}
|
168
|
+
end unless method_defined?(:each_key)
|
169
|
+
|
170
|
+
def each_value
|
171
|
+
each_pair {|k, v| yield v}
|
172
|
+
end unless method_defined?(:each_value)
|
173
|
+
|
174
|
+
alias_method :each, :each_pair unless method_defined?(:each)
|
175
|
+
|
176
|
+
def key(value)
|
177
|
+
each_pair {|k, v| return k if v == value}
|
178
|
+
nil
|
179
|
+
end unless method_defined?(:key)
|
180
|
+
alias_method :index, :key if RUBY_VERSION < '1.9'
|
181
|
+
|
182
|
+
def empty?
|
183
|
+
each_pair {|k, v| return false}
|
184
|
+
true
|
185
|
+
end unless method_defined?(:empty?)
|
186
|
+
|
187
|
+
def size
|
188
|
+
count = 0
|
189
|
+
each_pair {|k, v| count += 1}
|
190
|
+
count
|
191
|
+
end unless method_defined?(:size)
|
192
|
+
|
193
|
+
def marshal_dump
|
194
|
+
raise TypeError, "can't dump hash with default proc" if @default_proc
|
195
|
+
h = {}
|
196
|
+
each_pair {|k, v| h[k] = v}
|
197
|
+
h
|
198
|
+
end
|
199
|
+
|
200
|
+
def marshal_load(hash)
|
201
|
+
initialize
|
202
|
+
populate_from(hash)
|
203
|
+
end
|
204
|
+
|
205
|
+
undef :freeze
|
206
|
+
|
207
|
+
# @!visibility private
|
208
|
+
DEFAULT_OBJ_ID_STR_WIDTH = 0.size == 4 ? 7 : 14 # we want to look "native", 7 for 32-bit, 14 for 64-bit
|
209
|
+
# override default #inspect() method: firstly, we don't want to be spilling our guts (i-vars), secondly, MRI backend's
|
210
|
+
# #inspect() call on its @backend i-var will bump @backend's iter level while possibly yielding GVL
|
211
|
+
def inspect
|
212
|
+
id_str = (object_id << 1).to_s(16).rjust(DEFAULT_OBJ_ID_STR_WIDTH, '0')
|
213
|
+
"#<#{self.class.name}:0x#{id_str} entries=#{size} default_proc=#{@default_proc.inspect}>"
|
214
|
+
end
|
215
|
+
|
216
|
+
private
|
217
|
+
def raise_fetch_no_key
|
218
|
+
raise KeyError, 'key not found'
|
219
|
+
end
|
220
|
+
|
221
|
+
def initialize_copy(other)
|
222
|
+
super
|
223
|
+
populate_from(other)
|
224
|
+
end
|
225
|
+
|
226
|
+
def populate_from(hash)
|
227
|
+
hash.each_pair {|k, v| self[k] = v}
|
228
|
+
self
|
229
|
+
end
|
230
|
+
|
231
|
+
def validate_options_hash!(options)
|
232
|
+
if (initial_capacity = options[:initial_capacity]) && (!initial_capacity.kind_of?(Integer) || initial_capacity < 0)
|
233
|
+
raise ArgumentError, ":initial_capacity must be a positive Integer"
|
234
|
+
end
|
235
|
+
if (load_factor = options[:load_factor]) && (!load_factor.kind_of?(Numeric) || load_factor <= 0 || load_factor > 1)
|
236
|
+
raise ArgumentError, ":load_factor must be a number between 0 and 1"
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
@@ -0,0 +1,229 @@
|
|
1
|
+
require 'concurrent/synchronization'
|
2
|
+
|
3
|
+
module Concurrent
|
4
|
+
|
5
|
+
# A `Maybe` encapsulates an optional value. A `Maybe` either contains a value
|
6
|
+
# of (represented as `Just`), or it is empty (represented as `Nothing`). Using
|
7
|
+
# `Maybe` is a good way to deal with errors or exceptional cases without
|
8
|
+
# resorting to drastic measures such as exceptions.
|
9
|
+
#
|
10
|
+
# `Maybe` is a replacement for the use of `nil` with better type checking.
|
11
|
+
#
|
12
|
+
# For compatibility with {Concurrent::Concern::Obligation} the predicate and
|
13
|
+
# accessor methods are aliased as `fulfilled?`, `rejected?`, `value`, and
|
14
|
+
# `reason`.
|
15
|
+
#
|
16
|
+
# ## Motivation
|
17
|
+
#
|
18
|
+
# A common pattern in languages with pattern matching, such as Erlang and
|
19
|
+
# Haskell, is to return *either* a value *or* an error from a function
|
20
|
+
# Consider this Erlang code:
|
21
|
+
#
|
22
|
+
# ```erlang
|
23
|
+
# case file:consult("data.dat") of
|
24
|
+
# {ok, Terms} -> do_something_useful(Terms);
|
25
|
+
# {error, Reason} -> lager:error(Reason)
|
26
|
+
# end.
|
27
|
+
# ```
|
28
|
+
#
|
29
|
+
# In this example the standard library function `file:consult` returns a
|
30
|
+
# [tuple](http://erlang.org/doc/reference_manual/data_types.html#id69044)
|
31
|
+
# with two elements: an [atom](http://erlang.org/doc/reference_manual/data_types.html#id64134)
|
32
|
+
# (similar to a ruby symbol) and a variable containing ancillary data. On
|
33
|
+
# success it returns the atom `ok` and the data from the file. On failure it
|
34
|
+
# returns `error` and a string with an explanation of the problem. With this
|
35
|
+
# pattern there is no ambiguity regarding success or failure. If the file is
|
36
|
+
# empty the return value cannot be misinterpreted as an error. And when an
|
37
|
+
# error occurs the return value provides useful information.
|
38
|
+
#
|
39
|
+
# In Ruby we tend to return `nil` when an error occurs or else we raise an
|
40
|
+
# exception. Both of these idioms are problematic. Returning `nil` is
|
41
|
+
# ambiguous because `nil` may also be a valid value. It also lacks
|
42
|
+
# information pertaining to the nature of the error. Raising an exception
|
43
|
+
# is both expensive and usurps the normal flow of control. All of these
|
44
|
+
# problems can be solved with the use of a `Maybe`.
|
45
|
+
#
|
46
|
+
# A `Maybe` is unambiguous with regard to whether or not it contains a value.
|
47
|
+
# When `Just` it contains a value, when `Nothing` it does not. When `Just`
|
48
|
+
# the value it contains may be `nil`, which is perfectly valid. When
|
49
|
+
# `Nothing` the reason for the lack of a value is contained as well. The
|
50
|
+
# previous Erlang example can be duplicated in Ruby in a principled way by
|
51
|
+
# having functions return `Maybe` objects:
|
52
|
+
#
|
53
|
+
# ```ruby
|
54
|
+
# result = MyFileUtils.consult("data.dat") # returns a Maybe
|
55
|
+
# if result.just?
|
56
|
+
# do_something_useful(result.value) # or result.just
|
57
|
+
# else
|
58
|
+
# logger.error(result.reason) # or result.nothing
|
59
|
+
# end
|
60
|
+
# ```
|
61
|
+
#
|
62
|
+
# @example Returning a Maybe from a Function
|
63
|
+
# module MyFileUtils
|
64
|
+
# def self.consult(path)
|
65
|
+
# file = File.open(path, 'r')
|
66
|
+
# Concurrent::Maybe.just(file.read)
|
67
|
+
# rescue => ex
|
68
|
+
# return Concurrent::Maybe.nothing(ex)
|
69
|
+
# ensure
|
70
|
+
# file.close if file
|
71
|
+
# end
|
72
|
+
# end
|
73
|
+
#
|
74
|
+
# maybe = MyFileUtils.consult('bogus.file')
|
75
|
+
# maybe.just? #=> false
|
76
|
+
# maybe.nothing? #=> true
|
77
|
+
# maybe.reason #=> #<Errno::ENOENT: No such file or directory @ rb_sysopen - bogus.file>
|
78
|
+
#
|
79
|
+
# maybe = MyFileUtils.consult('README.md')
|
80
|
+
# maybe.just? #=> true
|
81
|
+
# maybe.nothing? #=> false
|
82
|
+
# maybe.value #=> "# Concurrent Ruby\n[![Gem Version..."
|
83
|
+
#
|
84
|
+
# @example Using Maybe with a Block
|
85
|
+
# result = Concurrent::Maybe.from do
|
86
|
+
# Client.find(10) # Client is an ActiveRecord model
|
87
|
+
# end
|
88
|
+
#
|
89
|
+
# # -- if the record was found
|
90
|
+
# result.just? #=> true
|
91
|
+
# result.value #=> #<Client id: 10, first_name: "Ryan">
|
92
|
+
#
|
93
|
+
# # -- if the record was not found
|
94
|
+
# result.just? #=> false
|
95
|
+
# result.reason #=> ActiveRecord::RecordNotFound
|
96
|
+
#
|
97
|
+
# @example Using Maybe with the Null Object Pattern
|
98
|
+
# # In a Rails controller...
|
99
|
+
# result = ClientService.new(10).find # returns a Maybe
|
100
|
+
# render json: result.or(NullClient.new)
|
101
|
+
#
|
102
|
+
# @see https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html Haskell Data.Maybe
|
103
|
+
# @see https://github.com/purescript/purescript-maybe/blob/master/docs/Data.Maybe.md PureScript Data.Maybe
|
104
|
+
class Maybe < Synchronization::Object
|
105
|
+
include Comparable
|
106
|
+
safe_initialization!
|
107
|
+
|
108
|
+
# Indicates that the given attribute has not been set.
|
109
|
+
# When `Just` the {#nothing} getter will return `NONE`.
|
110
|
+
# When `Nothing` the {#just} getter will return `NONE`.
|
111
|
+
NONE = Object.new.freeze
|
112
|
+
|
113
|
+
# The value of a `Maybe` when `Just`. Will be `NONE` when `Nothing`.
|
114
|
+
attr_reader :just
|
115
|
+
|
116
|
+
# The reason for the `Maybe` when `Nothing`. Will be `NONE` when `Just`.
|
117
|
+
attr_reader :nothing
|
118
|
+
|
119
|
+
private_class_method :new
|
120
|
+
|
121
|
+
# Create a new `Maybe` using the given block.
|
122
|
+
#
|
123
|
+
# Runs the given block passing all function arguments to the block as block
|
124
|
+
# arguments. If the block runs to completion without raising an exception
|
125
|
+
# a new `Just` is created with the value set to the return value of the
|
126
|
+
# block. If the block raises an exception a new `Nothing` is created with
|
127
|
+
# the reason being set to the raised exception.
|
128
|
+
#
|
129
|
+
# @param [Array<Object>] args Zero or more arguments to pass to the block.
|
130
|
+
# @yield The block from which to create a new `Maybe`.
|
131
|
+
# @yieldparam [Array<Object>] args Zero or more block arguments passed as
|
132
|
+
# arguments to the function.
|
133
|
+
#
|
134
|
+
# @return [Maybe] The newly created object.
|
135
|
+
#
|
136
|
+
# @raise [ArgumentError] when no block given.
|
137
|
+
def self.from(*args)
|
138
|
+
raise ArgumentError.new('no block given') unless block_given?
|
139
|
+
begin
|
140
|
+
value = yield(*args)
|
141
|
+
return new(value, NONE)
|
142
|
+
rescue => ex
|
143
|
+
return new(NONE, ex)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
# Create a new `Just` with the given value.
|
148
|
+
#
|
149
|
+
# @param [Object] value The value to set for the new `Maybe` object.
|
150
|
+
#
|
151
|
+
# @return [Maybe] The newly created object.
|
152
|
+
def self.just(value)
|
153
|
+
return new(value, NONE)
|
154
|
+
end
|
155
|
+
|
156
|
+
# Create a new `Nothing` with the given (optional) reason.
|
157
|
+
#
|
158
|
+
# @param [Exception] error The reason to set for the new `Maybe` object.
|
159
|
+
# When given a string a new `StandardError` will be created with the
|
160
|
+
# argument as the message. When no argument is given a new
|
161
|
+
# `StandardError` with an empty message will be created.
|
162
|
+
#
|
163
|
+
# @return [Maybe] The newly created object.
|
164
|
+
def self.nothing(error = '')
|
165
|
+
if error.is_a?(Exception)
|
166
|
+
nothing = error
|
167
|
+
else
|
168
|
+
nothing = StandardError.new(error.to_s)
|
169
|
+
end
|
170
|
+
return new(NONE, nothing)
|
171
|
+
end
|
172
|
+
|
173
|
+
# Is this `Maybe` a `Just` (successfully fulfilled with a value)?
|
174
|
+
#
|
175
|
+
# @return [Boolean] True if `Just` or false if `Nothing`.
|
176
|
+
def just?
|
177
|
+
! nothing?
|
178
|
+
end
|
179
|
+
alias :fulfilled? :just?
|
180
|
+
|
181
|
+
# Is this `Maybe` a `nothing` (rejected with an exception upon fulfillment)?
|
182
|
+
#
|
183
|
+
# @return [Boolean] True if `Nothing` or false if `Just`.
|
184
|
+
def nothing?
|
185
|
+
@nothing != NONE
|
186
|
+
end
|
187
|
+
alias :rejected? :nothing?
|
188
|
+
|
189
|
+
alias :value :just
|
190
|
+
|
191
|
+
alias :reason :nothing
|
192
|
+
|
193
|
+
# Comparison operator.
|
194
|
+
#
|
195
|
+
# @return [Integer] 0 if self and other are both `Nothing`;
|
196
|
+
# -1 if self is `Nothing` and other is `Just`;
|
197
|
+
# 1 if self is `Just` and other is nothing;
|
198
|
+
# `self.just <=> other.just` if both self and other are `Just`.
|
199
|
+
def <=>(other)
|
200
|
+
if nothing?
|
201
|
+
other.nothing? ? 0 : -1
|
202
|
+
else
|
203
|
+
other.nothing? ? 1 : just <=> other.just
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
# Return either the value of self or the given default value.
|
208
|
+
#
|
209
|
+
# @return [Object] The value of self when `Just`; else the given default.
|
210
|
+
def or(other)
|
211
|
+
just? ? just : other
|
212
|
+
end
|
213
|
+
|
214
|
+
private
|
215
|
+
|
216
|
+
# Create a new `Maybe` with the given attributes.
|
217
|
+
#
|
218
|
+
# @param [Object] just The value when `Just` else `NONE`.
|
219
|
+
# @param [Exception, Object] nothing The exception when `Nothing` else `NONE`.
|
220
|
+
#
|
221
|
+
# @return [Maybe] The new `Maybe`.
|
222
|
+
#
|
223
|
+
# @!visibility private
|
224
|
+
def initialize(just, nothing)
|
225
|
+
@just = just
|
226
|
+
@nothing = nothing
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
@@ -0,0 +1,228 @@
|
|
1
|
+
require 'concurrent/synchronization/abstract_struct'
|
2
|
+
require 'concurrent/synchronization'
|
3
|
+
|
4
|
+
module Concurrent
|
5
|
+
|
6
|
+
# An thread-safe variation of Ruby's standard `Struct`. Values can be set at
|
7
|
+
# construction or safely changed at any time during the object's lifecycle.
|
8
|
+
#
|
9
|
+
# @see http://ruby-doc.org/core-2.2.0/Struct.html Ruby standard library `Struct`
|
10
|
+
module MutableStruct
|
11
|
+
include Synchronization::AbstractStruct
|
12
|
+
|
13
|
+
# @!macro [new] struct_new
|
14
|
+
#
|
15
|
+
# Factory for creating new struct classes.
|
16
|
+
#
|
17
|
+
# ```
|
18
|
+
# new([class_name] [, member_name]+>) -> StructClass click to toggle source
|
19
|
+
# new([class_name] [, member_name]+>) {|StructClass| block } -> StructClass
|
20
|
+
# new(value, ...) -> obj
|
21
|
+
# StructClass[value, ...] -> obj
|
22
|
+
# ```
|
23
|
+
#
|
24
|
+
# The first two forms are used to create a new struct subclass `class_name`
|
25
|
+
# that can contain a value for each member_name . This subclass can be
|
26
|
+
# used to create instances of the structure like any other Class .
|
27
|
+
#
|
28
|
+
# If the `class_name` is omitted an anonymous struct class will be created.
|
29
|
+
# Otherwise, the name of this struct will appear as a constant in the struct class,
|
30
|
+
# so it must be unique for all structs under this base class and must start with a
|
31
|
+
# capital letter. Assigning a struct class to a constant also gives the class
|
32
|
+
# the name of the constant.
|
33
|
+
#
|
34
|
+
# If a block is given it will be evaluated in the context of `StructClass`, passing
|
35
|
+
# the created class as a parameter. This is the recommended way to customize a struct.
|
36
|
+
# Subclassing an anonymous struct creates an extra anonymous class that will never be used.
|
37
|
+
#
|
38
|
+
# The last two forms create a new instance of a struct subclass. The number of value
|
39
|
+
# parameters must be less than or equal to the number of attributes defined for the
|
40
|
+
# struct. Unset parameters default to nil. Passing more parameters than number of attributes
|
41
|
+
# will raise an `ArgumentError`.
|
42
|
+
#
|
43
|
+
# @see http://ruby-doc.org/core-2.2.0/Struct.html#method-c-new Ruby standard library `Struct#new`
|
44
|
+
|
45
|
+
# @!macro [attach] struct_values
|
46
|
+
#
|
47
|
+
# Returns the values for this struct as an Array.
|
48
|
+
#
|
49
|
+
# @return [Array] the values for this struct
|
50
|
+
#
|
51
|
+
def values
|
52
|
+
synchronize { ns_values }
|
53
|
+
end
|
54
|
+
alias_method :to_a, :values
|
55
|
+
|
56
|
+
# @!macro [attach] struct_values_at
|
57
|
+
#
|
58
|
+
# Returns the struct member values for each selector as an Array.
|
59
|
+
#
|
60
|
+
# A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`).
|
61
|
+
#
|
62
|
+
# @param [Fixnum, Range] indexes the index(es) from which to obatin the values (in order)
|
63
|
+
def values_at(*indexes)
|
64
|
+
synchronize { ns_values_at(indexes) }
|
65
|
+
end
|
66
|
+
|
67
|
+
# @!macro [attach] struct_inspect
|
68
|
+
#
|
69
|
+
# Describe the contents of this struct in a string.
|
70
|
+
#
|
71
|
+
# @return [String] the contents of this struct in a string
|
72
|
+
def inspect
|
73
|
+
synchronize { ns_inspect }
|
74
|
+
end
|
75
|
+
alias_method :to_s, :inspect
|
76
|
+
|
77
|
+
# @!macro [attach] struct_merge
|
78
|
+
#
|
79
|
+
# Returns a new struct containing the contents of `other` and the contents
|
80
|
+
# of `self`. If no block is specified, the value for entries with duplicate
|
81
|
+
# keys will be that of `other`. Otherwise the value for each duplicate key
|
82
|
+
# is determined by calling the block with the key, its value in `self` and
|
83
|
+
# its value in `other`.
|
84
|
+
#
|
85
|
+
# @param [Hash] other the hash from which to set the new values
|
86
|
+
# @yield an options block for resolving duplicate keys
|
87
|
+
# @yieldparam [String, Symbol] member the name of the member which is duplicated
|
88
|
+
# @yieldparam [Object] selfvalue the value of the member in `self`
|
89
|
+
# @yieldparam [Object] othervalue the value of the member in `other`
|
90
|
+
#
|
91
|
+
# @return [Synchronization::AbstractStruct] a new struct with the new values
|
92
|
+
#
|
93
|
+
# @raise [ArgumentError] of given a member that is not defined in the struct
|
94
|
+
def merge(other, &block)
|
95
|
+
synchronize { ns_merge(other, &block) }
|
96
|
+
end
|
97
|
+
|
98
|
+
# @!macro [attach] struct_to_h
|
99
|
+
#
|
100
|
+
# Returns a hash containing the names and values for the struct’s members.
|
101
|
+
#
|
102
|
+
# @return [Hash] the names and values for the struct’s members
|
103
|
+
def to_h
|
104
|
+
synchronize { ns_to_h }
|
105
|
+
end
|
106
|
+
|
107
|
+
# @!macro [attach] struct_get
|
108
|
+
#
|
109
|
+
# Attribute Reference
|
110
|
+
#
|
111
|
+
# @param [Symbol, String, Integer] member the string or symbol name of the memeber
|
112
|
+
# for which to obtain the value or the member's index
|
113
|
+
#
|
114
|
+
# @return [Object] the value of the given struct member or the member at the given index.
|
115
|
+
#
|
116
|
+
# @raise [NameError] if the member does not exist
|
117
|
+
# @raise [IndexError] if the index is out of range.
|
118
|
+
def [](member)
|
119
|
+
synchronize { ns_get(member) }
|
120
|
+
end
|
121
|
+
|
122
|
+
# @!macro [attach] struct_equality
|
123
|
+
#
|
124
|
+
# Equality
|
125
|
+
#
|
126
|
+
# @return [Boolean] true if other has the same struct subclass and has
|
127
|
+
# equal member values (according to `Object#==`)
|
128
|
+
def ==(other)
|
129
|
+
synchronize { ns_equality(other) }
|
130
|
+
end
|
131
|
+
|
132
|
+
# @!macro [attach] struct_each
|
133
|
+
#
|
134
|
+
# Yields the value of each struct member in order. If no block is given
|
135
|
+
# an enumerator is returned.
|
136
|
+
#
|
137
|
+
# @yield the operation to be performed on each struct member
|
138
|
+
# @yieldparam [Object] value each struct value (in order)
|
139
|
+
def each(&block)
|
140
|
+
return enum_for(:each) unless block_given?
|
141
|
+
synchronize { ns_each(&block) }
|
142
|
+
end
|
143
|
+
|
144
|
+
# @!macro [attach] struct_each_pair
|
145
|
+
#
|
146
|
+
# Yields the name and value of each struct member in order. If no block is
|
147
|
+
# given an enumerator is returned.
|
148
|
+
#
|
149
|
+
# @yield the operation to be performed on each struct member/value pair
|
150
|
+
# @yieldparam [Object] member each struct member (in order)
|
151
|
+
# @yieldparam [Object] value each struct value (in order)
|
152
|
+
def each_pair(&block)
|
153
|
+
return enum_for(:each_pair) unless block_given?
|
154
|
+
synchronize { ns_each_pair(&block) }
|
155
|
+
end
|
156
|
+
|
157
|
+
# @!macro [attach] struct_select
|
158
|
+
#
|
159
|
+
# Yields each member value from the struct to the block and returns an Array
|
160
|
+
# containing the member values from the struct for which the given block
|
161
|
+
# returns a true value (equivalent to `Enumerable#select`).
|
162
|
+
#
|
163
|
+
# @yield the operation to be performed on each struct member
|
164
|
+
# @yieldparam [Object] value each struct value (in order)
|
165
|
+
#
|
166
|
+
# @return [Array] an array containing each value for which the block returns true
|
167
|
+
def select(&block)
|
168
|
+
return enum_for(:select) unless block_given?
|
169
|
+
synchronize { ns_select(&block) }
|
170
|
+
end
|
171
|
+
|
172
|
+
# @!macro [new] struct_set
|
173
|
+
#
|
174
|
+
# Attribute Assignment
|
175
|
+
#
|
176
|
+
# Sets the value of the given struct member or the member at the given index.
|
177
|
+
#
|
178
|
+
# @param [Symbol, String, Integer] member the string or symbol name of the memeber
|
179
|
+
# for which to obtain the value or the member's index
|
180
|
+
#
|
181
|
+
# @return [Object] the value of the given struct member or the member at the given index.
|
182
|
+
#
|
183
|
+
# @raise [NameError] if the name does not exist
|
184
|
+
# @raise [IndexError] if the index is out of range.
|
185
|
+
def []=(member, value)
|
186
|
+
if member.is_a? Integer
|
187
|
+
length = synchronize { @values.length }
|
188
|
+
if member >= length
|
189
|
+
raise IndexError.new("offset #{member} too large for struct(size:#{length})")
|
190
|
+
end
|
191
|
+
synchronize { @values[member] = value }
|
192
|
+
else
|
193
|
+
send("#{member}=", value)
|
194
|
+
end
|
195
|
+
rescue NoMethodError
|
196
|
+
raise NameError.new("no member '#{member}' in struct")
|
197
|
+
end
|
198
|
+
|
199
|
+
# @!macro struct_new
|
200
|
+
def self.new(*args, &block)
|
201
|
+
clazz_name = nil
|
202
|
+
if args.length == 0
|
203
|
+
raise ArgumentError.new('wrong number of arguments (0 for 1+)')
|
204
|
+
elsif args.length > 0 && args.first.is_a?(String)
|
205
|
+
clazz_name = args.shift
|
206
|
+
end
|
207
|
+
FACTORY.define_struct(clazz_name, args, &block)
|
208
|
+
end
|
209
|
+
|
210
|
+
FACTORY = Class.new(Synchronization::LockableObject) do
|
211
|
+
def define_struct(name, members, &block)
|
212
|
+
synchronize do
|
213
|
+
clazz = Synchronization::AbstractStruct.define_struct_class(MutableStruct, Synchronization::LockableObject, name, members, &block)
|
214
|
+
members.each_with_index do |member, index|
|
215
|
+
clazz.send(:define_method, member) do
|
216
|
+
synchronize { @values[index] }
|
217
|
+
end
|
218
|
+
clazz.send(:define_method, "#{member}=") do |value|
|
219
|
+
synchronize { @values[index] = value }
|
220
|
+
end
|
221
|
+
end
|
222
|
+
clazz
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end.new
|
226
|
+
private_constant :FACTORY
|
227
|
+
end
|
228
|
+
end
|