backports 3.17.0 → 3.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +244 -244
- data/lib/backports/2.0.0/range/size.rb +2 -0
- data/lib/backports/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96610f4ef4df388ed73a054e17beb5e0b18303f27a0ca81dc8f7b25bf2cbe5e2
|
4
|
+
data.tar.gz: bc295cdd8cea47ab32ade680a343989f47c6970d869d37d49ff99457378d7e58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d0c16a92ba629fb6db4894605fd73c78386f639ce7b2bb4ca09d9b2581313662df0633c69a8cd9a7faab9972eb7e6bd7dbc38946f96aa5a4d4b41570f75cd54
|
7
|
+
data.tar.gz: 5497f4f75e11ef12cf1880ccdd18c37e5d81ebee5ad437edd28b2b27b1c4860d670473662842f7a76caaa32bf43a241e0532c724ce96797f90f0bb1e01447187
|
data/CHANGELOG.md
CHANGED
@@ -8,7 +8,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
8
8
|
|
9
9
|
Note: [Next major version (X-mas 2020)](https://github.com/marcandre/backports/issues/139) will drop support for Ruby < 2.2.
|
10
10
|
|
11
|
-
## [3.17.
|
11
|
+
## [3.17.1](https://github.com/marcandre/backports/compare/v3.17.0...v3.17.1) - 2020-04-09
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
|
15
|
+
Fix Range#size (Ruby 2.0) on Ruby 1.8.7 [#144]
|
16
|
+
|
17
|
+
## [3.17.0](https://github.com/marcandre/backports/compare/v3.16.2...v3.17.0) - 2020-03-06
|
12
18
|
|
13
19
|
### Added
|
14
20
|
|
data/README.md
CHANGED
@@ -65,14 +65,14 @@ Goals for backported features:
|
|
65
65
|
Let's be a bit more precise about the "breaking code" business. It is of
|
66
66
|
course entirely possible that code will break. In particular, you may be
|
67
67
|
distinguishing parameters with duck typing, but a builtin class may, in the
|
68
|
-
future, be responding to a particular call. Here's
|
69
|
-
Rails}(https://github.com/rails/rails/blob/a4b55827721a5967299f3c1531afb3d6d81
|
70
|
-
e4ac0/activerecord/lib/active_record/associations/association.rb#L155-L159)
|
68
|
+
future, be responding to a particular call. Here's [an example from Rails][]
|
71
69
|
that is relying on the fact that Proc and Method respond to :to_proc and Hash
|
72
70
|
isn't. That is, until Ruby 2.3... This old version of Rails therefore won't
|
73
71
|
work on Ruby 2.3, or on older Rubies with that the `2.3.0/hash/to_proc`
|
74
72
|
loaded...
|
75
73
|
|
74
|
+
[an example from rails]: https://github.com/rails/rails/blob/a4b55827721a5967299f3c1531afb3d6d81e4ac0/activerecord/lib/active_record/associations/association.rb#L155-L159
|
75
|
+
|
76
76
|
For Ruby < 2.0, there are some real incompatibilities. For example,
|
77
77
|
`Module::instance_methods` which returns strings in 1.8 and symbols in 1.9. No
|
78
78
|
change can be made without the risk of breaking existing code. Such
|
@@ -111,242 +111,242 @@ itself, JRuby and Rubinius.
|
|
111
111
|
|
112
112
|
## Ruby 2.7 backports
|
113
113
|
|
114
|
-
|
115
|
-
|
114
|
+
#### Array
|
115
|
+
- `intersection`
|
116
116
|
|
117
|
-
|
118
|
-
|
117
|
+
#### Comparable
|
118
|
+
- `clamp` (with range)
|
119
119
|
|
120
|
-
|
121
|
-
|
120
|
+
#### Complex
|
121
|
+
- +<=>+
|
122
122
|
|
123
|
-
|
124
|
-
|
125
|
-
|
123
|
+
#### Enumerable
|
124
|
+
- `filter_map`
|
125
|
+
- `tally`
|
126
126
|
|
127
|
-
|
128
|
-
|
127
|
+
#### Enumerator
|
128
|
+
- `produce` (class method)
|
129
129
|
|
130
|
-
|
131
|
-
|
130
|
+
#### Time
|
131
|
+
- `floor`, `ceil`
|
132
132
|
|
133
133
|
## Ruby 2.6 backports
|
134
134
|
|
135
|
-
|
136
|
-
|
137
|
-
|
135
|
+
#### Array
|
136
|
+
- `difference`, `union`
|
137
|
+
- `to_h` (with block)
|
138
138
|
|
139
|
-
|
140
|
-
|
141
|
-
|
139
|
+
#### Enumerable
|
140
|
+
- `chain`
|
141
|
+
- `to_h` (with block)
|
142
142
|
|
143
|
-
|
143
|
+
#### Enumerator::Chain (use Enumerable#chain)
|
144
144
|
|
145
|
-
|
146
|
-
|
147
|
-
|
145
|
+
#### Hash
|
146
|
+
- `merge`, `merge!`/`update` (with multiple arguments)
|
147
|
+
- `to_h` (with block)
|
148
148
|
|
149
|
-
|
150
|
-
|
149
|
+
#### Kernel
|
150
|
+
- `then`
|
151
151
|
|
152
|
-
|
153
|
-
|
152
|
+
#### Method
|
153
|
+
- +<<+, +>>+
|
154
154
|
|
155
|
-
|
156
|
-
|
155
|
+
#### Proc
|
156
|
+
- +<<+, +>>+
|
157
157
|
|
158
|
-
|
159
|
-
|
158
|
+
#### Range
|
159
|
+
- `cover?` (with `Range` argument)
|
160
160
|
|
161
161
|
## Ruby 2.5 backports
|
162
162
|
|
163
|
-
|
164
|
-
|
163
|
+
#### Array
|
164
|
+
- `append`, `prepend`
|
165
165
|
|
166
|
-
|
167
|
-
|
166
|
+
#### Dir
|
167
|
+
- `children`, `each_child`
|
168
168
|
|
169
|
-
|
170
|
-
|
169
|
+
#### Enumerable
|
170
|
+
- `any?`, `all?`, `none?`, `one?` (with pattern argument)
|
171
171
|
|
172
|
-
|
173
|
-
|
174
|
-
|
172
|
+
#### Hash
|
173
|
+
- `slice`
|
174
|
+
- `transform_keys`
|
175
175
|
|
176
|
-
|
177
|
-
|
178
|
-
|
176
|
+
#### Integer
|
177
|
+
- `sqrt`
|
178
|
+
- `allbits?`, `anybits?` and `nobits?`
|
179
179
|
|
180
|
-
|
181
|
-
|
180
|
+
#### Kernel
|
181
|
+
- `yield_self`
|
182
182
|
|
183
|
-
|
184
|
-
|
185
|
-
|
183
|
+
#### Module
|
184
|
+
- `attr`, `attr_accessor`, `attr_reader`, `attr_writer` (now public)
|
185
|
+
- `define_method`, `alias_method`, `undef_method`, `remove_method` (now
|
186
186
|
public)
|
187
187
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
188
|
+
#### String
|
189
|
+
- `delete_prefix`, `delete_prefix!`
|
190
|
+
- `delete_suffix`, `delete_suffix!`
|
191
|
+
- `undump`
|
192
192
|
|
193
|
-
|
194
|
-
|
193
|
+
#### Struct
|
194
|
+
- `new` (with `keyword_init: true`)
|
195
195
|
|
196
196
|
## Ruby 2.4 backports
|
197
197
|
|
198
|
-
|
199
|
-
|
198
|
+
#### Comparable
|
199
|
+
- `clamp`
|
200
200
|
|
201
|
-
|
202
|
-
|
203
|
-
|
201
|
+
#### Enumerable
|
202
|
+
- `sum`
|
203
|
+
- `uniq`
|
204
204
|
|
205
|
-
|
206
|
-
|
207
|
-
|
205
|
+
#### Hash
|
206
|
+
- `compact`, `compact!`
|
207
|
+
- `transform_values`, `transform_values!`
|
208
208
|
|
209
|
-
|
210
|
-
|
209
|
+
#### Regexp
|
210
|
+
- `match?`
|
211
211
|
|
212
|
-
|
213
|
-
|
212
|
+
#### String
|
213
|
+
- `match?`
|
214
214
|
|
215
|
-
|
216
|
-
|
215
|
+
#### FalseClass, Fixnum, Float, NilClass, TrueClass
|
216
|
+
- `dup`
|
217
217
|
|
218
218
|
## Ruby 2.3 backports
|
219
219
|
|
220
|
-
|
221
|
-
|
222
|
-
|
220
|
+
#### Array
|
221
|
+
- `bsearch_index`
|
222
|
+
- `dig`
|
223
223
|
|
224
|
-
|
225
|
-
|
226
|
-
|
224
|
+
#### Enumerable
|
225
|
+
- `chunk_while`
|
226
|
+
- `grep_v`
|
227
227
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
228
|
+
#### Hash
|
229
|
+
- `dig`
|
230
|
+
- `fetch_values`
|
231
|
+
- `to_proc`
|
232
|
+
- <=, <, >=, >
|
233
233
|
|
234
|
-
|
235
|
-
|
236
|
-
|
234
|
+
#### Numeric
|
235
|
+
- `negative?`
|
236
|
+
- `positive?`
|
237
237
|
|
238
|
-
|
239
|
-
|
238
|
+
#### String
|
239
|
+
- unary + and -
|
240
240
|
|
241
|
-
|
242
|
-
|
241
|
+
#### Struct
|
242
|
+
- `dig`
|
243
243
|
|
244
244
|
## Ruby 2.2 backports
|
245
245
|
|
246
|
-
|
247
|
-
|
248
|
-
|
246
|
+
#### Enumerable
|
247
|
+
- `slice_after`
|
248
|
+
- `slice_when`
|
249
249
|
|
250
|
-
|
251
|
-
|
252
|
-
|
250
|
+
#### Float
|
251
|
+
- `prev_float`
|
252
|
+
- `next_float`
|
253
253
|
|
254
|
-
|
255
|
-
|
254
|
+
#### Kernel
|
255
|
+
- `itself`
|
256
256
|
|
257
|
-
|
258
|
-
|
259
|
-
|
257
|
+
#### Method
|
258
|
+
- `curry`
|
259
|
+
- `super_method`
|
260
260
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
261
|
+
#### String
|
262
|
+
- `unicode_normalize`
|
263
|
+
- `unicode_normalize!`
|
264
|
+
- `unicode_normalize?`
|
265
265
|
|
266
266
|
## Ruby 2.1 backports
|
267
267
|
|
268
|
-
|
269
|
-
|
268
|
+
#### Array
|
269
|
+
- `to_h`
|
270
270
|
|
271
|
-
|
272
|
-
|
271
|
+
#### Bignum
|
272
|
+
- `bit_length`
|
273
273
|
|
274
|
-
|
275
|
-
|
274
|
+
#### Enumerable
|
275
|
+
- `to_h`
|
276
276
|
|
277
|
-
|
278
|
-
|
277
|
+
#### Fixnum
|
278
|
+
- `bit_length`
|
279
279
|
|
280
|
-
|
281
|
-
|
280
|
+
#### Module
|
281
|
+
- `include` (now public)
|
282
282
|
|
283
283
|
## Ruby 2.0 backports
|
284
284
|
|
285
|
-
|
286
|
-
|
285
|
+
#### Array
|
286
|
+
- `bsearch`
|
287
287
|
|
288
|
-
|
289
|
-
|
288
|
+
#### Enumerable
|
289
|
+
- `lazy`
|
290
290
|
|
291
|
-
|
292
|
-
|
291
|
+
#### Enumerator::Lazy
|
292
|
+
- all methods
|
293
293
|
|
294
|
-
|
295
|
-
|
296
|
-
|
294
|
+
#### Hash
|
295
|
+
- `default_proc=` (with nil argument)
|
296
|
+
- `to_h`
|
297
297
|
|
298
|
-
|
298
|
+
#### `nil.to_h`
|
299
299
|
|
300
|
-
|
301
|
-
|
300
|
+
#### Range
|
301
|
+
- `bsearch`
|
302
302
|
|
303
|
-
|
304
|
-
|
303
|
+
#### Struct
|
304
|
+
- `to_h`
|
305
305
|
|
306
306
|
## Ruby 1.9.3 backports
|
307
307
|
|
308
|
-
|
309
|
-
|
308
|
+
#### File
|
309
|
+
- `NULL`
|
310
310
|
|
311
|
-
|
312
|
-
|
313
|
-
|
311
|
+
#### IO
|
312
|
+
- `advise` (acts as a noop)
|
313
|
+
- `write`, `binwrite`
|
314
314
|
|
315
|
-
|
316
|
-
|
317
|
-
|
315
|
+
#### String
|
316
|
+
- `byteslice`
|
317
|
+
- `prepend`
|
318
318
|
|
319
319
|
## Ruby 1.9.2 backports
|
320
320
|
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
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
328
|
|
329
|
-
|
330
|
-
|
329
|
+
#### Complex
|
330
|
+
- `to_r`
|
331
331
|
|
332
|
-
|
333
|
-
|
332
|
+
#### Dir
|
333
|
+
- `home`
|
334
334
|
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
335
|
+
#### Enumerable
|
336
|
+
- `chunk`
|
337
|
+
- `flat_map`, `collect_concat`
|
338
|
+
- `join`
|
339
|
+
- `slice_before`
|
340
340
|
|
341
|
-
|
341
|
+
#### Float::INFINITY, NAN
|
342
342
|
|
343
|
-
|
344
|
-
|
343
|
+
#### Hash
|
344
|
+
- `keep_if`, `select!`
|
345
345
|
|
346
|
-
|
347
|
-
|
346
|
+
#### Object
|
347
|
+
- `singleton_class`
|
348
348
|
|
349
|
-
|
349
|
+
#### Random (new class)
|
350
350
|
|
351
351
|
*Note*: The methods of `Random` can't be required individually; the class
|
352
352
|
can only be required whole with `require 'backports/1.9.2/random'`.
|
@@ -354,78 +354,78 @@ can only be required whole with `require 'backports/1.9.2/random'`.
|
|
354
354
|
## Ruby 1.9.1 backports
|
355
355
|
|
356
356
|
Additionally, the following Ruby 1.9 features have been backported:
|
357
|
-
|
358
|
-
|
359
|
-
|
357
|
+
#### Array
|
358
|
+
- `try_convert`
|
359
|
+
- `sample`
|
360
360
|
|
361
|
-
|
362
|
-
|
363
|
-
|
361
|
+
#### Enumerable
|
362
|
+
- `each_with_object`
|
363
|
+
- `each_with_index` (with arguments)
|
364
364
|
|
365
|
-
|
366
|
-
|
365
|
+
#### Enumerator
|
366
|
+
- `new` (with block)
|
367
367
|
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
368
|
+
#### File
|
369
|
+
- `binread`
|
370
|
+
- `to_path`
|
371
|
+
- All class methods accepting filenames will accept files or anything
|
372
372
|
with a `#to_path` method.
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
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
429
|
|
430
430
|
`Enumerator` can be accessed directly (instead of `Enumerable::Enumerator`)
|
431
431
|
|
@@ -444,9 +444,9 @@ Complete Ruby 1.8.7 backporting (core language). Refer to the official list of
|
|
444
444
|
backports!
|
445
445
|
|
446
446
|
Only exceptions:
|
447
|
-
|
448
|
-
|
449
|
-
|
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
450
|
|
451
451
|
## Libraries
|
452
452
|
|
@@ -456,18 +456,18 @@ The backports would be automatically used after requiring 'backports/std_lib' bu
|
|
456
456
|
|
457
457
|
The following libraries are up to date with Ruby 1.9.3:
|
458
458
|
|
459
|
-
|
460
|
-
|
461
|
-
|
459
|
+
#### Matrix
|
460
|
+
#### Prime
|
461
|
+
#### Set
|
462
462
|
|
463
463
|
The following library is to date with Ruby 2.0.0:
|
464
464
|
|
465
|
-
|
465
|
+
#### OpenStruct (ostruct)
|
466
466
|
|
467
467
|
I am aware of the following backport gem, which probably won't make it into
|
468
468
|
this gem:
|
469
469
|
|
470
|
-
|
470
|
+
#### Net::SMTP for Ruby 1.8.6:
|
471
471
|
[smtp_tls](http://seattlerb.rubyforge.org/smtp_tls/)
|
472
472
|
|
473
473
|
Requiring backports for a given version of Ruby will also load
|
@@ -479,14 +479,14 @@ Some backports would create incompatibilities in their current Ruby version
|
|
479
479
|
but could be useful in some projects. It is possible to request such
|
480
480
|
incompatible changes. Backports currently supports the following:
|
481
481
|
|
482
|
-
|
483
|
-
|
482
|
+
#### Hash
|
483
|
+
- `select` (returns a Hash instead of an Array)
|
484
484
|
|
485
|
-
|
486
|
-
|
485
|
+
#### Enumerable / Array
|
486
|
+
- `map` (returns an enumerator when called without a block)
|
487
487
|
|
488
|
-
|
489
|
-
|
488
|
+
#### String
|
489
|
+
- `length`, `size` (for UTF-8 support)
|
490
490
|
|
491
491
|
These must be imported in addition to the backports gem, for example:
|
492
492
|
|
@@ -497,10 +497,10 @@ These must be imported in addition to the backports gem, for example:
|
|
497
497
|
|
498
498
|
Thanks for the bug reports and patches, in particular the repeat offenders:
|
499
499
|
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
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
504
|
|
505
505
|
## Contributing
|
506
506
|
|
data/lib/backports/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Backports
|
2
|
-
VERSION = "3.17.
|
2
|
+
VERSION = "3.17.1" unless Backports.constants.include? :VERSION # the guard is against a redefinition warning that happens on Travis
|
3
3
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.17.
|
4
|
+
version: 3.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc-André Lafortune
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Essential backports that enable many of the nice features of Ruby for
|
14
14
|
earlier versions.
|
@@ -584,7 +584,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
584
584
|
- !ruby/object:Gem::Version
|
585
585
|
version: '0'
|
586
586
|
requirements: []
|
587
|
-
rubygems_version: 3.
|
587
|
+
rubygems_version: 3.1.2
|
588
588
|
signing_key:
|
589
589
|
specification_version: 4
|
590
590
|
summary: Backports of Ruby features for older Ruby.
|