backports 3.22.1 → 3.23.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b09ae893ba2541ab9e4f564e480c01c7a435354b17a89d0b6e3bbdf33991037
4
- data.tar.gz: 02b726590557cc3a0ab3253afa6bec58926c96524faf7cfe801a16db57edcfb4
3
+ metadata.gz: 3ebf913e1cb86c25292dbf4106e69878788804f7d1e150ba7a41ea2743b4cce7
4
+ data.tar.gz: 5caf5e6bc8a92fd2ceff9eed115bdd504b3cac17478b56e798816744c17b5fab
5
5
  SHA512:
6
- metadata.gz: 81ea7ba57a26c62c7919a0e875593a58e7875c8aec8e408b93a13c12373a9d1a48dbebb2e4ec41b38028a8923d110c0813885772df014faa71fbed2f96a22a3c
7
- data.tar.gz: cb6a8e303724c7ecf9cf5b06907ff77e77dc8ac4a0cea8fa83f51785c85a24f1df650436e91e33af5ce79d3a9e8ea89396f90d6e053e73ca0e43f5db098fc375
6
+ metadata.gz: aac88ca171d07ddcb74fd4fa71cbca9fe82f69f1d8c763ccaa54cd8b2328bae08af481f0011937f98fb2c79ee4484e17ac1d606d42f0a424d5677b91f50935f6
7
+ data.tar.gz: a7a179a5c9e51e767180d822b7dd2976312a44221f7f2e33a00f682e9f28e747fa7d00c4d81541af9011bb4aba4b12025b6f7e6f2c4050a94608897995ee8248
data/CHANGELOG.md CHANGED
@@ -8,18 +8,58 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
8
8
 
