backports 3.15.0 → 3.24.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (505) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +846 -0
  3. data/Gemfile +6 -13
  4. data/README.md +706 -0
  5. data/SECURITY.md +5 -0
  6. data/backports.gemspec +6 -2
  7. data/lib/backports/1.8.7.rb +10 -2
  8. data/lib/backports/1.9.1.rb +6 -1
  9. data/lib/backports/1.9.2/stdlib/matrix.rb +5 -0
  10. data/lib/backports/1.9.2.rb +6 -1
  11. data/lib/backports/1.9.3.rb +6 -1
  12. data/lib/backports/2.0.0/range/size.rb +2 -0
  13. data/lib/backports/2.0.0.rb +7 -2
  14. data/lib/backports/2.1.0/module/singleton_class.rb +8 -0
  15. data/lib/backports/2.1.0.rb +2 -2
  16. data/lib/backports/2.2.0/enumerable/slice_after.rb +1 -1
  17. data/lib/backports/2.2.0/float/next_float.rb +1 -1
  18. data/lib/backports/2.2.0/float/prev_float.rb +1 -1
  19. data/lib/backports/2.2.0/method/super_method.rb +2 -2
  20. data/lib/backports/2.2.0/string/unicode_normalize.rb +3 -3
  21. data/lib/backports/2.2.0.rb +2 -2
  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/queue/close.rb +48 -0
  27. data/lib/backports/2.3.0/string.rb +3 -0
  28. data/lib/backports/2.3.0/struct/dig.rb +3 -2
  29. data/lib/backports/2.3.0.rb +2 -2
  30. data/lib/backports/2.4.0/bignum/dup.rb +5 -0
  31. data/lib/backports/2.4.0/bignum.rb +3 -0
  32. data/lib/backports/2.4.0/enumerable/sum.rb +8 -4
  33. data/lib/backports/2.4.0/hash/transform_values.rb +2 -2
  34. data/lib/backports/2.4.0/string/unpack1.rb +7 -0
  35. data/lib/backports/2.4.0/true_class/dup.rb +0 -1
  36. data/lib/backports/2.4.0.rb +2 -2
  37. data/lib/backports/2.5.0/dir/children.rb +4 -0
  38. data/lib/backports/2.5.0/dir/each_child.rb +7 -0
  39. data/lib/backports/2.5.0/hash/transform_keys.rb +11 -4
  40. data/lib/backports/2.5.0/integer/sqrt.rb +2 -2
  41. data/lib/backports/2.5.0/module/alias_method.rb +0 -1
  42. data/lib/backports/2.5.0/string/undump.rb +5 -9
  43. data/lib/backports/2.5.0/struct/new.rb +1 -1
  44. data/lib/backports/2.5.0.rb +2 -2
  45. data/lib/backports/2.5.rb +1 -1
  46. data/lib/backports/2.6.0/array/difference.rb +7 -3
  47. data/lib/backports/2.6.0/enumerable/chain.rb +6 -1
  48. data/lib/backports/2.6.0/hash/to_h.rb +1 -1
  49. data/lib/backports/2.6.0/range/cover.rb +22 -0
  50. data/lib/backports/2.6.0/range.rb +3 -0
  51. data/lib/backports/2.6.0.rb +3 -3
  52. data/lib/backports/2.6.rb +1 -1
  53. data/lib/backports/2.7.0/array/intersection.rb +7 -0
  54. data/lib/backports/2.7.0/array.rb +3 -0
  55. data/lib/backports/2.7.0/comparable/clamp.rb +23 -0
  56. data/lib/backports/2.7.0/comparable.rb +3 -0
  57. data/lib/backports/2.7.0/complex/comparison.rb +13 -0
  58. data/lib/backports/2.7.0/complex.rb +3 -0
  59. data/lib/backports/2.7.0/enumerable/filter_map.rb +14 -0
  60. data/lib/backports/2.7.0/enumerable/tally.rb +11 -0
  61. data/lib/backports/2.7.0/enumerable.rb +3 -0
  62. data/lib/backports/2.7.0/enumerator/produce.rb +20 -0
  63. data/lib/backports/2.7.0/enumerator.rb +3 -0
  64. data/lib/backports/2.7.0/symbol/end_with.rb +9 -0
  65. data/lib/backports/2.7.0/symbol/start_with.rb +9 -0
  66. data/lib/backports/2.7.0/symbol.rb +3 -0
  67. data/lib/backports/2.7.0/time/ceil.rb +10 -0
  68. data/lib/backports/2.7.0/time/floor.rb +7 -0
  69. data/lib/backports/2.7.0.rb +3 -0
  70. data/lib/backports/2.7.rb +1 -0
  71. data/lib/backports/3.0.0/env/except.rb +10 -0
  72. data/lib/backports/3.0.0/env.rb +3 -0
  73. data/lib/backports/3.0.0/hash/except.rb +10 -0
  74. data/lib/backports/3.0.0/hash/transform_keys.rb +48 -0
  75. data/lib/backports/3.0.0/hash.rb +3 -0
  76. data/lib/backports/3.0.0/ractor.rb +19 -0
  77. data/lib/backports/3.0.0/symbol/name.rb +21 -0
  78. data/lib/backports/3.0.0/symbol.rb +3 -0
  79. data/lib/backports/3.0.0.rb +3 -0
  80. data/lib/backports/3.0.rb +1 -0
  81. data/lib/backports/3.1.0/array/intersect.rb +16 -0
  82. data/lib/backports/3.1.0/array.rb +3 -0
  83. data/lib/backports/3.1.0/class/subclasses.rb +11 -0
  84. data/lib/backports/3.1.0/enumerable/compact.rb +5 -0
  85. data/lib/backports/3.1.0/enumerable/tally.rb +18 -0
  86. data/lib/backports/3.1.0/enumerable.rb +3 -0
  87. data/lib/backports/3.1.0/file/dirname.rb +16 -0
  88. data/lib/backports/3.1.0/file.rb +3 -0
  89. data/lib/backports/3.1.0/integer/try_convert.rb +7 -0
  90. data/lib/backports/3.1.0/integer.rb +3 -0
  91. data/lib/backports/3.1.0/match_data/match.rb +5 -0
  92. data/lib/backports/3.1.0/match_data/match_length.rb +6 -0
  93. data/lib/backports/3.1.0/match_data.rb +3 -0
  94. data/lib/backports/3.1.0/struct/keyword_init.rb +5 -0
  95. data/lib/backports/3.1.0/struct.rb +3 -0
  96. data/lib/backports/3.1.0.rb +3 -0
  97. data/lib/backports/3.1.rb +1 -0
  98. data/lib/backports/3.2.0/class/attached_object.rb +10 -0
  99. data/lib/backports/3.2.0/class.rb +3 -0
  100. data/lib/backports/3.2.0/data.rb +144 -0
  101. data/lib/backports/3.2.0/enumerator/product.rb +64 -0
  102. data/lib/backports/3.2.0/enumerator.rb +3 -0
  103. data/lib/backports/3.2.0/hash/shift.rb +10 -0
  104. data/lib/backports/3.2.0/hash.rb +3 -0
  105. data/lib/backports/3.2.0/integer/ceildiv.rb +7 -0
  106. data/lib/backports/3.2.0/integer.rb +3 -0
  107. data/lib/backports/3.2.0/match_data/byteoffset.rb +12 -0
  108. data/lib/backports/3.2.0/match_data.rb +3 -0
  109. data/lib/backports/3.2.0.rb +3 -0
  110. data/lib/backports/3.2.rb +1 -0
  111. data/lib/backports/latest.rb +1 -1
  112. data/lib/backports/ractor/cloner.rb +103 -0
  113. data/lib/backports/ractor/errors.rb +20 -0
  114. data/lib/backports/ractor/filtered_queue.rb +205 -0
  115. data/lib/backports/ractor/queues.rb +66 -0
  116. data/lib/backports/ractor/ractor.rb +272 -0
  117. data/lib/backports/ractor/sharing.rb +97 -0
  118. data/lib/backports/rails/array.rb +4 -0
  119. data/lib/backports/rails/enumerable.rb +4 -0
  120. data/lib/backports/rails/hash.rb +4 -0
  121. data/lib/backports/rails/kernel.rb +4 -0
  122. data/lib/backports/rails/module.rb +4 -0
  123. data/lib/backports/rails/string.rb +4 -0
  124. data/lib/backports/std_lib.rb +3 -0
  125. data/lib/backports/tools/deprecation.rb +19 -0
  126. data/lib/backports/tools/require_relative_dir.rb +6 -1
  127. data/lib/backports/version.rb +1 -1
  128. data/lib/backports.rb +6 -0
  129. metadata +81 -488
  130. data/.document +0 -6
  131. data/.gitignore +0 -9
  132. data/.gitmodules +0 -6
  133. data/.irbrc +0 -3
  134. data/.travis.yml +0 -20
  135. data/CHANGELOG.rdoc +0 -479
  136. data/README.rdoc +0 -422
  137. data/Rakefile +0 -189
  138. data/default.mspec +0 -14
  139. data/frozen_old_spec/tags/1.8.6/core/argf/each_line_spec.rb +0 -6
  140. data/frozen_old_spec/tags/1.8.6/core/argf/each_spec.rb +0 -6
  141. data/frozen_old_spec/tags/1.8.6/core/argf/lines_spec.rb +0 -6
  142. data/frozen_old_spec/tags/1.8.6/core/array/append_spec.rb +0 -1
  143. data/frozen_old_spec/tags/1.8.6/core/array/collect_spec.rb +0 -7
  144. data/frozen_old_spec/tags/1.8.6/core/array/rotate_spec.rb +0 -2
  145. data/frozen_old_spec/tags/1.8.6/core/array/uniq_spec.rb +0 -3
  146. data/frozen_old_spec/tags/1.8.6/core/complex/to_r_spec.rb +0 -3
  147. data/frozen_old_spec/tags/1.8.6/core/enumerable/all_spec.rb +0 -1
  148. data/frozen_old_spec/tags/1.8.6/core/enumerable/any_spec.rb +0 -2
  149. data/frozen_old_spec/tags/1.8.6/core/enumerable/each_entry_spec.rb +0 -1
  150. data/frozen_old_spec/tags/1.8.6/core/enumerable/none_spec.rb +0 -1
  151. data/frozen_old_spec/tags/1.8.6/core/enumerable/one_spec.rb +0 -1
  152. data/frozen_old_spec/tags/1.8.6/core/enumerator/next_spec.rb +0 -1
  153. data/frozen_old_spec/tags/1.8.6/core/env/to_h_spec.rb +0 -2
  154. data/frozen_old_spec/tags/1.8.6/core/file/join_spec.rb +0 -3
  155. data/frozen_old_spec/tags/1.8.6/core/file/lchmod_spec.rb +0 -2
  156. data/frozen_old_spec/tags/1.8.6/core/file/new_spec.rb +0 -2
  157. data/frozen_old_spec/tags/1.8.6/core/file/open_spec.rb +0 -13
  158. data/frozen_old_spec/tags/1.8.6/core/file/to_path_spec.rb +0 -1
  159. data/frozen_old_spec/tags/1.8.6/core/fixnum/fdiv_spec.rb +0 -1
  160. data/frozen_old_spec/tags/1.8.6/core/gc/stress_spec.rb +0 -2
  161. data/frozen_old_spec/tags/1.8.6/core/hash/assoc_spec.rb +0 -1
  162. data/frozen_old_spec/tags/1.8.6/core/hash/constructor_spec.rb +0 -3
  163. data/frozen_old_spec/tags/1.8.6/core/hash/default_proc_spec.rb +0 -3
  164. data/frozen_old_spec/tags/1.8.6/core/hash/delete_if_spec.rb +0 -1
  165. data/frozen_old_spec/tags/1.8.6/core/hash/each_pair_spec.rb +0 -1
  166. data/frozen_old_spec/tags/1.8.6/core/hash/eql_spec.rb +0 -3
  167. data/frozen_old_spec/tags/1.8.6/core/hash/hash_spec.rb +0 -3
  168. data/frozen_old_spec/tags/1.8.6/core/hash/keep_if_spec.rb +0 -2
  169. data/frozen_old_spec/tags/1.8.6/core/hash/rassoc_spec.rb +0 -1
  170. data/frozen_old_spec/tags/1.8.6/core/hash/reject_spec.rb +0 -2
  171. data/frozen_old_spec/tags/1.8.6/core/hash/select_spec.rb +0 -8
  172. data/frozen_old_spec/tags/1.8.6/core/integer/round_spec.rb +0 -2
  173. data/frozen_old_spec/tags/1.8.6/core/io/binread_spec.rb +0 -7
  174. data/frozen_old_spec/tags/1.8.6/core/io/chars_spec.rb +0 -1
  175. data/frozen_old_spec/tags/1.8.6/core/io/each_char_spec.rb +0 -1
  176. data/frozen_old_spec/tags/1.8.6/core/io/lines_spec.rb +0 -1
  177. data/frozen_old_spec/tags/1.8.6/core/io/open_spec.rb +0 -24
  178. data/frozen_old_spec/tags/1.8.6/core/io/ungetbyte_spec.rb +0 -4
  179. data/frozen_old_spec/tags/1.8.6/core/io/write_spec.rb +0 -5
  180. data/frozen_old_spec/tags/1.8.6/core/kernel/__callee___spec.rb +0 -6
  181. data/frozen_old_spec/tags/1.8.6/core/kernel/__method___spec.rb +0 -1
  182. data/frozen_old_spec/tags/1.8.6/core/kernel/define_singleton_method_spec.rb +0 -2
  183. data/frozen_old_spec/tags/1.8.6/core/kernel/public_method_spec.rb +0 -2
  184. data/frozen_old_spec/tags/1.8.6/core/kernel/require_relative_spec.rb +0 -3
  185. data/frozen_old_spec/tags/1.8.6/core/math/log2_spec.rb +0 -6
  186. data/frozen_old_spec/tags/1.8.6/core/math/log_spec.rb +0 -3
  187. data/frozen_old_spec/tags/1.8.6/core/module/alias_method_spec.rb +0 -1
  188. data/frozen_old_spec/tags/1.8.6/core/module/attr_accessor_spec.rb +0 -2
  189. data/frozen_old_spec/tags/1.8.6/core/module/attr_reader_spec.rb +0 -2
  190. data/frozen_old_spec/tags/1.8.6/core/module/attr_spec.rb +0 -1
  191. data/frozen_old_spec/tags/1.8.6/core/module/attr_writer_spec.rb +0 -2
  192. data/frozen_old_spec/tags/1.8.6/core/module/class_exec_spec.rb +0 -2
  193. data/frozen_old_spec/tags/1.8.6/core/module/define_method_spec.rb +0 -1
  194. data/frozen_old_spec/tags/1.8.6/core/module/module_exec_spec.rb +0 -2
  195. data/frozen_old_spec/tags/1.8.6/core/module/remove_method_spec.rb +0 -1
  196. data/frozen_old_spec/tags/1.8.6/core/module/undef_method_spec.rb +0 -1
  197. data/frozen_old_spec/tags/1.8.6/core/nil/dup_spec.rb +0 -1
  198. data/frozen_old_spec/tags/1.8.6/core/numeric/step_spec.rb +0 -12
  199. data/frozen_old_spec/tags/1.8.6/core/proc/curry_spec.rb +0 -4
  200. data/frozen_old_spec/tags/1.8.6/core/range/step_spec.rb +0 -12
  201. data/frozen_old_spec/tags/1.8.6/core/string/getbyte_spec.rb +0 -6
  202. data/frozen_old_spec/tags/1.8.6/core/string/partition_spec.rb +0 -1
  203. data/frozen_old_spec/tags/1.8.6/core/string/prepend_spec.rb +0 -1
  204. data/frozen_old_spec/tags/1.8.6/core/string/rpartition_spec.rb +0 -1
  205. data/frozen_old_spec/tags/1.8.6/core/string/setbyte_spec.rb +0 -5
  206. data/frozen_old_spec/tags/1.8.6/core/string/upto_spec.rb +0 -1
  207. data/frozen_old_spec/tags/1.8.6/core/symbol/capitalize_spec.rb +0 -3
  208. data/frozen_old_spec/tags/1.8.6/core/symbol/comparison_spec.rb +0 -1
  209. data/frozen_old_spec/tags/1.8.6/core/symbol/downcase_spec.rb +0 -2
  210. data/frozen_old_spec/tags/1.8.6/core/symbol/element_reference_spec.rb +0 -4
  211. data/frozen_old_spec/tags/1.8.6/core/symbol/empty_spec.rb +0 -1
  212. data/frozen_old_spec/tags/1.8.6/core/symbol/match_spec.rb +0 -2
  213. data/frozen_old_spec/tags/1.8.6/core/symbol/swapcase_spec.rb +0 -2
  214. data/frozen_old_spec/tags/1.8.6/core/symbol/to_proc_spec.rb +0 -1
  215. data/frozen_old_spec/tags/1.8.6/core/symbol/upcase_spec.rb +0 -1
  216. data/frozen_old_spec/tags/1.8.7/core/array/append_spec.rb +0 -1
  217. data/frozen_old_spec/tags/1.8.7/core/array/keep_if_spec.rb +0 -2
  218. data/frozen_old_spec/tags/1.8.7/core/array/rotate_spec.rb +0 -2
  219. data/frozen_old_spec/tags/1.8.7/core/array/select_spec.rb +0 -2
  220. data/frozen_old_spec/tags/1.8.7/core/array/uniq_spec.rb +0 -3
  221. data/frozen_old_spec/tags/1.8.7/core/complex/to_r_spec.rb +0 -3
  222. data/frozen_old_spec/tags/1.8.7/core/enumerable/all_spec.rb +0 -1
  223. data/frozen_old_spec/tags/1.8.7/core/enumerable/any_spec.rb +0 -2
  224. data/frozen_old_spec/tags/1.8.7/core/enumerable/collect_concat_spec.rb +0 -1
  225. data/frozen_old_spec/tags/1.8.7/core/enumerable/flat_map_spec.rb +0 -1
  226. data/frozen_old_spec/tags/1.8.7/core/enumerable/none_spec.rb +0 -1
  227. data/frozen_old_spec/tags/1.8.7/core/enumerable/one_spec.rb +0 -1
  228. data/frozen_old_spec/tags/1.8.7/core/env/to_h_spec.rb +0 -2
  229. data/frozen_old_spec/tags/1.8.7/core/file/lchmod_spec.rb +0 -2
  230. data/frozen_old_spec/tags/1.8.7/core/file/new_spec.rb +0 -1
  231. data/frozen_old_spec/tags/1.8.7/core/file/open_spec.rb +0 -5
  232. data/frozen_old_spec/tags/1.8.7/core/file/readlink_spec.rb +0 -6
  233. data/frozen_old_spec/tags/1.8.7/core/file/to_path_spec.rb +0 -1
  234. data/frozen_old_spec/tags/1.8.7/core/hash/assoc_spec.rb +0 -1
  235. data/frozen_old_spec/tags/1.8.7/core/hash/default_proc_spec.rb +0 -3
  236. data/frozen_old_spec/tags/1.8.7/core/hash/keep_if_spec.rb +0 -2
  237. data/frozen_old_spec/tags/1.8.7/core/hash/merge_spec.rb +0 -3
  238. data/frozen_old_spec/tags/1.8.7/core/hash/rassoc_spec.rb +0 -1
  239. data/frozen_old_spec/tags/1.8.7/core/hash/select_spec.rb +0 -1
  240. data/frozen_old_spec/tags/1.8.7/core/hash/to_h_spec.rb +0 -1
  241. data/frozen_old_spec/tags/1.8.7/core/hash/update_spec.rb +0 -3
  242. data/frozen_old_spec/tags/1.8.7/core/integer/round_spec.rb +0 -2
  243. data/frozen_old_spec/tags/1.8.7/core/io/binread_spec.rb +0 -7
  244. data/frozen_old_spec/tags/1.8.7/core/io/open_spec.rb +0 -32
  245. data/frozen_old_spec/tags/1.8.7/core/io/ungetbyte_spec.rb +0 -4
  246. data/frozen_old_spec/tags/1.8.7/core/io/write_spec.rb +0 -5
  247. data/frozen_old_spec/tags/1.8.7/core/kernel/__callee___spec.rb +0 -6
  248. data/frozen_old_spec/tags/1.8.7/core/kernel/define_singleton_method_spec.rb +0 -2
  249. data/frozen_old_spec/tags/1.8.7/core/kernel/public_method_spec.rb +0 -1
  250. data/frozen_old_spec/tags/1.8.7/core/kernel/require_relative_spec.rb +0 -3
  251. data/frozen_old_spec/tags/1.8.7/core/math/log2_spec.rb +0 -6
  252. data/frozen_old_spec/tags/1.8.7/core/math/log_spec.rb +0 -3
  253. data/frozen_old_spec/tags/1.8.7/core/module/alias_method_spec.rb +0 -7
  254. data/frozen_old_spec/tags/1.8.7/core/module/attr_accessor_spec.rb +0 -2
  255. data/frozen_old_spec/tags/1.8.7/core/module/attr_reader_spec.rb +0 -2
  256. data/frozen_old_spec/tags/1.8.7/core/module/attr_spec.rb +0 -2
  257. data/frozen_old_spec/tags/1.8.7/core/module/attr_writer_spec.rb +0 -2
  258. data/frozen_old_spec/tags/1.8.7/core/module/define_method_spec.rb +0 -1
  259. data/frozen_old_spec/tags/1.8.7/core/module/include_spec.rb +0 -3
  260. data/frozen_old_spec/tags/1.8.7/core/module/remove_method_spec.rb +0 -3
  261. data/frozen_old_spec/tags/1.8.7/core/module/undef_method_spec.rb +0 -3
  262. data/frozen_old_spec/tags/1.8.7/core/nil/dup_spec.rb +0 -1
  263. data/frozen_old_spec/tags/1.8.7/core/proc/curry_spec.rb +0 -3
  264. data/frozen_old_spec/tags/1.8.7/core/proc/yield_spec.rb +0 -4
  265. data/frozen_old_spec/tags/1.8.7/core/range/size_spec.rb +0 -1
  266. data/frozen_old_spec/tags/1.8.7/core/string/getbyte_spec.rb +0 -5
  267. data/frozen_old_spec/tags/1.8.7/core/string/prepend_spec.rb +0 -1
  268. data/frozen_old_spec/tags/1.8.7/core/string/setbyte_spec.rb +0 -5
  269. data/frozen_old_spec/tags/1.8.7/core/struct/new_spec.rb +0 -3
  270. data/frozen_old_spec/tags/1.8.7/core/symbol/capitalize_spec.rb +0 -3
  271. data/frozen_old_spec/tags/1.8.7/core/symbol/comparison_spec.rb +0 -1
  272. data/frozen_old_spec/tags/1.8.7/core/symbol/downcase_spec.rb +0 -2
  273. data/frozen_old_spec/tags/1.8.7/core/symbol/element_reference_spec.rb +0 -4
  274. data/frozen_old_spec/tags/1.8.7/core/symbol/empty_spec.rb +0 -1
  275. data/frozen_old_spec/tags/1.8.7/core/symbol/match_spec.rb +0 -2
  276. data/frozen_old_spec/tags/1.8.7/core/symbol/swapcase_spec.rb +0 -2
  277. data/frozen_old_spec/tags/1.8.7/core/symbol/upcase_spec.rb +0 -1
  278. data/frozen_old_spec/tags/1.9.1/core/array/append_spec.rb +0 -1
  279. data/frozen_old_spec/tags/1.9.1/core/array/rotate_spec.rb +0 -1
  280. data/frozen_old_spec/tags/1.9.1/core/enumerable/all_spec.rb +0 -1
  281. data/frozen_old_spec/tags/1.9.1/core/enumerable/any_spec.rb +0 -2
  282. data/frozen_old_spec/tags/1.9.1/core/enumerable/none_spec.rb +0 -1
  283. data/frozen_old_spec/tags/1.9.1/core/enumerable/one_spec.rb +0 -1
  284. data/frozen_old_spec/tags/1.9.1/core/env/to_h_spec.rb +0 -2
  285. data/frozen_old_spec/tags/1.9.1/core/hash/default_proc_spec.rb +0 -1
  286. data/frozen_old_spec/tags/1.9.1/core/io/write_spec.rb +0 -2
  287. data/frozen_old_spec/tags/1.9.1/core/module/alias_method_spec.rb +0 -4
  288. data/frozen_old_spec/tags/1.9.1/core/module/attr_accessor_spec.rb +0 -2
  289. data/frozen_old_spec/tags/1.9.1/core/module/attr_reader_spec.rb +0 -2
  290. data/frozen_old_spec/tags/1.9.1/core/module/attr_spec.rb +0 -1
  291. data/frozen_old_spec/tags/1.9.1/core/module/attr_writer_spec.rb +0 -2
  292. data/frozen_old_spec/tags/1.9.1/core/module/define_method_spec.rb +0 -3
  293. data/frozen_old_spec/tags/1.9.1/core/module/remove_method_spec.rb +0 -1
  294. data/frozen_old_spec/tags/1.9.1/core/module/undef_method_spec.rb +0 -1
  295. data/frozen_old_spec/tags/1.9.1/core/nil/dup_spec.rb +0 -1
  296. data/frozen_old_spec/tags/1.9.2/core/array/append_spec.rb +0 -1
  297. data/frozen_old_spec/tags/1.9.2/core/enumerable/all_spec.rb +0 -1
  298. data/frozen_old_spec/tags/1.9.2/core/enumerable/any_spec.rb +0 -2
  299. data/frozen_old_spec/tags/1.9.2/core/enumerable/none_spec.rb +0 -1
  300. data/frozen_old_spec/tags/1.9.2/core/enumerable/one_spec.rb +0 -1
  301. data/frozen_old_spec/tags/1.9.2/core/io/write_spec.rb +0 -3
  302. data/frozen_old_spec/tags/1.9.2/core/module/alias_method_spec.rb +0 -4
  303. data/frozen_old_spec/tags/1.9.2/core/module/attr_accessor_spec.rb +0 -2
  304. data/frozen_old_spec/tags/1.9.2/core/module/attr_reader_spec.rb +0 -2
  305. data/frozen_old_spec/tags/1.9.2/core/module/attr_spec.rb +0 -1
  306. data/frozen_old_spec/tags/1.9.2/core/module/attr_writer_spec.rb +0 -2
  307. data/frozen_old_spec/tags/1.9.2/core/module/define_method_spec.rb +0 -3
  308. data/frozen_old_spec/tags/1.9.2/core/module/remove_method_spec.rb +0 -1
  309. data/frozen_old_spec/tags/1.9.2/core/module/undef_method_spec.rb +0 -1
  310. data/frozen_old_spec/tags/1.9.2/core/nil/dup_spec.rb +0 -1
  311. data/frozen_old_spec/tags/1.9.3/core/enumerable/any_spec.rb +0 -1
  312. data/frozen_old_spec/tags/1.9.3/core/module/alias_method_spec.rb +0 -4
  313. data/frozen_old_spec/tags/1.9.3/core/module/attr_accessor_spec.rb +0 -1
  314. data/frozen_old_spec/tags/1.9.3/core/module/attr_reader_spec.rb +0 -1
  315. data/frozen_old_spec/tags/1.9.3/core/module/attr_spec.rb +0 -1
  316. data/frozen_old_spec/tags/1.9.3/core/module/attr_writer_spec.rb +0 -1
  317. data/frozen_old_spec/tags/1.9.3/core/module/define_method_spec.rb +0 -3
  318. data/frozen_old_spec/tags/1.9.3/core/module/remove_method_spec.rb +0 -1
  319. data/frozen_old_spec/tags/1.9.3/core/module/undef_method_spec.rb +0 -1
  320. data/frozen_old_spec/tags/2.0.0/core/enumerable/any_spec.rb +0 -1
  321. data/frozen_old_spec/tags/2.0.0/core/module/alias_method_spec.rb +0 -1
  322. data/frozen_old_spec/tags/2.0.0/core/module/attr_accessor_spec.rb +0 -2
  323. data/frozen_old_spec/tags/2.0.0/core/module/attr_reader_spec.rb +0 -2
  324. data/frozen_old_spec/tags/2.0.0/core/module/attr_spec.rb +0 -1
  325. data/frozen_old_spec/tags/2.0.0/core/module/attr_writer_spec.rb +0 -2
  326. data/frozen_old_spec/tags/2.0.0/core/module/define_method_spec.rb +0 -2
  327. data/frozen_old_spec/tags/2.0.0/core/module/remove_method_spec.rb +0 -1
  328. data/frozen_old_spec/tags/2.0.0/core/module/undef_method_spec.rb +0 -1
  329. data/frozen_old_spec/tags/2.0.0/core/nil/dup_spec.rb +0 -1
  330. data/frozen_old_spec/tags/2.0.0/core/struct/new_spec.rb +0 -1
  331. data/frozen_old_spec/tags/2.1.0/core/enumerable/any_spec.rb +0 -1
  332. data/frozen_old_spec/tags/2.1.0/core/module/alias_method_spec.rb +0 -1
  333. data/frozen_old_spec/tags/2.1.0/core/module/attr_accessor_spec.rb +0 -2
  334. data/frozen_old_spec/tags/2.1.0/core/module/attr_reader_spec.rb +0 -2
  335. data/frozen_old_spec/tags/2.1.0/core/module/attr_spec.rb +0 -1
  336. data/frozen_old_spec/tags/2.1.0/core/module/attr_writer_spec.rb +0 -2
  337. data/frozen_old_spec/tags/2.1.0/core/module/define_method_spec.rb +0 -2
  338. data/frozen_old_spec/tags/2.1.0/core/module/remove_method_spec.rb +0 -1
  339. data/frozen_old_spec/tags/2.1.0/core/module/undef_method_spec.rb +0 -1
  340. data/frozen_old_spec/tags/2.1.0/core/nil/dup_spec.rb +0 -1
  341. data/frozen_old_spec/tags/2.1.0/core/struct/new_spec.rb +0 -1
  342. data/frozen_old_spec/tags/2.2.0/core/enumerable/any_spec.rb +0 -1
  343. data/frozen_old_spec/tags/2.2.0/core/module/alias_method_spec.rb +0 -1
  344. data/frozen_old_spec/tags/2.2.0/core/module/attr_accessor_spec.rb +0 -2
  345. data/frozen_old_spec/tags/2.2.0/core/module/attr_reader_spec.rb +0 -2
  346. data/frozen_old_spec/tags/2.2.0/core/module/attr_spec.rb +0 -1
  347. data/frozen_old_spec/tags/2.2.0/core/module/attr_writer_spec.rb +0 -2
  348. data/frozen_old_spec/tags/2.2.0/core/module/define_method_spec.rb +0 -1
  349. data/frozen_old_spec/tags/2.2.0/core/module/remove_method_spec.rb +0 -1
  350. data/frozen_old_spec/tags/2.2.0/core/module/undef_method_spec.rb +0 -1
  351. data/frozen_old_spec/tags/2.2.0/core/nil/dup_spec.rb +0 -1
  352. data/frozen_old_spec/tags/2.2.0/core/struct/new_spec.rb +0 -1
  353. data/frozen_old_spec/tags/2.3.0/core/enumerable/any_spec.rb +0 -1
  354. data/frozen_old_spec/tags/2.3.0/core/module/alias_method_spec.rb +0 -1
  355. data/frozen_old_spec/tags/2.3.0/core/module/attr_accessor_spec.rb +0 -2
  356. data/frozen_old_spec/tags/2.3.0/core/module/attr_reader_spec.rb +0 -2
  357. data/frozen_old_spec/tags/2.3.0/core/module/attr_spec.rb +0 -1
  358. data/frozen_old_spec/tags/2.3.0/core/module/attr_writer_spec.rb +0 -2
  359. data/frozen_old_spec/tags/2.3.0/core/module/define_method_spec.rb +0 -1
  360. data/frozen_old_spec/tags/2.3.0/core/module/remove_method_spec.rb +0 -1
  361. data/frozen_old_spec/tags/2.3.0/core/module/undef_method_spec.rb +0 -1
  362. data/frozen_old_spec/tags/2.3.0/core/nil/dup_spec.rb +0 -1
  363. data/frozen_old_spec/tags/2.3.0/core/struct/new_spec.rb +0 -1
  364. data/frozen_old_spec/tags/2.3.5/core/struct/new_spec.rb +0 -1
  365. data/frozen_old_spec/tags/2.4.0/core/enumerable/any_spec.rb +0 -1
  366. data/frozen_old_spec/tags/2.4.0/core/module/alias_method_spec.rb +0 -1
  367. data/frozen_old_spec/tags/2.4.0/core/module/attr_accessor_spec.rb +0 -2
  368. data/frozen_old_spec/tags/2.4.0/core/module/attr_reader_spec.rb +0 -2
  369. data/frozen_old_spec/tags/2.4.0/core/module/attr_spec.rb +0 -1
  370. data/frozen_old_spec/tags/2.4.0/core/module/attr_writer_spec.rb +0 -2
  371. data/frozen_old_spec/tags/2.4.0/core/module/define_method_spec.rb +0 -1
  372. data/frozen_old_spec/tags/2.4.0/core/module/remove_method_spec.rb +0 -1
  373. data/frozen_old_spec/tags/2.4.0/core/module/undef_method_spec.rb +0 -1
  374. data/frozen_old_spec/tags/2.4.0/core/nil/dup_spec.rb +0 -1
  375. data/frozen_old_spec/tags/2.4.0/core/struct/new_spec.rb +0 -1
  376. data/frozen_old_spec/tags/2.5.0/core/enumerable/any_spec.rb +0 -1
  377. data/frozen_old_spec/tags/2.5.0/core/module/alias_method_spec.rb +0 -1
  378. data/frozen_old_spec/tags/2.5.0/core/module/attr_accessor_spec.rb +0 -2
  379. data/frozen_old_spec/tags/2.5.0/core/module/attr_reader_spec.rb +0 -2
  380. data/frozen_old_spec/tags/2.5.0/core/module/attr_spec.rb +0 -1
  381. data/frozen_old_spec/tags/2.5.0/core/module/attr_writer_spec.rb +0 -2
  382. data/frozen_old_spec/tags/2.5.0/core/module/define_method_spec.rb +0 -1
  383. data/frozen_old_spec/tags/2.5.0/core/module/remove_method_spec.rb +0 -1
  384. data/frozen_old_spec/tags/2.5.0/core/module/undef_method_spec.rb +0 -1
  385. data/frozen_old_spec/tags/2.5.0/core/nil/dup_spec.rb +0 -1
  386. data/frozen_old_spec/tags/2.5.0/core/struct/new_spec.rb +0 -1
  387. data/set_version/1.8.7.rb +0 -1
  388. data/set_version/1.9.1.rb +0 -1
  389. data/set_version/1.9.2.rb +0 -1
  390. data/set_version/1.9.3.rb +0 -1
  391. data/set_version/2.0.0.rb +0 -1
  392. data/set_version/2.1.0.rb +0 -1
  393. data/set_version/2.2.0.rb +0 -1
  394. data/set_version/2.3.0.rb +0 -1
  395. data/set_version/2.4.0.rb +0 -1
  396. data/set_version/2.5.0.rb +0 -1
  397. data/set_version/2.6.0.rb +0 -1
  398. data/set_version/setter.rb +0 -22
  399. data/spec/tags/1.8.7/core/array/to_h_spec.rb +0 -3
  400. data/spec/tags/1.8.7/core/enumerable/to_h_spec.rb +0 -2
  401. data/spec/tags/1.8.7/core/module/attr_spec.rb +0 -1
  402. data/spec/tags/1.8.7/core/module/include_spec.rb +0 -1
  403. data/spec/tags/1.9.1/core/array/bsearch_index_spec.rb +0 -1
  404. data/spec/tags/1.9.1/core/array/rotate_spec.rb +0 -1
  405. data/spec/tags/1.9.1/core/dir/each_child_spec.rb +0 -1
  406. data/spec/tags/1.9.1/core/env/to_h_spec.rb +0 -2
  407. data/spec/tags/1.9.1/core/hash/default_proc_spec.rb +0 -1
  408. data/spec/tags/1.9.1/core/hash/slice_spec.rb +0 -1
  409. data/spec/tags/1.9.1/core/hash/transform_keys_spec.rb +0 -2
  410. data/spec/tags/1.9.1/core/hash/transform_values_spec.rb +0 -2
  411. data/spec/tags/1.9.1/core/io/write_spec.rb +0 -3
  412. data/spec/tags/1.9.1/core/kernel/yield_self_spec.rb +0 -1
  413. data/spec/tags/1.9.1/core/method/curry_spec.rb +0 -1
  414. data/spec/tags/1.9.1/core/module/alias_method_spec.rb +0 -3
  415. data/spec/tags/1.9.1/core/module/attr_accessor_spec.rb +0 -1
  416. data/spec/tags/1.9.1/core/module/attr_reader_spec.rb +0 -1
  417. data/spec/tags/1.9.1/core/module/attr_spec.rb +0 -1
  418. data/spec/tags/1.9.1/core/module/attr_writer_spec.rb +0 -1
  419. data/spec/tags/1.9.1/core/module/define_method_spec.rb +0 -7
  420. data/spec/tags/1.9.1/core/string/uplus_spec.rb +0 -1
  421. data/spec/tags/1.9.1/core/struct/new_spec.rb +0 -2
  422. data/spec/tags/1.9.2/core/array/bsearch_index_spec.rb +0 -1
  423. data/spec/tags/1.9.2/core/array/to_h_spec.rb +0 -3
  424. data/spec/tags/1.9.2/core/dir/each_child_spec.rb +0 -1
  425. data/spec/tags/1.9.2/core/enumerable/to_h_spec.rb +0 -2
  426. data/spec/tags/1.9.2/core/hash/slice_spec.rb +0 -1
  427. data/spec/tags/1.9.2/core/hash/to_h_spec.rb +0 -3
  428. data/spec/tags/1.9.2/core/hash/transform_keys_spec.rb +0 -2
  429. data/spec/tags/1.9.2/core/hash/transform_values_spec.rb +0 -2
  430. data/spec/tags/1.9.2/core/io/write_spec.rb +0 -3
  431. data/spec/tags/1.9.2/core/kernel/then_spec.rb +0 -1
  432. data/spec/tags/1.9.2/core/kernel/yield_self_spec.rb +0 -1
  433. data/spec/tags/1.9.2/core/method/curry_spec.rb +0 -1
  434. data/spec/tags/1.9.2/core/module/alias_method_spec.rb +0 -3
  435. data/spec/tags/1.9.2/core/module/attr_accessor_spec.rb +0 -1
  436. data/spec/tags/1.9.2/core/module/attr_reader_spec.rb +0 -1
  437. data/spec/tags/1.9.2/core/module/attr_writer_spec.rb +0 -1
  438. data/spec/tags/1.9.2/core/module/define_method_spec.rb +0 -7
  439. data/spec/tags/1.9.2/core/module/include_spec.rb +0 -1
  440. data/spec/tags/1.9.2/core/string/uplus_spec.rb +0 -1
  441. data/spec/tags/1.9.2/core/struct/new_spec.rb +0 -2
  442. data/spec/tags/1.9.3/core/array/bsearch_index_spec.rb +0 -1
  443. data/spec/tags/1.9.3/core/dir/each_child_spec.rb +0 -1
  444. data/spec/tags/1.9.3/core/hash/slice_spec.rb +0 -1
  445. data/spec/tags/1.9.3/core/hash/to_h_spec.rb +0 -3
  446. data/spec/tags/1.9.3/core/hash/transform_keys_spec.rb +0 -2
  447. data/spec/tags/1.9.3/core/hash/transform_values_spec.rb +0 -2
  448. data/spec/tags/1.9.3/core/io/write_spec.rb +0 -3
  449. data/spec/tags/1.9.3/core/kernel/yield_self_spec.rb +0 -1
  450. data/spec/tags/1.9.3/core/method/curry_spec.rb +0 -1
  451. data/spec/tags/1.9.3/core/module/alias_method_spec.rb +0 -3
  452. data/spec/tags/1.9.3/core/module/attr_accessor_spec.rb +0 -1
  453. data/spec/tags/1.9.3/core/module/attr_reader_spec.rb +0 -1
  454. data/spec/tags/1.9.3/core/module/attr_writer_spec.rb +0 -1
  455. data/spec/tags/1.9.3/core/module/define_method_spec.rb +0 -7
  456. data/spec/tags/1.9.3/core/module/include_spec.rb +0 -1
  457. data/spec/tags/1.9.3/core/string/uplus_spec.rb +0 -1
  458. data/spec/tags/1.9.3/core/struct/new_spec.rb +0 -2
  459. data/spec/tags/2.0.0/core/array/to_h_spec.rb +0 -3
  460. data/spec/tags/2.0.0/core/enumerable/to_h_spec.rb +0 -2
  461. data/spec/tags/2.0.0/core/hash/slice_spec.rb +0 -1
  462. data/spec/tags/2.0.0/core/hash/to_h_spec.rb +0 -3
  463. data/spec/tags/2.0.0/core/module/attr_accessor_spec.rb +0 -1
  464. data/spec/tags/2.0.0/core/module/attr_reader_spec.rb +0 -1
  465. data/spec/tags/2.0.0/core/module/attr_spec.rb +0 -1
  466. data/spec/tags/2.0.0/core/module/attr_writer_spec.rb +0 -1
  467. data/spec/tags/2.0.0/core/module/define_method_spec.rb +0 -4
  468. data/spec/tags/2.0.0/core/module/include_spec.rb +0 -1
  469. data/spec/tags/2.0.0/core/string/uplus_spec.rb +0 -1
  470. data/spec/tags/2.0.0/core/struct/new_spec.rb +0 -1
  471. data/spec/tags/2.1.0/core/array/union_spec.rb +0 -1
  472. data/spec/tags/2.1.0/core/hash/slice_spec.rb +0 -1
  473. data/spec/tags/2.1.0/core/hash/to_h_spec.rb +0 -1
  474. data/spec/tags/2.1.0/core/module/attr_accessor_spec.rb +0 -1
  475. data/spec/tags/2.1.0/core/module/attr_reader_spec.rb +0 -1
  476. data/spec/tags/2.1.0/core/module/attr_spec.rb +0 -1
  477. data/spec/tags/2.1.0/core/module/attr_writer_spec.rb +0 -1
  478. data/spec/tags/2.1.0/core/module/define_method_spec.rb +0 -4
  479. data/spec/tags/2.1.0/core/string/uplus_spec.rb +0 -1
  480. data/spec/tags/2.1.0/core/struct/new_spec.rb +0 -1
  481. data/spec/tags/2.2.0/core/hash/slice_spec.rb +0 -1
  482. data/spec/tags/2.2.0/core/hash/to_h_spec.rb +0 -1
  483. data/spec/tags/2.2.0/core/module/attr_accessor_spec.rb +0 -1
  484. data/spec/tags/2.2.0/core/module/attr_reader_spec.rb +0 -1
  485. data/spec/tags/2.2.0/core/module/attr_spec.rb +0 -1
  486. data/spec/tags/2.2.0/core/module/attr_writer_spec.rb +0 -1
  487. data/spec/tags/2.2.0/core/module/define_method_spec.rb +0 -4
  488. data/spec/tags/2.2.0/core/string/uplus_spec.rb +0 -1
  489. data/spec/tags/2.2.0/core/struct/new_spec.rb +0 -1
  490. data/spec/tags/2.3.0/core/hash/slice_spec.rb +0 -1
  491. data/spec/tags/2.3.0/core/hash/to_h_spec.rb +0 -1
  492. data/spec/tags/2.3.0/core/module/attr_spec.rb +0 -1
  493. data/spec/tags/2.3.0/core/string/uplus_spec.rb +0 -1
  494. data/spec/tags/2.3.0/core/struct/new_spec.rb +0 -1
  495. data/spec/tags/2.4.0/core/hash/slice_spec.rb +0 -1
  496. data/spec/tags/2.4.0/core/hash/to_h_spec.rb +0 -1
  497. data/spec/tags/2.4.0/core/module/attr_spec.rb +0 -1
  498. data/spec/tags/2.4.0/core/struct/new_spec.rb +0 -1
  499. data/spec/tags/2.5.0/core/hash/to_h_spec.rb +0 -1
  500. data/test/README +0 -2
  501. data/test/_backport_guards_test.rb +0 -148
  502. data/test/bit_length_test.rb +0 -11
  503. data/test/lazy_test.rb +0 -487
  504. data/test/socket_interaction_test.rb +0 -9
  505. data/test/test_helper.rb +0 -1
