backports 3.17.0 → 3.17.1

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: a3d24b48165778d61941516a41ffd588433f8481e2271c203faf13b00633f625
4
- data.tar.gz: 9ea6f26974c57c1ee4656cf3067d4ae274b66d939327125f729dce56523e1e94
3
+ metadata.gz: 96610f4ef4df388ed73a054e17beb5e0b18303f27a0ca81dc8f7b25bf2cbe5e2
4
+ data.tar.gz: bc295cdd8cea47ab32ade680a343989f47c6970d869d37d49ff99457378d7e58
5
5
  SHA512:
6
- metadata.gz: b9ad712f51352110a758778522f443f24a668434ddbf78f7b8c0580935bb7ccd7465663ce27b6656cf0e785347f960a46b384daed7eb05329afa049a3ec8f228
7
- data.tar.gz: 557038055c3775404fb13c546c4ea0caaa8ddcd1a631c2a232f044345dbce5ae38dbe183de86c288b0b39e8d961201d5512923f6d596f03b9afa662b0b64c39b
6
+ metadata.gz: 5d0c16a92ba629fb6db4894605fd73c78386f639ce7b2bb4ca09d9b2581313662df0633c69a8cd9a7faab9972eb7e6bd7dbc38946f96aa5a4d4b41570f75cd54
7
+ data.tar.gz: 5497f4f75e11ef12cf1880ccdd18c37e5d81ebee5ad437edd28b2b27b1c4860d670473662842f7a76caaa32bf43a241e0532c724ce96797f90f0bb1e01447187
@@ -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.0](https://github.com/marcandre/backports/compare/v3.16.1...v3.16.2) - 2020-03-06
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 {an exemple from
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
- * Array
115
- * `intersection`
114
+ #### Array
115
+ - `intersection`
116
116
 
117
- * Comparable
118
- * `clamp` (with range)
117
+ #### Comparable
118
+ - `clamp` (with range)
119
119
 
120
- * Complex
121
- * +<=>+
120
+ #### Complex
121
+ - +<=>+
122
122
 
123
- * Enumerable
124
- * `filter_map`
125
- * `tally`
123
+ #### Enumerable
124
+ - `filter_map`
125
+ - `tally`
126
126
 
127
- * Enumerator
128
- * `produce` (class method)
127
+ #### Enumerator
128
+ - `produce` (class method)
129
129
 
130
- * Time
131
- * `floor`, `ceil`
130
+ #### Time
131
+ - `floor`, `ceil`
132
132
 
133
133
  ## Ruby 2.6 backports
134
134
 
135
- * Array
136
- * `difference`, `union`
137
- * `to_h` (with block)
135
+ #### Array
136
+ - `difference`, `union`
137
+ - `to_h` (with block)
138
138
 
139
- * Enumerable
140
- * `chain`
141
- * `to_h` (with block)
139
+ #### Enumerable
140
+ - `chain`
141
+ - `to_h` (with block)
142
142
 
143
- * Enumerator::Chain (use Enumerable#chain)
143
+ #### Enumerator::Chain (use Enumerable#chain)
144
144
 
145
- * Hash
146
- * `merge`, `merge!`/`update` (with multiple arguments)
147
- * `to_h` (with block)
145
+ #### Hash
146
+ - `merge`, `merge!`/`update` (with multiple arguments)
147
+ - `to_h` (with block)
148
148
 
149
- * Kernel
150
- * `then`
149
+ #### Kernel
150
+ - `then`
151
151
 
152
- * Method
153
- * +<<+, +>>+
152
+ #### Method
153
+ - +<<+, +>>+
154
154
 
155
- * Proc
156
- * +<<+, +>>+
155
+ #### Proc
156
+ - +<<+, +>>+
157
157
 
158
- * Range
159
- * `cover?` (with `Range` argument)
158
+ #### Range
159
+ - `cover?` (with `Range` argument)
160
160
 
161
161
  ## Ruby 2.5 backports
162
162
 
163
- * Array
164
- * `append`, `prepend`
163
+ #### Array
164
+ - `append`, `prepend`
165
165
 
166
- * Dir
167
- * `children`, `each_child`
166
+ #### Dir
167
+ - `children`, `each_child`
168
168
 
169
- * Enumerable
170
- * `any?`, `all?`, `none?`, `one?` (with pattern argument)
169
+ #### Enumerable
170
+ - `any?`, `all?`, `none?`, `one?` (with pattern argument)
171
171
 
172
- * Hash
173
- * `slice`
174
- * `transform_keys`
172
+ #### Hash
173
+ - `slice`
174
+ - `transform_keys`
175
175
 
176
- * Integer
177
- * `sqrt`
178
- * `allbits?`, `anybits?` and `nobits?`
176
+ #### Integer
177
+ - `sqrt`
178
+ - `allbits?`, `anybits?` and `nobits?`
179
179
 
180
- * Kernel
181
- * `yield_self`
180
+ #### Kernel
181
+ - `yield_self`
182
182
 
183
- * Module
184
- * `attr`, `attr_accessor`, `attr_reader`, `attr_writer` (now public)
185
- * `define_method`, `alias_method`, `undef_method`, `remove_method` (now
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
- * String
189
- * `delete_prefix`, `delete_prefix!`
190
- * `delete_suffix`, `delete_suffix!`
191
- * `undump`
188
+ #### String
189
+ - `delete_prefix`, `delete_prefix!`
190
+ - `delete_suffix`, `delete_suffix!`
191
+ - `undump`
192
192
 
193
- * Struct
194
- * `new` (with `keyword_init: true`)
193
+ #### Struct
194
+ - `new` (with `keyword_init: true`)
195
195
 
196
196
  ## Ruby 2.4 backports
197
197
 
198
- * Comparable
199
- * `clamp`
198
+ #### Comparable
199
+ - `clamp`
200
200
 
201
- * Enumerable
202
- * `sum`
203
- * `uniq`
201
+ #### Enumerable
202
+ - `sum`
203
+ - `uniq`
204
204
 
205
- * Hash
206
- * `compact`, `compact!`
207
- * `transform_values`, `transform_values!`
205
+ #### Hash
206
+ - `compact`, `compact!`
207
+ - `transform_values`, `transform_values!`
208
208
 
209
- * Regexp
210
- * `match?`
209
+ #### Regexp
210
+ - `match?`
211
211
 
212
- * String
213
- * `match?`
212
+ #### String
213
+ - `match?`
214
214
 
215
- * FalseClass, Fixnum, Float, NilClass, TrueClass
216
- * `dup`
215
+ #### FalseClass, Fixnum, Float, NilClass, TrueClass
216
+ - `dup`
217
217
 
218
218
  ## Ruby 2.3 backports
219
219
 
220
- * Array
221
- * `bsearch_index`
222
- * `dig`
220
+ #### Array
221
+ - `bsearch_index`
222
+ - `dig`
223
223
 
224
- * Enumerable
225
- * `chunk_while`
226
- * `grep_v`
224
+ #### Enumerable
225
+ - `chunk_while`
226
+ - `grep_v`
227
227
 
228
- * Hash
229
- * `dig`
230
- * `fetch_values`
231
- * `to_proc`
232
- * <=, <, >=, >
228
+ #### Hash
229
+ - `dig`
230
+ - `fetch_values`
231
+ - `to_proc`
232
+ - <=, <, >=, >
233
233
 
234
- * Numeric
235
- * `negative?`
236
- * `positive?`
234
+ #### Numeric
235
+ - `negative?`
236
+ - `positive?`
237
237
 
238
- * String
239
- * unary + and -
238
+ #### String
239
+ - unary + and -
240
240
 
241
- * Struct
242
- * `dig`
241
+ #### Struct
242
+ - `dig`
243
243
 
244
244
  ## Ruby 2.2 backports
245
245
 
246
- * Enumerable
247
- * `slice_after`
248
- * `slice_when`
246
+ #### Enumerable
247
+ - `slice_after`
248
+ - `slice_when`
249
249
 
250
- * Float
251
- * `prev_float`
252
- * `next_float`
250
+ #### Float
251
+ - `prev_float`
252
+ - `next_float`
253
253
 
254
- * Kernel
255
- * `itself`
254
+ #### Kernel
255
+ - `itself`
256
256
 
257
- * Method
258
- * `curry`
259
- * `super_method`
257
+ #### Method
258
+ - `curry`
259
+ - `super_method`
260
260
 
261
- * String
262
- * `unicode_normalize`
263
- * `unicode_normalize!`
264
- * `unicode_normalize?`
261
+ #### String
262
+ - `unicode_normalize`
263
+ - `unicode_normalize!`
264
+ - `unicode_normalize?`
265
265
 
266
266
  ## Ruby 2.1 backports
267
267
 
268
- * Array
269
- * `to_h`
268
+ #### Array
269
+ - `to_h`
270
270
 
271
- * Bignum
272
- * `bit_length`
271
+ #### Bignum
272
+ - `bit_length`
273
273
 
274
- * Enumerable
275
- * `to_h`
274
+ #### Enumerable
275
+ - `to_h`
276
276
 
277
- * Fixnum
278
- * `bit_length`
277
+ #### Fixnum
278
+ - `bit_length`
279
279
 
280
- * Module
281
- * `include` (now public)
280
+ #### Module
281
+ - `include` (now public)
282
282
 
283
283
  ## Ruby 2.0 backports
284
284
 
285
- * Array
286
- * `bsearch`
285
+ #### Array
286
+ - `bsearch`
287
287
 
288
- * Enumerable
289
- * `lazy`
288
+ #### Enumerable
289
+ - `lazy`
290
290
 
291
- * Enumerator::Lazy
292
- * all methods
291
+ #### Enumerator::Lazy
292
+ - all methods
293
293
 
294
- * Hash
295
- * `default_proc=` (with nil argument)
296
- * `to_h`
294
+ #### Hash
295
+ - `default_proc=` (with nil argument)
296
+ - `to_h`
297
297
 
298
- * `nil.to_h`
298
+ #### `nil.to_h`
299
299
 
300
- * Range
301
- * `bsearch`
300
+ #### Range
301
+ - `bsearch`
302
302
 
303
- * Struct
304
- * `to_h`
303
+ #### Struct
304
+ - `to_h`
305
305
 
306
306
  ## Ruby 1.9.3 backports
307
307
 
308
- * File
309
- * `NULL`
308
+ #### File
309
+ - `NULL`
310
310
 
311
- * IO
312
- * `advise` (acts as a noop)
313
- * `write`, `binwrite`
311
+ #### IO
312
+ - `advise` (acts as a noop)
313
+ - `write`, `binwrite`
314
314
 
315
- * String
316
- * `byteslice`
317
- * `prepend`
315
+ #### String
316
+ - `byteslice`
317
+ - `prepend`
318
318
 
319
319
  ## Ruby 1.9.2 backports
320
320
 
321
- * Array
322
- * `rotate, rotate!`
323
- * `keep_if, select!`
324
- * `product` (with block)
325
- * `repeated_combination`, `repeated_permutation`
326
- * `sort_by!`
327
- * `uniq, uniq!` (with block)
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
- * Complex
330
- * `to_r`
329
+ #### Complex
330
+ - `to_r`
331
331
 
332
- * Dir
333
- * `home`
332
+ #### Dir
333
+ - `home`
334
334
 
335
- * Enumerable
336
- * `chunk`
337
- * `flat_map`, `collect_concat`
338
- * `join`
339
- * `slice_before`
335
+ #### Enumerable
336
+ - `chunk`
337
+ - `flat_map`, `collect_concat`
338
+ - `join`
339
+ - `slice_before`
340
340
 
341
- * Float::INFINITY, NAN
341
+ #### Float::INFINITY, NAN
342
342
 
343
- * Hash
344
- * `keep_if`, `select!`
343
+ #### Hash
344
+ - `keep_if`, `select!`
345
345
 
346
- * Object
347
- * `singleton_class`
346
+ #### Object
347
+ - `singleton_class`
348
348
 
349
- * Random (new class)
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
- * Array
358
- * `try_convert`
359
- * `sample`
357
+ #### Array
358
+ - `try_convert`
359
+ - `sample`
360
360
 
361
- * Enumerable
362
- * `each_with_object`
363
- * `each_with_index` (with arguments)
361
+ #### Enumerable
362
+ - `each_with_object`
363
+ - `each_with_index` (with arguments)
364
364
 
365
- * Enumerator
366
- * `new` (with block)
365
+ #### Enumerator
366
+ - `new` (with block)
367
367
 
368
- * File
369
- * `binread`
370
- * `to_path`
371
- * All class methods accepting filenames will accept files or anything
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
- * `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`
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
- * 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)
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
- * Matrix
460
- * Prime
461
- * Set
459
+ #### Matrix
460
+ #### Prime
461
+ #### Set
462
462
 
463
463
  The following library is to date with Ruby 2.0.0:
464
464
 
465
- * OpenStruct (ostruct)
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
- * Net::SMTP for Ruby 1.8.6:
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
- * Hash
483
- * `select` (returns a Hash instead of an Array)
482
+ #### Hash
483
+ - `select` (returns a Hash instead of an Array)
484
484
 
485
- * Enumerable / Array
486
- * `map` (returns an enumerator when called without a block)
485
+ #### Enumerable / Array
486
+ - `map` (returns an enumerator when called without a block)
487
487
 
488
- * String
489
- * `length`, `size` (for UTF-8 support)
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
- * 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) )
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
 
@@ -1,4 +1,6 @@
1
1
  unless Range.method_defined? :size
2
+ require 'backports/1.9.2/float/infinity'
3
+
2
4
  class Range
3
5
  def size
4
6
  return nil unless self.begin.is_a?(Numeric) && self.end.is_a?(Numeric)
@@ -1,3 +1,3 @@
1
1
  module Backports
2
- VERSION = "3.17.0" unless Backports.constants.include? :VERSION # the guard is against a redefinition warning that happens on Travis
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.0
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-03-06 00:00:00.000000000 Z
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.0.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.