backports 3.16.0 → 3.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (441) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +691 -0
  3. data/Gemfile +6 -0
  4. data/README.md +529 -0
  5. data/SECURITY.md +5 -0
  6. data/backports.gemspec +5 -1
  7. data/lib/backports.rb +6 -0
  8. data/lib/backports/1.8.7.rb +10 -2
  9. data/lib/backports/1.9.1.rb +6 -1
  10. data/lib/backports/1.9.2.rb +6 -1
  11. data/lib/backports/1.9.2/stdlib/matrix.rb +5 -0
  12. data/lib/backports/1.9.3.rb +6 -1
  13. data/lib/backports/2.0.0.rb +6 -1
  14. data/lib/backports/2.0.0/range/size.rb +2 -0
  15. data/lib/backports/2.1.0.rb +1 -1
  16. data/lib/backports/2.2.0.rb +1 -1
  17. data/lib/backports/2.2.0/enumerable/slice_after.rb +1 -1
  18. data/lib/backports/2.2.0/float/next_float.rb +1 -1
  19. data/lib/backports/2.2.0/float/prev_float.rb +1 -1
  20. data/lib/backports/2.2.0/method/super_method.rb +2 -2
  21. data/lib/backports/2.3.0.rb +1 -1
  22. data/lib/backports/2.3.0/array/bsearch_index.rb +1 -1
  23. data/lib/backports/2.3.0/hash/lt.rb +1 -1
  24. data/lib/backports/2.3.0/hash/lte.rb +1 -1
  25. data/lib/backports/2.3.0/hash/to_proc.rb +1 -1
  26. data/lib/backports/2.3.0/struct/dig.rb +1 -2
  27. data/lib/backports/2.4.0.rb +1 -1
  28. data/lib/backports/2.4.0/hash/transform_values.rb +2 -2
  29. data/lib/backports/2.4.0/true_class/dup.rb +0 -1
  30. data/lib/backports/2.5.0.rb +1 -1
  31. data/lib/backports/2.5.0/hash/transform_keys.rb +1 -1
  32. data/lib/backports/2.5.0/integer/sqrt.rb +2 -2
  33. data/lib/backports/2.5.0/module/alias_method.rb +0 -1
  34. data/lib/backports/2.5.0/string/undump.rb +3 -7
  35. data/lib/backports/2.5.0/struct/new.rb +1 -1
  36. data/lib/backports/2.6.0.rb +1 -1
  37. data/lib/backports/2.6.0/enumerable/chain.rb +4 -1
  38. data/lib/backports/2.6.0/hash/to_h.rb +1 -1
  39. data/lib/backports/2.6.0/range.rb +3 -0
  40. data/lib/backports/2.6.0/range/cover.rb +22 -0
  41. data/lib/backports/2.7.0.rb +1 -1
  42. data/lib/backports/2.7.0/enumerable/filter_map.rb +2 -2
  43. data/lib/backports/rails/array.rb +4 -0
  44. data/lib/backports/rails/enumerable.rb +4 -0
  45. data/lib/backports/rails/hash.rb +4 -0
  46. data/lib/backports/rails/kernel.rb +4 -0
  47. data/lib/backports/rails/module.rb +4 -0
  48. data/lib/backports/rails/string.rb +4 -0
  49. data/lib/backports/std_lib.rb +3 -0
  50. data/lib/backports/tools/deprecation.rb +19 -0
  51. data/lib/backports/tools/require_relative_dir.rb +6 -1
  52. data/lib/backports/version.rb +1 -1
  53. metadata +10 -511
  54. data/.document +0 -6
  55. data/.gitignore +0 -9
  56. data/.gitmodules +0 -6
  57. data/.irbrc +0 -3
  58. data/.travis.yml +0 -19
  59. data/CHANGELOG.rdoc +0 -504
  60. data/README.rdoc +0 -445
  61. data/Rakefile +0 -192
  62. data/default.mspec +0 -14
  63. data/frozen_old_spec/tags/1.8.6/core/argf/each_line_spec.rb +0 -6
  64. data/frozen_old_spec/tags/1.8.6/core/argf/each_spec.rb +0 -6
  65. data/frozen_old_spec/tags/1.8.6/core/argf/lines_spec.rb +0 -6
  66. data/frozen_old_spec/tags/1.8.6/core/array/append_spec.rb +0 -1
  67. data/frozen_old_spec/tags/1.8.6/core/array/collect_spec.rb +0 -7
  68. data/frozen_old_spec/tags/1.8.6/core/array/rotate_spec.rb +0 -2
  69. data/frozen_old_spec/tags/1.8.6/core/array/uniq_spec.rb +0 -3
  70. data/frozen_old_spec/tags/1.8.6/core/complex/to_r_spec.rb +0 -3
  71. data/frozen_old_spec/tags/1.8.6/core/enumerable/all_spec.rb +0 -1
  72. data/frozen_old_spec/tags/1.8.6/core/enumerable/any_spec.rb +0 -2
  73. data/frozen_old_spec/tags/1.8.6/core/enumerable/each_entry_spec.rb +0 -1
  74. data/frozen_old_spec/tags/1.8.6/core/enumerable/none_spec.rb +0 -1
  75. data/frozen_old_spec/tags/1.8.6/core/enumerable/one_spec.rb +0 -1
  76. data/frozen_old_spec/tags/1.8.6/core/enumerator/next_spec.rb +0 -1
  77. data/frozen_old_spec/tags/1.8.6/core/env/to_h_spec.rb +0 -2
  78. data/frozen_old_spec/tags/1.8.6/core/file/join_spec.rb +0 -3
  79. data/frozen_old_spec/tags/1.8.6/core/file/lchmod_spec.rb +0 -2
  80. data/frozen_old_spec/tags/1.8.6/core/file/new_spec.rb +0 -2
  81. data/frozen_old_spec/tags/1.8.6/core/file/open_spec.rb +0 -13
  82. data/frozen_old_spec/tags/1.8.6/core/file/to_path_spec.rb +0 -1
  83. data/frozen_old_spec/tags/1.8.6/core/fixnum/fdiv_spec.rb +0 -1
  84. data/frozen_old_spec/tags/1.8.6/core/gc/stress_spec.rb +0 -2
  85. data/frozen_old_spec/tags/1.8.6/core/hash/assoc_spec.rb +0 -1
  86. data/frozen_old_spec/tags/1.8.6/core/hash/constructor_spec.rb +0 -3
  87. data/frozen_old_spec/tags/1.8.6/core/hash/default_proc_spec.rb +0 -3
  88. data/frozen_old_spec/tags/1.8.6/core/hash/delete_if_spec.rb +0 -1
  89. data/frozen_old_spec/tags/1.8.6/core/hash/each_pair_spec.rb +0 -1
  90. data/frozen_old_spec/tags/1.8.6/core/hash/eql_spec.rb +0 -3
  91. data/frozen_old_spec/tags/1.8.6/core/hash/hash_spec.rb +0 -3
  92. data/frozen_old_spec/tags/1.8.6/core/hash/keep_if_spec.rb +0 -2
  93. data/frozen_old_spec/tags/1.8.6/core/hash/rassoc_spec.rb +0 -1
  94. data/frozen_old_spec/tags/1.8.6/core/hash/reject_spec.rb +0 -2
  95. data/frozen_old_spec/tags/1.8.6/core/hash/select_spec.rb +0 -8
  96. data/frozen_old_spec/tags/1.8.6/core/integer/round_spec.rb +0 -2
  97. data/frozen_old_spec/tags/1.8.6/core/io/binread_spec.rb +0 -7
  98. data/frozen_old_spec/tags/1.8.6/core/io/chars_spec.rb +0 -1
  99. data/frozen_old_spec/tags/1.8.6/core/io/each_char_spec.rb +0 -1
  100. data/frozen_old_spec/tags/1.8.6/core/io/lines_spec.rb +0 -1
  101. data/frozen_old_spec/tags/1.8.6/core/io/open_spec.rb +0 -24
  102. data/frozen_old_spec/tags/1.8.6/core/io/ungetbyte_spec.rb +0 -4
  103. data/frozen_old_spec/tags/1.8.6/core/io/write_spec.rb +0 -5
  104. data/frozen_old_spec/tags/1.8.6/core/kernel/__callee___spec.rb +0 -6
  105. data/frozen_old_spec/tags/1.8.6/core/kernel/__method___spec.rb +0 -1
  106. data/frozen_old_spec/tags/1.8.6/core/kernel/define_singleton_method_spec.rb +0 -2
  107. data/frozen_old_spec/tags/1.8.6/core/kernel/public_method_spec.rb +0 -2
  108. data/frozen_old_spec/tags/1.8.6/core/kernel/require_relative_spec.rb +0 -3
  109. data/frozen_old_spec/tags/1.8.6/core/math/log2_spec.rb +0 -6
  110. data/frozen_old_spec/tags/1.8.6/core/math/log_spec.rb +0 -3
  111. data/frozen_old_spec/tags/1.8.6/core/module/alias_method_spec.rb +0 -1
  112. data/frozen_old_spec/tags/1.8.6/core/module/attr_accessor_spec.rb +0 -2
  113. data/frozen_old_spec/tags/1.8.6/core/module/attr_reader_spec.rb +0 -2
  114. data/frozen_old_spec/tags/1.8.6/core/module/attr_spec.rb +0 -1
  115. data/frozen_old_spec/tags/1.8.6/core/module/attr_writer_spec.rb +0 -2
  116. data/frozen_old_spec/tags/1.8.6/core/module/class_exec_spec.rb +0 -2
  117. data/frozen_old_spec/tags/1.8.6/core/module/define_method_spec.rb +0 -1
  118. data/frozen_old_spec/tags/1.8.6/core/module/module_exec_spec.rb +0 -2
  119. data/frozen_old_spec/tags/1.8.6/core/module/remove_method_spec.rb +0 -1
  120. data/frozen_old_spec/tags/1.8.6/core/module/undef_method_spec.rb +0 -1
  121. data/frozen_old_spec/tags/1.8.6/core/nil/dup_spec.rb +0 -1
  122. data/frozen_old_spec/tags/1.8.6/core/numeric/step_spec.rb +0 -12
  123. data/frozen_old_spec/tags/1.8.6/core/proc/curry_spec.rb +0 -4
  124. data/frozen_old_spec/tags/1.8.6/core/range/step_spec.rb +0 -12
  125. data/frozen_old_spec/tags/1.8.6/core/string/getbyte_spec.rb +0 -6
  126. data/frozen_old_spec/tags/1.8.6/core/string/partition_spec.rb +0 -1
  127. data/frozen_old_spec/tags/1.8.6/core/string/prepend_spec.rb +0 -1
  128. data/frozen_old_spec/tags/1.8.6/core/string/rpartition_spec.rb +0 -1
  129. data/frozen_old_spec/tags/1.8.6/core/string/setbyte_spec.rb +0 -5
  130. data/frozen_old_spec/tags/1.8.6/core/string/upto_spec.rb +0 -1
  131. data/frozen_old_spec/tags/1.8.6/core/symbol/capitalize_spec.rb +0 -3
  132. data/frozen_old_spec/tags/1.8.6/core/symbol/comparison_spec.rb +0 -1
  133. data/frozen_old_spec/tags/1.8.6/core/symbol/downcase_spec.rb +0 -2
  134. data/frozen_old_spec/tags/1.8.6/core/symbol/element_reference_spec.rb +0 -4
  135. data/frozen_old_spec/tags/1.8.6/core/symbol/empty_spec.rb +0 -1
  136. data/frozen_old_spec/tags/1.8.6/core/symbol/match_spec.rb +0 -2
  137. data/frozen_old_spec/tags/1.8.6/core/symbol/swapcase_spec.rb +0 -2
  138. data/frozen_old_spec/tags/1.8.6/core/symbol/to_proc_spec.rb +0 -1
  139. data/frozen_old_spec/tags/1.8.6/core/symbol/upcase_spec.rb +0 -1
  140. data/frozen_old_spec/tags/1.8.7/core/array/append_spec.rb +0 -1
  141. data/frozen_old_spec/tags/1.8.7/core/array/keep_if_spec.rb +0 -2
  142. data/frozen_old_spec/tags/1.8.7/core/array/rotate_spec.rb +0 -2
  143. data/frozen_old_spec/tags/1.8.7/core/array/select_spec.rb +0 -2
  144. data/frozen_old_spec/tags/1.8.7/core/array/uniq_spec.rb +0 -3
  145. data/frozen_old_spec/tags/1.8.7/core/complex/to_r_spec.rb +0 -3
  146. data/frozen_old_spec/tags/1.8.7/core/enumerable/all_spec.rb +0 -1
  147. data/frozen_old_spec/tags/1.8.7/core/enumerable/any_spec.rb +0 -2
  148. data/frozen_old_spec/tags/1.8.7/core/enumerable/collect_concat_spec.rb +0 -1
  149. data/frozen_old_spec/tags/1.8.7/core/enumerable/flat_map_spec.rb +0 -1
  150. data/frozen_old_spec/tags/1.8.7/core/enumerable/none_spec.rb +0 -1
  151. data/frozen_old_spec/tags/1.8.7/core/enumerable/one_spec.rb +0 -1
  152. data/frozen_old_spec/tags/1.8.7/core/env/to_h_spec.rb +0 -2
  153. data/frozen_old_spec/tags/1.8.7/core/file/lchmod_spec.rb +0 -2
  154. data/frozen_old_spec/tags/1.8.7/core/file/new_spec.rb +0 -1
  155. data/frozen_old_spec/tags/1.8.7/core/file/open_spec.rb +0 -5
  156. data/frozen_old_spec/tags/1.8.7/core/file/readlink_spec.rb +0 -6
  157. data/frozen_old_spec/tags/1.8.7/core/file/to_path_spec.rb +0 -1
  158. data/frozen_old_spec/tags/1.8.7/core/hash/assoc_spec.rb +0 -1
  159. data/frozen_old_spec/tags/1.8.7/core/hash/default_proc_spec.rb +0 -3
  160. data/frozen_old_spec/tags/1.8.7/core/hash/keep_if_spec.rb +0 -2
  161. data/frozen_old_spec/tags/1.8.7/core/hash/merge_spec.rb +0 -3
  162. data/frozen_old_spec/tags/1.8.7/core/hash/rassoc_spec.rb +0 -1
  163. data/frozen_old_spec/tags/1.8.7/core/hash/select_spec.rb +0 -1
  164. data/frozen_old_spec/tags/1.8.7/core/hash/to_h_spec.rb +0 -1
  165. data/frozen_old_spec/tags/1.8.7/core/hash/update_spec.rb +0 -3
  166. data/frozen_old_spec/tags/1.8.7/core/integer/round_spec.rb +0 -2
  167. data/frozen_old_spec/tags/1.8.7/core/io/binread_spec.rb +0 -7
  168. data/frozen_old_spec/tags/1.8.7/core/io/open_spec.rb +0 -32
  169. data/frozen_old_spec/tags/1.8.7/core/io/ungetbyte_spec.rb +0 -4
  170. data/frozen_old_spec/tags/1.8.7/core/io/write_spec.rb +0 -5
  171. data/frozen_old_spec/tags/1.8.7/core/kernel/__callee___spec.rb +0 -6
  172. data/frozen_old_spec/tags/1.8.7/core/kernel/define_singleton_method_spec.rb +0 -2
  173. data/frozen_old_spec/tags/1.8.7/core/kernel/public_method_spec.rb +0 -1
  174. data/frozen_old_spec/tags/1.8.7/core/kernel/require_relative_spec.rb +0 -3
  175. data/frozen_old_spec/tags/1.8.7/core/math/log2_spec.rb +0 -6
  176. data/frozen_old_spec/tags/1.8.7/core/math/log_spec.rb +0 -3
  177. data/frozen_old_spec/tags/1.8.7/core/module/alias_method_spec.rb +0 -7
  178. data/frozen_old_spec/tags/1.8.7/core/module/attr_accessor_spec.rb +0 -2
  179. data/frozen_old_spec/tags/1.8.7/core/module/attr_reader_spec.rb +0 -2
  180. data/frozen_old_spec/tags/1.8.7/core/module/attr_spec.rb +0 -2
  181. data/frozen_old_spec/tags/1.8.7/core/module/attr_writer_spec.rb +0 -2
  182. data/frozen_old_spec/tags/1.8.7/core/module/define_method_spec.rb +0 -1
  183. data/frozen_old_spec/tags/1.8.7/core/module/include_spec.rb +0 -3
  184. data/frozen_old_spec/tags/1.8.7/core/module/remove_method_spec.rb +0 -3
  185. data/frozen_old_spec/tags/1.8.7/core/module/undef_method_spec.rb +0 -3
  186. data/frozen_old_spec/tags/1.8.7/core/nil/dup_spec.rb +0 -1
  187. data/frozen_old_spec/tags/1.8.7/core/proc/curry_spec.rb +0 -3
  188. data/frozen_old_spec/tags/1.8.7/core/proc/yield_spec.rb +0 -4
  189. data/frozen_old_spec/tags/1.8.7/core/range/size_spec.rb +0 -1
  190. data/frozen_old_spec/tags/1.8.7/core/string/getbyte_spec.rb +0 -5
  191. data/frozen_old_spec/tags/1.8.7/core/string/prepend_spec.rb +0 -1
  192. data/frozen_old_spec/tags/1.8.7/core/string/setbyte_spec.rb +0 -5
  193. data/frozen_old_spec/tags/1.8.7/core/struct/new_spec.rb +0 -3
  194. data/frozen_old_spec/tags/1.8.7/core/symbol/capitalize_spec.rb +0 -3
  195. data/frozen_old_spec/tags/1.8.7/core/symbol/comparison_spec.rb +0 -1
  196. data/frozen_old_spec/tags/1.8.7/core/symbol/downcase_spec.rb +0 -2
  197. data/frozen_old_spec/tags/1.8.7/core/symbol/element_reference_spec.rb +0 -4
  198. data/frozen_old_spec/tags/1.8.7/core/symbol/empty_spec.rb +0 -1
  199. data/frozen_old_spec/tags/1.8.7/core/symbol/match_spec.rb +0 -2
  200. data/frozen_old_spec/tags/1.8.7/core/symbol/swapcase_spec.rb +0 -2
  201. data/frozen_old_spec/tags/1.8.7/core/symbol/upcase_spec.rb +0 -1
  202. data/frozen_old_spec/tags/1.9.1/core/array/append_spec.rb +0 -1
  203. data/frozen_old_spec/tags/1.9.1/core/array/rotate_spec.rb +0 -1
  204. data/frozen_old_spec/tags/1.9.1/core/enumerable/all_spec.rb +0 -1
  205. data/frozen_old_spec/tags/1.9.1/core/enumerable/any_spec.rb +0 -2
  206. data/frozen_old_spec/tags/1.9.1/core/enumerable/none_spec.rb +0 -1
  207. data/frozen_old_spec/tags/1.9.1/core/enumerable/one_spec.rb +0 -1
  208. data/frozen_old_spec/tags/1.9.1/core/env/to_h_spec.rb +0 -2
  209. data/frozen_old_spec/tags/1.9.1/core/hash/default_proc_spec.rb +0 -1
  210. data/frozen_old_spec/tags/1.9.1/core/io/write_spec.rb +0 -2
  211. data/frozen_old_spec/tags/1.9.1/core/module/alias_method_spec.rb +0 -4
  212. data/frozen_old_spec/tags/1.9.1/core/module/attr_accessor_spec.rb +0 -2
  213. data/frozen_old_spec/tags/1.9.1/core/module/attr_reader_spec.rb +0 -2
  214. data/frozen_old_spec/tags/1.9.1/core/module/attr_spec.rb +0 -1
  215. data/frozen_old_spec/tags/1.9.1/core/module/attr_writer_spec.rb +0 -2
  216. data/frozen_old_spec/tags/1.9.1/core/module/define_method_spec.rb +0 -3
  217. data/frozen_old_spec/tags/1.9.1/core/module/remove_method_spec.rb +0 -1
  218. data/frozen_old_spec/tags/1.9.1/core/module/undef_method_spec.rb +0 -1
  219. data/frozen_old_spec/tags/1.9.1/core/nil/dup_spec.rb +0 -1
  220. data/frozen_old_spec/tags/1.9.2/core/array/append_spec.rb +0 -1
  221. data/frozen_old_spec/tags/1.9.2/core/enumerable/all_spec.rb +0 -1
  222. data/frozen_old_spec/tags/1.9.2/core/enumerable/any_spec.rb +0 -2
  223. data/frozen_old_spec/tags/1.9.2/core/enumerable/none_spec.rb +0 -1
  224. data/frozen_old_spec/tags/1.9.2/core/enumerable/one_spec.rb +0 -1
  225. data/frozen_old_spec/tags/1.9.2/core/io/write_spec.rb +0 -3
  226. data/frozen_old_spec/tags/1.9.2/core/module/alias_method_spec.rb +0 -4
  227. data/frozen_old_spec/tags/1.9.2/core/module/attr_accessor_spec.rb +0 -2
  228. data/frozen_old_spec/tags/1.9.2/core/module/attr_reader_spec.rb +0 -2
  229. data/frozen_old_spec/tags/1.9.2/core/module/attr_spec.rb +0 -1
  230. data/frozen_old_spec/tags/1.9.2/core/module/attr_writer_spec.rb +0 -2
  231. data/frozen_old_spec/tags/1.9.2/core/module/define_method_spec.rb +0 -3
  232. data/frozen_old_spec/tags/1.9.2/core/module/remove_method_spec.rb +0 -1
  233. data/frozen_old_spec/tags/1.9.2/core/module/undef_method_spec.rb +0 -1
  234. data/frozen_old_spec/tags/1.9.2/core/nil/dup_spec.rb +0 -1
  235. data/frozen_old_spec/tags/1.9.3/core/enumerable/any_spec.rb +0 -1
  236. data/frozen_old_spec/tags/1.9.3/core/module/alias_method_spec.rb +0 -4
  237. data/frozen_old_spec/tags/1.9.3/core/module/attr_accessor_spec.rb +0 -1
  238. data/frozen_old_spec/tags/1.9.3/core/module/attr_reader_spec.rb +0 -1
  239. data/frozen_old_spec/tags/1.9.3/core/module/attr_spec.rb +0 -1
  240. data/frozen_old_spec/tags/1.9.3/core/module/attr_writer_spec.rb +0 -1
  241. data/frozen_old_spec/tags/1.9.3/core/module/define_method_spec.rb +0 -3
  242. data/frozen_old_spec/tags/1.9.3/core/module/remove_method_spec.rb +0 -1
  243. data/frozen_old_spec/tags/1.9.3/core/module/undef_method_spec.rb +0 -1
  244. data/frozen_old_spec/tags/2.0.0/core/enumerable/any_spec.rb +0 -1
  245. data/frozen_old_spec/tags/2.0.0/core/module/alias_method_spec.rb +0 -1
  246. data/frozen_old_spec/tags/2.0.0/core/module/attr_accessor_spec.rb +0 -2
  247. data/frozen_old_spec/tags/2.0.0/core/module/attr_reader_spec.rb +0 -2
  248. data/frozen_old_spec/tags/2.0.0/core/module/attr_spec.rb +0 -1
  249. data/frozen_old_spec/tags/2.0.0/core/module/attr_writer_spec.rb +0 -2
  250. data/frozen_old_spec/tags/2.0.0/core/module/define_method_spec.rb +0 -2
  251. data/frozen_old_spec/tags/2.0.0/core/module/remove_method_spec.rb +0 -1
  252. data/frozen_old_spec/tags/2.0.0/core/module/undef_method_spec.rb +0 -1
  253. data/frozen_old_spec/tags/2.0.0/core/nil/dup_spec.rb +0 -1
  254. data/frozen_old_spec/tags/2.0.0/core/struct/new_spec.rb +0 -1
  255. data/frozen_old_spec/tags/2.1.0/core/enumerable/any_spec.rb +0 -1
  256. data/frozen_old_spec/tags/2.1.0/core/module/alias_method_spec.rb +0 -1
  257. data/frozen_old_spec/tags/2.1.0/core/module/attr_accessor_spec.rb +0 -2
  258. data/frozen_old_spec/tags/2.1.0/core/module/attr_reader_spec.rb +0 -2
  259. data/frozen_old_spec/tags/2.1.0/core/module/attr_spec.rb +0 -1
  260. data/frozen_old_spec/tags/2.1.0/core/module/attr_writer_spec.rb +0 -2
  261. data/frozen_old_spec/tags/2.1.0/core/module/define_method_spec.rb +0 -2
  262. data/frozen_old_spec/tags/2.1.0/core/module/remove_method_spec.rb +0 -1
  263. data/frozen_old_spec/tags/2.1.0/core/module/undef_method_spec.rb +0 -1
  264. data/frozen_old_spec/tags/2.1.0/core/nil/dup_spec.rb +0 -1
  265. data/frozen_old_spec/tags/2.1.0/core/struct/new_spec.rb +0 -1
  266. data/frozen_old_spec/tags/2.2.0/core/enumerable/any_spec.rb +0 -1
  267. data/frozen_old_spec/tags/2.2.0/core/module/alias_method_spec.rb +0 -1
  268. data/frozen_old_spec/tags/2.2.0/core/module/attr_accessor_spec.rb +0 -2
  269. data/frozen_old_spec/tags/2.2.0/core/module/attr_reader_spec.rb +0 -2
  270. data/frozen_old_spec/tags/2.2.0/core/module/attr_spec.rb +0 -1
  271. data/frozen_old_spec/tags/2.2.0/core/module/attr_writer_spec.rb +0 -2
  272. data/frozen_old_spec/tags/2.2.0/core/module/define_method_spec.rb +0 -1
  273. data/frozen_old_spec/tags/2.2.0/core/module/remove_method_spec.rb +0 -1
  274. data/frozen_old_spec/tags/2.2.0/core/module/undef_method_spec.rb +0 -1
  275. data/frozen_old_spec/tags/2.2.0/core/nil/dup_spec.rb +0 -1
  276. data/frozen_old_spec/tags/2.2.0/core/struct/new_spec.rb +0 -1
  277. data/frozen_old_spec/tags/2.3.0/core/enumerable/any_spec.rb +0 -1
  278. data/frozen_old_spec/tags/2.3.0/core/module/alias_method_spec.rb +0 -1
  279. data/frozen_old_spec/tags/2.3.0/core/module/attr_accessor_spec.rb +0 -2
  280. data/frozen_old_spec/tags/2.3.0/core/module/attr_reader_spec.rb +0 -2
  281. data/frozen_old_spec/tags/2.3.0/core/module/attr_spec.rb +0 -1
  282. data/frozen_old_spec/tags/2.3.0/core/module/attr_writer_spec.rb +0 -2
  283. data/frozen_old_spec/tags/2.3.0/core/module/define_method_spec.rb +0 -1
  284. data/frozen_old_spec/tags/2.3.0/core/module/remove_method_spec.rb +0 -1
  285. data/frozen_old_spec/tags/2.3.0/core/module/undef_method_spec.rb +0 -1
  286. data/frozen_old_spec/tags/2.3.0/core/nil/dup_spec.rb +0 -1
  287. data/frozen_old_spec/tags/2.3.0/core/struct/new_spec.rb +0 -1
  288. data/frozen_old_spec/tags/2.3.5/core/struct/new_spec.rb +0 -1
  289. data/frozen_old_spec/tags/2.4.0/core/enumerable/any_spec.rb +0 -1
  290. data/frozen_old_spec/tags/2.4.0/core/module/alias_method_spec.rb +0 -1
  291. data/frozen_old_spec/tags/2.4.0/core/module/attr_accessor_spec.rb +0 -2
  292. data/frozen_old_spec/tags/2.4.0/core/module/attr_reader_spec.rb +0 -2
  293. data/frozen_old_spec/tags/2.4.0/core/module/attr_spec.rb +0 -1
  294. data/frozen_old_spec/tags/2.4.0/core/module/attr_writer_spec.rb +0 -2
  295. data/frozen_old_spec/tags/2.4.0/core/module/define_method_spec.rb +0 -1
  296. data/frozen_old_spec/tags/2.4.0/core/module/remove_method_spec.rb +0 -1
  297. data/frozen_old_spec/tags/2.4.0/core/module/undef_method_spec.rb +0 -1
  298. data/frozen_old_spec/tags/2.4.0/core/nil/dup_spec.rb +0 -1
  299. data/frozen_old_spec/tags/2.4.0/core/struct/new_spec.rb +0 -1
  300. data/frozen_old_spec/tags/2.5.0/core/enumerable/any_spec.rb +0 -1
  301. data/frozen_old_spec/tags/2.5.0/core/module/alias_method_spec.rb +0 -1
  302. data/frozen_old_spec/tags/2.5.0/core/module/attr_accessor_spec.rb +0 -2
  303. data/frozen_old_spec/tags/2.5.0/core/module/attr_reader_spec.rb +0 -2
  304. data/frozen_old_spec/tags/2.5.0/core/module/attr_spec.rb +0 -1
  305. data/frozen_old_spec/tags/2.5.0/core/module/attr_writer_spec.rb +0 -2
  306. data/frozen_old_spec/tags/2.5.0/core/module/define_method_spec.rb +0 -1
  307. data/frozen_old_spec/tags/2.5.0/core/module/remove_method_spec.rb +0 -1
  308. data/frozen_old_spec/tags/2.5.0/core/module/undef_method_spec.rb +0 -1
  309. data/frozen_old_spec/tags/2.5.0/core/nil/dup_spec.rb +0 -1
  310. data/frozen_old_spec/tags/2.5.0/core/struct/new_spec.rb +0 -1
  311. data/set_version/1.8.7.rb +0 -1
  312. data/set_version/1.9.1.rb +0 -1
  313. data/set_version/1.9.2.rb +0 -1
  314. data/set_version/1.9.3.rb +0 -1
  315. data/set_version/2.0.0.rb +0 -1
  316. data/set_version/2.1.0.rb +0 -1
  317. data/set_version/2.2.0.rb +0 -1
  318. data/set_version/2.3.0.rb +0 -1
  319. data/set_version/2.4.0.rb +0 -1
  320. data/set_version/2.5.0.rb +0 -1
  321. data/set_version/2.6.0.rb +0 -1
  322. data/set_version/2.7.0.rb +0 -1
  323. data/set_version/setter.rb +0 -22
  324. data/spec/tags/1.8.7/core/array/to_h_spec.rb +0 -3
  325. data/spec/tags/1.8.7/core/enumerable/to_h_spec.rb +0 -2
  326. data/spec/tags/1.8.7/core/module/attr_spec.rb +0 -1
  327. data/spec/tags/1.8.7/core/module/include_spec.rb +0 -1
  328. data/spec/tags/1.9.1/core/array/bsearch_index_spec.rb +0 -1
  329. data/spec/tags/1.9.1/core/array/rotate_spec.rb +0 -1
  330. data/spec/tags/1.9.1/core/dir/each_child_spec.rb +0 -1
  331. data/spec/tags/1.9.1/core/env/to_h_spec.rb +0 -2
  332. data/spec/tags/1.9.1/core/hash/default_proc_spec.rb +0 -1
  333. data/spec/tags/1.9.1/core/hash/slice_spec.rb +0 -1
  334. data/spec/tags/1.9.1/core/hash/transform_keys_spec.rb +0 -2
  335. data/spec/tags/1.9.1/core/hash/transform_values_spec.rb +0 -2
  336. data/spec/tags/1.9.1/core/io/write_spec.rb +0 -3
  337. data/spec/tags/1.9.1/core/kernel/yield_self_spec.rb +0 -1
  338. data/spec/tags/1.9.1/core/method/curry_spec.rb +0 -1
  339. data/spec/tags/1.9.1/core/module/alias_method_spec.rb +0 -3
  340. data/spec/tags/1.9.1/core/module/attr_accessor_spec.rb +0 -1
  341. data/spec/tags/1.9.1/core/module/attr_reader_spec.rb +0 -1
  342. data/spec/tags/1.9.1/core/module/attr_spec.rb +0 -1
  343. data/spec/tags/1.9.1/core/module/attr_writer_spec.rb +0 -1
  344. data/spec/tags/1.9.1/core/module/define_method_spec.rb +0 -7
  345. data/spec/tags/1.9.1/core/string/uplus_spec.rb +0 -1
  346. data/spec/tags/1.9.1/core/struct/new_spec.rb +0 -2
  347. data/spec/tags/1.9.2/core/array/bsearch_index_spec.rb +0 -1
  348. data/spec/tags/1.9.2/core/array/to_h_spec.rb +0 -3
  349. data/spec/tags/1.9.2/core/dir/each_child_spec.rb +0 -1
  350. data/spec/tags/1.9.2/core/enumerable/to_h_spec.rb +0 -2
  351. data/spec/tags/1.9.2/core/hash/slice_spec.rb +0 -1
  352. data/spec/tags/1.9.2/core/hash/to_h_spec.rb +0 -3
  353. data/spec/tags/1.9.2/core/hash/transform_keys_spec.rb +0 -2
  354. data/spec/tags/1.9.2/core/hash/transform_values_spec.rb +0 -2
  355. data/spec/tags/1.9.2/core/io/write_spec.rb +0 -3
  356. data/spec/tags/1.9.2/core/kernel/then_spec.rb +0 -1
  357. data/spec/tags/1.9.2/core/kernel/yield_self_spec.rb +0 -1
  358. data/spec/tags/1.9.2/core/method/curry_spec.rb +0 -1
  359. data/spec/tags/1.9.2/core/module/alias_method_spec.rb +0 -3
  360. data/spec/tags/1.9.2/core/module/attr_accessor_spec.rb +0 -1
  361. data/spec/tags/1.9.2/core/module/attr_reader_spec.rb +0 -1
  362. data/spec/tags/1.9.2/core/module/attr_writer_spec.rb +0 -1
  363. data/spec/tags/1.9.2/core/module/define_method_spec.rb +0 -7
  364. data/spec/tags/1.9.2/core/module/include_spec.rb +0 -1
  365. data/spec/tags/1.9.2/core/string/uplus_spec.rb +0 -1
  366. data/spec/tags/1.9.2/core/struct/new_spec.rb +0 -2
  367. data/spec/tags/1.9.3/core/array/bsearch_index_spec.rb +0 -1
  368. data/spec/tags/1.9.3/core/array/to_h_spec.rb +0 -3
  369. data/spec/tags/1.9.3/core/dir/each_child_spec.rb +0 -1
  370. data/spec/tags/1.9.3/core/enumerable/grep_v_spec.rb +0 -2
  371. data/spec/tags/1.9.3/core/enumerable/to_h_spec.rb +0 -2
  372. data/spec/tags/1.9.3/core/enumerator/produce_spec.rb +0 -1
  373. data/spec/tags/1.9.3/core/hash/slice_spec.rb +0 -1
  374. data/spec/tags/1.9.3/core/hash/to_h_spec.rb +0 -3
  375. data/spec/tags/1.9.3/core/hash/transform_keys_spec.rb +0 -2
  376. data/spec/tags/1.9.3/core/hash/transform_values_spec.rb +0 -2
  377. data/spec/tags/1.9.3/core/io/write_spec.rb +0 -3
  378. data/spec/tags/1.9.3/core/kernel/then_spec.rb +0 -1
  379. data/spec/tags/1.9.3/core/kernel/yield_self_spec.rb +0 -1
  380. data/spec/tags/1.9.3/core/method/curry_spec.rb +0 -1
  381. data/spec/tags/1.9.3/core/module/alias_method_spec.rb +0 -3
  382. data/spec/tags/1.9.3/core/module/attr_accessor_spec.rb +0 -1
  383. data/spec/tags/1.9.3/core/module/attr_reader_spec.rb +0 -1
  384. data/spec/tags/1.9.3/core/module/attr_writer_spec.rb +0 -1
  385. data/spec/tags/1.9.3/core/module/define_method_spec.rb +0 -7
  386. data/spec/tags/1.9.3/core/module/include_spec.rb +0 -1
  387. data/spec/tags/1.9.3/core/string/uplus_spec.rb +0 -1
  388. data/spec/tags/1.9.3/core/struct/new_spec.rb +0 -2
  389. data/spec/tags/2.0.0/core/array/to_h_spec.rb +0 -3
  390. data/spec/tags/2.0.0/core/enumerable/grep_v_spec.rb +0 -2
  391. data/spec/tags/2.0.0/core/enumerable/to_h_spec.rb +0 -2
  392. data/spec/tags/2.0.0/core/hash/slice_spec.rb +0 -1
  393. data/spec/tags/2.0.0/core/hash/to_h_spec.rb +0 -3
  394. data/spec/tags/2.0.0/core/module/attr_accessor_spec.rb +0 -1
  395. data/spec/tags/2.0.0/core/module/attr_reader_spec.rb +0 -1
  396. data/spec/tags/2.0.0/core/module/attr_spec.rb +0 -1
  397. data/spec/tags/2.0.0/core/module/attr_writer_spec.rb +0 -1
  398. data/spec/tags/2.0.0/core/module/define_method_spec.rb +0 -5
  399. data/spec/tags/2.0.0/core/module/include_spec.rb +0 -1
  400. data/spec/tags/2.0.0/core/module/undef_method_spec.rb +0 -2
  401. data/spec/tags/2.0.0/core/string/uplus_spec.rb +0 -1
  402. data/spec/tags/2.0.0/core/struct/new_spec.rb +0 -3
  403. data/spec/tags/2.1.0/core/array/union_spec.rb +0 -1
  404. data/spec/tags/2.1.0/core/enumerable/grep_v_spec.rb +0 -2
  405. data/spec/tags/2.1.0/core/hash/slice_spec.rb +0 -1
  406. data/spec/tags/2.1.0/core/hash/to_h_spec.rb +0 -1
  407. data/spec/tags/2.1.0/core/module/attr_accessor_spec.rb +0 -1
  408. data/spec/tags/2.1.0/core/module/attr_reader_spec.rb +0 -1
  409. data/spec/tags/2.1.0/core/module/attr_spec.rb +0 -1
  410. data/spec/tags/2.1.0/core/module/attr_writer_spec.rb +0 -1
  411. data/spec/tags/2.1.0/core/module/define_method_spec.rb +0 -5
  412. data/spec/tags/2.1.0/core/module/undef_method_spec.rb +0 -2
  413. data/spec/tags/2.1.0/core/string/uplus_spec.rb +0 -1
  414. data/spec/tags/2.1.0/core/struct/new_spec.rb +0 -3
  415. data/spec/tags/2.2.0/core/enumerable/grep_v_spec.rb +0 -2
  416. data/spec/tags/2.2.0/core/hash/slice_spec.rb +0 -1
  417. data/spec/tags/2.2.0/core/hash/to_h_spec.rb +0 -1
  418. data/spec/tags/2.2.0/core/module/attr_accessor_spec.rb +0 -1
  419. data/spec/tags/2.2.0/core/module/attr_reader_spec.rb +0 -1
  420. data/spec/tags/2.2.0/core/module/attr_spec.rb +0 -1
  421. data/spec/tags/2.2.0/core/module/attr_writer_spec.rb +0 -1
  422. data/spec/tags/2.2.0/core/module/define_method_spec.rb +0 -5
  423. data/spec/tags/2.2.0/core/module/undef_method_spec.rb +0 -2
  424. data/spec/tags/2.2.0/core/string/uplus_spec.rb +0 -1
  425. data/spec/tags/2.2.0/core/struct/new_spec.rb +0 -3
  426. data/spec/tags/2.3.0/core/hash/slice_spec.rb +0 -1
  427. data/spec/tags/2.3.0/core/hash/to_h_spec.rb +0 -1
  428. data/spec/tags/2.3.0/core/module/attr_spec.rb +0 -1
  429. data/spec/tags/2.3.0/core/string/uplus_spec.rb +0 -1
  430. data/spec/tags/2.3.0/core/struct/new_spec.rb +0 -3
  431. data/spec/tags/2.4.0/core/hash/slice_spec.rb +0 -1
  432. data/spec/tags/2.4.0/core/hash/to_h_spec.rb +0 -1
  433. data/spec/tags/2.4.0/core/module/attr_spec.rb +0 -1
  434. data/spec/tags/2.4.0/core/struct/new_spec.rb +0 -1
  435. data/spec/tags/2.5.0/core/hash/to_h_spec.rb +0 -1
  436. data/test/README +0 -2
  437. data/test/_backport_guards_test.rb +0 -152
  438. data/test/bit_length_test.rb +0 -11
  439. data/test/lazy_test.rb +0 -487
  440. data/test/socket_interaction_test.rb +0 -9
  441. data/test/test_helper.rb +0 -1
