backports 3.16.0 → 3.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +691 -0
- data/Gemfile +6 -0
- data/README.md +529 -0
- data/SECURITY.md +5 -0
- data/backports.gemspec +5 -1
- data/lib/backports.rb +6 -0
- data/lib/backports/1.8.7.rb +10 -2
- data/lib/backports/1.9.1.rb +6 -1
- data/lib/backports/1.9.2.rb +6 -1
- data/lib/backports/1.9.2/stdlib/matrix.rb +5 -0
- data/lib/backports/1.9.3.rb +6 -1
- data/lib/backports/2.0.0.rb +6 -1
- data/lib/backports/2.0.0/range/size.rb +2 -0
- data/lib/backports/2.1.0.rb +1 -1
- data/lib/backports/2.2.0.rb +1 -1
- data/lib/backports/2.2.0/enumerable/slice_after.rb +1 -1
- data/lib/backports/2.2.0/float/next_float.rb +1 -1
- data/lib/backports/2.2.0/float/prev_float.rb +1 -1
- data/lib/backports/2.2.0/method/super_method.rb +2 -2
- data/lib/backports/2.3.0.rb +1 -1
- data/lib/backports/2.3.0/array/bsearch_index.rb +1 -1
- data/lib/backports/2.3.0/hash/lt.rb +1 -1
- data/lib/backports/2.3.0/hash/lte.rb +1 -1
- data/lib/backports/2.3.0/hash/to_proc.rb +1 -1
- data/lib/backports/2.3.0/struct/dig.rb +1 -2
- data/lib/backports/2.4.0.rb +1 -1
- data/lib/backports/2.4.0/hash/transform_values.rb +2 -2
- data/lib/backports/2.4.0/true_class/dup.rb +0 -1
- data/lib/backports/2.5.0.rb +1 -1
- data/lib/backports/2.5.0/hash/transform_keys.rb +1 -1
- data/lib/backports/2.5.0/integer/sqrt.rb +2 -2
- data/lib/backports/2.5.0/module/alias_method.rb +0 -1
- data/lib/backports/2.5.0/string/undump.rb +3 -7
- data/lib/backports/2.5.0/struct/new.rb +1 -1
- data/lib/backports/2.6.0.rb +1 -1
- data/lib/backports/2.6.0/enumerable/chain.rb +4 -1
- data/lib/backports/2.6.0/hash/to_h.rb +1 -1
- data/lib/backports/2.6.0/range.rb +3 -0
- data/lib/backports/2.6.0/range/cover.rb +22 -0
- data/lib/backports/2.7.0.rb +1 -1
- data/lib/backports/2.7.0/enumerable/filter_map.rb +2 -2
- data/lib/backports/rails/array.rb +4 -0
- data/lib/backports/rails/enumerable.rb +4 -0
- data/lib/backports/rails/hash.rb +4 -0
- data/lib/backports/rails/kernel.rb +4 -0
- data/lib/backports/rails/module.rb +4 -0
- data/lib/backports/rails/string.rb +4 -0
- data/lib/backports/std_lib.rb +3 -0
- data/lib/backports/tools/deprecation.rb +19 -0
- data/lib/backports/tools/require_relative_dir.rb +6 -1
- data/lib/backports/version.rb +1 -1
- metadata +10 -511
- data/.document +0 -6
- data/.gitignore +0 -9
- data/.gitmodules +0 -6
- data/.irbrc +0 -3
- data/.travis.yml +0 -19
- data/CHANGELOG.rdoc +0 -504
- data/README.rdoc +0 -445
- data/Rakefile +0 -192
- data/default.mspec +0 -14
- data/frozen_old_spec/tags/1.8.6/core/argf/each_line_spec.rb +0 -6
- data/frozen_old_spec/tags/1.8.6/core/argf/each_spec.rb +0 -6
- data/frozen_old_spec/tags/1.8.6/core/argf/lines_spec.rb +0 -6
- data/frozen_old_spec/tags/1.8.6/core/array/append_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/array/collect_spec.rb +0 -7
- data/frozen_old_spec/tags/1.8.6/core/array/rotate_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/array/uniq_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/complex/to_r_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/enumerable/all_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/enumerable/any_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/enumerable/each_entry_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/enumerable/none_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/enumerable/one_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/enumerator/next_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/env/to_h_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/file/join_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/file/lchmod_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/file/new_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/file/open_spec.rb +0 -13
- data/frozen_old_spec/tags/1.8.6/core/file/to_path_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/fixnum/fdiv_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/gc/stress_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/hash/assoc_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/hash/constructor_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/hash/default_proc_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/hash/delete_if_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/hash/each_pair_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/hash/eql_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/hash/hash_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/hash/keep_if_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/hash/rassoc_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/hash/reject_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/hash/select_spec.rb +0 -8
- data/frozen_old_spec/tags/1.8.6/core/integer/round_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/io/binread_spec.rb +0 -7
- data/frozen_old_spec/tags/1.8.6/core/io/chars_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/io/each_char_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/io/lines_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/io/open_spec.rb +0 -24
- data/frozen_old_spec/tags/1.8.6/core/io/ungetbyte_spec.rb +0 -4
- data/frozen_old_spec/tags/1.8.6/core/io/write_spec.rb +0 -5
- data/frozen_old_spec/tags/1.8.6/core/kernel/__callee___spec.rb +0 -6
- data/frozen_old_spec/tags/1.8.6/core/kernel/__method___spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/kernel/define_singleton_method_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/kernel/public_method_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/kernel/require_relative_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/math/log2_spec.rb +0 -6
- data/frozen_old_spec/tags/1.8.6/core/math/log_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/module/alias_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/module/class_exec_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/module/define_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/module/module_exec_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/numeric/step_spec.rb +0 -12
- data/frozen_old_spec/tags/1.8.6/core/proc/curry_spec.rb +0 -4
- data/frozen_old_spec/tags/1.8.6/core/range/step_spec.rb +0 -12
- data/frozen_old_spec/tags/1.8.6/core/string/getbyte_spec.rb +0 -6
- data/frozen_old_spec/tags/1.8.6/core/string/partition_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/string/prepend_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/string/rpartition_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/string/setbyte_spec.rb +0 -5
- data/frozen_old_spec/tags/1.8.6/core/string/upto_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/symbol/capitalize_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.6/core/symbol/comparison_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/symbol/downcase_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/symbol/element_reference_spec.rb +0 -4
- data/frozen_old_spec/tags/1.8.6/core/symbol/empty_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/symbol/match_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/symbol/swapcase_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.6/core/symbol/to_proc_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.6/core/symbol/upcase_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/array/append_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/array/keep_if_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/array/rotate_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/array/select_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/array/uniq_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/complex/to_r_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/enumerable/all_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/enumerable/any_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/enumerable/collect_concat_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/enumerable/flat_map_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/enumerable/none_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/enumerable/one_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/env/to_h_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/file/lchmod_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/file/new_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/file/open_spec.rb +0 -5
- data/frozen_old_spec/tags/1.8.7/core/file/readlink_spec.rb +0 -6
- data/frozen_old_spec/tags/1.8.7/core/file/to_path_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/hash/assoc_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/hash/default_proc_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/hash/keep_if_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/hash/merge_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/hash/rassoc_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/hash/select_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/hash/to_h_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/hash/update_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/integer/round_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/io/binread_spec.rb +0 -7
- data/frozen_old_spec/tags/1.8.7/core/io/open_spec.rb +0 -32
- data/frozen_old_spec/tags/1.8.7/core/io/ungetbyte_spec.rb +0 -4
- data/frozen_old_spec/tags/1.8.7/core/io/write_spec.rb +0 -5
- data/frozen_old_spec/tags/1.8.7/core/kernel/__callee___spec.rb +0 -6
- data/frozen_old_spec/tags/1.8.7/core/kernel/define_singleton_method_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/kernel/public_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/kernel/require_relative_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/math/log2_spec.rb +0 -6
- data/frozen_old_spec/tags/1.8.7/core/math/log_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/module/alias_method_spec.rb +0 -7
- data/frozen_old_spec/tags/1.8.7/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/module/attr_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/module/define_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/module/include_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/module/remove_method_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/module/undef_method_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/proc/curry_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/proc/yield_spec.rb +0 -4
- data/frozen_old_spec/tags/1.8.7/core/range/size_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/string/getbyte_spec.rb +0 -5
- data/frozen_old_spec/tags/1.8.7/core/string/prepend_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/string/setbyte_spec.rb +0 -5
- data/frozen_old_spec/tags/1.8.7/core/struct/new_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/symbol/capitalize_spec.rb +0 -3
- data/frozen_old_spec/tags/1.8.7/core/symbol/comparison_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/symbol/downcase_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/symbol/element_reference_spec.rb +0 -4
- data/frozen_old_spec/tags/1.8.7/core/symbol/empty_spec.rb +0 -1
- data/frozen_old_spec/tags/1.8.7/core/symbol/match_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/symbol/swapcase_spec.rb +0 -2
- data/frozen_old_spec/tags/1.8.7/core/symbol/upcase_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/array/append_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/array/rotate_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/enumerable/all_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/enumerable/any_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.1/core/enumerable/none_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/enumerable/one_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/env/to_h_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.1/core/hash/default_proc_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/io/write_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.1/core/module/alias_method_spec.rb +0 -4
- data/frozen_old_spec/tags/1.9.1/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.1/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.1/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.1/core/module/define_method_spec.rb +0 -3
- data/frozen_old_spec/tags/1.9.1/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.1/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.2/core/array/append_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.2/core/enumerable/all_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.2/core/enumerable/any_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.2/core/enumerable/none_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.2/core/enumerable/one_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.2/core/io/write_spec.rb +0 -3
- data/frozen_old_spec/tags/1.9.2/core/module/alias_method_spec.rb +0 -4
- data/frozen_old_spec/tags/1.9.2/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.2/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.2/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.2/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/1.9.2/core/module/define_method_spec.rb +0 -3
- data/frozen_old_spec/tags/1.9.2/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.2/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.2/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.3/core/enumerable/any_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.3/core/module/alias_method_spec.rb +0 -4
- data/frozen_old_spec/tags/1.9.3/core/module/attr_accessor_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.3/core/module/attr_reader_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.3/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.3/core/module/attr_writer_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.3/core/module/define_method_spec.rb +0 -3
- data/frozen_old_spec/tags/1.9.3/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/1.9.3/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.0.0/core/enumerable/any_spec.rb +0 -1
- data/frozen_old_spec/tags/2.0.0/core/module/alias_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.0.0/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/2.0.0/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/2.0.0/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/2.0.0/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/2.0.0/core/module/define_method_spec.rb +0 -2
- data/frozen_old_spec/tags/2.0.0/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.0.0/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.0.0/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/2.0.0/core/struct/new_spec.rb +0 -1
- data/frozen_old_spec/tags/2.1.0/core/enumerable/any_spec.rb +0 -1
- data/frozen_old_spec/tags/2.1.0/core/module/alias_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.1.0/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/2.1.0/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/2.1.0/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/2.1.0/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/2.1.0/core/module/define_method_spec.rb +0 -2
- data/frozen_old_spec/tags/2.1.0/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.1.0/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.1.0/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/2.1.0/core/struct/new_spec.rb +0 -1
- data/frozen_old_spec/tags/2.2.0/core/enumerable/any_spec.rb +0 -1
- data/frozen_old_spec/tags/2.2.0/core/module/alias_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.2.0/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/2.2.0/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/2.2.0/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/2.2.0/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/2.2.0/core/module/define_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.2.0/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.2.0/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.2.0/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/2.2.0/core/struct/new_spec.rb +0 -1
- data/frozen_old_spec/tags/2.3.0/core/enumerable/any_spec.rb +0 -1
- data/frozen_old_spec/tags/2.3.0/core/module/alias_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.3.0/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/2.3.0/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/2.3.0/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/2.3.0/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/2.3.0/core/module/define_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.3.0/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.3.0/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.3.0/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/2.3.0/core/struct/new_spec.rb +0 -1
- data/frozen_old_spec/tags/2.3.5/core/struct/new_spec.rb +0 -1
- data/frozen_old_spec/tags/2.4.0/core/enumerable/any_spec.rb +0 -1
- data/frozen_old_spec/tags/2.4.0/core/module/alias_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.4.0/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/2.4.0/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/2.4.0/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/2.4.0/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/2.4.0/core/module/define_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.4.0/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.4.0/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.4.0/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/2.4.0/core/struct/new_spec.rb +0 -1
- data/frozen_old_spec/tags/2.5.0/core/enumerable/any_spec.rb +0 -1
- data/frozen_old_spec/tags/2.5.0/core/module/alias_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.5.0/core/module/attr_accessor_spec.rb +0 -2
- data/frozen_old_spec/tags/2.5.0/core/module/attr_reader_spec.rb +0 -2
- data/frozen_old_spec/tags/2.5.0/core/module/attr_spec.rb +0 -1
- data/frozen_old_spec/tags/2.5.0/core/module/attr_writer_spec.rb +0 -2
- data/frozen_old_spec/tags/2.5.0/core/module/define_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.5.0/core/module/remove_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.5.0/core/module/undef_method_spec.rb +0 -1
- data/frozen_old_spec/tags/2.5.0/core/nil/dup_spec.rb +0 -1
- data/frozen_old_spec/tags/2.5.0/core/struct/new_spec.rb +0 -1
- data/set_version/1.8.7.rb +0 -1
- data/set_version/1.9.1.rb +0 -1
- data/set_version/1.9.2.rb +0 -1
- data/set_version/1.9.3.rb +0 -1
- data/set_version/2.0.0.rb +0 -1
- data/set_version/2.1.0.rb +0 -1
- data/set_version/2.2.0.rb +0 -1
- data/set_version/2.3.0.rb +0 -1
- data/set_version/2.4.0.rb +0 -1
- data/set_version/2.5.0.rb +0 -1
- data/set_version/2.6.0.rb +0 -1
- data/set_version/2.7.0.rb +0 -1
- data/set_version/setter.rb +0 -22
- data/spec/tags/1.8.7/core/array/to_h_spec.rb +0 -3
- data/spec/tags/1.8.7/core/enumerable/to_h_spec.rb +0 -2
- data/spec/tags/1.8.7/core/module/attr_spec.rb +0 -1
- data/spec/tags/1.8.7/core/module/include_spec.rb +0 -1
- data/spec/tags/1.9.1/core/array/bsearch_index_spec.rb +0 -1
- data/spec/tags/1.9.1/core/array/rotate_spec.rb +0 -1
- data/spec/tags/1.9.1/core/dir/each_child_spec.rb +0 -1
- data/spec/tags/1.9.1/core/env/to_h_spec.rb +0 -2
- data/spec/tags/1.9.1/core/hash/default_proc_spec.rb +0 -1
- data/spec/tags/1.9.1/core/hash/slice_spec.rb +0 -1
- data/spec/tags/1.9.1/core/hash/transform_keys_spec.rb +0 -2
- data/spec/tags/1.9.1/core/hash/transform_values_spec.rb +0 -2
- data/spec/tags/1.9.1/core/io/write_spec.rb +0 -3
- data/spec/tags/1.9.1/core/kernel/yield_self_spec.rb +0 -1
- data/spec/tags/1.9.1/core/method/curry_spec.rb +0 -1
- data/spec/tags/1.9.1/core/module/alias_method_spec.rb +0 -3
- data/spec/tags/1.9.1/core/module/attr_accessor_spec.rb +0 -1
- data/spec/tags/1.9.1/core/module/attr_reader_spec.rb +0 -1
- data/spec/tags/1.9.1/core/module/attr_spec.rb +0 -1
- data/spec/tags/1.9.1/core/module/attr_writer_spec.rb +0 -1
- data/spec/tags/1.9.1/core/module/define_method_spec.rb +0 -7
- data/spec/tags/1.9.1/core/string/uplus_spec.rb +0 -1
- data/spec/tags/1.9.1/core/struct/new_spec.rb +0 -2
- data/spec/tags/1.9.2/core/array/bsearch_index_spec.rb +0 -1
- data/spec/tags/1.9.2/core/array/to_h_spec.rb +0 -3
- data/spec/tags/1.9.2/core/dir/each_child_spec.rb +0 -1
- data/spec/tags/1.9.2/core/enumerable/to_h_spec.rb +0 -2
- data/spec/tags/1.9.2/core/hash/slice_spec.rb +0 -1
- data/spec/tags/1.9.2/core/hash/to_h_spec.rb +0 -3
- data/spec/tags/1.9.2/core/hash/transform_keys_spec.rb +0 -2
- data/spec/tags/1.9.2/core/hash/transform_values_spec.rb +0 -2
- data/spec/tags/1.9.2/core/io/write_spec.rb +0 -3
- data/spec/tags/1.9.2/core/kernel/then_spec.rb +0 -1
- data/spec/tags/1.9.2/core/kernel/yield_self_spec.rb +0 -1
- data/spec/tags/1.9.2/core/method/curry_spec.rb +0 -1
- data/spec/tags/1.9.2/core/module/alias_method_spec.rb +0 -3
- data/spec/tags/1.9.2/core/module/attr_accessor_spec.rb +0 -1
- data/spec/tags/1.9.2/core/module/attr_reader_spec.rb +0 -1
- data/spec/tags/1.9.2/core/module/attr_writer_spec.rb +0 -1
- data/spec/tags/1.9.2/core/module/define_method_spec.rb +0 -7
- data/spec/tags/1.9.2/core/module/include_spec.rb +0 -1
- data/spec/tags/1.9.2/core/string/uplus_spec.rb +0 -1
- data/spec/tags/1.9.2/core/struct/new_spec.rb +0 -2
- data/spec/tags/1.9.3/core/array/bsearch_index_spec.rb +0 -1
- data/spec/tags/1.9.3/core/array/to_h_spec.rb +0 -3
- data/spec/tags/1.9.3/core/dir/each_child_spec.rb +0 -1
- data/spec/tags/1.9.3/core/enumerable/grep_v_spec.rb +0 -2
- data/spec/tags/1.9.3/core/enumerable/to_h_spec.rb +0 -2
- data/spec/tags/1.9.3/core/enumerator/produce_spec.rb +0 -1
- data/spec/tags/1.9.3/core/hash/slice_spec.rb +0 -1
- data/spec/tags/1.9.3/core/hash/to_h_spec.rb +0 -3
- data/spec/tags/1.9.3/core/hash/transform_keys_spec.rb +0 -2
- data/spec/tags/1.9.3/core/hash/transform_values_spec.rb +0 -2
- data/spec/tags/1.9.3/core/io/write_spec.rb +0 -3
- data/spec/tags/1.9.3/core/kernel/then_spec.rb +0 -1
- data/spec/tags/1.9.3/core/kernel/yield_self_spec.rb +0 -1
- data/spec/tags/1.9.3/core/method/curry_spec.rb +0 -1
- data/spec/tags/1.9.3/core/module/alias_method_spec.rb +0 -3
- data/spec/tags/1.9.3/core/module/attr_accessor_spec.rb +0 -1
- data/spec/tags/1.9.3/core/module/attr_reader_spec.rb +0 -1
- data/spec/tags/1.9.3/core/module/attr_writer_spec.rb +0 -1
- data/spec/tags/1.9.3/core/module/define_method_spec.rb +0 -7
- data/spec/tags/1.9.3/core/module/include_spec.rb +0 -1
- data/spec/tags/1.9.3/core/string/uplus_spec.rb +0 -1
- data/spec/tags/1.9.3/core/struct/new_spec.rb +0 -2
- data/spec/tags/2.0.0/core/array/to_h_spec.rb +0 -3
- data/spec/tags/2.0.0/core/enumerable/grep_v_spec.rb +0 -2
- data/spec/tags/2.0.0/core/enumerable/to_h_spec.rb +0 -2
- data/spec/tags/2.0.0/core/hash/slice_spec.rb +0 -1
- data/spec/tags/2.0.0/core/hash/to_h_spec.rb +0 -3
- data/spec/tags/2.0.0/core/module/attr_accessor_spec.rb +0 -1
- data/spec/tags/2.0.0/core/module/attr_reader_spec.rb +0 -1
- data/spec/tags/2.0.0/core/module/attr_spec.rb +0 -1
- data/spec/tags/2.0.0/core/module/attr_writer_spec.rb +0 -1
- data/spec/tags/2.0.0/core/module/define_method_spec.rb +0 -5
- data/spec/tags/2.0.0/core/module/include_spec.rb +0 -1
- data/spec/tags/2.0.0/core/module/undef_method_spec.rb +0 -2
- data/spec/tags/2.0.0/core/string/uplus_spec.rb +0 -1
- data/spec/tags/2.0.0/core/struct/new_spec.rb +0 -3
- data/spec/tags/2.1.0/core/array/union_spec.rb +0 -1
- data/spec/tags/2.1.0/core/enumerable/grep_v_spec.rb +0 -2
- data/spec/tags/2.1.0/core/hash/slice_spec.rb +0 -1
- data/spec/tags/2.1.0/core/hash/to_h_spec.rb +0 -1
- data/spec/tags/2.1.0/core/module/attr_accessor_spec.rb +0 -1
- data/spec/tags/2.1.0/core/module/attr_reader_spec.rb +0 -1
- data/spec/tags/2.1.0/core/module/attr_spec.rb +0 -1
- data/spec/tags/2.1.0/core/module/attr_writer_spec.rb +0 -1
- data/spec/tags/2.1.0/core/module/define_method_spec.rb +0 -5
- data/spec/tags/2.1.0/core/module/undef_method_spec.rb +0 -2
- data/spec/tags/2.1.0/core/string/uplus_spec.rb +0 -1
- data/spec/tags/2.1.0/core/struct/new_spec.rb +0 -3
- data/spec/tags/2.2.0/core/enumerable/grep_v_spec.rb +0 -2
- data/spec/tags/2.2.0/core/hash/slice_spec.rb +0 -1
- data/spec/tags/2.2.0/core/hash/to_h_spec.rb +0 -1
- data/spec/tags/2.2.0/core/module/attr_accessor_spec.rb +0 -1
- data/spec/tags/2.2.0/core/module/attr_reader_spec.rb +0 -1
- data/spec/tags/2.2.0/core/module/attr_spec.rb +0 -1
- data/spec/tags/2.2.0/core/module/attr_writer_spec.rb +0 -1
- data/spec/tags/2.2.0/core/module/define_method_spec.rb +0 -5
- data/spec/tags/2.2.0/core/module/undef_method_spec.rb +0 -2
- data/spec/tags/2.2.0/core/string/uplus_spec.rb +0 -1
- data/spec/tags/2.2.0/core/struct/new_spec.rb +0 -3
- data/spec/tags/2.3.0/core/hash/slice_spec.rb +0 -1
- data/spec/tags/2.3.0/core/hash/to_h_spec.rb +0 -1
- data/spec/tags/2.3.0/core/module/attr_spec.rb +0 -1
- data/spec/tags/2.3.0/core/string/uplus_spec.rb +0 -1
- data/spec/tags/2.3.0/core/struct/new_spec.rb +0 -3
- data/spec/tags/2.4.0/core/hash/slice_spec.rb +0 -1
- data/spec/tags/2.4.0/core/hash/to_h_spec.rb +0 -1
- data/spec/tags/2.4.0/core/module/attr_spec.rb +0 -1
- data/spec/tags/2.4.0/core/struct/new_spec.rb +0 -1
- data/spec/tags/2.5.0/core/hash/to_h_spec.rb +0 -1
- data/test/README +0 -2
- data/test/_backport_guards_test.rb +0 -152
- data/test/bit_length_test.rb +0 -11
- data/test/lazy_test.rb +0 -487
- data/test/socket_interaction_test.rb +0 -9
- data/test/test_helper.rb +0 -1
data/SECURITY.md
ADDED
data/backports.gemspec
CHANGED
@@ -13,7 +13,11 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.homepage = "http://github.com/marcandre/backports"
|
14
14
|
gem.license = "MIT"
|
15
15
|
|
16
|
-
gem.files =
|
16
|
+
gem.files = Dir[*%w[
|
17
|
+
lib/**/*
|
18
|
+
*.{md,txt,gemspec}
|
19
|
+
Gemfile
|
20
|
+
]]
|
17
21
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
22
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
23
|
gem.require_paths = ["lib"]
|
data/lib/backports.rb
CHANGED
@@ -1,3 +1,9 @@
|
|
1
1
|
require "backports/version"
|
2
|
+
|
3
|
+
require "backports/tools/deprecation"
|
4
|
+
Backports.deprecate :require_version,
|
5
|
+
"Doing `require 'backports'` is deprecated and will not load any backport in the next major release.\n" \
|
6
|
+
"Require just the needed backports instead, or 'backports/latest'."
|
2
7
|
require "backports/2.4"
|
8
|
+
Backports.warned[:rails] = true
|
3
9
|
require "backports/rails"
|
data/lib/backports/1.8.7.rb
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
# require this file to load all the backports of Ruby 1.8.7
|
2
2
|
require "backports/tools/require_relative_dir"
|
3
|
-
require "backports/
|
4
|
-
|
3
|
+
require "backports/tools/deprecation"
|
4
|
+
|
5
|
+
Backports.frown_upon :require_version,
|
6
|
+
'Requiring backports/<ruby version> is not recommended in production. Require just the needed backports instead.'
|
7
|
+
|
8
|
+
if RUBY_VERSION < '1.8.7'
|
9
|
+
Backports.warned[:require_std_lib] = true
|
10
|
+
require "backports/std_lib"
|
11
|
+
Backports.require_relative_dir
|
12
|
+
end
|
data/lib/backports/1.9.1.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
1
|
# require this file to load all the backports up to Ruby 1.9.1 (including all of 1.8.8 and below)
|
2
2
|
require 'backports/1.8'
|
3
|
-
|
3
|
+
|
4
|
+
if RUBY_VERSION < '1.9.1'
|
5
|
+
Backports.warned[:require_std_lib] = true
|
6
|
+
require "backports/std_lib"
|
7
|
+
Backports.require_relative_dir
|
8
|
+
end
|
data/lib/backports/1.9.2.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
1
|
# require this file to load all the backports up to Ruby 1.9.2
|
2
2
|
require 'backports/1.9.1'
|
3
|
-
|
3
|
+
|
4
|
+
if RUBY_VERSION < '1.9.2'
|
5
|
+
Backports.warned[:require_std_lib] = true
|
6
|
+
require "backports/std_lib"
|
7
|
+
Backports.require_relative_dir
|
8
|
+
end
|
@@ -11,7 +11,10 @@
|
|
11
11
|
# Original Documentation:: Gavin Sinclair (sourced from <i>Ruby in a Nutshell</i> (Matsumoto, O'Reilly))
|
12
12
|
##
|
13
13
|
|
14
|
+
begin
|
14
15
|
require "e2mmap.rb"
|
16
|
+
rescue LoadError
|
17
|
+
else
|
15
18
|
|
16
19
|
module ExceptionForMatrix # :nodoc:
|
17
20
|
def_e2message(TypeError, "wrong argument type %s (expected %s)")
|
@@ -1870,3 +1873,5 @@ class Vector
|
|
1870
1873
|
end
|
1871
1874
|
end
|
1872
1875
|
end
|
1876
|
+
|
1877
|
+
end
|
data/lib/backports/1.9.3.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
1
|
# require this file to load all the backports up to Ruby 1.9.3
|
2
2
|
require 'backports/1.9.2'
|
3
|
-
|
3
|
+
|
4
|
+
if RUBY_VERSION < '1.9.3'
|
5
|
+
Backports.warned[:require_std_lib] = true
|
6
|
+
require "backports/std_lib"
|
7
|
+
Backports.require_relative_dir
|
8
|
+
end
|
data/lib/backports/2.0.0.rb
CHANGED
data/lib/backports/2.1.0.rb
CHANGED
data/lib/backports/2.2.0.rb
CHANGED
@@ -7,7 +7,7 @@ unless Enumerable.method_defined? :slice_after
|
|
7
7
|
raise ArgumentError, 'both pattern and block are given' if pattern != Backports::Undefined && block
|
8
8
|
raise ArgumentError, 'wrong number of arguments (given 0, expected 1)' if pattern == Backports::Undefined && !block
|
9
9
|
enum = self
|
10
|
-
block ||=
|
10
|
+
block ||= proc {|elem| pattern === elem}
|
11
11
|
Enumerator.new do |y|
|
12
12
|
acc = []
|
13
13
|
enum.each do |*elem|
|
@@ -4,7 +4,7 @@ unless Float.method_defined? :next_float
|
|
4
4
|
class Float
|
5
5
|
def next_float
|
6
6
|
return Float::INFINITY if self == Float::INFINITY
|
7
|
-
r = Backports.integer_to_float(Backports.float_to_integer(self)+1)
|
7
|
+
r = Backports.integer_to_float(Backports.float_to_integer(self) + 1)
|
8
8
|
r == 0 ? -0.0 : r # Map +0.0 to -0.0
|
9
9
|
end
|
10
10
|
end
|
@@ -5,7 +5,7 @@ unless Float.method_defined? :prev_float
|
|
5
5
|
class Float
|
6
6
|
def prev_float
|
7
7
|
return -Float::INFINITY if self == -Float::INFINITY
|
8
|
-
Backports.integer_to_float(Backports.float_to_integer(self)-1)
|
8
|
+
Backports.integer_to_float(Backports.float_to_integer(self) - 1)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -6,10 +6,10 @@ unless Method.method_defined? :super_method
|
|
6
6
|
singleton_klass = class << receiver; self; end
|
7
7
|
call_chain = singleton_klass.ancestors
|
8
8
|
# find current position in call chain:
|
9
|
-
skip = call_chain.find_index{|c| c == owner} or return
|
9
|
+
skip = call_chain.find_index {|c| c == owner} or return
|
10
10
|
call_chain = call_chain.drop(skip + 1)
|
11
11
|
# find next in chain with a definition:
|
12
|
-
next_index = call_chain.find_index{|c| c.method_defined? name}
|
12
|
+
next_index = call_chain.find_index {|c| c.method_defined? name}
|
13
13
|
next_index && call_chain[next_index].instance_method(name).bind(receiver)
|
14
14
|
end
|
15
15
|
end
|
data/lib/backports/2.3.0.rb
CHANGED
@@ -2,11 +2,10 @@ unless Struct.method_defined? :dig
|
|
2
2
|
class Struct
|
3
3
|
def dig(key, *rest)
|
4
4
|
return nil unless respond_to?(key)
|
5
|
-
val =
|
5
|
+
val = public_send(key)
|
6
6
|
return val if rest.empty? || val == nil
|
7
7
|
raise TypeError, "#{val.class} does not have #dig method" unless val.respond_to? :dig
|
8
8
|
val.dig(*rest)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
12
|
-
|
data/lib/backports/2.4.0.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Hash
|
2
2
|
def transform_values
|
3
|
-
return to_enum(:transform_values){ size } unless block_given?
|
3
|
+
return to_enum(:transform_values) { size } unless block_given?
|
4
4
|
h = {}
|
5
5
|
each do |key, value|
|
6
6
|
h[key] = yield value
|
@@ -9,7 +9,7 @@ class Hash
|
|
9
9
|
end unless method_defined? :transform_values
|
10
10
|
|
11
11
|
def transform_values!
|
12
|
-
return to_enum(:transform_values!){ size } unless block_given?
|
12
|
+
return to_enum(:transform_values!) { size } unless block_given?
|
13
13
|
reject!{} if frozen? # Force error triggerring if frozen, in case of empty array
|
14
14
|
each do |key, value|
|
15
15
|
self[key] = yield value
|
data/lib/backports/2.5.0.rb
CHANGED
@@ -6,9 +6,9 @@ class Integer
|
|
6
6
|
def self.sqrt(n)
|
7
7
|
n = Backports.coerce_to_int(n)
|
8
8
|
return Math.sqrt(n).to_i if n <= 9_999_899_999_899_999_322_536_673_279
|
9
|
-
bits_shift = n.bit_length/2 + 1
|
9
|
+
bits_shift = n.bit_length / 2 + 1
|
10
10
|
bitn_mask = root = 1 << bits_shift
|
11
|
-
|
11
|
+
loop do
|
12
12
|
root ^= bitn_mask if (root * root) > n
|
13
13
|
bitn_mask >>= 1
|
14
14
|
return root if bitn_mask == 0
|
@@ -6,14 +6,10 @@ unless String.method_defined? :undump
|
|
6
6
|
raise 'string contains null byte' if string["\0"]
|
7
7
|
raise 'non-ASCII character detected' unless string.ascii_only?
|
8
8
|
|
9
|
-
|
10
|
-
match = string.match(/\A(".*?"?)(?:\.force_encoding\("([^"]*)"\))?\z/)
|
11
|
-
if match
|
12
|
-
string = match[1]
|
13
|
-
encoding = match[2]
|
14
|
-
else
|
9
|
+
match = string.match(/\A(".*?"?)(?:\.force_encoding\("([^"]*)"\))?\z/) or
|
15
10
|
raise %(invalid dumped string; not wrapped with '"' nor '"...".force_encoding("...")' form)
|
16
|
-
|
11
|
+
string = match[1]
|
12
|
+
encoding = match[2]
|
17
13
|
|
18
14
|
# Ruby 1.9.3 does weird things to encoding during gsub
|
19
15
|
encoding ||= string.encoding.to_s
|
data/lib/backports/2.6.0.rb
CHANGED
@@ -11,7 +11,10 @@ unless Enumerable.method_defined? :chain
|
|
11
11
|
def initialize(*enums)
|
12
12
|
@enums = enums
|
13
13
|
@rewindable = -1
|
14
|
-
self
|
14
|
+
# This self is necessary to pass RubySpec,
|
15
|
+
# See rubyspec/core/enumerator/chain/initialize_spec.rb
|
16
|
+
# ...it checks what call of #initialize on non-initalized object returns
|
17
|
+
self # rubocop:disable Lint/Void
|
15
18
|
end
|
16
19
|
|
17
20
|
def each(*args, &block)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
unless (1..4).cover?(2..3)
|
2
|
+
require 'backports/tools/alias_method_chain'
|
3
|
+
|
4
|
+
class Range
|
5
|
+
def cover_with_range_compatibility?(what)
|
6
|
+
return cover_without_range_compatibility?(what) unless what.is_a?(Range)
|
7
|
+
|
8
|
+
left = self.begin <=> what.begin
|
9
|
+
right = self.end <=> what.end
|
10
|
+
return false unless left && right
|
11
|
+
|
12
|
+
left <= 0 && (
|
13
|
+
right >= 1 ||
|
14
|
+
right == 0 && (!exclude_end? || what.exclude_end?) ||
|
15
|
+
what.exclude_end? && what.begin.is_a?(Integer) &&
|
16
|
+
what.end.is_a?(Integer) && cover_without_range_compatibility?(what.end - 1)
|
17
|
+
)
|
18
|
+
end
|
19
|
+
Backports.alias_method_chain self, :cover?, :range_compatibility
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/lib/backports/2.7.0.rb
CHANGED
@@ -5,10 +5,10 @@ unless Enumerable.method_defined? :filter_map
|
|
5
5
|
def filter_map
|
6
6
|
return to_enum(:filter_map) unless block_given?
|
7
7
|
|
8
|
-
each_with_object([])
|
8
|
+
each_with_object([]) do |item, res|
|
9
9
|
processed = yield(item)
|
10
10
|
res << processed if processed
|
11
|
-
|
11
|
+
end
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -1,3 +1,7 @@
|
|
1
|
+
require 'backports/tools/deprecation'
|
2
|
+
|
3
|
+
Backports.deprecate :rails, 'Rails backports are deprecated.'
|
4
|
+
|
1
5
|
module Enumerable
|
2
6
|
# Standard in rails... See official documentation[http://api.rubyonrails.org/classes/Enumerable.html]
|
3
7
|
# Modified from rails 2.3 to not rely on size
|
data/lib/backports/rails/hash.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
require 'backports/tools/deprecation'
|
2
|
+
|
3
|
+
Backports.deprecate :rails, 'Rails backports are deprecated.'
|
4
|
+
|
1
5
|
class Hash
|
2
6
|
# Standard in rails. See official documentation[http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Hash/Keys.html]
|
3
7
|
def reverse_merge(other_hash)
|
@@ -1,3 +1,7 @@
|
|
1
|
+
require 'backports/tools/deprecation'
|
2
|
+
|
3
|
+
Backports.deprecate :rails, 'Rails backports are deprecated.'
|
4
|
+
|
1
5
|
class Module
|
2
6
|
# Standard in rails... See official documentation[http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Module.html]
|
3
7
|
def alias_method_chain(target, feature, &block)
|
@@ -1,3 +1,7 @@
|
|
1
|
+
require 'backports/tools/deprecation'
|
2
|
+
|
3
|
+
Backports.deprecate :rails, 'Rails backports are deprecated.'
|
4
|
+
|
1
5
|
class String
|
2
6
|
# Standard in rails. See official documentation[http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html]
|
3
7
|
def camelize(first_letter = :upper)
|