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,46 +0,0 @@
|
|
1
|
-
# lazy_load_hooks allows rails to lazily load a lot of components and thus making the app boot faster. Because of
|
2
|
-
# this feature now there is no need to require <tt>ActiveRecord::Base</tt> at boot time purely to apply configuration. Instead
|
3
|
-
# a hook is registered that applies configuration once <tt>ActiveRecord::Base</tt> is loaded. Here <tt>ActiveRecord::Base</tt> is used
|
4
|
-
# as example but this feature can be applied elsewhere too.
|
5
|
-
#
|
6
|
-
# Here is an example where +on_load+ method is called to register a hook.
|
7
|
-
#
|
8
|
-
# initializer "active_record.initialize_timezone" do
|
9
|
-
# ActiveSupport.on_load(:active_record) do
|
10
|
-
# self.time_zone_aware_attributes = true
|
11
|
-
# self.default_timezone = :utc
|
12
|
-
# end
|
13
|
-
# end
|
14
|
-
#
|
15
|
-
# When the entirety of +activerecord/lib/active_record/base.rb+ has been evaluated then +run_load_hooks+ is invoked.
|
16
|
-
# The very last line of +activerecord/lib/active_record/base.rb+ is:
|
17
|
-
#
|
18
|
-
# ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)
|
19
|
-
#
|
20
|
-
module ActiveSupport
|
21
|
-
@load_hooks = Hash.new { |h,k| h[k] = [] }
|
22
|
-
@loaded = Hash.new { |h,k| h[k] = [] }
|
23
|
-
|
24
|
-
def self.on_load(name, options = {}, &block)
|
25
|
-
@loaded[name].each do |base|
|
26
|
-
execute_hook(base, options, block)
|
27
|
-
end
|
28
|
-
|
29
|
-
@load_hooks[name] << [block, options]
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.execute_hook(base, options, block)
|
33
|
-
if options[:yield]
|
34
|
-
block.call(base)
|
35
|
-
else
|
36
|
-
base.instance_eval(&block)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.run_load_hooks(name, base = Object)
|
41
|
-
@loaded[name] << base
|
42
|
-
@load_hooks[name].each do |hook, options|
|
43
|
-
execute_hook(base, options, hook)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
en:
|
2
|
-
date:
|
3
|
-
formats:
|
4
|
-
# Use the strftime parameters for formats.
|
5
|
-
# When no format has been given, it uses default.
|
6
|
-
# You can provide other formats here if you like!
|
7
|
-
default: "%Y-%m-%d"
|
8
|
-
short: "%b %d"
|
9
|
-
long: "%B %d, %Y"
|
10
|
-
|
11
|
-
day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
|
12
|
-
abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
|
13
|
-
|
14
|
-
# Don't forget the nil at the beginning; there's no such thing as a 0th month
|
15
|
-
month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
|
16
|
-
abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
|
17
|
-
# Used in date_select and datetime_select.
|
18
|
-
order:
|
19
|
-
- :year
|
20
|
-
- :month
|
21
|
-
- :day
|
22
|
-
|
23
|
-
time:
|
24
|
-
formats:
|
25
|
-
default: "%a, %d %b %Y %H:%M:%S %z"
|
26
|
-
short: "%d %b %H:%M"
|
27
|
-
long: "%B %d, %Y %H:%M"
|
28
|
-
am: "am"
|
29
|
-
pm: "pm"
|
30
|
-
|
31
|
-
# Used in array.to_sentence.
|
32
|
-
support:
|
33
|
-
array:
|
34
|
-
words_connector: ", "
|
35
|
-
two_words_connector: " and "
|
36
|
-
last_word_connector: ", and "
|
@@ -1,122 +0,0 @@
|
|
1
|
-
require 'active_support/core_ext/module/attribute_accessors'
|
2
|
-
require 'active_support/core_ext/class/attribute'
|
3
|
-
|
4
|
-
module ActiveSupport
|
5
|
-
# ActiveSupport::LogSubscriber is an object set to consume ActiveSupport::Notifications
|
6
|
-
# with the sole purpose of logging them. The log subscriber dispatches notifications to
|
7
|
-
# a registered object based on its given namespace.
|
8
|
-
#
|
9
|
-
# An example would be Active Record log subscriber responsible for logging queries:
|
10
|
-
#
|
11
|
-
# module ActiveRecord
|
12
|
-
# class LogSubscriber < ActiveSupport::LogSubscriber
|
13
|
-
# def sql(event)
|
14
|
-
# "#{event.payload[:name]} (#{event.duration}) #{event.payload[:sql]}"
|
15
|
-
# end
|
16
|
-
# end
|
17
|
-
# end
|
18
|
-
#
|
19
|
-
# And it's finally registered as:
|
20
|
-
#
|
21
|
-
# ActiveRecord::LogSubscriber.attach_to :active_record
|
22
|
-
#
|
23
|
-
# Since we need to know all instance methods before attaching the log subscriber,
|
24
|
-
# the line above should be called after your <tt>ActiveRecord::LogSubscriber</tt> definition.
|
25
|
-
#
|
26
|
-
# After configured, whenever a "sql.active_record" notification is published,
|
27
|
-
# it will properly dispatch the event (ActiveSupport::Notifications::Event) to
|
28
|
-
# the sql method.
|
29
|
-
#
|
30
|
-
# Log subscriber also has some helpers to deal with logging and automatically flushes
|
31
|
-
# all logs when the request finishes (via action_dispatch.callback notification) in
|
32
|
-
# a Rails environment.
|
33
|
-
class LogSubscriber
|
34
|
-
# Embed in a String to clear all previous ANSI sequences.
|
35
|
-
CLEAR = "\e[0m"
|
36
|
-
BOLD = "\e[1m"
|
37
|
-
|
38
|
-
# Colors
|
39
|
-
BLACK = "\e[30m"
|
40
|
-
RED = "\e[31m"
|
41
|
-
GREEN = "\e[32m"
|
42
|
-
YELLOW = "\e[33m"
|
43
|
-
BLUE = "\e[34m"
|
44
|
-
MAGENTA = "\e[35m"
|
45
|
-
CYAN = "\e[36m"
|
46
|
-
WHITE = "\e[37m"
|
47
|
-
|
48
|
-
mattr_accessor :colorize_logging
|
49
|
-
self.colorize_logging = true
|
50
|
-
|
51
|
-
class_attribute :logger
|
52
|
-
|
53
|
-
class << self
|
54
|
-
remove_method :logger
|
55
|
-
def logger
|
56
|
-
@logger ||= Rails.logger if defined?(Rails)
|
57
|
-
end
|
58
|
-
|
59
|
-
def attach_to(namespace, log_subscriber=new, notifier=ActiveSupport::Notifications)
|
60
|
-
log_subscribers << log_subscriber
|
61
|
-
@@flushable_loggers = nil
|
62
|
-
|
63
|
-
log_subscriber.public_methods(false).each do |event|
|
64
|
-
next if 'call' == event.to_s
|
65
|
-
|
66
|
-
notifier.subscribe("#{event}.#{namespace}", log_subscriber)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
def log_subscribers
|
71
|
-
@@log_subscribers ||= []
|
72
|
-
end
|
73
|
-
|
74
|
-
def flushable_loggers
|
75
|
-
@@flushable_loggers ||= begin
|
76
|
-
loggers = log_subscribers.map(&:logger)
|
77
|
-
loggers.uniq!
|
78
|
-
loggers.select { |l| l.respond_to?(:flush) }
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
# Flush all log_subscribers' logger.
|
83
|
-
def flush_all!
|
84
|
-
flushable_loggers.each { |log| log.flush }
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def call(message, *args)
|
89
|
-
return unless logger
|
90
|
-
|
91
|
-
method = message.split('.').first
|
92
|
-
begin
|
93
|
-
send(method, ActiveSupport::Notifications::Event.new(message, *args))
|
94
|
-
rescue Exception => e
|
95
|
-
logger.error "Could not log #{message.inspect} event. #{e.class}: #{e.message}"
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
protected
|
100
|
-
|
101
|
-
%w(info debug warn error fatal unknown).each do |level|
|
102
|
-
class_eval <<-METHOD, __FILE__, __LINE__ + 1
|
103
|
-
def #{level}(*args, &block)
|
104
|
-
return unless logger
|
105
|
-
logger.#{level}(*args, &block)
|
106
|
-
end
|
107
|
-
METHOD
|
108
|
-
end
|
109
|
-
|
110
|
-
# Set color by using a string or one of the defined constants. If a third
|
111
|
-
# option is set to true, it also adds bold to the string. This is based
|
112
|
-
# on the Highline implementation and will automatically append CLEAR to the
|
113
|
-
# end of the returned String.
|
114
|
-
#
|
115
|
-
def color(text, color, bold=false)
|
116
|
-
return text unless colorize_logging
|
117
|
-
color = self.class.const_get(color.to_s.upcase) if color.is_a?(Symbol)
|
118
|
-
bold = bold ? BOLD : ""
|
119
|
-
"#{bold}#{color}#{text}#{CLEAR}"
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|
data/vendor/bundle/gems/activesupport-3.2.11/lib/active_support/log_subscriber/test_helper.rb
DELETED
@@ -1,101 +0,0 @@
|
|
1
|
-
require 'active_support/log_subscriber'
|
2
|
-
require 'active_support/buffered_logger'
|
3
|
-
require 'active_support/notifications'
|
4
|
-
|
5
|
-
module ActiveSupport
|
6
|
-
class LogSubscriber
|
7
|
-
# Provides some helpers to deal with testing log subscribers by setting up
|
8
|
-
# notifications. Take for instance Active Record subscriber tests:
|
9
|
-
#
|
10
|
-
# class SyncLogSubscriberTest < ActiveSupport::TestCase
|
11
|
-
# include ActiveSupport::LogSubscriber::TestHelper
|
12
|
-
#
|
13
|
-
# def setup
|
14
|
-
# ActiveRecord::LogSubscriber.attach_to(:active_record)
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# def test_basic_query_logging
|
18
|
-
# Developer.all
|
19
|
-
# wait
|
20
|
-
# assert_equal 1, @logger.logged(:debug).size
|
21
|
-
# assert_match(/Developer Load/, @logger.logged(:debug).last)
|
22
|
-
# assert_match(/SELECT \* FROM "developers"/, @logger.logged(:debug).last)
|
23
|
-
# end
|
24
|
-
# end
|
25
|
-
#
|
26
|
-
# All you need to do is to ensure that your log subscriber is added to Rails::Subscriber,
|
27
|
-
# as in the second line of the code above. The test helpers are responsible for setting
|
28
|
-
# up the queue, subscriptions and turning colors in logs off.
|
29
|
-
#
|
30
|
-
# The messages are available in the @logger instance, which is a logger with limited
|
31
|
-
# powers (it actually does not send anything to your output), and you can collect them
|
32
|
-
# doing @logger.logged(level), where level is the level used in logging, like info,
|
33
|
-
# debug, warn and so on.
|
34
|
-
#
|
35
|
-
module TestHelper
|
36
|
-
def setup
|
37
|
-
@logger = MockLogger.new
|
38
|
-
@notifier = ActiveSupport::Notifications::Fanout.new
|
39
|
-
|
40
|
-
ActiveSupport::LogSubscriber.colorize_logging = false
|
41
|
-
|
42
|
-
@old_notifier = ActiveSupport::Notifications.notifier
|
43
|
-
set_logger(@logger)
|
44
|
-
ActiveSupport::Notifications.notifier = @notifier
|
45
|
-
end
|
46
|
-
|
47
|
-
def teardown
|
48
|
-
set_logger(nil)
|
49
|
-
ActiveSupport::Notifications.notifier = @old_notifier
|
50
|
-
end
|
51
|
-
|
52
|
-
class MockLogger
|
53
|
-
include ActiveSupport::BufferedLogger::Severity
|
54
|
-
|
55
|
-
attr_reader :flush_count
|
56
|
-
attr_accessor :level
|
57
|
-
|
58
|
-
def initialize(level = DEBUG)
|
59
|
-
@flush_count = 0
|
60
|
-
@level = level
|
61
|
-
@logged = Hash.new { |h,k| h[k] = [] }
|
62
|
-
end
|
63
|
-
|
64
|
-
def method_missing(level, message)
|
65
|
-
@logged[level] << message
|
66
|
-
end
|
67
|
-
|
68
|
-
def logged(level)
|
69
|
-
@logged[level].compact.map { |l| l.to_s.strip }
|
70
|
-
end
|
71
|
-
|
72
|
-
def flush
|
73
|
-
@flush_count += 1
|
74
|
-
end
|
75
|
-
|
76
|
-
ActiveSupport::BufferedLogger::Severity.constants.each do |severity|
|
77
|
-
class_eval <<-EOT, __FILE__, __LINE__ + 1
|
78
|
-
def #{severity.downcase}?
|
79
|
-
#{severity} >= @level
|
80
|
-
end
|
81
|
-
EOT
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
# Wait notifications to be published.
|
86
|
-
def wait
|
87
|
-
@notifier.wait
|
88
|
-
end
|
89
|
-
|
90
|
-
# Overwrite if you use another logger in your log subscriber:
|
91
|
-
#
|
92
|
-
# def logger
|
93
|
-
# ActiveRecord::Base.logger = @logger
|
94
|
-
# end
|
95
|
-
#
|
96
|
-
def set_logger(logger)
|
97
|
-
ActiveSupport::LogSubscriber.logger = logger
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
@@ -1,116 +0,0 @@
|
|
1
|
-
require 'active_support/core_ext/kernel/singleton_class'
|
2
|
-
require 'active_support/core_ext/module/aliasing'
|
3
|
-
require 'active_support/deprecation'
|
4
|
-
|
5
|
-
module ActiveSupport
|
6
|
-
module Memoizable
|
7
|
-
def self.extended(base)
|
8
|
-
ActiveSupport::Deprecation.warn "ActiveSupport::Memoizable is deprecated and will be removed in future releases," \
|
9
|
-
"simply use Ruby memoization pattern instead.", caller
|
10
|
-
super
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.memoized_ivar_for(symbol)
|
14
|
-
"@_memoized_#{symbol.to_s.sub(/\?\Z/, '_query').sub(/!\Z/, '_bang')}".to_sym
|
15
|
-
end
|
16
|
-
|
17
|
-
module InstanceMethods
|
18
|
-
def self.included(base)
|
19
|
-
base.class_eval do
|
20
|
-
unless base.method_defined?(:freeze_without_memoizable)
|
21
|
-
alias_method_chain :freeze, :memoizable
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def freeze_with_memoizable
|
27
|
-
memoize_all unless frozen?
|
28
|
-
freeze_without_memoizable
|
29
|
-
end
|
30
|
-
|
31
|
-
def memoize_all
|
32
|
-
prime_cache ".*"
|
33
|
-
end
|
34
|
-
|
35
|
-
def unmemoize_all
|
36
|
-
flush_cache ".*"
|
37
|
-
end
|
38
|
-
|
39
|
-
def prime_cache(*syms)
|
40
|
-
syms.each do |sym|
|
41
|
-
methods.each do |m|
|
42
|
-
if m.to_s =~ /^_unmemoized_(#{sym})/
|
43
|
-
if method(m).arity == 0
|
44
|
-
__send__($1)
|
45
|
-
else
|
46
|
-
ivar = ActiveSupport::Memoizable.memoized_ivar_for($1)
|
47
|
-
instance_variable_set(ivar, {})
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def flush_cache(*syms)
|
55
|
-
syms.each do |sym|
|
56
|
-
(methods + private_methods + protected_methods).each do |m|
|
57
|
-
if m.to_s =~ /^_unmemoized_(#{sym.to_s.gsub(/\?\Z/, '\?')})/
|
58
|
-
ivar = ActiveSupport::Memoizable.memoized_ivar_for($1)
|
59
|
-
instance_variable_get(ivar).clear if instance_variable_defined?(ivar)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def memoize(*symbols)
|
67
|
-
symbols.each do |symbol|
|
68
|
-
original_method = :"_unmemoized_#{symbol}"
|
69
|
-
memoized_ivar = ActiveSupport::Memoizable.memoized_ivar_for(symbol)
|
70
|
-
|
71
|
-
class_eval <<-EOS, __FILE__, __LINE__ + 1
|
72
|
-
include InstanceMethods # include InstanceMethods
|
73
|
-
#
|
74
|
-
if method_defined?(:#{original_method}) # if method_defined?(:_unmemoized_mime_type)
|
75
|
-
raise "Already memoized #{symbol}" # raise "Already memoized mime_type"
|
76
|
-
end # end
|
77
|
-
alias #{original_method} #{symbol} # alias _unmemoized_mime_type mime_type
|
78
|
-
#
|
79
|
-
if instance_method(:#{symbol}).arity == 0 # if instance_method(:mime_type).arity == 0
|
80
|
-
def #{symbol}(reload = false) # def mime_type(reload = false)
|
81
|
-
if reload || !defined?(#{memoized_ivar}) || #{memoized_ivar}.empty? # if reload || !defined?(@_memoized_mime_type) || @_memoized_mime_type.empty?
|
82
|
-
#{memoized_ivar} = [#{original_method}] # @_memoized_mime_type = [_unmemoized_mime_type]
|
83
|
-
end # end
|
84
|
-
#{memoized_ivar}[0] # @_memoized_mime_type[0]
|
85
|
-
end # end
|
86
|
-
else # else
|
87
|
-
def #{symbol}(*args) # def mime_type(*args)
|
88
|
-
#{memoized_ivar} ||= {} unless frozen? # @_memoized_mime_type ||= {} unless frozen?
|
89
|
-
args_length = method(:#{original_method}).arity # args_length = method(:_unmemoized_mime_type).arity
|
90
|
-
if args.length == args_length + 1 && # if args.length == args_length + 1 &&
|
91
|
-
(args.last == true || args.last == :reload) # (args.last == true || args.last == :reload)
|
92
|
-
reload = args.pop # reload = args.pop
|
93
|
-
end # end
|
94
|
-
#
|
95
|
-
if defined?(#{memoized_ivar}) && #{memoized_ivar} # if defined?(@_memoized_mime_type) && @_memoized_mime_type
|
96
|
-
if !reload && #{memoized_ivar}.has_key?(args) # if !reload && @_memoized_mime_type.has_key?(args)
|
97
|
-
#{memoized_ivar}[args] # @_memoized_mime_type[args]
|
98
|
-
elsif #{memoized_ivar} # elsif @_memoized_mime_type
|
99
|
-
#{memoized_ivar}[args] = #{original_method}(*args) # @_memoized_mime_type[args] = _unmemoized_mime_type(*args)
|
100
|
-
end # end
|
101
|
-
else # else
|
102
|
-
#{original_method}(*args) # _unmemoized_mime_type(*args)
|
103
|
-
end # end
|
104
|
-
end # end
|
105
|
-
end # end
|
106
|
-
#
|
107
|
-
if private_method_defined?(#{original_method.inspect}) # if private_method_defined?(:_unmemoized_mime_type)
|
108
|
-
private #{symbol.inspect} # private :mime_type
|
109
|
-
elsif protected_method_defined?(#{original_method.inspect}) # elsif protected_method_defined?(:_unmemoized_mime_type)
|
110
|
-
protected #{symbol.inspect} # protected :mime_type
|
111
|
-
end # end
|
112
|
-
EOS
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
require 'openssl'
|
2
|
-
require 'active_support/base64'
|
3
|
-
|
4
|
-
module ActiveSupport
|
5
|
-
# MessageEncryptor is a simple way to encrypt values which get stored somewhere
|
6
|
-
# you don't trust.
|
7
|
-
#
|
8
|
-
# The cipher text and initialization vector are base64 encoded and returned to you.
|
9
|
-
#
|
10
|
-
# This can be used in situations similar to the <tt>MessageVerifier</tt>, but where you don't
|
11
|
-
# want users to be able to determine the value of the payload.
|
12
|
-
class MessageEncryptor
|
13
|
-
module NullSerializer #:nodoc:
|
14
|
-
def self.load(value)
|
15
|
-
value
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.dump(value)
|
19
|
-
value
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
class InvalidMessage < StandardError; end
|
24
|
-
OpenSSLCipherError = OpenSSL::Cipher.const_defined?(:CipherError) ? OpenSSL::Cipher::CipherError : OpenSSL::CipherError
|
25
|
-
|
26
|
-
def initialize(secret, options = {})
|
27
|
-
unless options.is_a?(Hash)
|
28
|
-
ActiveSupport::Deprecation.warn "The second parameter should be an options hash. Use :cipher => 'algorithm' to specify the cipher algorithm."
|
29
|
-
options = { :cipher => options }
|
30
|
-
end
|
31
|
-
|
32
|
-
@secret = secret
|
33
|
-
@cipher = options[:cipher] || 'aes-256-cbc'
|
34
|
-
@verifier = MessageVerifier.new(@secret, :serializer => NullSerializer)
|
35
|
-
@serializer = options[:serializer] || Marshal
|
36
|
-
end
|
37
|
-
|
38
|
-
def encrypt(value)
|
39
|
-
ActiveSupport::Deprecation.warn "MessageEncryptor#encrypt is deprecated as it is not safe without a signature. " \
|
40
|
-
"Please use MessageEncryptor#encrypt_and_sign instead."
|
41
|
-
_encrypt(value)
|
42
|
-
end
|
43
|
-
|
44
|
-
def decrypt(value)
|
45
|
-
ActiveSupport::Deprecation.warn "MessageEncryptor#decrypt is deprecated as it is not safe without a signature. " \
|
46
|
-
"Please use MessageEncryptor#decrypt_and_verify instead."
|
47
|
-
_decrypt(value)
|
48
|
-
end
|
49
|
-
|
50
|
-
# Encrypt and sign a message. We need to sign the message in order to avoid padding attacks.
|
51
|
-
# Reference: http://www.limited-entropy.com/padding-oracle-attacks
|
52
|
-
def encrypt_and_sign(value)
|
53
|
-
verifier.generate(_encrypt(value))
|
54
|
-
end
|
55
|
-
|
56
|
-
# Decrypt and verify a message. We need to verify the message in order to avoid padding attacks.
|
57
|
-
# Reference: http://www.limited-entropy.com/padding-oracle-attacks
|
58
|
-
def decrypt_and_verify(value)
|
59
|
-
_decrypt(verifier.verify(value))
|
60
|
-
end
|
61
|
-
|
62
|
-
private
|
63
|
-
|
64
|
-
def _encrypt(value)
|
65
|
-
cipher = new_cipher
|
66
|
-
# Rely on OpenSSL for the initialization vector
|
67
|
-
iv = cipher.random_iv
|
68
|
-
|
69
|
-
cipher.encrypt
|
70
|
-
cipher.key = @secret
|
71
|
-
cipher.iv = iv
|
72
|
-
|
73
|
-
encrypted_data = cipher.update(@serializer.dump(value))
|
74
|
-
encrypted_data << cipher.final
|
75
|
-
|
76
|
-
[encrypted_data, iv].map {|v| ::Base64.strict_encode64(v)}.join("--")
|
77
|
-
end
|
78
|
-
|
79
|
-
def _decrypt(encrypted_message)
|
80
|
-
cipher = new_cipher
|
81
|
-
encrypted_data, iv = encrypted_message.split("--").map {|v| ::Base64.decode64(v)}
|
82
|
-
|
83
|
-
cipher.decrypt
|
84
|
-
cipher.key = @secret
|
85
|
-
cipher.iv = iv
|
86
|
-
|
87
|
-
decrypted_data = cipher.update(encrypted_data)
|
88
|
-
decrypted_data << cipher.final
|
89
|
-
|
90
|
-
@serializer.load(decrypted_data)
|
91
|
-
rescue OpenSSLCipherError, TypeError
|
92
|
-
raise InvalidMessage
|
93
|
-
end
|
94
|
-
|
95
|
-
def new_cipher
|
96
|
-
OpenSSL::Cipher::Cipher.new(@cipher)
|
97
|
-
end
|
98
|
-
|
99
|
-
def verifier
|
100
|
-
@verifier
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|