backports 3.16.0 → 3.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +658 -0
- data/README.md +524 -0
- data/backports.gemspec +5 -1
- data/lib/backports/1.8.7.rb +7 -0
- data/lib/backports/1.9.2/stdlib/matrix.rb +5 -0
- 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 +12 -0
- data/lib/backports/version.rb +1 -1
- metadata +7 -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/README.rdoc
DELETED
@@ -1,445 +0,0 @@
|
|
1
|
-
= Backports Library {<img src="https://travis-ci.org/marcandre/backports.svg?branch=master">}[https://travis-ci.org/marcandre/backports] {<img src="https://badge.fury.io/rb/backports.svg" alt="Gem Version" />}[http://badge.fury.io/rb/backports]
|
2
|
-
|
3
|
-
Yearning to use some of the new cool features in Ruby 2.7 while using 2.3.x? Have some legacy code in Ruby 1.8 but can't live without `flat_map`?
|
4
|
-
|
5
|
-
This gem is for you!
|
6
|
-
|
7
|
-
The goal of 'backports' is to make it easier to write ruby code that runs across different versions of Ruby.
|
8
|
-
|
9
|
-
Note: {Next major version (X-mas 2020)}[https://github.com/marcandre/backports/issues/139] will drop support for Ruby < 2.2.
|
10
|
-
|
11
|
-
== Loading backports
|
12
|
-
|
13
|
-
=== Explicitly (recommended)
|
14
|
-
|
15
|
-
For example, if you want to use transform_values and transform_keys, even in Ruby implementations that don't include it:
|
16
|
-
|
17
|
-
require 'backports/2.4.0/hash/transform_values'
|
18
|
-
require 'backports/2.5.0/hash/transform_keys'
|
19
|
-
|
20
|
-
This will enable Hash#transform_values and Hash#transform_keys, using the native versions if available or otherwise provide a pure Ruby version.
|
21
|
-
|
22
|
-
=== By Module
|
23
|
-
|
24
|
-
To bring all the backports for a given Class/Module, you can specify only that Class:
|
25
|
-
|
26
|
-
require 'backports/2.3.0/hash'
|
27
|
-
|
28
|
-
This will make sure that Hash responds to dig, fetch_values, <, <=, >, >= and to_proc
|
29
|
-
|
30
|
-
=== Up to a specific Ruby version
|
31
|
-
|
32
|
-
You can load all backports up to a specific version. For example, to bring any version of Ruby mostly up to Ruby 2.4.0's standards:
|
33
|
-
|
34
|
-
require 'backports/2.4.0'
|
35
|
-
|
36
|
-
This will bring in all the features of 1.8.7 and many features of Ruby 1.9.x all the way up to Ruby 2.4.0 (for all versions of Ruby)!
|
37
|
-
|
38
|
-
While it is not recommended, you may `require 'backports/latest'` as a shortcut to the latest Ruby version supported. This is equivalent to the deprecated `require 'backports'`.
|
39
|
-
|
40
|
-
+Note+: Although I am a Ruby committer, this gem is a personal project and is not endorsed by ruby-core.
|
41
|
-
|
42
|
-
== What's inside
|
43
|
-
|
44
|
-
Goals for backported features:
|
45
|
-
1. Won't break older code
|
46
|
-
2. Pure Ruby (no C extensions)
|
47
|
-
3. Pass ruby/spec[https://github.com/ruby/spec]
|
48
|
-
|
49
|
-
Let's be a bit more precise about the "breaking code" business. It is of course entirely possible that code will break. In particular, you may be distinguishing parameters with duck typing, but a builtin class may, in the future, be responding to a particular call. Here's {an exemple from Rails}(https://github.com/rails/rails/blob/a4b55827721a5967299f3c1531afb3d6d81e4ac0/activerecord/lib/active_record/associations/association.rb#L155-L159) that is relying on the fact that Proc and Method respond to :to_proc and Hash isn't. That is, until Ruby 2.3... This old version of Rails therefore won't work on Ruby 2.3, or on older Rubies with that the `2.3.0/hash/to_proc` loaded...
|
50
|
-
|
51
|
-
For Ruby < 2.0, there are some real incompatibilities. For example, <tt>Module::instance_methods</tt> which returns strings in 1.8 and symbols in 1.9. No change can be made without the risk of breaking existing code. Such incompatibilities are left unchanged, although you can require some of these changes in addition (see below).
|
52
|
-
|
53
|
-
== Installation & compatibility
|
54
|
-
|
55
|
-
+backports+ can be installed with:
|
56
|
-
|
57
|
-
gem install backports
|
58
|
-
|
59
|
-
To use:
|
60
|
-
|
61
|
-
require 'rubygems'
|
62
|
-
# For only specific backports:
|
63
|
-
require 'backports/1.9.1/kernel/require_relative'
|
64
|
-
require 'backports/2.0.0/enumerable/lazy'
|
65
|
-
|
66
|
-
# For all backports up to a given version
|
67
|
-
require 'backports/1.9.2' # All backports for Ruby 1.9.2 and below
|
68
|
-
|
69
|
-
Note: about a dozen of backports have a dependency that will be also loaded. For example, the backport of Enumerable#flat_map uses flatten(1), so if required from Ruby 1.8.6 (where Array#flatten does not accept an argument), the backport for Ruby's 1.8.7 flatten with an argument will also be loaded.
|
70
|
-
|
71
|
-
With bundler, add to your Gemfile:
|
72
|
-
|
73
|
-
gem 'backports', :require => false
|
74
|
-
|
75
|
-
Run <tt>bundle install</tt> and require the desired backports.
|
76
|
-
Compatible with Ruby itself, JRuby and Rubinius.
|
77
|
-
|
78
|
-
= Complete List of backports
|
79
|
-
|
80
|
-
== Ruby 2.7 backports
|
81
|
-
|
82
|
-
* Array
|
83
|
-
* +intersection+
|
84
|
-
|
85
|
-
* Comparable
|
86
|
-
* +clamp+ (with range)
|
87
|
-
|
88
|
-
* Complex
|
89
|
-
* +<=>+
|
90
|
-
|
91
|
-
* Enumerable
|
92
|
-
* +filter_map+
|
93
|
-
* +tally+
|
94
|
-
|
95
|
-
* Enumerator
|
96
|
-
* +produce+ (class method)
|
97
|
-
|
98
|
-
* Time
|
99
|
-
* +floor+, +ceil+
|
100
|
-
|
101
|
-
== Ruby 2.6 backports
|
102
|
-
|
103
|
-
* Array
|
104
|
-
* +difference+, +union+
|
105
|
-
* +to_h+ (with block)
|
106
|
-
|
107
|
-
* Enumerable
|
108
|
-
* +chain+
|
109
|
-
* +to_h+ (with block)
|
110
|
-
|
111
|
-
* Enumerator::Chain (use Enumerable#chain)
|
112
|
-
|
113
|
-
* Hash
|
114
|
-
* +merge+, +merge!+/+update+ (with multiple arguments)
|
115
|
-
* +to_h+ (with block)
|
116
|
-
|
117
|
-
* Kernel
|
118
|
-
* +then+
|
119
|
-
|
120
|
-
* Method
|
121
|
-
* +<<+, +>>+
|
122
|
-
|
123
|
-
* Proc
|
124
|
-
* +<<+, +>>+
|
125
|
-
|
126
|
-
== Ruby 2.5 backports
|
127
|
-
|
128
|
-
* Array
|
129
|
-
* +append+, +prepend+
|
130
|
-
* Dir
|
131
|
-
* +children+, +each_child+
|
132
|
-
* Enumerable
|
133
|
-
* +any?+, +all?+, +none?+, +one?+ (with pattern argument)
|
134
|
-
* Hash
|
135
|
-
* +slice+
|
136
|
-
* +transform_keys+
|
137
|
-
* Integer
|
138
|
-
* +sqrt+
|
139
|
-
* +allbits?+, +anybits?+ and +nobits?+
|
140
|
-
* Kernel
|
141
|
-
* +yield_self+
|
142
|
-
* Module
|
143
|
-
* +attr+, +attr_accessor+, +attr_reader+, +attr_writer+ (now public)
|
144
|
-
* +define_method+, +alias_method+, +undef_method+, +remove_method+ (now public)
|
145
|
-
* String
|
146
|
-
* +delete_prefix+, +delete_prefix!+
|
147
|
-
* +delete_suffix+, +delete_suffix!+
|
148
|
-
* +undump+
|
149
|
-
* Struct
|
150
|
-
* +new+ (with <code>keyword_init: true</code>)
|
151
|
-
|
152
|
-
== Ruby 2.4 backports
|
153
|
-
|
154
|
-
* Comparable
|
155
|
-
* +clamp+
|
156
|
-
* Enumerable
|
157
|
-
* +sum+
|
158
|
-
* +uniq+
|
159
|
-
* Hash
|
160
|
-
* +compact+, +compact!+
|
161
|
-
* +transform_values+, +transform_values!+
|
162
|
-
* Regexp
|
163
|
-
* +match?+
|
164
|
-
* String
|
165
|
-
* +match?+
|
166
|
-
* FalseClass, Fixnum, Float, NilClass, TrueClass
|
167
|
-
* +dup+
|
168
|
-
|
169
|
-
== Ruby 2.3 backports
|
170
|
-
|
171
|
-
* Array
|
172
|
-
* +bsearch_index+
|
173
|
-
* +dig+
|
174
|
-
* Enumerable
|
175
|
-
* +chunk_while+
|
176
|
-
* +grep_v+
|
177
|
-
* Hash
|
178
|
-
* +dig+
|
179
|
-
* +fetch_values+
|
180
|
-
* +to_proc+
|
181
|
-
* <=, <, >=, >
|
182
|
-
* Numeric
|
183
|
-
* +negative?+
|
184
|
-
* +positive?+
|
185
|
-
* String
|
186
|
-
* unary + and -
|
187
|
-
* Struct
|
188
|
-
* +dig+
|
189
|
-
|
190
|
-
== Ruby 2.2 backports
|
191
|
-
|
192
|
-
* Enumerable
|
193
|
-
* +slice_after+
|
194
|
-
* +slice_when+
|
195
|
-
* Float
|
196
|
-
* +prev_float+
|
197
|
-
* +next_float+
|
198
|
-
* Kernel
|
199
|
-
* +itself+
|
200
|
-
* Method
|
201
|
-
* +curry+
|
202
|
-
* +super_method+
|
203
|
-
* String
|
204
|
-
* +unicode_normalize+
|
205
|
-
* +unicode_normalize!+
|
206
|
-
* +unicode_normalize?+
|
207
|
-
|
208
|
-
== Ruby 2.1 backports
|
209
|
-
|
210
|
-
* Array
|
211
|
-
* +to_h+
|
212
|
-
* Bignum
|
213
|
-
* +bit_length+
|
214
|
-
* Enumerable
|
215
|
-
* +to_h+
|
216
|
-
* Fixnum
|
217
|
-
* +bit_length+
|
218
|
-
* Module
|
219
|
-
* +include+ (now public)
|
220
|
-
|
221
|
-
== Ruby 2.0 backports
|
222
|
-
|
223
|
-
* Array
|
224
|
-
* +bsearch+
|
225
|
-
* Enumerable
|
226
|
-
* +lazy+
|
227
|
-
* Enumerator::Lazy
|
228
|
-
* all methods
|
229
|
-
* Hash
|
230
|
-
* <tt>default_proc=</tt> (with nil argument)
|
231
|
-
* +to_h+
|
232
|
-
* nil.to_h
|
233
|
-
* Range
|
234
|
-
* +bsearch+
|
235
|
-
* Struct
|
236
|
-
* +to_h+
|
237
|
-
|
238
|
-
== Ruby 1.9.3 backports
|
239
|
-
|
240
|
-
* File
|
241
|
-
* +NULL+
|
242
|
-
* IO
|
243
|
-
* +advise+ (acts as a noop)
|
244
|
-
* +write+, +binwrite+
|
245
|
-
* String
|
246
|
-
* +byteslice+
|
247
|
-
* +prepend+
|
248
|
-
|
249
|
-
== Ruby 1.9.2 backports
|
250
|
-
|
251
|
-
* Array
|
252
|
-
* <tt>rotate, rotate!</tt>
|
253
|
-
* <tt>keep_if, select!</tt>
|
254
|
-
* +product+ (with block)
|
255
|
-
* +repeated_combination+, +repeated_permutation+
|
256
|
-
* <tt>sort_by!</tt>
|
257
|
-
* <tt>uniq, uniq!</tt> (with block)
|
258
|
-
|
259
|
-
* Complex
|
260
|
-
* +to_r+
|
261
|
-
|
262
|
-
* Dir
|
263
|
-
* +home+
|
264
|
-
|
265
|
-
* Enumerable
|
266
|
-
* +chunk+
|
267
|
-
* +flat_map+, +collect_concat+
|
268
|
-
* +join+
|
269
|
-
* +slice_before+
|
270
|
-
|
271
|
-
* Float::INFINITY, NAN
|
272
|
-
|
273
|
-
* Hash
|
274
|
-
* +keep_if+, <tt>select!</tt>
|
275
|
-
|
276
|
-
* Object
|
277
|
-
* <tt>singleton_class</tt>
|
278
|
-
|
279
|
-
* Random (new class)
|
280
|
-
|
281
|
-
*Note*: The methods of +Random+ can't be required individually; the class can only be required whole with <tt>require 'backports/1.9.2/random'</tt>.
|
282
|
-
|
283
|
-
== Ruby 1.9.1 backports
|
284
|
-
|
285
|
-
Additionally, the following Ruby 1.9 features have been backported:
|
286
|
-
* Array
|
287
|
-
* +try_convert+
|
288
|
-
* +sample+
|
289
|
-
|
290
|
-
* Enumerable
|
291
|
-
* +each_with_object+
|
292
|
-
* +each_with_index+ (with arguments)
|
293
|
-
|
294
|
-
* Enumerator
|
295
|
-
* +new+ (with block)
|
296
|
-
|
297
|
-
* File
|
298
|
-
* +binread+
|
299
|
-
* +to_path+
|
300
|
-
* All class methods accepting filenames will accept files or anything with a <tt>#to_path</tt> method.
|
301
|
-
* <tt>File.open</tt> accepts an options hash.
|
302
|
-
|
303
|
-
* Float
|
304
|
-
* +round+
|
305
|
-
|
306
|
-
* Hash
|
307
|
-
* +assoc+, +rassoc+
|
308
|
-
* +key+
|
309
|
-
* +try_convert+
|
310
|
-
* <tt>default_proc=</tt>
|
311
|
-
|
312
|
-
* Integer
|
313
|
-
* +magnitude+
|
314
|
-
* +round+
|
315
|
-
|
316
|
-
* IO
|
317
|
-
* +bin_read+
|
318
|
-
* +try_convert+
|
319
|
-
* +ungetbyte+
|
320
|
-
* <tt>IO.open</tt> accepts an options hash.
|
321
|
-
|
322
|
-
* Kernel
|
323
|
-
* +require_relative+
|
324
|
-
|
325
|
-
* Math
|
326
|
-
* +log+ (with base)
|
327
|
-
* +log2+
|
328
|
-
|
329
|
-
* Numeric
|
330
|
-
* +round+
|
331
|
-
|
332
|
-
* Object
|
333
|
-
* +define_singleton_method+
|
334
|
-
* +public_method+
|
335
|
-
* +public_send+
|
336
|
-
|
337
|
-
* Proc
|
338
|
-
* +yield+
|
339
|
-
* +lambda?+
|
340
|
-
* +curry+
|
341
|
-
* <tt>===</tt>
|
342
|
-
|
343
|
-
* Range
|
344
|
-
* <tt>cover?</tt>
|
345
|
-
|
346
|
-
* Regexp
|
347
|
-
* +try_convert+
|
348
|
-
|
349
|
-
* String
|
350
|
-
* <tt>ascii_only?</tt>
|
351
|
-
* +chr+
|
352
|
-
* +clear+
|
353
|
-
* +codepoints+, +each_codepoint+
|
354
|
-
* +get_byte+, +set_byte+
|
355
|
-
* +ord+
|
356
|
-
* +try_convert+
|
357
|
-
|
358
|
-
+Enumerator+ can be accessed directly (instead of <tt>Enumerable::Enumerator</tt>)
|
359
|
-
|
360
|
-
To include _only_ these backports and those of the 1.8 line, <tt>require "backports/1.9.1"</tt>.
|
361
|
-
|
362
|
-
Moreover, a pretty good imitation of +BasicObject+ is available,
|
363
|
-
but since it is only an imitation, it must be required explicitly:
|
364
|
-
|
365
|
-
require 'backports/basic_object'
|
366
|
-
|
367
|
-
== Ruby 1.8.7
|
368
|
-
|
369
|
-
Complete Ruby 1.8.7 backporting (core language). Refer to the official list of changes[https://github.com/ruby/ruby/blob/ruby_1_8_7/NEWS]. That's about 130 backports!
|
370
|
-
|
371
|
-
Only exceptions:
|
372
|
-
* String#gsub (the form returning an enumerator)
|
373
|
-
* GC.stress= (not implemented)
|
374
|
-
* Array#choice (removed in 1.9, use 1.9.1's Array#sample instead)
|
375
|
-
|
376
|
-
== Libraries
|
377
|
-
|
378
|
-
Libraries are slowly being backported. You simply require them as usual after requiring 'backports/std_lib'. Requiring 'backports/std_lib' after the standard libraries is also supported.
|
379
|
-
|
380
|
-
require "backports/std_lib"
|
381
|
-
require "prime"
|
382
|
-
42.prime? # => false, even in Ruby 1.8.x
|
383
|
-
|
384
|
-
The following libraries are up to date with Ruby 1.9.3:
|
385
|
-
|
386
|
-
* Matrix
|
387
|
-
* Prime
|
388
|
-
* Set
|
389
|
-
|
390
|
-
The following library is to date with Ruby 2.0.0:
|
391
|
-
|
392
|
-
* OpenStruct (ostruct)
|
393
|
-
|
394
|
-
I am aware of the following backport gem, which probably won't make it into this gem:
|
395
|
-
|
396
|
-
* Net::SMTP for Ruby 1.8.6: smtp_tls[http://seattlerb.rubyforge.org/smtp_tls/]
|
397
|
-
|
398
|
-
Requiring backports for a given version of Ruby will also load 'backports/std_lib'.
|
399
|
-
|
400
|
-
== Forcing incompatibilities
|
401
|
-
|
402
|
-
Some backports would create incompatibilities in their current Ruby version but could be useful in some projects. It is possible to request such incompatible changes. Backports currently supports the following:
|
403
|
-
|
404
|
-
* Hash
|
405
|
-
* +select+ (returns a Hash instead of an Array)
|
406
|
-
|
407
|
-
* Enumerable / Array
|
408
|
-
* +map+ (returns an enumerator when called without a block)
|
409
|
-
|
410
|
-
* String
|
411
|
-
* +length+, +size+ (for UTF-8 support)
|
412
|
-
|
413
|
-
These must be imported in addition to the backports gem, for example:
|
414
|
-
|
415
|
-
require "backports/force/hash_select"
|
416
|
-
{}.select{} # => {}, even in Ruby 1.8
|
417
|
-
|
418
|
-
|
419
|
-
== Thanks
|
420
|
-
|
421
|
-
Thanks for the bug reports and patches, in particular the repeat offenders:
|
422
|
-
|
423
|
-
* Arto Bendiken ( bendiken[http://github.com/bendiken] )
|
424
|
-
* Konstantin Haase ( rkh[https://github.com/rkh])
|
425
|
-
* Roger Pack ( rdp[http://github.com/rdp] )
|
426
|
-
|
427
|
-
== Contributing
|
428
|
-
|
429
|
-
The best way to submit a patch is to also submit a patch to ruby/spec[https://github.com/ruby/spec] and then a patch to backports that make it pass the spec.
|
430
|
-
|
431
|
-
See below to test rubyspec. Note that only features missing from your Ruby version are tested.
|
432
|
-
|
433
|
-
git submodule init && git submodule update # => pulls rubyspecs
|
434
|
-
bundle install
|
435
|
-
bundle exec rake spec[hash/slice] # => tests Hash#slice (must be in Ruby 2.4 or less)
|
436
|
-
bundle exec rake spec[hash/*] # => tests all backported Hash methods
|
437
|
-
bundle exec rake spec (or rake spec[*/*]) # => all rubyspecs for backported methods
|
438
|
-
|
439
|
-
Failures that are acceptable are added the to `tags` file.
|
440
|
-
|
441
|
-
= License
|
442
|
-
|
443
|
-
+backports+ is released under the terms of the MIT License, see the included LICENSE file.
|
444
|
-
|
445
|
-
Author:: Marc-André Lafortune
|
data/Rakefile
DELETED
@@ -1,192 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require "bundler/gem_tasks"
|
3
|
-
rescue LoadError
|
4
|
-
# bundler not installed
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'rake/testtask'
|
8
|
-
Rake::TestTask.new(:test) do |test|
|
9
|
-
test.libs << 'lib' << 'test'
|
10
|
-
test.pattern = 'test/**/*_test.rb'
|
11
|
-
test.verbose = false
|
12
|
-
end
|
13
|
-
|
14
|
-
class SpecRunner
|
15
|
-
STATS = [:files, :examples, :expectations, :failures, :errors]
|
16
|
-
attr_reader :stats, :not_found
|
17
|
-
|
18
|
-
def initialize
|
19
|
-
@counts = [0] * 5
|
20
|
-
@not_found = []
|
21
|
-
end
|
22
|
-
|
23
|
-
def run(cmd, path)
|
24
|
-
result = `#{cmd}`
|
25
|
-
match = result.match(/(\d+) files?, (\d+) examples?, (\d+) expectations?, (\d+) failures?, (\d+) errors?/)
|
26
|
-
if match.nil?
|
27
|
-
puts "*** mspec returned with unexpected results:"
|
28
|
-
puts result
|
29
|
-
puts "Command was:", cmd
|
30
|
-
exit
|
31
|
-
end
|
32
|
-
_, ex, p, f, e = data = match.captures.map{|x| x.to_i}
|
33
|
-
not_found << path if ex == 0
|
34
|
-
STATS.each_with_index do |_, i|
|
35
|
-
@counts[i] += data[i]
|
36
|
-
end
|
37
|
-
if f + e > 0
|
38
|
-
puts cmd
|
39
|
-
puts result
|
40
|
-
else
|
41
|
-
print "."
|
42
|
-
STDOUT.flush
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def stats
|
47
|
-
h = {}
|
48
|
-
STATS.zip(@counts).each{|k, v| h[k]=v}
|
49
|
-
h
|
50
|
-
end
|
51
|
-
|
52
|
-
def report
|
53
|
-
puts "*** Overall:", stats.map{|a| a.join(' ')}.join(', ')
|
54
|
-
puts "No spec found for #{@not_found.join(', ')}" unless @not_found.empty?
|
55
|
-
end
|
56
|
-
|
57
|
-
def success?
|
58
|
-
stats[:failures] == 0 && stats[:errors] == 0
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
desc "Run specs, where path can be '*/*' (default), 'class/*' or 'class/method'."
|
63
|
-
task :spec, :path, :action do |t, args|
|
64
|
-
args.with_defaults(:path => '*/*', :action => 'ci')
|
65
|
-
specs = SpecRunner.new
|
66
|
-
|
67
|
-
# Avoid unclear error message by checking if at least one spec exists in the old specs
|
68
|
-
has_frozen_spec = !Dir.glob('frozen_old_spec/rubyspec/core/#{path}_spec.rb')
|
69
|
-
if has_frozen_spec || RUBY_VERSION < '1.9'
|
70
|
-
mspec_cmds(args[:path], 'frozen_old_spec', args[:action]) do |cmd, path|
|
71
|
-
specs.run(cmd, path)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
unless RUBY_VERSION < '1.9' # Give up entirely on running new specs in 1.8.x, mainly because of {hash: 'syntax'}
|
76
|
-
mspec_cmds(args[:path], 'spec', args[:action]) do |cmd, path|
|
77
|
-
specs.run(cmd, path)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
specs.report
|
81
|
-
fail unless specs.success?
|
82
|
-
end
|
83
|
-
|
84
|
-
task :all_spec do # Necessary because of argument passing bug in 1.8.7
|
85
|
-
Rake::Task[:spec].invoke
|
86
|
-
end
|
87
|
-
|
88
|
-
desc "Same as spec, but creating tags for failures"
|
89
|
-
task :spec_tag, :path do |t, args|
|
90
|
-
Rake::Task[:spec].invoke(args[:path], 'tag -G fails')
|
91
|
-
end
|
92
|
-
|
93
|
-
task :default => [:test, :all_spec]
|
94
|
-
|
95
|
-
DEPENDENCIES = Hash.new([]).merge!(
|
96
|
-
'1.8.7/argf/chars' => 'backports/1.8.7/string/each_char',
|
97
|
-
'1.8.7/argf/each_char' => 'backports/1.8.7/string/each_char',
|
98
|
-
'1.8.7/array/cycle' => 'backports/1.8.7/stop_iteration',
|
99
|
-
'1.8.7/enumerable/entries' => ['backports/1.8.7/enumerable/each_with_index', 'backports/1.8.7/enumerable/to_a'],
|
100
|
-
'1.8.7/enumerator/rewind' => 'backports/1.8.7/enumerator/next',
|
101
|
-
'1.8.7/hash/reject' => 'backports/1.8.7/integer/even',
|
102
|
-
'1.9.1/hash/rassoc' => 'backports/1.9.1/hash/key',
|
103
|
-
'1.9.1/proc/lambda' => 'backports/1.9.1/proc/curry',
|
104
|
-
'1.9.2/complex/to_r' => 'complex',
|
105
|
-
'1.9.2/array/select' => 'backports/1.8.7/array/select',
|
106
|
-
'1.9.2/hash/select' => 'backports/1.8.7/hash/select',
|
107
|
-
'1.9.2/enumerable/each_entry' => 'backports/1.8.7/enumerable/each_with_index',
|
108
|
-
'2.0.0/hash/to_h' => 'backports/1.9.1/hash/default_proc',
|
109
|
-
'2.2.0/float/next_float' => 'backports/2.2.0/float/prev_float',
|
110
|
-
'2.2.0/float/prev_float' => 'backports/2.2.0/float/next_float',
|
111
|
-
'2.3.0/array/bsearch_index' => ['backports/2.3.0/array/dig', 'backports/2.3.0/hash/dig'],
|
112
|
-
'2.3.0/array/dig' => ['backports/2.3.0/hash/dig', 'backports/2.3.0/struct/dig'],
|
113
|
-
'2.3.0/hash/dig' => ['backports/2.3.0/array/dig', 'backports/2.3.0/struct/dig'],
|
114
|
-
'2.3.0/struct/dig' => ['backports/2.3.0/array/dig', 'backports/2.3.0/hash/dig'],
|
115
|
-
'2.7.0/enumerable/tally' => ['backports/2.4.0/hash/transform_values', 'backports/2.2.0/kernel/itself'],
|
116
|
-
)
|
117
|
-
{
|
118
|
-
:each_with_index => %w[enumerable/detect enumerable/find enumerable/find_all enumerable/select enumerable/to_a],
|
119
|
-
:first => %w[enumerable/cycle io/bytes io/chars io/each_byte io/each_char io/lines io/each_line]
|
120
|
-
}.each do |req, libs|
|
121
|
-
libs.each{|l| DEPENDENCIES["1.8.7/#{l}"] = "backports/1.8.7/enumerable/#{req}" }
|
122
|
-
end
|
123
|
-
|
124
|
-
# These **old** specs cause actual errors while loading in 1.8:
|
125
|
-
OLD_IGNORE_IN_18 = %w[
|
126
|
-
1.9.1/symbol/length
|
127
|
-
1.9.1/symbol/size
|
128
|
-
1.9.3/string/byteslice
|
129
|
-
1.8.7/proc/yield
|
130
|
-
1.9.1/proc/case_compare
|
131
|
-
2.4.0/string/match
|
132
|
-
2.4.0/regexp/match
|
133
|
-
2.5.0/module/define_method
|
134
|
-
]
|
135
|
-
# These **new** specs cause actual errors while loading in 1.9:
|
136
|
-
IGNORE_IN_19 = %w[
|
137
|
-
2.1.0/enumerable/to_h
|
138
|
-
2.1.0/array/to_h
|
139
|
-
2.1.0/module/include
|
140
|
-
2.2.0/kernel/itself
|
141
|
-
2.5.0/module/define_method
|
142
|
-
2.5.0/module/alias_method
|
143
|
-
2.5.0/module/undef_method
|
144
|
-
2.5.0/module/remove_method
|
145
|
-
2.5.0/module/attr
|
146
|
-
2.5.0/module/attr_reader
|
147
|
-
2.5.0/module/attr_writer
|
148
|
-
2.5.0/module/attr_accessor
|
149
|
-
2.5.0/struct/new
|
150
|
-
]
|
151
|
-
# These **new** specs cause actual errors while loading in 2.0.0:
|
152
|
-
IGNORE_IN_200 = %w[
|
153
|
-
2.4.0/enumerable/sum
|
154
|
-
]
|
155
|
-
|
156
|
-
CLASS_MAP = Hash.new{|k, v| k[v] = v}.merge!(
|
157
|
-
'match_data' => 'matchdata', # don't ask me why RubySpec uses matchdata instead of match_data
|
158
|
-
'true_class' => 'true',
|
159
|
-
'false_class' => 'false',
|
160
|
-
'nil_class' => 'nil'
|
161
|
-
)
|
162
|
-
|
163
|
-
EXTRA_SPECS = {
|
164
|
-
'enumerable/chain' => %w[enumerator/chain/*]
|
165
|
-
}
|
166
|
-
|
167
|
-
def mspec_cmds(pattern, spec_folder, action='ci')
|
168
|
-
pattern = "lib/backports/*.*.*/#{pattern}.rb"
|
169
|
-
Dir.glob(pattern) do |lib_path|
|
170
|
-
_match, version, path = lib_path.match(/backports\/(\d\.\d\.\d)\/(.*)\.rb/).to_a
|
171
|
-
next if path =~ /stdlib/
|
172
|
-
next if version <= RUBY_VERSION
|
173
|
-
version_path = "#{version}/#{path}"
|
174
|
-
if RUBY_VERSION < '2.0.0'
|
175
|
-
next if OLD_IGNORE_IN_18.include? version_path if RUBY_VERSION < '1.9'
|
176
|
-
next if IGNORE_IN_19.include? version_path
|
177
|
-
next if spec_folder != 'frozen_old_spec' && version <= '2.0.0' # Don't run new specs for pre 2.0 features & ruby
|
178
|
-
end
|
179
|
-
next if RUBY_VERSION < '2.1.0' && IGNORE_IN_200.include?(version_path)
|
180
|
-
deps = [*DEPENDENCIES[version_path]].map{|p| "-r #{p}"}.join(' ')
|
181
|
-
klass, method = path.split('/')
|
182
|
-
path = [CLASS_MAP[klass], method].join('/')
|
183
|
-
spec_paths = [path, *EXTRA_SPECS[path]].map {|p| "#{spec_folder}/rubyspec/core/#{p}_spec.rb" }
|
184
|
-
yield %W[mspec #{action}
|
185
|
-
-I lib
|
186
|
-
-r ./set_version/#{version}
|
187
|
-
#{deps}
|
188
|
-
-r backports/#{version_path}
|
189
|
-
#{spec_paths.join(' ')}
|
190
|
-
].join(' '), path
|
191
|
-
end
|
192
|
-
end
|