backbone-deep-rails 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/lib/backbone/deep/rails/version.rb +1 -1
- metadata +18 -245
- data/vendor/bundle/cache/activemodel-3.2.11.gem +0 -0
- data/vendor/bundle/cache/activesupport-3.2.11.gem +0 -0
- data/vendor/bundle/gems/activesupport-3.2.11/CHANGELOG.md +0 -157
- data/vendor/bundle/gems/activesupport-3.2.11/MIT-LICENSE +0 -20
- data/vendor/bundle/gems/activesupport-3.2.11/README.rdoc +0 -33
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support.rb +0 -82
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/all.rb +0 -3
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/backtrace_cleaner.rb +0 -99
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/base64.rb +0 -54
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/basic_object.rb +0 -21
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/benchmarkable.rb +0 -55
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/buffered_logger.rb +0 -125
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/builder.rb +0 -6
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache.rb +0 -638
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/file_store.rb +0 -178
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/mem_cache_store.rb +0 -206
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/memory_store.rb +0 -159
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/null_store.rb +0 -44
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/cache/strategy/local_cache.rb +0 -169
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/callbacks.rb +0 -626
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/concern.rb +0 -131
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/configurable.rb +0 -90
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext.rb +0 -3
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array.rb +0 -8
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/access.rb +0 -46
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/conversions.rb +0 -164
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/extract_options.rb +0 -29
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/grouping.rb +0 -100
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/prepend_and_append.rb +0 -7
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/random_access.rb +0 -30
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/uniq_by.rb +0 -16
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/array/wrap.rb +0 -48
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/benchmark.rb +0 -7
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/big_decimal.rb +0 -1
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/big_decimal/conversions.rb +0 -45
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class.rb +0 -4
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class/attribute.rb +0 -115
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class/attribute_accessors.rb +0 -168
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class/delegating_attributes.rb +0 -44
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/class/subclasses.rb +0 -36
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/acts_like.rb +0 -8
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/calculations.rb +0 -276
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/conversions.rb +0 -106
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/freeze.rb +0 -33
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date/zones.rb +0 -14
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date_time/acts_like.rb +0 -13
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date_time/calculations.rb +0 -143
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date_time/conversions.rb +0 -103
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/date_time/zones.rb +0 -21
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/enumerable.rb +0 -127
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/exception.rb +0 -3
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/file.rb +0 -2
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/file/atomic.rb +0 -42
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/file/path.rb +0 -5
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/float.rb +0 -1
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/float/rounding.rb +0 -19
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash.rb +0 -9
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/conversions.rb +0 -175
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/deep_dup.rb +0 -18
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/deep_merge.rb +0 -21
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/diff.rb +0 -13
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/except.rb +0 -23
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/indifferent_access.rb +0 -24
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/keys.rb +0 -54
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/reverse_merge.rb +0 -23
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/slice.rb +0 -40
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/integer.rb +0 -3
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/integer/inflections.rb +0 -17
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/integer/multiple.rb +0 -10
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/integer/time.rb +0 -39
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/io.rb +0 -15
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel.rb +0 -4
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/agnostics.rb +0 -11
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/debugger.rb +0 -10
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/reporting.rb +0 -93
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/kernel/singleton_class.rb +0 -13
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/load_error.rb +0 -23
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/logger.rb +0 -83
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module.rb +0 -12
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/aliasing.rb +0 -70
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/anonymous.rb +0 -24
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/attr_internal.rb +0 -39
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/attribute_accessors.rb +0 -64
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/delegation.rb +0 -153
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/deprecation.rb +0 -9
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/introspection.rb +0 -88
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/method_names.rb +0 -14
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/qualified_const.rb +0 -64
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/reachable.rb +0 -8
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/remove_method.rb +0 -16
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/module/synchronization.rb +0 -45
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/name_error.rb +0 -18
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/numeric.rb +0 -2
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/numeric/bytes.rb +0 -44
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/numeric/time.rb +0 -79
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object.rb +0 -13
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/acts_like.rb +0 -10
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/blank.rb +0 -121
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/conversions.rb +0 -4
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/duplicable.rb +0 -119
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/inclusion.rb +0 -25
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/instance_variables.rb +0 -33
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/to_json.rb +0 -19
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/to_param.rb +0 -55
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/to_query.rb +0 -27
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/try.rb +0 -57
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/object/with_options.rb +0 -43
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/proc.rb +0 -14
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/process.rb +0 -1
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/process/daemon.rb +0 -23
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range.rb +0 -5
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/blockless_step.rb +0 -29
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/conversions.rb +0 -21
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/cover.rb +0 -3
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/include_range.rb +0 -21
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/range/overlaps.rb +0 -8
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/regexp.rb +0 -5
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/rexml.rb +0 -46
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string.rb +0 -14
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/access.rb +0 -99
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/behavior.rb +0 -6
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/conversions.rb +0 -66
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/encoding.rb +0 -11
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/exclude.rb +0 -11
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/filters.rb +0 -49
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/inflections.rb +0 -202
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/inquiry.rb +0 -13
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/interpolation.rb +0 -2
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/multibyte.rb +0 -72
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/output_safety.rb +0 -186
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/starts_ends_with.rb +0 -4
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/strip.rb +0 -26
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/string/xchar.rb +0 -18
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/acts_like.rb +0 -8
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/calculations.rb +0 -360
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/conversions.rb +0 -85
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/marshal.rb +0 -57
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/publicize_conversion_methods.rb +0 -10
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/time/zones.rb +0 -86
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/uri.rb +0 -30
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/dependencies.rb +0 -703
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/dependencies/autoload.rb +0 -50
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation.rb +0 -18
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation/behaviors.rb +0 -49
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation/method_wrappers.rb +0 -29
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation/proxy_wrappers.rb +0 -81
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/deprecation/reporting.rb +0 -65
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/descendants_tracker.rb +0 -45
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/duration.rb +0 -110
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/file_update_checker.rb +0 -121
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/file_watcher.rb +0 -36
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/gzip.rb +0 -30
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/hash_with_indifferent_access.rb +0 -178
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/i18n.rb +0 -9
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/i18n_railtie.rb +0 -102
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflections.rb +0 -63
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflector.rb +0 -7
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflector/inflections.rb +0 -174
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb +0 -321
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/inflector/transliterate.rb +0 -98
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/json.rb +0 -2
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/json/decoding.rb +0 -79
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/json/encoding.rb +0 -284
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/json/variable.rb +0 -9
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb +0 -46
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/locale/en.yml +0 -36
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/log_subscriber.rb +0 -122
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/log_subscriber/test_helper.rb +0 -101
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/memoizable.rb +0 -116
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/message_encryptor.rb +0 -103
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/message_verifier.rb +0 -74
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte.rb +0 -44
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte/chars.rb +0 -476
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte/exceptions.rb +0 -8
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte/unicode.rb +0 -393
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/multibyte/utils.rb +0 -60
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/notifications.rb +0 -154
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/notifications/fanout.rb +0 -61
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/notifications/instrumenter.rb +0 -53
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/option_merger.rb +0 -25
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/ordered_hash.rb +0 -222
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/ordered_options.rb +0 -61
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/railtie.rb +0 -59
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/rescuable.rb +0 -115
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/ruby/shim.rb +0 -22
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/string_inquirer.rb +0 -21
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/tagged_logging.rb +0 -80
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/test_case.rb +0 -34
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/assertions.rb +0 -97
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/declarative.rb +0 -40
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/deprecation.rb +0 -55
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/isolation.rb +0 -157
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/mochaing.rb +0 -7
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/pending.rb +0 -52
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance.rb +0 -317
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/jruby.rb +0 -115
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/rubinius.rb +0 -113
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/ruby.rb +0 -152
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/ruby/mri.rb +0 -57
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/performance/ruby/yarv.rb +0 -57
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/testing/setup_and_teardown.rb +0 -118
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/time.rb +0 -35
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/time/autoload.rb +0 -5
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/time_with_zone.rb +0 -358
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/values/time_zone.rb +0 -397
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/values/unicode_tables.dat +0 -0
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/version.rb +0 -10
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/whiny_nil.rb +0 -24
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini.rb +0 -168
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/jdom.rb +0 -175
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/libxml.rb +0 -80
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/libxmlsax.rb +0 -86
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/nokogiri.rb +0 -84
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/nokogirisax.rb +0 -88
- data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/xml_mini/rexml.rb +0 -130
- data/vendor/bundle/specifications/activesupport-3.2.11.gemspec +0 -33
@@ -1,178 +0,0 @@
|
|
1
|
-
require 'active_support/core_ext/file/atomic'
|
2
|
-
require 'active_support/core_ext/string/conversions'
|
3
|
-
require 'active_support/core_ext/object/inclusion'
|
4
|
-
require 'rack/utils'
|
5
|
-
|
6
|
-
module ActiveSupport
|
7
|
-
module Cache
|
8
|
-
# A cache store implementation which stores everything on the filesystem.
|
9
|
-
#
|
10
|
-
# FileStore implements the Strategy::LocalCache strategy which implements
|
11
|
-
# an in-memory cache inside of a block.
|
12
|
-
class FileStore < Store
|
13
|
-
attr_reader :cache_path
|
14
|
-
|
15
|
-
DIR_FORMATTER = "%03X"
|
16
|
-
FILENAME_MAX_SIZE = 230 # max filename size on file system is 255, minus room for timestamp and random characters appended by Tempfile (used by atomic write)
|
17
|
-
EXCLUDED_DIRS = ['.', '..'].freeze
|
18
|
-
|
19
|
-
def initialize(cache_path, options = nil)
|
20
|
-
super(options)
|
21
|
-
@cache_path = cache_path.to_s
|
22
|
-
extend Strategy::LocalCache
|
23
|
-
end
|
24
|
-
|
25
|
-
def clear(options = nil)
|
26
|
-
root_dirs = Dir.entries(cache_path).reject{|f| f.in?(EXCLUDED_DIRS)}
|
27
|
-
FileUtils.rm_r(root_dirs.collect{|f| File.join(cache_path, f)})
|
28
|
-
end
|
29
|
-
|
30
|
-
def cleanup(options = nil)
|
31
|
-
options = merged_options(options)
|
32
|
-
each_key(options) do |key|
|
33
|
-
entry = read_entry(key, options)
|
34
|
-
delete_entry(key, options) if entry && entry.expired?
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def increment(name, amount = 1, options = nil)
|
39
|
-
file_name = key_file_path(namespaced_key(name, options))
|
40
|
-
lock_file(file_name) do
|
41
|
-
options = merged_options(options)
|
42
|
-
if num = read(name, options)
|
43
|
-
num = num.to_i + amount
|
44
|
-
write(name, num, options)
|
45
|
-
num
|
46
|
-
else
|
47
|
-
nil
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def decrement(name, amount = 1, options = nil)
|
53
|
-
file_name = key_file_path(namespaced_key(name, options))
|
54
|
-
lock_file(file_name) do
|
55
|
-
options = merged_options(options)
|
56
|
-
if num = read(name, options)
|
57
|
-
num = num.to_i - amount
|
58
|
-
write(name, num, options)
|
59
|
-
num
|
60
|
-
else
|
61
|
-
nil
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def delete_matched(matcher, options = nil)
|
67
|
-
options = merged_options(options)
|
68
|
-
instrument(:delete_matched, matcher.inspect) do
|
69
|
-
matcher = key_matcher(matcher, options)
|
70
|
-
search_dir(cache_path) do |path|
|
71
|
-
key = file_path_key(path)
|
72
|
-
delete_entry(key, options) if key.match(matcher)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
protected
|
78
|
-
|
79
|
-
def read_entry(key, options)
|
80
|
-
file_name = key_file_path(key)
|
81
|
-
if File.exist?(file_name)
|
82
|
-
File.open(file_name) { |f| Marshal.load(f) }
|
83
|
-
end
|
84
|
-
rescue
|
85
|
-
nil
|
86
|
-
end
|
87
|
-
|
88
|
-
def write_entry(key, entry, options)
|
89
|
-
file_name = key_file_path(key)
|
90
|
-
ensure_cache_path(File.dirname(file_name))
|
91
|
-
File.atomic_write(file_name, cache_path) {|f| Marshal.dump(entry, f)}
|
92
|
-
true
|
93
|
-
end
|
94
|
-
|
95
|
-
def delete_entry(key, options)
|
96
|
-
file_name = key_file_path(key)
|
97
|
-
if File.exist?(file_name)
|
98
|
-
begin
|
99
|
-
File.delete(file_name)
|
100
|
-
delete_empty_directories(File.dirname(file_name))
|
101
|
-
true
|
102
|
-
rescue => e
|
103
|
-
# Just in case the error was caused by another process deleting the file first.
|
104
|
-
raise e if File.exist?(file_name)
|
105
|
-
false
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
private
|
111
|
-
# Lock a file for a block so only one process can modify it at a time.
|
112
|
-
def lock_file(file_name, &block) # :nodoc:
|
113
|
-
if File.exist?(file_name)
|
114
|
-
File.open(file_name, 'r+') do |f|
|
115
|
-
begin
|
116
|
-
f.flock File::LOCK_EX
|
117
|
-
yield
|
118
|
-
ensure
|
119
|
-
f.flock File::LOCK_UN
|
120
|
-
end
|
121
|
-
end
|
122
|
-
else
|
123
|
-
yield
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
# Translate a key into a file path.
|
128
|
-
def key_file_path(key)
|
129
|
-
fname = Rack::Utils.escape(key)
|
130
|
-
hash = Zlib.adler32(fname)
|
131
|
-
hash, dir_1 = hash.divmod(0x1000)
|
132
|
-
dir_2 = hash.modulo(0x1000)
|
133
|
-
fname_paths = []
|
134
|
-
|
135
|
-
# Make sure file name doesn't exceed file system limits.
|
136
|
-
begin
|
137
|
-
fname_paths << fname[0, FILENAME_MAX_SIZE]
|
138
|
-
fname = fname[FILENAME_MAX_SIZE..-1]
|
139
|
-
end until fname.blank?
|
140
|
-
|
141
|
-
File.join(cache_path, DIR_FORMATTER % dir_1, DIR_FORMATTER % dir_2, *fname_paths)
|
142
|
-
end
|
143
|
-
|
144
|
-
# Translate a file path into a key.
|
145
|
-
def file_path_key(path)
|
146
|
-
fname = path[cache_path.size, path.size].split(File::SEPARATOR, 4).last
|
147
|
-
Rack::Utils.unescape(fname)
|
148
|
-
end
|
149
|
-
|
150
|
-
# Delete empty directories in the cache.
|
151
|
-
def delete_empty_directories(dir)
|
152
|
-
return if dir == cache_path
|
153
|
-
if Dir.entries(dir).reject{|f| f.in?(EXCLUDED_DIRS)}.empty?
|
154
|
-
File.delete(dir) rescue nil
|
155
|
-
delete_empty_directories(File.dirname(dir))
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
# Make sure a file path's directories exist.
|
160
|
-
def ensure_cache_path(path)
|
161
|
-
FileUtils.makedirs(path) unless File.exist?(path)
|
162
|
-
end
|
163
|
-
|
164
|
-
def search_dir(dir, &callback)
|
165
|
-
return if !File.exist?(dir)
|
166
|
-
Dir.foreach(dir) do |d|
|
167
|
-
next if d.in?(EXCLUDED_DIRS)
|
168
|
-
name = File.join(dir, d)
|
169
|
-
if File.directory?(name)
|
170
|
-
search_dir(name, &callback)
|
171
|
-
else
|
172
|
-
callback.call name
|
173
|
-
end
|
174
|
-
end
|
175
|
-
end
|
176
|
-
end
|
177
|
-
end
|
178
|
-
end
|
@@ -1,206 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'memcache'
|
3
|
-
rescue LoadError => e
|
4
|
-
$stderr.puts "You don't have memcache-client installed in your application. Please add it to your Gemfile and run bundle install"
|
5
|
-
raise e
|
6
|
-
end
|
7
|
-
|
8
|
-
require 'digest/md5'
|
9
|
-
require 'active_support/core_ext/string/encoding'
|
10
|
-
|
11
|
-
module ActiveSupport
|
12
|
-
module Cache
|
13
|
-
# A cache store implementation which stores data in Memcached:
|
14
|
-
# http://memcached.org/
|
15
|
-
#
|
16
|
-
# This is currently the most popular cache store for production websites.
|
17
|
-
#
|
18
|
-
# Special features:
|
19
|
-
# - Clustering and load balancing. One can specify multiple memcached servers,
|
20
|
-
# and MemCacheStore will load balance between all available servers. If a
|
21
|
-
# server goes down, then MemCacheStore will ignore it until it comes back up.
|
22
|
-
#
|
23
|
-
# MemCacheStore implements the Strategy::LocalCache strategy which implements
|
24
|
-
# an in-memory cache inside of a block.
|
25
|
-
class MemCacheStore < Store
|
26
|
-
module Response # :nodoc:
|
27
|
-
STORED = "STORED\r\n"
|
28
|
-
NOT_STORED = "NOT_STORED\r\n"
|
29
|
-
EXISTS = "EXISTS\r\n"
|
30
|
-
NOT_FOUND = "NOT_FOUND\r\n"
|
31
|
-
DELETED = "DELETED\r\n"
|
32
|
-
end
|
33
|
-
|
34
|
-
ESCAPE_KEY_CHARS = /[\x00-\x20%\x7F-\xFF]/n
|
35
|
-
|
36
|
-
def self.build_mem_cache(*addresses)
|
37
|
-
addresses = addresses.flatten
|
38
|
-
options = addresses.extract_options!
|
39
|
-
addresses = ["localhost:11211"] if addresses.empty?
|
40
|
-
MemCache.new(addresses, options)
|
41
|
-
end
|
42
|
-
|
43
|
-
# Creates a new MemCacheStore object, with the given memcached server
|
44
|
-
# addresses. Each address is either a host name, or a host-with-port string
|
45
|
-
# in the form of "host_name:port". For example:
|
46
|
-
#
|
47
|
-
# ActiveSupport::Cache::MemCacheStore.new("localhost", "server-downstairs.localnetwork:8229")
|
48
|
-
#
|
49
|
-
# If no addresses are specified, then MemCacheStore will connect to
|
50
|
-
# localhost port 11211 (the default memcached port).
|
51
|
-
#
|
52
|
-
# Instead of addresses one can pass in a MemCache-like object. For example:
|
53
|
-
#
|
54
|
-
# require 'memcached' # gem install memcached; uses C bindings to libmemcached
|
55
|
-
# ActiveSupport::Cache::MemCacheStore.new(Memcached::Rails.new("localhost:11211"))
|
56
|
-
def initialize(*addresses)
|
57
|
-
addresses = addresses.flatten
|
58
|
-
options = addresses.extract_options!
|
59
|
-
super(options)
|
60
|
-
|
61
|
-
if addresses.first.respond_to?(:get)
|
62
|
-
@data = addresses.first
|
63
|
-
else
|
64
|
-
mem_cache_options = options.dup
|
65
|
-
UNIVERSAL_OPTIONS.each{|name| mem_cache_options.delete(name)}
|
66
|
-
@data = self.class.build_mem_cache(*(addresses + [mem_cache_options]))
|
67
|
-
end
|
68
|
-
|
69
|
-
extend Strategy::LocalCache
|
70
|
-
extend LocalCacheWithRaw
|
71
|
-
end
|
72
|
-
|
73
|
-
# Reads multiple values from the cache using a single call to the
|
74
|
-
# servers for all keys. Options can be passed in the last argument.
|
75
|
-
def read_multi(*names)
|
76
|
-
options = names.extract_options!
|
77
|
-
options = merged_options(options)
|
78
|
-
keys_to_names = Hash[names.map{|name| [escape_key(namespaced_key(name, options)), name]}]
|
79
|
-
raw_values = @data.get_multi(keys_to_names.keys, :raw => true)
|
80
|
-
values = {}
|
81
|
-
raw_values.each do |key, value|
|
82
|
-
entry = deserialize_entry(value)
|
83
|
-
values[keys_to_names[key]] = entry.value unless entry.expired?
|
84
|
-
end
|
85
|
-
values
|
86
|
-
end
|
87
|
-
|
88
|
-
# Increment a cached value. This method uses the memcached incr atomic
|
89
|
-
# operator and can only be used on values written with the :raw option.
|
90
|
-
# Calling it on a value not stored with :raw will initialize that value
|
91
|
-
# to zero.
|
92
|
-
def increment(name, amount = 1, options = nil) # :nodoc:
|
93
|
-
options = merged_options(options)
|
94
|
-
response = instrument(:increment, name, :amount => amount) do
|
95
|
-
@data.incr(escape_key(namespaced_key(name, options)), amount)
|
96
|
-
end
|
97
|
-
response == Response::NOT_FOUND ? nil : response.to_i
|
98
|
-
rescue MemCache::MemCacheError
|
99
|
-
nil
|
100
|
-
end
|
101
|
-
|
102
|
-
# Decrement a cached value. This method uses the memcached decr atomic
|
103
|
-
# operator and can only be used on values written with the :raw option.
|
104
|
-
# Calling it on a value not stored with :raw will initialize that value
|
105
|
-
# to zero.
|
106
|
-
def decrement(name, amount = 1, options = nil) # :nodoc:
|
107
|
-
options = merged_options(options)
|
108
|
-
response = instrument(:decrement, name, :amount => amount) do
|
109
|
-
@data.decr(escape_key(namespaced_key(name, options)), amount)
|
110
|
-
end
|
111
|
-
response == Response::NOT_FOUND ? nil : response.to_i
|
112
|
-
rescue MemCache::MemCacheError
|
113
|
-
nil
|
114
|
-
end
|
115
|
-
|
116
|
-
# Clear the entire cache on all memcached servers. This method should
|
117
|
-
# be used with care when shared cache is being used.
|
118
|
-
def clear(options = nil)
|
119
|
-
@data.flush_all
|
120
|
-
end
|
121
|
-
|
122
|
-
# Get the statistics from the memcached servers.
|
123
|
-
def stats
|
124
|
-
@data.stats
|
125
|
-
end
|
126
|
-
|
127
|
-
protected
|
128
|
-
# Read an entry from the cache.
|
129
|
-
def read_entry(key, options) # :nodoc:
|
130
|
-
deserialize_entry(@data.get(escape_key(key), true))
|
131
|
-
rescue MemCache::MemCacheError => e
|
132
|
-
logger.error("MemCacheError (#{e}): #{e.message}") if logger
|
133
|
-
nil
|
134
|
-
end
|
135
|
-
|
136
|
-
# Write an entry to the cache.
|
137
|
-
def write_entry(key, entry, options) # :nodoc:
|
138
|
-
method = options && options[:unless_exist] ? :add : :set
|
139
|
-
value = options[:raw] ? entry.value.to_s : entry
|
140
|
-
expires_in = options[:expires_in].to_i
|
141
|
-
if expires_in > 0 && !options[:raw]
|
142
|
-
# Set the memcache expire a few minutes in the future to support race condition ttls on read
|
143
|
-
expires_in += 5.minutes
|
144
|
-
end
|
145
|
-
response = @data.send(method, escape_key(key), value, expires_in, options[:raw])
|
146
|
-
response == Response::STORED
|
147
|
-
rescue MemCache::MemCacheError => e
|
148
|
-
logger.error("MemCacheError (#{e}): #{e.message}") if logger
|
149
|
-
false
|
150
|
-
end
|
151
|
-
|
152
|
-
# Delete an entry from the cache.
|
153
|
-
def delete_entry(key, options) # :nodoc:
|
154
|
-
response = @data.delete(escape_key(key))
|
155
|
-
response == Response::DELETED
|
156
|
-
rescue MemCache::MemCacheError => e
|
157
|
-
logger.error("MemCacheError (#{e}): #{e.message}") if logger
|
158
|
-
false
|
159
|
-
end
|
160
|
-
|
161
|
-
private
|
162
|
-
|
163
|
-
# Memcache keys are binaries. So we need to force their encoding to binary
|
164
|
-
# before applying the regular expression to ensure we are escaping all
|
165
|
-
# characters properly.
|
166
|
-
def escape_key(key)
|
167
|
-
key = key.to_s.dup
|
168
|
-
key = key.force_encoding("BINARY") if key.encoding_aware?
|
169
|
-
key = key.gsub(ESCAPE_KEY_CHARS){ |match| "%#{match.getbyte(0).to_s(16).upcase}" }
|
170
|
-
key = "#{key[0, 213]}:md5:#{Digest::MD5.hexdigest(key)}" if key.size > 250
|
171
|
-
key
|
172
|
-
end
|
173
|
-
|
174
|
-
def deserialize_entry(raw_value)
|
175
|
-
if raw_value
|
176
|
-
entry = Marshal.load(raw_value) rescue raw_value
|
177
|
-
entry.is_a?(Entry) ? entry : Entry.new(entry)
|
178
|
-
else
|
179
|
-
nil
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
# Provide support for raw values in the local cache strategy.
|
184
|
-
module LocalCacheWithRaw # :nodoc:
|
185
|
-
protected
|
186
|
-
def read_entry(key, options)
|
187
|
-
entry = super
|
188
|
-
if options[:raw] && local_cache && entry
|
189
|
-
entry = deserialize_entry(entry.value)
|
190
|
-
end
|
191
|
-
entry
|
192
|
-
end
|
193
|
-
|
194
|
-
def write_entry(key, entry, options) # :nodoc:
|
195
|
-
retval = super
|
196
|
-
if options[:raw] && local_cache && retval
|
197
|
-
raw_entry = Entry.new(entry.value.to_s)
|
198
|
-
raw_entry.expires_at = entry.expires_at
|
199
|
-
local_cache.write_entry(key, raw_entry, options)
|
200
|
-
end
|
201
|
-
retval
|
202
|
-
end
|
203
|
-
end
|
204
|
-
end
|
205
|
-
end
|
206
|
-
end
|
@@ -1,159 +0,0 @@
|
|
1
|
-
require 'monitor'
|
2
|
-
|
3
|
-
module ActiveSupport
|
4
|
-
module Cache
|
5
|
-
# A cache store implementation which stores everything into memory in the
|
6
|
-
# same process. If you're running multiple Ruby on Rails server processes
|
7
|
-
# (which is the case if you're using mongrel_cluster or Phusion Passenger),
|
8
|
-
# then this means that Rails server process instances won't be able
|
9
|
-
# to share cache data with each other and this may not be the most
|
10
|
-
# appropriate cache in that scenario.
|
11
|
-
#
|
12
|
-
# This cache has a bounded size specified by the :size options to the
|
13
|
-
# initializer (default is 32Mb). When the cache exceeds the allotted size,
|
14
|
-
# a cleanup will occur which tries to prune the cache down to three quarters
|
15
|
-
# of the maximum size by removing the least recently used entries.
|
16
|
-
#
|
17
|
-
# MemoryStore is thread-safe.
|
18
|
-
class MemoryStore < Store
|
19
|
-
def initialize(options = nil)
|
20
|
-
options ||= {}
|
21
|
-
super(options)
|
22
|
-
@data = {}
|
23
|
-
@key_access = {}
|
24
|
-
@max_size = options[:size] || 32.megabytes
|
25
|
-
@max_prune_time = options[:max_prune_time] || 2
|
26
|
-
@cache_size = 0
|
27
|
-
@monitor = Monitor.new
|
28
|
-
@pruning = false
|
29
|
-
end
|
30
|
-
|
31
|
-
def clear(options = nil)
|
32
|
-
synchronize do
|
33
|
-
@data.clear
|
34
|
-
@key_access.clear
|
35
|
-
@cache_size = 0
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def cleanup(options = nil)
|
40
|
-
options = merged_options(options)
|
41
|
-
instrument(:cleanup, :size => @data.size) do
|
42
|
-
keys = synchronize{ @data.keys }
|
43
|
-
keys.each do |key|
|
44
|
-
entry = @data[key]
|
45
|
-
delete_entry(key, options) if entry && entry.expired?
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
# To ensure entries fit within the specified memory prune the cache by removing the least
|
51
|
-
# recently accessed entries.
|
52
|
-
def prune(target_size, max_time = nil)
|
53
|
-
return if pruning?
|
54
|
-
@pruning = true
|
55
|
-
begin
|
56
|
-
start_time = Time.now
|
57
|
-
cleanup
|
58
|
-
instrument(:prune, target_size, :from => @cache_size) do
|
59
|
-
keys = synchronize{ @key_access.keys.sort{|a,b| @key_access[a].to_f <=> @key_access[b].to_f} }
|
60
|
-
keys.each do |key|
|
61
|
-
delete_entry(key, options)
|
62
|
-
return if @cache_size <= target_size || (max_time && Time.now - start_time > max_time)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
ensure
|
66
|
-
@pruning = false
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# Returns true if the cache is currently being pruned.
|
71
|
-
def pruning?
|
72
|
-
@pruning
|
73
|
-
end
|
74
|
-
|
75
|
-
# Increment an integer value in the cache.
|
76
|
-
def increment(name, amount = 1, options = nil)
|
77
|
-
synchronize do
|
78
|
-
options = merged_options(options)
|
79
|
-
if num = read(name, options)
|
80
|
-
num = num.to_i + amount
|
81
|
-
write(name, num, options)
|
82
|
-
num
|
83
|
-
else
|
84
|
-
nil
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
# Decrement an integer value in the cache.
|
90
|
-
def decrement(name, amount = 1, options = nil)
|
91
|
-
synchronize do
|
92
|
-
options = merged_options(options)
|
93
|
-
if num = read(name, options)
|
94
|
-
num = num.to_i - amount
|
95
|
-
write(name, num, options)
|
96
|
-
num
|
97
|
-
else
|
98
|
-
nil
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
def delete_matched(matcher, options = nil)
|
104
|
-
options = merged_options(options)
|
105
|
-
instrument(:delete_matched, matcher.inspect) do
|
106
|
-
matcher = key_matcher(matcher, options)
|
107
|
-
keys = synchronize { @data.keys }
|
108
|
-
keys.each do |key|
|
109
|
-
delete_entry(key, options) if key.match(matcher)
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
def inspect # :nodoc:
|
115
|
-
"<##{self.class.name} entries=#{@data.size}, size=#{@cache_size}, options=#{@options.inspect}>"
|
116
|
-
end
|
117
|
-
|
118
|
-
# Synchronize calls to the cache. This should be called wherever the underlying cache implementation
|
119
|
-
# is not thread safe.
|
120
|
-
def synchronize(&block) # :nodoc:
|
121
|
-
@monitor.synchronize(&block)
|
122
|
-
end
|
123
|
-
|
124
|
-
protected
|
125
|
-
def read_entry(key, options) # :nodoc:
|
126
|
-
entry = @data[key]
|
127
|
-
synchronize do
|
128
|
-
if entry
|
129
|
-
@key_access[key] = Time.now.to_f
|
130
|
-
else
|
131
|
-
@key_access.delete(key)
|
132
|
-
end
|
133
|
-
end
|
134
|
-
entry
|
135
|
-
end
|
136
|
-
|
137
|
-
def write_entry(key, entry, options) # :nodoc:
|
138
|
-
synchronize do
|
139
|
-
old_entry = @data[key]
|
140
|
-
@cache_size -= old_entry.size if old_entry
|
141
|
-
@cache_size += entry.size
|
142
|
-
@key_access[key] = Time.now.to_f
|
143
|
-
@data[key] = entry
|
144
|
-
prune(@max_size * 0.75, @max_prune_time) if @cache_size > @max_size
|
145
|
-
true
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
def delete_entry(key, options) # :nodoc:
|
150
|
-
synchronize do
|
151
|
-
@key_access.delete(key)
|
152
|
-
entry = @data.delete(key)
|
153
|
-
@cache_size -= entry.size if entry
|
154
|
-
!!entry
|
155
|
-
end
|
156
|
-
end
|
157
|
-
end
|
158
|
-
end
|
159
|
-
end
|