data/README.rdoc DELETED
@@ -1,422 +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.6 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
- == Loading backports
10
-
11
- === Explicitly (recommended)
12
-
13
- For example, if you want to use transform_values and transform_keys, even in Ruby implementations that don't include it:
14
-
15
- require 'backports/2.4.0/hash/transform_values'
16
- require 'backports/2.5.0/hash/transform_keys'
17
-
18
- This will enable Hash#transform_values and Hash#transform_keys, using the native versions if available or otherwise provide a pure Ruby version.
19
-
20
- === By Module
21
-
22
- To bring all the backports for a given Class/Module, you can specify only that Class:
23
-
24
- require 'backports/2.3.0/hash'
25
-
26
- This will make sure that Hash responds to dig, fetch_values, <, <=, >, >= and to_proc
27
-
28
- === Up to a specific Ruby version
29
-
30
- 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:
31
-
32
- require 'backports/2.4.0'
33
-
34
- 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)!
35
-
36
- 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'`.
37
-
38
- +Note+: Although I am a Ruby committer, this gem is a personal project and is not endorsed by ruby-core.
39
-
40
- == What's inside
41
-
42
- Goals for backported features:
43
- 1. Won't break older code
44
- 2. Pure Ruby (no C extensions)
45
- 3. Pass ruby/spec[https://github.com/ruby/spec]
46
-
47
- 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...
48
-
49
- 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).
50
-
51
- == Installation & compatibility
52
-
53
- +backports+ can be installed with:
54
-
55
- gem install backports
56
-
57
- To use:
58
-
59
- require 'rubygems'
60
- # For only specific backports:
61
- require 'backports/1.9.1/kernel/require_relative'
62
- require 'backports/2.0.0/enumerable/lazy'
63
-
64
- # For all backports up to a given version
65
- require 'backports/1.9.2' # All backports for Ruby 1.9.2 and below
66
-
67
- 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.
68
-
69
- With bundler, add to your Gemfile:
70
-
71
- gem 'backports', :require => false
72
-
73
- Run <tt>bundle install</tt> and require the desired backports.
74
- Compatible with Ruby itself, JRuby and Rubinius.
75
-
76
- = Complete List of backports
77
-
78
- == Ruby 2.6 backports
79
-
80
- * Array
81
- * +difference+, +union+
82
- * +to_h+ (with block)
83
-
84
- * Enumerable
85
- * +chain+
86
- * +to_h+ (with block)
87
-
88
- * Enumerator::Chain (use Enumerable#chain)
89
-
90
- * Hash
91
- * +merge+, +merge!+/+update+ (with multiple arguments)
92
- * +to_h+ (with block)
93
-
94
- * Kernel
95
- * +then+
96
-
97
- * Method
98
- * +<<+, +>>+
99
-
100
- * Proc
101
- * +<<+, +>>+
102
-
103
- == Ruby 2.5 backports
104
-
105
- * Array
106
- * +append+, +prepend+
107
- * Dir
108
- * +children+, +each_child+
109
- * Enumerable
110
- * +any?+, +all?+, +none?+, +one?+ (with pattern argument)
111
- * Hash
112
- * +slice+
113
- * +transform_keys+
114
- * Integer
115
- * +sqrt+
116
- * +allbits?+, +anybits?+ and +nobits?+
117
- * Kernel
118
- * +yield_self+
119
- * Module
120
- * +attr+, +attr_accessor+, +attr_reader+, +attr_writer+ (now public)
121
- * +define_method+, +alias_method+, +undef_method+, +remove_method+ (now public)
122
- * String
123
- * +delete_prefix+, +delete_prefix!+
124
- * +delete_suffix+, +delete_suffix!+
125
- * +undump+
126
- * Struct
127
- * +new+ (with <code>keyword_init: true</code>)
128
-
129
- == Ruby 2.4 backports
130
-
131
- * Comparable
132
- * +clamp+
133
- * Enumerable
134
- * +sum+
135
- * +uniq+
136
- * Hash
137
- * +compact+, +compact!+
138
- * +transform_values+, +transform_values!+
139
- * Regexp
140
- * +match?+
141
- * String
142
- * +match?+
143
- * FalseClass, Fixnum, Float, NilClass, TrueClass
144
- * +dup+
145
-
146
- == Ruby 2.3 backports
147
-
148
- * Array
149
- * +bsearch_index+
150
- * +dig+
151
- * Enumerable
152
- * +chunk_while+
153
- * +grep_v+
154
- * Hash
155
- * +dig+
156
- * +fetch_values+
157
- * +to_proc+
158
- * <=, <, >=, >
159
- * Numeric
160
- * +negative?+
161
- * +positive?+
162
- * String
163
- * unary + and -
164
- * Struct
165
- * +dig+
166
-
167
- == Ruby 2.2 backports
168
-
169
- * Enumerable
170
- * +slice_after+
171
- * +slice_when+
172
- * Float
173
- * +prev_float+
174
- * +next_float+
175
- * Kernel
176
- * +itself+
177
- * Method
178
- * +curry+
179
- * +super_method+
180
- * String
181
- * +unicode_normalize+
182
- * +unicode_normalize!+
183
- * +unicode_normalize?+
184
-
185
- == Ruby 2.1 backports
186
-
187
- * Array
188
- * +to_h+
189
- * Bignum
190
- * +bit_length+
191
- * Enumerable
192
- * +to_h+
193
- * Fixnum
194
- * +bit_length+
195
- * Module
196
- * +include+ (now public)
197
-
198
- == Ruby 2.0 backports
199
-
200
- * Array
201
- * +bsearch+
202
- * Enumerable
203
- * +lazy+
204
- * Enumerator::Lazy
205
- * all methods
206
- * Hash
207
- * <tt>default_proc=</tt> (with nil argument)
208
- * +to_h+
209
- * nil.to_h
210
- * Range
211
- * +bsearch+
212
- * Struct
213
- * +to_h+
214
-
215
- == Ruby 1.9.3 backports
216
-
217
- * File
218
- * +NULL+
219
- * IO
220
- * +advise+ (acts as a noop)
221
- * +write+, +binwrite+
222
- * String
223
- * +byteslice+
224
- * +prepend+
225
-
226
- == Ruby 1.9.2 backports
227
-
228
- * Array
229
- * <tt>rotate, rotate!</tt>
230
- * <tt>keep_if, select!</tt>
231
- * +product+ (with block)
232
- * +repeated_combination+, +repeated_permutation+
233
- * <tt>sort_by!</tt>
234
- * <tt>uniq, uniq!</tt> (with block)
235
-
236
- * Complex
237
- * +to_r+
238
-
239
- * Dir
240
- * +home+
241
-
242
- * Enumerable
243
- * +chunk+
244
- * +flat_map+, +collect_concat+
245
- * +join+
246
- * +slice_before+
247
-
248
- * Float::INFINITY, NAN
249
-
250
- * Hash
251
- * +keep_if+, <tt>select!</tt>
252
-
253
- * Object
254
- * <tt>singleton_class</tt>
255
-
256
- * Random (new class)
257
-
258
- *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>.
259
-
260
- == Ruby 1.9.1 backports
261
-
262
- Additionally, the following Ruby 1.9 features have been backported:
263
- * Array
264
- * +try_convert+
265
- * +sample+
266
-
267
- * Enumerable
268
- * +each_with_object+
269
- * +each_with_index+ (with arguments)
270
-
271
- * Enumerator
272
- * +new+ (with block)
273
-
274
- * File
275
- * +binread+
276
- * +to_path+
277
- * All class methods accepting filenames will accept files or anything with a <tt>#to_path</tt> method.
278
- * <tt>File.open</tt> accepts an options hash.
279
-
280
- * Float
281
- * +round+
282
-
283
- * Hash
284
- * +assoc+, +rassoc+
285
- * +key+
286
- * +try_convert+
287
- * <tt>default_proc=</tt>
288
-
289
- * Integer
290
- * +magnitude+
291
- * +round+
292
-
293
- * IO
294
- * +bin_read+
295
- * +try_convert+
296
- * +ungetbyte+
297
- * <tt>IO.open</tt> accepts an options hash.
298
-
299
- * Kernel
300
- * +require_relative+
301
-
302
- * Math
303
- * +log+ (with base)
304
- * +log2+
305
-
306
- * Numeric
307
- * +round+
308
-
309
- * Object
310
- * +define_singleton_method+
311
- * +public_method+
312
- * +public_send+
313
-
314
- * Proc
315
- * +yield+
316
- * +lambda?+
317
- * +curry+
318
- * <tt>===</tt>
319
-
320
- * Range
321
- * <tt>cover?</tt>
322
-
323
- * Regexp
324
- * +try_convert+
325
-
326
- * String
327
- * <tt>ascii_only?</tt>
328
- * +chr+
329
- * +clear+
330
- * +codepoints+, +each_codepoint+
331
- * +get_byte+, +set_byte+
332
- * +ord+
333
- * +try_convert+
334
-
335
- +Enumerator+ can be accessed directly (instead of <tt>Enumerable::Enumerator</tt>)
336
-
337
- To include _only_ these backports and those of the 1.8 line, <tt>require "backports/1.9.1"</tt>.
338
-
339
- Moreover, a pretty good imitation of +BasicObject+ is available,
340
- but since it is only an imitation, it must be required explicitly:
341
-
342
- require 'backports/basic_object'
343
-
344
- == Ruby 1.8.7
345
-
346
- 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!
347
-
348
- Only exceptions:
349
- * String#gsub (the form returning an enumerator)
350
- * GC.stress= (not implemented)
351
- * Array#choice (removed in 1.9, use 1.9.1's Array#sample instead)
352
-
353
- == Libraries
354
-
355
- 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.
356
-
357
- require "backports/std_lib"
358
- require "prime"
359
- 42.prime? # => false, even in Ruby 1.8.x
360
-
361
- The following libraries are up to date with Ruby 1.9.3:
362
-
363
- * Matrix
364
- * Prime
365
- * Set
366
-
367
- The following library is to date with Ruby 2.0.0:
368
-
369
- * OpenStruct (ostruct)
370
-
371
- I am aware of the following backport gem, which probably won't make it into this gem:
372
-
373
- * Net::SMTP for Ruby 1.8.6: smtp_tls[http://seattlerb.rubyforge.org/smtp_tls/]
374
-
375
- Requiring backports for a given version of Ruby will also load 'backports/std_lib'.
376
-
377
- == Forcing incompatibilities
378
-
379
- 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:
380
-
381
- * Hash
382
- * +select+ (returns a Hash instead of an Array)
383
-
384
- * Enumerable / Array
385
- * +map+ (returns an enumerator when called without a block)
386
-
387
- * String
388
- * +length+, +size+ (for UTF-8 support)
389
-
390
- These must be imported in addition to the backports gem, for example:
391
-
392
- require "backports/force/hash_select"
393
- {}.select{} # => {}, even in Ruby 1.8
394
-
395
-
396
- == Thanks
397
-
398
- Thanks for the bug reports and patches, in particular the repeat offenders:
399
-
400
- * Arto Bendiken ( bendiken[http://github.com/bendiken] )
401
- * Konstantin Haase ( rkh[https://github.com/rkh])
402
- * Roger Pack ( rdp[http://github.com/rdp] )
403
-
404
- == Contributing
405
-
406
- 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.
407
-
408
- See below to test rubyspec. Note that only features missing from your Ruby version are tested.
409
-
410
- git submodule init && git submodule update # => pulls rubyspecs
411
- bundle install
412
- bundle exec rake spec[hash/slice] # => tests Hash#slice (must be in Ruby 2.4 or less)
413
- bundle exec rake spec[hash/*] # => tests all backported Hash methods
414
- bundle exec rake spec (or rake spec[*/*]) # => all rubyspecs for backported methods
415
-
416
- Failures that are acceptable are added the to `tags` file.
417
-
418
- = License
419
-
420
- +backports+ is released under the terms of the MIT License, see the included LICENSE file.
421
-
422
- Author:: Marc-André Lafortune
data/Rakefile DELETED
@@ -1,189 +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
- end
31
- _, ex, p, f, e = data = match.captures.map{|x| x.to_i}
32
- not_found << path if ex == 0
33
- STATS.each_with_index do |_, i|
34
- @counts[i] += data[i]
35
- end
36
- if f + e > 0
37
- puts cmd
38
- puts result
39
- else
40
- print "."
41
- STDOUT.flush
42
- end
43
- end
44
-
45
- def stats
46
- h = {}
47
- STATS.zip(@counts).each{|k, v| h[k]=v}
48
- h
49
- end
50
-
51
- def report
52
- puts "*** Overall:", stats.map{|a| a.join(' ')}.join(', ')
53
- puts "No spec found for #{@not_found.join(', ')}" unless @not_found.empty?
54
- end
55
-
56
- def success?
57
- stats[:failures] == 0 && stats[:errors] == 0
58
- end
59
- end
60
-
61
- desc "Run specs, where path can be '*/*' (default), 'class/*' or 'class/method'."
62
- task :spec, :path, :action do |t, args|
63
- args.with_defaults(:path => '*/*', :action => 'ci')
64
- specs = SpecRunner.new
65
-
66
- # Avoid unclear error message by checking if at least one spec exists in the old specs
67
- has_frozen_spec = !Dir.glob('frozen_old_spec/rubyspec/core/#{path}_spec.rb')
68
- if has_frozen_spec || RUBY_VERSION < '1.9'
69
- mspec_cmds(args[:path], 'frozen_old_spec', args[:action]) do |cmd, path|
70
- specs.run(cmd, path)
71
- end
72
- end
73
-
74
- unless RUBY_VERSION < '1.9' # Give up entirely on running new specs in 1.8.x, mainly because of {hash: 'syntax'}
75
- mspec_cmds(args[:path], 'spec', args[:action]) do |cmd, path|
76
- specs.run(cmd, path)
77
- end
78
- end
79
- specs.report
80
- fail unless specs.success?
81
- end
82
-
83
- task :all_spec do # Necessary because of argument passing bug in 1.8.7
84
- Rake::Task[:spec].invoke
85
- end
86
-
87
- task :spec_tag, :path do |t, args|
88
- Rake::Task[:spec].invoke(args[:path], 'tag -G fails')
89
- end
90
-
91
- task :default => [:test, :all_spec]
92
-
93
- DEPENDENCIES = Hash.new([]).merge!(
94
- '1.8.7/argf/chars' => 'backports/1.8.7/string/each_char',
95
- '1.8.7/argf/each_char' => 'backports/1.8.7/string/each_char',
96
- '1.8.7/array/cycle' => 'backports/1.8.7/stop_iteration',
97
- '1.8.7/enumerable/entries' => ['backports/1.8.7/enumerable/each_with_index', 'backports/1.8.7/enumerable/to_a'],
98
- '1.8.7/enumerator/rewind' => 'backports/1.8.7/enumerator/next',
99
- '1.8.7/hash/reject' => 'backports/1.8.7/integer/even',
100
- '1.9.1/hash/rassoc' => 'backports/1.9.1/hash/key',
101
- '1.9.1/proc/lambda' => 'backports/1.9.1/proc/curry',
102
- '1.9.2/complex/to_r' => 'complex',
103
- '1.9.2/array/select' => 'backports/1.8.7/array/select',
104
- '1.9.2/hash/select' => 'backports/1.8.7/hash/select',
105
- '1.9.2/enumerable/each_entry' => 'backports/1.8.7/enumerable/each_with_index',
106
- '2.0.0/hash/to_h' => 'backports/1.9.1/hash/default_proc',
107
- '2.2.0/float/next_float' => 'backports/2.2.0/float/prev_float',
108
- '2.2.0/float/prev_float' => 'backports/2.2.0/float/next_float',
109
- '2.3.0/array/bsearch_index' => ['backports/2.3.0/array/dig', 'backports/2.3.0/hash/dig'],
110
- '2.3.0/array/dig' => ['backports/2.3.0/hash/dig', 'backports/2.3.0/struct/dig'],
111
- '2.3.0/hash/dig' => ['backports/2.3.0/array/dig', 'backports/2.3.0/struct/dig'],
112
- '2.3.0/struct/dig' => ['backports/2.3.0/array/dig', 'backports/2.3.0/hash/dig']
113
- )
114
- {
115
- :each_with_index => %w[enumerable/detect enumerable/find enumerable/find_all enumerable/select enumerable/to_a],
116
- :first => %w[enumerable/cycle io/bytes io/chars io/each_byte io/each_char io/lines io/each_line]
117
- }.each do |req, libs|
118
- libs.each{|l| DEPENDENCIES["1.8.7/#{l}"] = "backports/1.8.7/enumerable/#{req}" }
119
- end
120
-
121
- # These **old** specs cause actual errors while loading in 1.8:
122
- OLD_IGNORE_IN_18 = %w[
123
- 1.9.1/symbol/length
124
- 1.9.1/symbol/size
125
- 1.9.3/string/byteslice
126
- 1.8.7/proc/yield
127
- 1.9.1/proc/case_compare
128
- 2.4.0/string/match
129
- 2.4.0/regexp/match
130
- 2.5.0/module/define_method
131
- ]
132
- # These **new** specs cause actual errors while loading in 1.9:
133
- IGNORE_IN_19 = %w[
134
- 2.1.0/enumerable/to_h
135
- 2.1.0/array/to_h
136
- 2.1.0/module/include
137
- 2.2.0/kernel/itself
138
- 2.5.0/module/define_method
139
- 2.5.0/module/alias_method
140
- 2.5.0/module/undef_method
141
- 2.5.0/module/remove_method
142
- 2.5.0/module/attr
143
- 2.5.0/module/attr_reader
144
- 2.5.0/module/attr_writer
145
- 2.5.0/module/attr_accessor
146
- 2.5.0/struct/new
147
- ]
148
- # These **new** specs cause actual errors while loading in 2.0.0:
149
- IGNORE_IN_200 = %w[
150
- 2.4.0/enumerable/sum
151
- ]
152
-
153
- CLASS_MAP = Hash.new{|k, v| k[v] = v}.merge!(
154
- 'match_data' => 'matchdata', # don't ask me why RubySpec uses matchdata instead of match_data
155
- 'true_class' => 'true',
156
- 'false_class' => 'false',
157
- 'nil_class' => 'nil'
158
- )
159
-
160
- EXTRA_SPECS = {
161
- 'enumerable/chain' => %w[enumerator/chain/*]
162
- }
163
-
164
- def mspec_cmds(pattern, spec_folder, action='ci')
165
- pattern = "lib/backports/*.*.*/#{pattern}.rb"
166
- Dir.glob(pattern) do |lib_path|
167
- _match, version, path = lib_path.match(/backports\/(\d\.\d\.\d)\/(.*)\.rb/).to_a
168
- next if path =~ /stdlib/
169
- next if version <= RUBY_VERSION
170
- version_path = "#{version}/#{path}"
171
- if RUBY_VERSION < '2.0.0'
172
- next if OLD_IGNORE_IN_18.include? version_path if RUBY_VERSION < '1.9'
173
- next if IGNORE_IN_19.include? version_path
174
- next if spec_folder != 'frozen_old_spec' && version <= '2.0.0' # Don't run new specs for pre 2.0 features & ruby
175
- end
176
- next if RUBY_VERSION < '2.1.0' && IGNORE_IN_200.include?(version_path)
177
- deps = [*DEPENDENCIES[version_path]].map{|p| "-r #{p}"}.join(' ')
178
- klass, method = path.split('/')
179
- path = [CLASS_MAP[klass], method].join('/')
180
- spec_paths = [path, *EXTRA_SPECS[path]].map {|p| "#{spec_folder}/rubyspec/core/#{p}_spec.rb" }
181
- yield %W[mspec #{action}
182
- -I lib
183
- -r ./set_version/#{version}
184
- #{deps}
185
- -r backports/#{version_path}
186
- #{spec_paths.join(' ')}
187
- ].join(' '), path
188
- end
189
- end
data/default.mspec DELETED
@@ -1,14 +0,0 @@
1
- if (Backports::TARGET_VERSION rescue false) # Conf loaded at different times, not sure why
2
- class MSpecScript
3
- # The set of substitutions to transform a spec filename
4
- # into a tag filename.
5
- main_version = RUBY_VERSION
6
- unless File.exist?(File.expand_path("../lib/backports/#{main_version}.rb", __FILE__))
7
- main_version = main_version.sub(/\.\d+$/, '.0')
8
- end
9
-
10
- set :tags_patterns, [ [%r(rubyspec/), "tags/#{main_version}/"] ]
11
- end
12
-
13
- SpecGuard.ruby_version_override = Backports::TARGET_VERSION if Backports::TARGET_VERSION > RUBY_VERSION
14
- end
@@ -1,6 +0,0 @@
1
- fails:ARGF.each_line is a public method
2
- fails:ARGF.each_line requires multiple arguments
3
- fails:ARGF.each_line reads each line of files
4
- fails:ARGF.each_line returns self when passed a block
5
- fails:ARGF.each_line returns an Enumerator when passed no block
6
- fails:ARGF.each_line with a separator yields each separated section of all streams
@@ -1,6 +0,0 @@
1
- fails:ARGF.each is a public method
2
- fails:ARGF.each requires multiple arguments
3
- fails:ARGF.each reads each line of files
4
- fails:ARGF.each returns self when passed a block
5
- fails:ARGF.each returns an Enumerator when passed no block
6
- fails:ARGF.each with a separator yields each separated section of all streams
@@ -1,6 +0,0 @@
1
- fails:ARGF.lines is a public method
2
- fails:ARGF.lines requires multiple arguments
3
- fails:ARGF.lines reads each line of files
4
- fails:ARGF.lines returns self when passed a block
5
- fails:ARGF.lines returns an Enumerator when passed no block
6
- fails:ARGF.lines with a separator yields each separated section of all streams
@@ -1 +0,0 @@
1
- fails:Array#<< raises a RuntimeError on a frozen array
@@ -1,7 +0,0 @@
1
- fails:Array#collect returns an Enumerator when no block given
2
- fails:Array#collect does not copy untrusted status
3
- fails:Array#collect! keeps untrusted status
4
- fails:Array#collect! when frozen raises a RuntimeError
5
- fails:Array#collect! when frozen raises a RuntimeError when empty
6
- fails:Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator
7
- fails:Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator when empty
@@ -1,2 +0,0 @@
1
- fails:Array#rotate returns subclass instance for Array subclasses
2
- fails:Array#rotate! raises a RuntimeError on a frozen array
@@ -1,3 +0,0 @@
1
- fails:Array#uniq! raises a RuntimeError on a frozen array when the array is modified
2
- fails:Array#uniq! raises a RuntimeError on a frozen array when the array would not be modified
3
- fails:Array#uniq! doesn't yield to the block on a frozen array
@@ -1,3 +0,0 @@
1
- fails:Complex#to_r when the imaginary part is Fixnum 0 returns the result of sending #to_r to the real part
2
- fails:Complex#to_r when the imaginary part is Rational 0 returns the result of sending #to_r to the real part
3
- fails:Complex#to_r when the imaginary part responds to #== 0 with true returns the result of sending #to_r to the real part
@@ -1 +0,0 @@
1
- fails:Enumerable#all? with block gathers initial args as elements when each yields multiple
@@ -1,2 +0,0 @@
1
- fails:Enumerable#any? raises an ArgumentError when any arguments provided
2
- fails:Enumerable#any? with block gathers initial args as elements when each yields multiple
@@ -1 +0,0 @@
1
- fails:Enumerable#each_entry passes through the values yielded by #each_with_index
@@ -1 +0,0 @@
1
- fails:Enumerable#none? with a block gathers initial args as elements when each yields multiple
@@ -1 +0,0 @@
1
- fails:Enumerable#one? when passed a block gathers initial args as elements when each yields multiple
@@ -1 +0,0 @@
1
- fails:Enumerator#next is rewound after encountering a StopIteration