9
9
  Note: [Next major version (X-mas 2021?)](https://github.com/marcandre/backports/issues/139) may drop support for Ruby < 2.2, please comment.
10
10
 
11
+ ## [3.23.0](https://github.com/marcandre/backports/compare/v3.22.1...v3.23.0) - 2021-12-28
12
+
13
+ ### Added
14
+
15
+ - `Integer.try_convert` (Ruby 3.1)
16
+ - `Symbol.end_with?` (Ruby 2.7) [#171]
17
+
18
+ ## [3.22.1](https://github.com/marcandre/backports/compare/v3.21.0...v3.22.1) - 2021-12-27
19
+
20
+ ### Added
21
+
22
+ Ruby 3.1 backports:
23
+
24
+ #### Array
25
+
26
+ - `intersect?`
27
+
28
+ #### Class
29
+
30
+ - `descendants`
31
+ - `subclasses`
32
+
33
+ #### Enumerable
34
+
35
+ - `compact`
36
+ - `tally` (with hash argument)
37
+
38
+ ### File
39
+
40
+ - `dirname` (with depth argument)
41
+
42
+ #### MatchData
43
+
44
+ - `match`
45
+ - `match_length`
46
+
47
+ #### Struct
48
+
49
+ - `keyword_init?`
50
+
11
51
  ## [3.21.0](https://github.com/marcandre/backports/compare/v3.20.1...v3.21.0) - 2021-03-31
12
52
 
13
53
  ### Added
14
54
 
15
- * Added `String#unpack1` (Ruby 2.4) [#166]
55
+ - Added `String#unpack1` (Ruby 2.4) [#166]
16
56
 
17
57
  ## [3.20.1](https://github.com/marcandre/backports/compare/v3.20.0...v3.20.1) - 2021-01-03
18
58
 
19
59
  ### Fixed
20
60
 
21
- * Added `Ractor.[]` and `[]=` [#161]
22
- * `Ractor.current` fixed from threads [#161]
61
+ - Added `Ractor.[]` and `[]=` [#161]
62
+ - `Ractor.current` fixed from threads [#161]
23
63
 
24
64
  ## [3.20.0](https://github.com/marcandre/backports/compare/v3.19.0...v3.20.0) - 2020-12-30
25
65
 
@@ -31,22 +71,24 @@ Ractor backport (all methods)
31
71
 
32
72
  ### Added
33
73
 
34
- * Ruby 3.0 backports
74
+ - Ruby 3.0 backports
75
+
76
+ - Env
77
+
78
+ - `except`
35
79
 
36
- * Env
37
- * `except`
80
+ - Hash
38
81
 
39
- * Hash
40
- * `except`
41
- * `transform_keys`, `transform_keys!` (with hash argument)
82
+ - `except`
83
+ - `transform_keys`, `transform_keys!` (with hash argument)
42
84
 
43
- * Symbol
44
- * `name`
85
+ - Symbol
86
+ - `name`
45
87
 
46
- * Ruby 2.3 backports
88
+ - Ruby 2.3 backports
47
89
 
48
- * Queue
49
- * `close`, `closed?` (affects `push`, `pop` and aliases)
90
+ - Queue
91
+ - `close`, `closed?` (affects `push`, `pop` and aliases)
50
92
 
51
93
  ## [3.18.2](https://github.com/marcandre/backports/compare/v3.18.0...v3.18.2) - 2020-08-26
52
94
 
@@ -82,10 +124,10 @@ Fix Range#size (Ruby 2.0) on Ruby 1.8.7 [#144]
82
124
 
83
125
  ### Added
84
126
 
85
- * Ruby 2.6 backports
127
+ - Ruby 2.6 backports
86
128
 
87
- * Range
88
- * `cover?` (with `Range` argument)
129
+ - Range
130
+ - `cover?` (with `Range` argument)
89
131
 
90
132
  ### Changed
91
133
 
@@ -107,148 +149,168 @@ Partly un-deprecated in 3.17.0!
107
149
 
108
150
  ### Added
109
151
 
110
- * Ruby 2.7 backports
152
+ - Ruby 2.7 backports
153
+
154
+ - Array
155
+
156
+ - `intersection`
111
157
 
112
- * Array
113
- * `intersection`
158
+ - Comparable
114
159
 
115
- * Comparable
116
- * `clamp` (with range)
160
+ - `clamp` (with range)
117
161
 
118
- * Complex
119
- * `<=>`
162
+ - Complex
120
163
 
121
- * Enumerable
122
- * `filter_map`
123
- * `tally`
164
+ - `<=>`
124
165
 
125
- * Enumerator
126
- * `produce` (class method)
166
+ - Enumerable
127
167
 
128
- * Time
129
- * `floor`, `ceil`
168
+ - `filter_map`
169
+ - `tally`
170
+
171
+ - Enumerator
172
+
173
+ - `produce` (class method)
174
+
175
+ - Time
176
+ - `floor`, `ceil`
130
177
 
131
178
  ## [3.15.0] - 2019-05-15
132
179
 
133
180
  ### Added
134
181
 
135
- * Proc / Method
136
- * `<<`, `>>`
182
+ - Proc / Method
183
+ - `<<`, `>>`
137
184
 
138
185
  ## 3.14.0 - 2019-04-29
139
186
 
140
187
  ### Added
141
188
 
142
- * Hash
143
- * `to_h` (with block)
189
+ - Hash
190
+ - `to_h` (with block)
144
191
 
145
192
  ## 3.13.0 - 2019-04-5
146
193
 
147
194
  ### Added
148
195
 
149
- * Hash
150
- * `merge`, `merge!`/`update` (with multiple arguments)
196
+ - Hash
197
+ - `merge`, `merge!`/`update` (with multiple arguments)
151
198
 
152
199
  ## 3.12.0 - 2019-02-20
153
200
 
154
201
  ### Added
155
202
 
156
- * Ruby 2.6.0 backports
157
- * Array
158
- * `difference`, `union`
159
- * `to_h` (with block)
203
+ - Ruby 2.6.0 backports
204
+
205
+ - Array
160
206
 
161
- * Enumerable
162
- * `chain`
163
- * `to_h` (with block)
207
+ - `difference`, `union`
208
+ - `to_h` (with block)
164
209
 
165
- * Enumerator::Chain (use Enumerable#chain)
166
- * Kernel
167
- * `then`
210
+ - Enumerable
168
211
 
169
- * Additional backports for 2.5.0:
170
- * String
171
- * `undump`
212
+ - `chain`
213
+ - `to_h` (with block)
214
+
215
+ - Enumerator::Chain (use Enumerable#chain)
216
+ - Kernel
217
+ - `then`
218
+
219
+ - Additional backports for 2.5.0:
220
+ - String
221
+ - `undump`
172
222
 
173
223
  ## 3.11.0 - 2017-12-25
174
224
 
175
225
  ### Added
176
226
 
177
- * Ruby version 2.5.0 backports
178
- * Array
179
- * `append`, `prepend`
227
+ - Ruby version 2.5.0 backports
228
+
229
+ - Array
230
+
231
+ - `append`, `prepend`
232
+
233
+ - Dir
234
+
235
+ - `children`, `each_child`
236
+
237
+ - Enumerable
238
+
239
+ - `any?`, `all?`, `none?`, `one?` (with pattern argument)
240
+
241
+ - Hash
180
242
 
181
- * Dir
182
- * `children`, `each_child`
243
+ - `slice`
244
+ - `transform_keys`
183
245
 
184
- * Enumerable
185
- * `any?`, `all?`, `none?`, `one?` (with pattern argument)
246
+ - Integer
186
247
 
187
- * Hash
188
- * `slice`
189
- * `transform_keys`
248
+ - `sqrt`
249
+ - `allbits?`, `anybits?` and `nobits?`
190
250
 
191
- * Integer
192
- * `sqrt`
193
- * `allbits?`, `anybits?` and `nobits?`
251
+ - Kernel
194
252
 
195
- * Kernel
196
- * `yield_self`
253
+ - `yield_self`
197
254
 
198
- * Module
199
- * `attr`, `attr_accessor`, `attr_reader`, `attr_writer` (now public)
200
- * `define_method`, `alias_method`, `undef_method`, `remove_method`
201
- (now public)
255
+ - Module
202
256
 
203
- * String
204
- * `delete_prefix`, `delete_prefix!`
205
- * `delete_suffix`, `delete_suffix!`
257
+ - `attr`, `attr_accessor`, `attr_reader`, `attr_writer` (now public)
258
+ - `define_method`, `alias_method`, `undef_method`, `remove_method`
259
+ (now public)
206
260
 
207
- * Struct
208
- * `new` (with `keyword_init: true`)
261
+ - String
209
262
 
210
- * `require 'backports/latest'` is now the way to require everything, but is
211
- discouraged
263
+ - `delete_prefix`, `delete_prefix!`
264
+ - `delete_suffix`, `delete_suffix!`
265
+
266
+ - Struct
267
+ - `new` (with `keyword_init: true`)
268
+
269
+ - `require 'backports/latest'` is now the way to require everything, but is
270
+ discouraged
212
271
 
213
272
  ## 3.10.0 - 2017-10-17
214
273
 
215
274
  ### Added
216
275
 
217
- * Additional features of 2.4.0
218
- * Enumerable
219
- * `uniq`
220
- * `sum`
276
+ - Additional features of 2.4.0
277
+
278
+ - Enumerable
221
279
 
222
- * Hash
223
- * `compact`
224
- * `transform_values`
280
+ - `uniq`
281
+ - `sum`
282
+
283
+ - Hash
284
+ - `compact`
285
+ - `transform_values`
225
286
 
226
287
  ## 3.9.0 - 2017-10-07
227
288
 
228
289
  ### Added
229
290
 
230
- * From 2.4.0: `dup` for `true`, `false`, `nil`, Numeric
231
- * From 2.2.0: `Method#super_method`
291
+ - From 2.4.0: `dup` for `true`, `false`, `nil`, Numeric
292
+ - From 2.2.0: `Method#super_method`
232
293
 
233
294
  ## 3.8.0 - 2017-04-26
234
295
 
235
296
  ### Added
236
297
 
237
- * From 2.4.0: `String#match?`, `Regexp#match?`
298
+ - From 2.4.0: `String#match?`, `Regexp#match?`
299
+
300
+ - From 2.3.0:
238
301
 
239
- * From 2.3.0:
240
- * unary `String#+`, `-`
241
- * Numeric: `positive?`, `negative?`
242
- * Hash: `to_proc`, `fetch_values`, `>`, `<`, `>=`, `<=`
243
- * Enumerable: `chunk_while`, `grep_v`
244
- * `{Array|Hash|Struct}#dig`
245
- * `Array#bsearch_index`
302
+ - unary `String#+`, `-`
303
+ - Numeric: `positive?`, `negative?`
304
+ - Hash: `to_proc`, `fetch_values`, `>`, `<`, `>=`, `<=`
305
+ - Enumerable: `chunk_while`, `grep_v`
306
+ - `{Array|Hash|Struct}#dig`
307
+ - `Array#bsearch_index`
246
308
 
247
- * From 2.2.0:
248
- * `Method#curry`
249
- * `String#unicode_normalize{|?|!}`
250
- * `Kernel#itself`
251
- * Float: `next_float`, `prev_float`
309
+ - From 2.2.0:
310
+ - `Method#curry`
311
+ - `String#unicode_normalize{|?|!}`
312
+ - `Kernel#itself`
313
+ - Float: `next_float`, `prev_float`
252
314
 
253
315
  ## 3.7.0 - 2017-03-28
254
316
 
@@ -256,146 +318,150 @@ Initiate work on backports of 2.2, 2.3, 2.4
256
318
 
257
319
  ### Added
258
320
 
259
- * From 2.4.0:
260
- * `Comparable#clamp`
321
+ - From 2.4.0:
261
322
 
262
- * From 2.2.0:
263
- * Enumerable: `slice_when`, `slice_after`
323
+ - `Comparable#clamp`
324
+
325
+ - From 2.2.0:
326
+ - Enumerable: `slice_when`, `slice_after`
264
327
 
265
328
  ## 3.6.0 - 2014-02-14
266
329
 
267
330
  ### Added
268
331
 
269
- * Additional features of 2.1.0
270
- * Bignum#bit_length
271
- * Fixnum#bit_length
272
- * Module#include (now public)
332
+ - Additional features of 2.1.0
333
+ - Bignum#bit_length
334
+ - Fixnum#bit_length
335
+ - Module#include (now public)
273
336
 
274
337
  ## 3.5.0 - 2014-02-3
275
338
 
276
339
  ### Added
277
340
 
278
- * Additional features of 2.0.0
279
- * Range#size
341
+ - Additional features of 2.0.0
342
+ - Range#size
280
343
 
281
344
  ## 3.4.0 - 2013-12-29
282
345
 
283
346
  ### Added
284
347
 
285
- * Additional features of 2.1.0
286
- * Array#to_h, Enumerable#to_h
348
+ - Additional features of 2.1.0
349
+ - Array#to_h, Enumerable#to_h
287
350
 
288
351
  ## 3.3.0 - 2013-04-03
289
352
 
290
353
  ### Fixed
291
354
 
292
- * Moved `Proc#yield` & `Hash#key` from 1.8.7 to 1.9.1
355
+ - Moved `Proc#yield` & `Hash#key` from 1.8.7 to 1.9.1
293
356
 
294
357
  ## 3.2.0 - 2013-04-02
295
358
 
296
359
  ### Fixed
297
360
 
298
- * Moved `Dir.mktmpdir` to the stdlib 'tmpdir' for Ruby 1.8.7
361
+ - Moved `Dir.mktmpdir` to the stdlib 'tmpdir' for Ruby 1.8.7
299
362
 
300
363
  ### Removed
301
364
 
302
- * Removed `returning` as it is no longer part of Rails.
365
+ - Removed `returning` as it is no longer part of Rails.
303
366
 
304
367
  ## 3.1.0 - 2013-03-05
305
368
 
306
369
  ### Added
307
370
 
308
- * Backports can now be loaded separately!
371
+ - Backports can now be loaded separately!
309
372
 
310
373
  ### Fixed
311
374
 
312
- * Small tweaks and fixes for many methods to pass more RubySpecs
375
+ - Small tweaks and fixes for many methods to pass more RubySpecs
313
376
 
314
377
  ## 3.0.0 - 2013-02-24
315
378
 
316
379
  ### Added
317
380
 
318
- * Additional features of 2.0.0
319
- * Struct#to_h, NilClass#to_h, Hash#to_h
320
- * Hash#default_proc = nil
321
- * OpenStruct lib
381
+ - Additional features of 2.0.0
382
+
383
+ - Struct#to_h, NilClass#to_h, Hash#to_h
384
+ - Hash#default_proc = nil
385
+ - OpenStruct lib
322
386
 
323
- * 1.8.7's Enumerator#with_index (it wasn't in the 1.8.7 NEWS file...)
387
+ - 1.8.7's Enumerator#with_index (it wasn't in the 1.8.7 NEWS file...)
324
388
 
325
389
  ## 2.8.0 - 2013-02-3
326
390
 
327
391
  ### Added
328
392
 
329
- * Added some features of 2.0.0 (must be required explicitly until official
330
- release):
331
- * Array#bsearch
332
- * Range#bsearch
393
+ - Added some features of 2.0.0 (must be required explicitly until official
394
+ release):
395
+ - Array#bsearch
396
+ - Range#bsearch
333
397
 
334
398
  ## 2.7.0 - 2013-01-14
335
399
 
336
400
  ### Added
337
401
 
338
- * Features of 2.0.0 (must be required explicitly until official
339
- release):
340
- * Enumerable#lazy
341
- * Enumerator::Lazy
402
+ - Features of 2.0.0 (must be required explicitly until official
403
+ release):
404
+ - Enumerable#lazy
405
+ - Enumerator::Lazy
342
406
 
343
407
  ## 2.6.0 - 2012-05-29
344
408
 
345
409
  ### Removed
346
410
 
347
- * Enumerable#join
411
+ - Enumerable#join
348
412
 
349
413
  ## 2.5.0 - 2012-02-25
350
414
 
351
415
  ### Added
352
416
 
353
- * Some features of 1.9.3:
354
- * IO::NULL
355
- * IO#advise
356
- * String#byteslice
357
- * String#prepend
417
+ - Some features of 1.9.3:
418
+ - IO::NULL
419
+ - IO#advise
420
+ - String#byteslice
421
+ - String#prepend
358
422
 
359
423
  ## 2.4.0 - 2012-02-24
360
424
 
361
425
  ### Added
362
426
 
363
- * Add backporting for libraries
427
+ - Add backporting for libraries
428
+
429
+ - Bring libraries up to date:
430
+
431
+ - Matrix
432
+ - Prime
433
+ - Set
364
434
 
365
- * Bring libraries up to date:
366
- * Matrix
367
- * Prime
368
- * Set
435
+ - Some features of 1.9.3:
369
436
 
370
- * Some features of 1.9.3:
371
- * IO.write, IO.binwrite
437
+ - IO.write, IO.binwrite
372
438
 
373
- * Forcing backports (must be required explicitly):
374
- * Hash#select (returns a Hash instead of an Array)
375
- * Enumerable / Array#map (returns an enumerator when called without a
376
- block)
377
- * String#length, size (for UTF-8 support)
439
+ - Forcing backports (must be required explicitly):
440
+ - Hash#select (returns a Hash instead of an Array)
441
+ - Enumerable / Array#map (returns an enumerator when called without a
442
+ block)
443
+ - String#length, size (for UTF-8 support)
378
444
 
379
445
  ## 2.3.0 - 2011-05-13
380
446
 
381
447
  ### Added
382
448
 
383
- * `Enumerator::Yielder#<<`
449
+ - `Enumerator::Yielder#<<`
384
450
 
385
451
  ## 2.2.0 - 2011-05-13
386
452
 
387
453
  ### Fixed
388
454
 
389
- * Ruby 1.8.8 was officially cancelled; code was moved to Ruby 1.9.1 and
390
- README updated.
455
+ - Ruby 1.8.8 was officially cancelled; code was moved to Ruby 1.9.1 and
456
+ README updated.
391
457
 
392
- * `"".ord` now raises an error.
458
+ - `"".ord` now raises an error.
393
459
 
394
460
  ## 2.1.0 - 2011-04-16
395
461
 
396
462
  ### Added
397
463
 
398
- * Proc#curry, #lambda (thanks Konstantine Haase)
464
+ - Proc#curry, #lambda (thanks Konstantine Haase)
399
465
 
400
466
  ## 2.0.0 - 2010-12-5
401
467
 
@@ -404,123 +470,123 @@ Initiate work on backports of 2.2, 2.3, 2.4
404
470
  Change of major version because of two small changes that are not quite
405
471
  compatible and because the minor version was getting quite high!
406
472
 
407
- * Remove attempt at faking the new method missing. Unless you used
408
- `respond_to_missing` **and**
409
- `method(:some_method_handled_with_method_missing)`, you won't see a
410
- difference, except better performance (see issue #32) and this fixes some
411
- errors (see issue #34)
473
+ - Remove attempt at faking the new method missing. Unless you used
474
+ `respond_to_missing` **and**
475
+ `method(:some_method_handled_with_method_missing)`, you won't see a
476
+ difference, except better performance (see issue #32) and this fixes some
477
+ errors (see issue #34)
412
478
 
413
- * Change behavior of array.flatten(0) to match Ruby 1.9 (i.e. return a dup
414
- of array, instead of array itself)
479
+ - Change behavior of array.flatten(0) to match Ruby 1.9 (i.e. return a dup
480
+ of array, instead of array itself)
415
481
 
416
482
  ## 1.18.0 - 2010-06-19
417
483
 
418
484
  ### Added
419
485
 
420
- * Some features of 1.9.1:
486
+ - Some features of 1.9.1:
421
487
 
422
- * Math#log2, Math#log with base
488
+ - Math#log2, Math#log with base
423
489
 
424
490
  ### Fixed
425
491
 
426
- * Enumerator#each in 1.8.6.
492
+ - Enumerator#each in 1.8.6.
427
493
 
428
494
  ## 1.17.0 - 2010-05-17
429
495
 
430
496
  ### Added
431
497
 
432
- * Some features of 1.9.2:
498
+ - Some features of 1.9.2:
433
499
 
434
- * Array#repeated_combination, #repeated_permutation
500
+ - Array#repeated_combination, #repeated_permutation
435
501
 
436
502
  ## 1.16.2 - 2010-04-11
437
503
 
438
504
  ### Added
439
505
 
440
- * Some features of 1.9.2:
506
+ - Some features of 1.9.2:
441
507
 
442
- * Array#uniq, #uniq! (with block)
443
- * Array#product (with block)
444
- * Dir.home
445
- * Hash#keep_if, select!
446
- * Random (new class)
508
+ - Array#uniq, #uniq! (with block)
509
+ - Array#product (with block)
510
+ - Dir.home
511
+ - Hash#keep_if, select!
512
+ - Random (new class)
447
513
 
448
514
  ## 1.15.0 - 2010-02-23
449
515
 
450
516
  ### Added
451
517
 
452
- * A features of 1.9.2:
518
+ - A features of 1.9.2:
453
519
 
454
- * Object#singleton_class
520
+ - Object#singleton_class
455
521
 
456
522
  ## 1.14.0 - 2010-02-3
457
523
 
458
524
  ### Added
459
525
 
460
- * Some features of 1.9.2:
526
+ - Some features of 1.9.2:
461
527
 
462
- * Array#rotate, rotate!
463
- * Array#keep_if, select!
464
- * Array#sort_by!
465
- * Enumerable#join
466
- * Enumerable#slice_before
467
- * Float::INFINITY, NAN
468
- * MatchData#==
528
+ - Array#rotate, rotate!
529
+ - Array#keep_if, select!
530
+ - Array#sort_by!
531
+ - Enumerable#join
532
+ - Enumerable#slice_before
533
+ - Float::INFINITY, NAN
534
+ - MatchData#==
469
535
 
470
536
  ## 1.13.0 - 2010-01-20
471
537
 
472
538
  ### Added
473
539
 
474
- * Missing for 1.8.7 were
475
- * Array#permutation
476
- * Hash#hash (was only inherited)
477
- * Hash#eql? (was only inherited)
540
+ - Missing for 1.8.7 were
541
+ - Array#permutation
542
+ - Hash#hash (was only inherited)
543
+ - Hash#eql? (was only inherited)
478
544
 
479
545
  ## 1.12.0 - 2009-12-4
480
546
 
481
547
  ### Added
482
548
 
483
- * Finer grain includes (see README) require "backports/1.9" # requires
484
- all ruby backports require "backports/1.9.1" # requires all ruby
485
- backports up to 1.9.1 (but not 1.9.2)
549
+ - Finer grain includes (see README) require "backports/1.9" # requires
550
+ all ruby backports require "backports/1.9.1" # requires all ruby
551
+ backports up to 1.9.1 (but not 1.9.2)
486
552
 
487
- * Backported all builtin methods of 1.8.8 (most of which where moved from
488
- the 1.9 backports)
553
+ - Backported all builtin methods of 1.8.8 (most of which where moved from
554
+ the 1.9 backports)
489
555
 
490
- * Refreshed README
556
+ - Refreshed README
491
557
 
492
558
  ## 1.11.0 - 2009-11-04
493
559
 
494
560
  ### Added
495
561
 
496
- * Enumerable#flat_map / collect_concat (Ruby 1.9)
562
+ - Enumerable#flat_map / collect_concat (Ruby 1.9)
497
563
 
498
- * Object#public_send (Ruby 1.9)
564
+ - Object#public_send (Ruby 1.9)
499
565
 
500
- * Object#public_method (Ruby 1.9)
566
+ - Object#public_method (Ruby 1.9)
501
567
 
502
568
  ## 1.10.0 - 2009-09-29
503
569
 
504
570
  ### Added
505
571
 
506
- * Enumerable#chunk (Ruby 1.9)
572
+ - Enumerable#chunk (Ruby 1.9)
507
573
 
508
- * Kernel#respond_to_missing? (Ruby 1.9)
574
+ - Kernel#respond_to_missing? (Ruby 1.9)
509
575
 
510
- * Completed Process.exec (Ruby 1.8.7)
576
+ - Completed Process.exec (Ruby 1.8.7)
511
577
 
512
578
  ## 1.9.0 - 2009-09-04
513
579
 
514
580
  ### Added
515
581
 
516
- * In Ruby 1.9, most class methods of File accept filenames as String, or
517
- convertible via #to_str or #to_path.
582
+ - In Ruby 1.9, most class methods of File accept filenames as String, or
583
+ convertible via #to_str or #to_path.
518
584
 
519
- * File#to_path is also an alias to File#path. These have been backported.
585
+ - File#to_path is also an alias to File#path. These have been backported.
520
586
 
521
- * File.binread (actually IO.binread)
587
+ - File.binread (actually IO.binread)
522
588
 
523
- * BasicObject available via "require 'backports/basic_object"
589
+ - BasicObject available via "require 'backports/basic_object"
524
590
 
525
591
  ## 1.8.4 - 2009-09-03
526
592
 
@@ -539,9 +605,10 @@ The alias String#lines (Ruby 1.8.7)
539
605
  ### Added
540
606
 
541
607
  Backports can be required selectively:
542
- * backports/1.8.7
543
- * backports/1.9 (which include 1.8.7)
544
- * rails
608
+
609
+ - backports/1.8.7
610
+ - backports/1.9 (which include 1.8.7)
611
+ - rails
545
612
 
546
613
  ## 1.7.1 - 2009-08-20
547
614
 
@@ -576,128 +643,149 @@ it.
576
643
 
577
644
  Completed backport to 1.8.7.
578
645
 
579
- * Array
580
- * `extract_options!`
646
+ - Array
647
+
648
+ - `extract_options!`
649
+
650
+ - Binding
651
+
652
+ - `eval`
653
+
654
+ - Dir
655
+
656
+ - `each`, `foreach`
657
+
658
+ - Enumerator
659
+
660
+ - `new`
661
+ - `with_object`
662
+ - `next`, `rewind`
663
+
664
+ - Hash
581
665
 
582
- * Binding
583
- * `eval`
666
+ - Optional block for `delete_if, each, each_key, each_pair, each_value, reject!, select` (and ENV)
584
667
 
585
- * Dir
586
- * `each`, `foreach`
668
+ - Integer
587
669
 
588
- * Enumerator
589
- * `new`
590
- * `with_object`
591
- * `next`, `rewind`
670
+ - moved stuff out of Fixnum
671
+ - Optional block for `downto`, `times`, `upto`
592
672
 
593
- * Hash
594
- * Optional block for `delete_if, each, each_key, each_pair, each_value,
595
- reject!, select` (and ENV)
673
+ - IO
596
674
 
597
- * Integer
598
- * moved stuff out of Fixnum
599
- * Optional block for `downto`, `times`, `upto`
675
+ - Optional block for `each`, `each_line`, `each_byte`, `foreach` (and
676
+ ARGF)
600
677
 
601
- * IO
602
- * Optional block for `each`, `each_line`, `each_byte`, `foreach` (and
603
- ARGF)
678
+ - Kernel
604
679
 
605
- * Kernel
606
- * `loop`, `StopIteration`
607
- * +__method__+, +__callee__+
680
+ - `loop`, `StopIteration`
681
+ - +**method**+, +**callee**+
608
682
 
609
- * Method
610
- * `name`, `owner`, `receiver`
683
+ - Method
611
684
 
612
- * Module
613
- * `class_exec`, `module_exec`
685
+ - `name`, `owner`, `receiver`
614
686
 
615
- * Numeric
616
- * `step`
687
+ - Module
617
688
 
618
- * Object
619
- * `define_singleton_method`
620
- * `instance_exec`
689
+ - `class_exec`, `module_exec`
621
690
 
622
- * ObjectSpace
623
- * `each_object`
691
+ - Numeric
624
692
 
625
- * Range
626
- * Optional block for `each`, `step`
693
+ - `step`
627
694
 
628
- * Regexp
629
- * `union`
695
+ - Object
630
696
 
631
- * String
632
- * `try_convert`
633
- * `ascii_only?`
634
- * `bytesize`
635
- * `chr`
636
- * `clear`
637
- * `codepoints`, `each_codepoint`
638
- * `stringify_keys`, `stringify_keys!`
639
- * `each`, `each_line`, `each_byte`
640
- * `gsub`
641
- * `upto`
697
+ - `define_singleton_method`
698
+ - `instance_exec`
642
699
 
643
- * Struct
644
- * `each`, `each_pair`
700
+ - ObjectSpace
645
701
 
646
- * Symbol
647
- * `<=>`, `casecmp`
648
- * `capitalize`, `downcase`, `next`, `succ`, `swapcase`, `upcase`
649
- * `=~, [], empty?, length, match, size`
702
+ - `each_object`
650
703
 
651
- * UnboundMethod
652
- * `name`, `owner`
704
+ - Range
705
+
706
+ - Optional block for `each`, `step`
707
+
708
+ - Regexp
709
+
710
+ - `union`
711
+
712
+ - String
713
+
714
+ - `try_convert`
715
+ - `ascii_only?`
716
+ - `bytesize`
717
+ - `chr`
718
+ - `clear`
719
+ - `codepoints`, `each_codepoint`
720
+ - `stringify_keys`, `stringify_keys!`
721
+ - `each`, `each_line`, `each_byte`
722
+ - `gsub`
723
+ - `upto`
724
+
725
+ - Struct
726
+
727
+ - `each`, `each_pair`
728
+
729
+ - Symbol
730
+
731
+ - `<=>`, `casecmp`
732
+ - `capitalize`, `downcase`, `next`, `succ`, `swapcase`, `upcase`
733
+ - `=~, [], empty?, length, match, size`
734
+
735
+ - UnboundMethod
736
+ - `name`, `owner`
653
737
 
654
738
  ## 1.5.0 - 2009-04-24
655
739
 
656
740
  ### Added
657
741
 
658
- * Array (completed)
659
- * `combination`
660
- * `try_convert`
661
- * Optional block for `collect!, :map!, :each, :each_index, :reject,
662
- :reject!, :delete_if`
663
- * `pop`, `shift`
664
- * `product`
742
+ - Array (completed)
743
+
744
+ - `combination`
745
+ - `try_convert`
746
+ - Optional block for `collect!, :map!, :each, :each_index, :reject, :reject!, :delete_if`
747
+ - `pop`, `shift`
748
+ - `product`
749
+
750
+ - Fixnum (completed)
665
751
 
666
- * Fixnum (completed)
667
- * `div`, `fdiv`
668
- * `succ`
669
- * `magnitude`
752
+ - `div`, `fdiv`
753
+ - `succ`
754
+ - `magnitude`
670
755
 
671
- * Enumerable (completed)
672
- * `each_with_object`
673
- * `inject`
674
- * `max_by`, `min_by`, `minmax`, `minmax_by`
675
- * `reduce`
676
- * `to_a`
756
+ - Enumerable (completed)
757
+ - `each_with_object`
758
+ - `inject`
759
+ - `max_by`, `min_by`, `minmax`, `minmax_by`
760
+ - `reduce`
761
+ - `to_a`
677
762
 
678
763
  ## 1.4.0 - 2009-04-21
679
764
 
680
765
  ### Added
681
766
 
682
- * String
683
- * `rpartition`
767
+ - String
684
768
 
685
- * Proc
686
- * `yield`
769
+ - `rpartition`
770
+
771
+ - Proc
772
+ - `yield`
687
773
 
688
774
  ## 1.3.0 - 2009-04-17
689
775
 
690
776
  ### Added
691
777
 
692
- * Enumerable
693
- * `none?`
778
+ - Enumerable
779
+
780
+ - `none?`
694
781
 
695
- * Array
696
- * `sample`, `shuffle`, `shuffle!`
782
+ - Array
697
783
 
698
- * String
699
- * `each_char`, `chars`
700
- * `partition`
784
+ - `sample`, `shuffle`, `shuffle!`
785
+
786
+ - String
787
+ - `each_char`, `chars`
788
+ - `partition`
701
789
 
702
790
  Tests and fixes for `String#start_with?` and `String#end_with?`
703
791
 
@@ -705,39 +793,42 @@ Tests and fixes for `String#start_with?` and `String#end_with?`
705
793
 
706
794
  ### Added
707
795
 
708
- * Array
709
- * `reverse_each`
710
- * `cycle`
796
+ - Array
797
+
798
+ - `reverse_each`
799
+ - `cycle`
711
800
 
712
- * Enumerable
713
- * `reverse_each`
714
- * `each_slice`, `each_cons`
715
- * `count`
716
- * `cycle`
717
- * `group_by`
801
+ - Enumerable
718
802
 
719
- * Hash
720
- * `default_proc=`
803
+ - `reverse_each`
804
+ - `each_slice`, `each_cons`
805
+ - `count`
806
+ - `cycle`
807
+ - `group_by`
808
+
809
+ - Hash
810
+ - `default_proc=`
721
811
 
722
812
  ## 1.1.0 - 2009-04-11
723
813
 
724
814
  ### Added
725
815
 
726
- * Array
727
- * `flatten`, `flatten!`
728
- * `find_index`, `index`
816
+ - Array
817
+
818
+ - `flatten`, `flatten!`
819
+ - `find_index`, `index`
729
820
 
730
- * Hash
731
- * `reverse_merge`, `reverse_merge!`
821
+ - Hash
822
+ - `reverse_merge`, `reverse_merge!`
732
823
 
733
824
  ## 1.0.0 - 2009-04-2
734
825
 
735
- * Initial release.
826
+ - Initial release.
736
827
 
737
828
  ## Notes
738
829
 
739
830
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
740
831
 
741
- [Unreleased]: https://github.com/marcandre/backports/compare/v3.16.0...HEAD
832
+ [unreleased]: https://github.com/marcandre/backports/compare/v3.16.0...HEAD
742
833
  [3.16.0]: https://github.com/marcandre/backports/compare/v3.15.0...v3.16.0
743
834
  [3.15.0]: https://github.com/marcandre/backports/compare/v3.14.0...v3.15.0
data/README.md CHANGED
@@ -129,6 +129,10 @@ itself, JRuby and Rubinius.
129
129
 
130
130
  - `dirname` (with depth argument)
131
131
 
132
+ #### Integer
133
+
134
+ - `try_convert`
135
+
132
136
  #### MatchData
133
137
 
134
138
  - `match`
@@ -183,6 +187,9 @@ itself, JRuby and Rubinius.
183
187
 
184
188
  - `produce` (class method)
185
189
 
190
+ #### Symbol
191
+ - `end_with?`
192
+
186
193
  #### Time
187
194
 
188
195
  - `floor`, `ceil`
@@ -0,0 +1,9 @@
1
+ require 'backports/1.8.7/string/end_with' unless String.method_defined? :end_with?
2
+
3
+ unless Symbol.method_defined?(:end_with?)
4
+ class Symbol
5
+ def end_with?(*suffixes)
6
+ to_s.end_with?(*suffixes)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ require 'backports/tools/require_relative_dir'
2
+
3
+ Backports.require_relative_dir
@@ -1,11 +1,21 @@
1
1
  unless Symbol.method_defined? :name
2
- def Backports.symbol_names
3
- @symbol_names ||= ObjectSpace::WeakMap.new
4
- end
2
+ if ((ObjectSpace::WeakMap.new[:test] = :test) rescue false)
3
+ # WeakMaps accept symbols only in Ruby 2.7+
4
+ def Backports.symbol_names
5
+ @symbol_names ||= ObjectSpace::WeakMap.new
6
+ end
5
7
 
6
- class Symbol
7
- def name
8
- Backports.symbol_names[self] ||= to_s.freeze
8
+ class Symbol
9
+ def name
10
+ Backports.symbol_names[self] ||= to_s.freeze
11
+ end
12
+ end
13
+ else
14
+ # For earlier Rubies, we can't pool their strings
15
+ class Symbol
16
+ def name
17
+ to_s.freeze
18
+ end
9
19
  end
10
20
  end
11
21
  end
@@ -0,0 +1,7 @@
1
+ class Integer
2
+ require 'backports/tools/arguments'
3
+
4
+ def self.try_convert(obj)
5
+ ::Backports.try_convert(obj, ::Integer, :to_int)
6
+ end
7
+ end unless Integer.respond_to? :try_convert
@@ -0,0 +1,3 @@
1
+ require 'backports/tools/require_relative_dir'
2
+
3
+ Backports.require_relative_dir
@@ -1,3 +1,3 @@
1
1
  module Backports
2
- VERSION = "3.22.1" unless Backports.constants.include? :VERSION # the guard is against a redefinition warning that happens on Travis
2
+ VERSION = "3.23.0" unless Backports.constants.include? :VERSION # the guard is against a redefinition warning that happens on Travis
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backports
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.22.1
4
+ version: 3.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Lafortune
@@ -531,6 +531,8 @@ files:
531
531
  - lib/backports/2.7.0/enumerable/tally.rb
532
532
  - lib/backports/2.7.0/enumerator.rb
533
533
  - lib/backports/2.7.0/enumerator/produce.rb
534
+ - lib/backports/2.7.0/symbol.rb
535
+ - lib/backports/2.7.0/symbol/end_with.rb
534
536
  - lib/backports/2.7.0/time/ceil.rb
535
537
  - lib/backports/2.7.0/time/floor.rb
536
538
  - lib/backports/2.7.rb
@@ -555,6 +557,8 @@ files:
555
557
  - lib/backports/3.1.0/enumerable/tally.rb
556
558
  - lib/backports/3.1.0/file.rb
557
559
  - lib/backports/3.1.0/file/dirname.rb
560
+ - lib/backports/3.1.0/integer.rb
561
+ - lib/backports/3.1.0/integer/try_convert.rb
558
562
  - lib/backports/3.1.0/match_data.rb
559
563
  - lib/backports/3.1.0/match_data/match.rb
560
564
  - lib/backports/3.1.0/match_data/match_length.rb
@@ -623,7 +627,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
623
627
  - !ruby/object:Gem::Version
624
628
  version: '0'
625
629
  requirements: []
626
- rubygems_version: 3.1.4
630
+ rubygems_version: 3.3.3
627
631
  signing_key:
628
632
  specification_version: 4
629
633
  summary: Backports of Ruby features for older Ruby.