data/Gemfile CHANGED
@@ -14,6 +14,12 @@ group :test do
14
14
  gem 'test-unit', '~>2.1.1.0'
15
15
  end
16
16
 
17
+ if RUBY_VERSION >= '2.3.0'
18
+ group :development do
19
+ gem 'rubocop', '~> 0.80.0'
20
+ end
21
+ end
22
+
17
23
  # Declare any dependencies that are still in development here instead of in
18
24
  # your gemspec. These might include edge Rails or gems from your path or
19
25
  # Git. Remember to move these dependencies to your gemspec before releasing
@@ -0,0 +1,529 @@
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) [![Tidelift](https://tidelift.com/badges/package/rubygems/backports)](https://tidelift.com/subscription/pkg/rubygems-backports?utm_source=rubygems-backports&utm_medium=referral&utm_campaign=readme)
2
+
3
+ Yearning to use some of the new cool features in Ruby 2.7 while using 2.3.x?
4
+ Have some legacy code in Ruby 1.8 but can't live without `flat_map`?
5
+
6
+ This gem is for you!
7
+
8
+ The goal of 'backports' is to make it easier to write ruby code that runs
9
+ across different versions of Ruby.
10
+
11
+ Note: [Next major version (X-mas
12
+ 2020)](https://github.com/marcandre/backports/issues/139) will drop support
13
+ for Ruby < 2.2.
14
+
15
+ ## Loading backports
16
+
17
+ ### Explicitly (recommended)
18
+
19
+ For example, if you want to use transform_values and transform_keys, even in
20
+ Ruby implementations that don't include it:
21
+
22
+ require 'backports/2.4.0/hash/transform_values'
23
+ require 'backports/2.5.0/hash/transform_keys'
24
+
25
+ This will enable Hash#transform_values and Hash#transform_keys, using the
26
+ native versions if available or otherwise provide a pure Ruby version.
27
+
28
+ ### By Module
29
+
30
+ To bring all the backports for a given Class/Module, you can specify only that
31
+ Class:
32
+
33
+ require 'backports/2.3.0/hash'
34
+
35
+ This will make sure that Hash responds to dig, fetch_values, <, <=, >, >= and
36
+ to_proc
37
+
38
+ ### Up to a specific Ruby version (for quick coding)
39
+
40
+ You can load all backports up to a specific version.
41
+ For example, to bring any
42
+ version of Ruby mostly up to Ruby 2.7.0's standards:
43
+
44
+ require 'backports/2.7.0'
45
+
46
+ This will bring in all the features of 1.8.7 and many features of Ruby 1.9.x
47
+ all the way up to Ruby 2.7.0 (for all versions of Ruby)!
48
+
49
+ You may `require 'backports/latest'` as a
50
+ shortcut to the latest Ruby version supported.
51
+
52
+ *Note*: For production / public gems, it is highly recommended you only require
53
+ the backports you need explicitly.
54
+
55
+ *Note*: Although I am a Ruby committer, this gem is a personal project and is
56
+ not endorsed by ruby-core.
57
+
58
+ ## What's inside
59
+
60
+ Goals for backported features:
61
+ 1. Won't break older code
62
+ 2. Pure Ruby (no C extensions)
63
+ 3. Pass [ruby/spec](https://github.com/ruby/spec)
64
+
65
+ Let's be a bit more precise about the "breaking code" business. It is of
66
+ course entirely possible that code will break. In particular, you may be
67
+ distinguishing parameters with duck typing, but a builtin class may, in the
68
+ future, be responding to a particular call. Here's [an example from Rails][]
69
+ that is relying on the fact that Proc and Method respond to :to_proc and Hash
70
+ isn't. That is, until Ruby 2.3... This old version of Rails therefore won't
71
+ work on Ruby 2.3, or on older Rubies with that the `2.3.0/hash/to_proc`
72
+ loaded...
73
+
74
+ [an example from rails]: https://github.com/rails/rails/blob/a4b55827721a5967299f3c1531afb3d6d81e4ac0/activerecord/lib/active_record/associations/association.rb#L155-L159
75
+
76
+ For Ruby < 2.0, there are some real incompatibilities. For example,
77
+ `Module::instance_methods` which returns strings in 1.8 and symbols in 1.9. No
78
+ change can be made without the risk of breaking existing code. Such
79
+ incompatibilities are left unchanged, although you can require some of these
80
+ changes in addition (see below).
81
+
82
+ ## Installation & compatibility
83
+
84
+ `backports` can be installed with:
85
+
86
+ gem install backports
87
+
88
+ To use:
89
+
90
+ require 'rubygems'
91
+ # For only specific backports:
92
+ require 'backports/1.9.1/kernel/require_relative'
93
+ require 'backports/2.0.0/enumerable/lazy'
94
+
95
+ # For all backports up to a given version
96
+ require 'backports/1.9.2' # All backports for Ruby 1.9.2 and below
97
+
98
+ Note: about a dozen of backports have a dependency that will be also loaded.
99
+ For example, the backport of Enumerable#flat_map uses flatten(1), so if
100
+ required from Ruby 1.8.6 (where Array#flatten does not accept an argument),
101
+ the backport for Ruby's 1.8.7 flatten with an argument will also be loaded.
102
+
103
+ With bundler, add to your Gemfile:
104
+
105
+ gem 'backports', :require => false
106
+
107
+ Run `bundle install` and require the desired backports. Compatible with Ruby
108
+ itself, JRuby and Rubinius.
109
+
110
+ # Complete List of backports
111
+
112
+ ## Ruby 2.7 backports
113
+
114
+ #### Array
115
+ - `intersection`
116
+
117
+ #### Comparable
118
+ - `clamp` (with range)
119
+
120
+ #### Complex
121
+ - +<=>+
122
+
123
+ #### Enumerable
124
+ - `filter_map`
125
+ - `tally`
126
+
127
+ #### Enumerator
128
+ - `produce` (class method)
129
+
130
+ #### Time
131
+ - `floor`, `ceil`
132
+
133
+ ## Ruby 2.6 backports
134
+
135
+ #### Array
136
+ - `difference`, `union`
137
+ - `to_h` (with block)
138
+
139
+ #### Enumerable
140
+ - `chain`
141
+ - `to_h` (with block)
142
+
143
+ #### Enumerator::Chain (use Enumerable#chain)
144
+
145
+ #### Hash
146
+ - `merge`, `merge!`/`update` (with multiple arguments)
147
+ - `to_h` (with block)
148
+
149
+ #### Kernel
150
+ - `then`
151
+
152
+ #### Method
153
+ - +<<+, +>>+
154
+
155
+ #### Proc
156
+ - +<<+, +>>+
157
+
158
+ #### Range
159
+ - `cover?` (with `Range` argument)
160
+
161
+ ## Ruby 2.5 backports
162
+
163
+ #### Array
164
+ - `append`, `prepend`
165
+
166
+ #### Dir
167
+ - `children`, `each_child`
168
+
169
+ #### Enumerable
170
+ - `any?`, `all?`, `none?`, `one?` (with pattern argument)
171
+
172
+ #### Hash
173
+ - `slice`
174
+ - `transform_keys`
175
+
176
+ #### Integer
177
+ - `sqrt`
178
+ - `allbits?`, `anybits?` and `nobits?`
179
+
180
+ #### Kernel
181
+ - `yield_self`
182
+
183
+ #### Module
184
+ - `attr`, `attr_accessor`, `attr_reader`, `attr_writer` (now public)
185
+ - `define_method`, `alias_method`, `undef_method`, `remove_method` (now
186
+ public)
187
+
188
+ #### String
189
+ - `delete_prefix`, `delete_prefix!`
190
+ - `delete_suffix`, `delete_suffix!`
191
+ - `undump`
192
+
193
+ #### Struct
194
+ - `new` (with `keyword_init: true`)
195
+
196
+ ## Ruby 2.4 backports
197
+
198
+ #### Comparable
199
+ - `clamp`
200
+
201
+ #### Enumerable
202
+ - `sum`
203
+ - `uniq`
204
+
205
+ #### Hash
206
+ - `compact`, `compact!`
207
+ - `transform_values`, `transform_values!`
208
+
209
+ #### Regexp
210
+ - `match?`
211
+
212
+ #### String
213
+ - `match?`
214
+
215
+ #### FalseClass, Fixnum, Float, NilClass, TrueClass
216
+ - `dup`
217
+
218
+ ## Ruby 2.3 backports
219
+
220
+ #### Array
221
+ - `bsearch_index`
222
+ - `dig`
223
+
224
+ #### Enumerable
225
+ - `chunk_while`
226
+ - `grep_v`
227
+
228
+ #### Hash
229
+ - `dig`
230
+ - `fetch_values`
231
+ - `to_proc`
232
+ - <=, <, >=, >
233
+
234
+ #### Numeric
235
+ - `negative?`
236
+ - `positive?`
237
+
238
+ #### String
239
+ - unary + and -
240
+
241
+ #### Struct
242
+ - `dig`
243
+
244
+ ## Ruby 2.2 backports
245
+
246
+ #### Enumerable
247
+ - `slice_after`
248
+ - `slice_when`
249
+
250
+ #### Float
251
+ - `prev_float`
252
+ - `next_float`
253
+
254
+ #### Kernel
255
+ - `itself`
256
+
257
+ #### Method
258
+ - `curry`
259
+ - `super_method`
260
+
261
+ #### String
262
+ - `unicode_normalize`
263
+ - `unicode_normalize!`
264
+ - `unicode_normalize?`
265
+
266
+ ## Ruby 2.1 backports
267
+
268
+ #### Array
269
+ - `to_h`
270
+
271
+ #### Bignum
272
+ - `bit_length`
273
+
274
+ #### Enumerable
275
+ - `to_h`
276
+
277
+ #### Fixnum
278
+ - `bit_length`
279
+
280
+ #### Module
281
+ - `include` (now public)
282
+
283
+ ## Ruby 2.0 backports
284
+
285
+ #### Array
286
+ - `bsearch`
287
+
288
+ #### Enumerable
289
+ - `lazy`
290
+
291
+ #### Enumerator::Lazy
292
+ - all methods
293
+
294
+ #### Hash
295
+ - `default_proc=` (with nil argument)
296
+ - `to_h`
297
+
298
+ #### `nil.to_h`
299
+
300
+ #### Range
301
+ - `bsearch`
302
+
303
+ #### Struct
304
+ - `to_h`
305
+
306
+ ## Ruby 1.9.3 backports
307
+
308
+ #### File
309
+ - `NULL`
310
+
311
+ #### IO
312
+ - `advise` (acts as a noop)
313
+ - `write`, `binwrite`
314
+
315
+ #### String
316
+ - `byteslice`
317
+ - `prepend`
318
+
319
+ ## Ruby 1.9.2 backports
320
+
321
+ #### Array
322
+ - `rotate, rotate!`
323
+ - `keep_if, select!`
324
+ - `product` (with block)
325
+ - `repeated_combination`, `repeated_permutation`
326
+ - `sort_by!`
327
+ - `uniq, uniq!` (with block)
328
+
329
+ #### Complex
330
+ - `to_r`
331
+
332
+ #### Dir
333
+ - `home`
334
+
335
+ #### Enumerable
336
+ - `chunk`
337
+ - `flat_map`, `collect_concat`
338
+ - `join`
339
+ - `slice_before`
340
+
341
+ #### Float::INFINITY, NAN
342
+
343
+ #### Hash
344
+ - `keep_if`, `select!`
345
+
346
+ #### Object
347
+ - `singleton_class`
348
+
349
+ #### Random (new class)
350
+
351
+ *Note*: The methods of `Random` can't be required individually; the class
352
+ can only be required whole with `require 'backports/1.9.2/random'`.
353
+
354
+ ## Ruby 1.9.1 backports
355
+
356
+ Additionally, the following Ruby 1.9 features have been backported:
357
+ #### Array
358
+ - `try_convert`
359
+ - `sample`
360
+
361
+ #### Enumerable
362
+ - `each_with_object`
363
+ - `each_with_index` (with arguments)
364
+
365
+ #### Enumerator
366
+ - `new` (with block)
367
+
368
+ #### File
369
+ - `binread`
370
+ - `to_path`
371
+ - All class methods accepting filenames will accept files or anything
372
+ with a `#to_path` method.
373
+ - `File.open` accepts an options hash.
374
+
375
+ #### Float
376
+ - `round`
377
+
378
+ #### Hash
379
+ - `assoc`, `rassoc`
380
+ - `key`
381
+ - `try_convert`
382
+ - `default_proc=`
383
+
384
+ #### Integer
385
+ - `magnitude`
386
+ - `round`
387
+
388
+ #### IO
389
+ - `bin_read`
390
+ - `try_convert`
391
+ - `ungetbyte`
392
+ - `IO.open` accepts an options hash.
393
+
394
+ #### Kernel
395
+ - `require_relative`
396
+
397
+ #### Math
398
+ - `log` (with base)
399
+ - `log2`
400
+
401
+ #### Numeric
402
+ - `round`
403
+
404
+ #### Object
405
+ - `define_singleton_method`
406
+ - `public_method`
407
+ - `public_send`
408
+
409
+ #### Proc
410
+ - `yield`
411
+ - `lambda?`
412
+ - `curry`
413
+ - `===`
414
+
415
+ #### Range
416
+ - `cover?`
417
+
418
+ #### Regexp
419
+ - `try_convert`
420
+
421
+ #### String
422
+ - `ascii_only?`
423
+ - `chr`
424
+ - `clear`
425
+ - `codepoints`, `each_codepoint`
426
+ - `get_byte`, `set_byte`
427
+ - `ord`
428
+ - `try_convert`
429
+
430
+ `Enumerator` can be accessed directly (instead of `Enumerable::Enumerator`)
431
+
432
+ To include *only* these backports and those of the 1.8 line, `require
433
+ "backports/1.9.1"`.
434
+
435
+ Moreover, a pretty good imitation of `BasicObject` is available, but since it
436
+ is only an imitation, it must be required explicitly:
437
+
438
+ require 'backports/basic_object'
439
+
440
+ ## Ruby 1.8.7
441
+
442
+ Complete Ruby 1.8.7 backporting (core language). Refer to the official list of
443
+ [changes](https://github.com/ruby/ruby/blob/ruby_1_8_7/NEWS). That's about 130
444
+ backports!
445
+
446
+ Only exceptions:
447
+ #### String#gsub (the form returning an enumerator)
448
+ #### GC.stress= (not implemented)
449
+ #### Array#choice (removed in 1.9, use 1.9.1's Array#sample instead)
450
+
451
+ ## Libraries
452
+
453
+ Libraries were slowly being backported, but they are now available as separate gems.
454
+
455
+ The backports would be automatically used after requiring 'backports/std_lib' but this is now deprecated and discouraged.
456
+
457
+ The following libraries are up to date with Ruby 1.9.3:
458
+
459
+ #### Matrix
460
+ #### Prime
461
+ #### Set
462
+
463
+ The following library is to date with Ruby 2.0.0:
464
+
465
+ #### OpenStruct (ostruct)
466
+
467
+ I am aware of the following backport gem, which probably won't make it into
468
+ this gem:
469
+
470
+ #### Net::SMTP for Ruby 1.8.6:
471
+ [smtp_tls](http://seattlerb.rubyforge.org/smtp_tls/)
472
+
473
+ Requiring backports for a given version of Ruby will also load
474
+ 'backports/std_lib'.
475
+
476
+ ## Forcing incompatibilities
477
+
478
+ Some backports would create incompatibilities in their current Ruby version
479
+ but could be useful in some projects. It is possible to request such
480
+ incompatible changes. Backports currently supports the following:
481
+
482
+ #### Hash
483
+ - `select` (returns a Hash instead of an Array)
484
+
485
+ #### Enumerable / Array
486
+ - `map` (returns an enumerator when called without a block)
487
+
488
+ #### String
489
+ - `length`, `size` (for UTF-8 support)
490
+
491
+ These must be imported in addition to the backports gem, for example:
492
+
493
+ require "backports/force/hash_select"
494
+ {}.select{} # => {}, even in Ruby 1.8
495
+
496
+ ## Thanks
497
+
498
+ Thanks for the bug reports and patches, in particular the repeat offenders:
499
+
500
+ #### Arto Bendiken ( [bendiken](http://github.com/bendiken) )
501
+ #### Konstantin Haase ( [rkh](https://github.com/rkh) )
502
+ #### Roger Pack ( [rdp](http://github.com/rdp) )
503
+ #### Victor Shepelev ( [zverok](http://github.com/zverok) )
504
+
505
+ ## Contributing
506
+
507
+ The best way to submit a patch is to also submit a patch to
508
+ [ruby/spec](https://github.com/ruby/spec) and then a patch to backports that
509
+ make it pass the spec.
510
+
511
+ See below to test rubyspec. Note that only features missing from your Ruby
512
+ version are tested.
513
+
514
+ git submodule init && git submodule update # => pulls rubyspecs
515
+ bundle install
516
+ bundle exec rake spec[hash/slice] # => tests Hash#slice (must be in Ruby 2.4 or less)
517
+ bundle exec rake spec[hash/*] # => tests all backported Hash methods
518
+ bundle exec rake spec (or rake spec[*/*]) # => all rubyspecs for backported methods
519
+
520
+ Failures that are acceptable are added the to `tags` file.
521
+
522
+ # License
523
+
524
+ `backports` is released under the terms of the MIT License, see the included
525
+ LICENSE file.
526
+
527
+ Author
528
+ : Marc-André Lafortune
529
+