backports 3.16.1 → 3.18.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 +35 -2
- data/Gemfile +6 -13
- data/README.md +256 -251
- data/SECURITY.md +5 -0
- data/backports.gemspec +1 -1
- data/lib/backports.rb +6 -0
- data/lib/backports/1.8.7.rb +7 -6
- data/lib/backports/1.9.1.rb +6 -1
- data/lib/backports/1.9.2.rb +6 -1
- data/lib/backports/1.9.3.rb +6 -1
- data/lib/backports/2.0.0.rb +6 -1
- data/lib/backports/2.0.0/range/size.rb +2 -0
- data/lib/backports/2.1.0.rb +1 -1
- data/lib/backports/2.2.0.rb +1 -1
- data/lib/backports/2.2.0/enumerable/slice_after.rb +1 -1
- data/lib/backports/2.2.0/float/next_float.rb +1 -1
- data/lib/backports/2.2.0/float/prev_float.rb +1 -1
- data/lib/backports/2.2.0/method/super_method.rb +2 -2
- data/lib/backports/2.3.0.rb +1 -1
- data/lib/backports/2.3.0/array/bsearch_index.rb +1 -1
- data/lib/backports/2.3.0/hash/lt.rb +1 -1
- data/lib/backports/2.3.0/hash/lte.rb +1 -1
- data/lib/backports/2.3.0/hash/to_proc.rb +1 -1
- data/lib/backports/2.3.0/struct/dig.rb +1 -2
- data/lib/backports/2.4.0.rb +1 -1
- data/lib/backports/2.4.0/hash/transform_values.rb +2 -2
- data/lib/backports/2.4.0/true_class/dup.rb +0 -1
- data/lib/backports/2.5.0.rb +1 -1
- data/lib/backports/2.5.0/hash/transform_keys.rb +1 -1
- data/lib/backports/2.5.0/integer/sqrt.rb +2 -2
- data/lib/backports/2.5.0/module/alias_method.rb +0 -1
- data/lib/backports/2.5.0/string/undump.rb +3 -7
- data/lib/backports/2.5.0/struct/new.rb +1 -1
- data/lib/backports/2.6.0.rb +1 -1
- data/lib/backports/2.6.0/enumerable/chain.rb +4 -1
- data/lib/backports/2.6.0/hash/to_h.rb +1 -1
- data/lib/backports/2.6.0/range.rb +3 -0
- data/lib/backports/2.6.0/range/cover.rb +22 -0
- data/lib/backports/2.7.0.rb +1 -1
- data/lib/backports/2.7.0/enumerable/filter_map.rb +2 -2
- data/lib/backports/tools/deprecation.rb +13 -6
- data/lib/backports/tools/require_relative_dir.rb +6 -1
- data/lib/backports/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1f8274a378c35a932287714e49499fdfe0f6b1cc0c3b10f77b3e0b321d05e80
|
4
|
+
data.tar.gz: 47596230657db9f20c4ccc221ac4e0d629bd8e0798ddadc6c94c096f3a3bd89f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6be9e6cde88338a14523a28bae4c2818f976aa81963001ec8370c137e0ca0d8e289049d76670f2d76b8619a4b27956b8e72a6bc186ba688095a6707a9ff804bf
|
7
|
+
data.tar.gz: 252030972b159d5380cd6a8b65807451cfdfbdaab179c2460ec07c150ec4de45db6c8d0f2fb36c1dd1caee078345514b71547564a9cc776ea84a0719e6767aa0
|
data/CHANGELOG.md
CHANGED
@@ -6,13 +6,46 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
-
Note: [Next major version (X-mas 2020)](https://github.com/marcandre/backports/issues/139)
|
9
|
+
Note: [Next major version (X-mas 2020)](https://github.com/marcandre/backports/issues/139) might drop support for Ruby < 2.2, please comment.
|
10
|
+
|
11
|
+
## [3.18.0](https://github.com/marcandre/backports/compare/v3.17.2...v3.18.0) - 2020-06-22
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
|
15
|
+
Require per ruby version / all requires now check `RUBY_VERSION` to be more efficient [#149]
|
16
|
+
|
17
|
+
## [3.17.2](https://github.com/marcandre/backports/compare/v3.17.1...v3.17.2) - 2020-04-09
|
18
|
+
|
19
|
+
### Fixed
|
20
|
+
|
21
|
+
Fix Range#cover (Ruby 2.6.0) [#148]
|
22
|
+
|
23
|
+
## [3.17.1](https://github.com/marcandre/backports/compare/v3.17.0...v3.17.1) - 2020-04-09
|
24
|
+
|
25
|
+
### Fixed
|
26
|
+
|
27
|
+
Fix Range#size (Ruby 2.0) on Ruby 1.8.7 [#144]
|
28
|
+
|
29
|
+
## [3.17.0](https://github.com/marcandre/backports/compare/v3.16.2...v3.17.0) - 2020-03-06
|
30
|
+
|
31
|
+
### Added
|
32
|
+
|
33
|
+
* Ruby 2.6 backports
|
34
|
+
|
35
|
+
* Range
|
36
|
+
* `cover?` (with `Range` argument)
|
37
|
+
|
38
|
+
### Changed
|
39
|
+
|
40
|
+
Requiring features for a particular version of Ruby or `latest` is un-deprecated but
|
41
|
+
instead simply warned in verbose mode.
|
10
42
|
|
11
43
|
## [3.16.1](https://github.com/marcandre/backports/compare/v3.16.0...v3.16.1) - 2020-02-16
|
12
44
|
|
13
45
|
### Deprecated
|
14
46
|
|
15
|
-
Officially deprecate requiring features for a particular version of Ruby, `latest`, `std_lib` or `rails` backports
|
47
|
+
Officially deprecate requiring features for a particular version of Ruby, `latest`, `std_lib` or `rails` backports.
|
48
|
+
Partly un-deprecated in 3.17.0!
|
16
49
|
|
17
50
|
### Fixed
|
18
51
|
|
data/Gemfile
CHANGED
@@ -1,23 +1,16 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
# Declare your gem's dependencies in backports.gemspec.
|
4
|
-
# Bundler will treat runtime dependencies like base dependencies, and
|
5
|
-
# development dependencies will be added by default to the :development group.
|
6
3
|
gemspec
|
7
4
|
|
8
|
-
# jquery-rails is used by the dummy application
|
9
5
|
group :test do
|
10
6
|
gem "rake"
|
11
7
|
gem 'mspec'
|
12
8
|
gem 'activesupport', '~>3.2.0'
|
13
|
-
gem '
|
14
|
-
gem 'test-unit', '~>2.1.1.0'
|
9
|
+
gem 'test-unit'
|
15
10
|
end
|
16
11
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# To use debugger
|
23
|
-
# gem 'ruby-debug19', :require => 'ruby-debug'
|
12
|
+
if RUBY_VERSION >= '2.3.0'
|
13
|
+
group :development do
|
14
|
+
gem 'rubocop', '~> 0.80.0'
|
15
|
+
end
|
16
|
+
end
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
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)
|
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) [](https://tidelift.com/subscription/pkg/rubygems-backports?utm_source=rubygems-backports&utm_medium=referral&utm_campaign=readme)
|
2
2
|
|
3
3
|
Yearning to use some of the new cool features in Ruby 2.7 while using 2.3.x?
|
4
4
|
Have some legacy code in Ruby 1.8 but can't live without `flat_map`?
|
@@ -35,20 +35,22 @@ Class:
|
|
35
35
|
This will make sure that Hash responds to dig, fetch_values, <, <=, >, >= and
|
36
36
|
to_proc
|
37
37
|
|
38
|
-
### Up to a specific Ruby version (
|
38
|
+
### Up to a specific Ruby version (for quick coding)
|
39
39
|
|
40
|
-
|
40
|
+
You can load all backports up to a specific version.
|
41
41
|
For example, to bring any
|
42
|
-
version of Ruby mostly up to Ruby 2.
|
42
|
+
version of Ruby mostly up to Ruby 2.7.0's standards:
|
43
43
|
|
44
|
-
require 'backports/2.
|
44
|
+
require 'backports/2.7.0'
|
45
45
|
|
46
46
|
This will bring in all the features of 1.8.7 and many features of Ruby 1.9.x
|
47
|
-
all the way up to Ruby 2.
|
47
|
+
all the way up to Ruby 2.7.0 (for all versions of Ruby)!
|
48
48
|
|
49
|
-
|
50
|
-
shortcut to the latest Ruby version supported.
|
51
|
-
|
49
|
+
You may `require 'backports/latest'` as a
|
50
|
+
shortcut to the latest Ruby version supported.
|
51
|
+
|
52
|
+
*Note*: For production / public gems, it is highly recommended you only require
|
53
|
+
the backports you need explicitly.
|
52
54
|
|
53
55
|
*Note*: Although I am a Ruby committer, this gem is a personal project and is
|
54
56
|
not endorsed by ruby-core.
|
@@ -63,14 +65,14 @@ Goals for backported features:
|
|
63
65
|
Let's be a bit more precise about the "breaking code" business. It is of
|
64
66
|
course entirely possible that code will break. In particular, you may be
|
65
67
|
distinguishing parameters with duck typing, but a builtin class may, in the
|
66
|
-
future, be responding to a particular call. Here's
|
67
|
-
Rails}(https://github.com/rails/rails/blob/a4b55827721a5967299f3c1531afb3d6d81
|
68
|
-
e4ac0/activerecord/lib/active_record/associations/association.rb#L155-L159)
|
68
|
+
future, be responding to a particular call. Here's [an example from Rails][]
|
69
69
|
that is relying on the fact that Proc and Method respond to :to_proc and Hash
|
70
70
|
isn't. That is, until Ruby 2.3... This old version of Rails therefore won't
|
71
71
|
work on Ruby 2.3, or on older Rubies with that the `2.3.0/hash/to_proc`
|
72
72
|
loaded...
|
73
73
|
|
74
|
+
[an example from rails]: https://github.com/rails/rails/blob/a4b55827721a5967299f3c1531afb3d6d81e4ac0/activerecord/lib/active_record/associations/association.rb#L155-L159
|
75
|
+
|
74
76
|
For Ruby < 2.0, there are some real incompatibilities. For example,
|
75
77
|
`Module::instance_methods` which returns strings in 1.8 and symbols in 1.9. No
|
76
78
|
change can be made without the risk of breaking existing code. Such
|
@@ -109,239 +111,242 @@ itself, JRuby and Rubinius.
|
|
109
111
|
|
110
112
|
## Ruby 2.7 backports
|
111
113
|
|
112
|
-
|
113
|
-
|
114
|
+
#### Array
|
115
|
+
- `intersection`
|
114
116
|
|
115
|
-
|
116
|
-
|
117
|
+
#### Comparable
|
118
|
+
- `clamp` (with range)
|
117
119
|
|
118
|
-
|
119
|
-
|
120
|
+
#### Complex
|
121
|
+
- +<=>+
|
120
122
|
|
121
|
-
|
122
|
-
|
123
|
-
|
123
|
+
#### Enumerable
|
124
|
+
- `filter_map`
|
125
|
+
- `tally`
|
124
126
|
|
125
|
-
|
126
|
-
|
127
|
+
#### Enumerator
|
128
|
+
- `produce` (class method)
|
127
129
|
|
128
|
-
|
129
|
-
|
130
|
+
#### Time
|
131
|
+
- `floor`, `ceil`
|
130
132
|
|
131
133
|
## Ruby 2.6 backports
|
132
134
|
|
133
|
-
|
134
|
-
|
135
|
-
|
135
|
+
#### Array
|
136
|
+
- `difference`, `union`
|
137
|
+
- `to_h` (with block)
|
138
|
+
|
139
|
+
#### Enumerable
|
140
|
+
- `chain`
|
141
|
+
- `to_h` (with block)
|
136
142
|
|
137
|
-
|
138
|
-
* `chain`
|
139
|
-
* `to_h` (with block)
|
143
|
+
#### Enumerator::Chain (use Enumerable#chain)
|
140
144
|
|
141
|
-
|
145
|
+
#### Hash
|
146
|
+
- `merge`, `merge!`/`update` (with multiple arguments)
|
147
|
+
- `to_h` (with block)
|
142
148
|
|
143
|
-
|
144
|
-
|
145
|
-
* `to_h` (with block)
|
149
|
+
#### Kernel
|
150
|
+
- `then`
|
146
151
|
|
147
|
-
|
148
|
-
|
152
|
+
#### Method
|
153
|
+
- +<<+, +>>+
|
149
154
|
|
150
|
-
|
151
|
-
|
155
|
+
#### Proc
|
156
|
+
- +<<+, +>>+
|
152
157
|
|
153
|
-
|
154
|
-
|
158
|
+
#### Range
|
159
|
+
- `cover?` (with `Range` argument)
|
155
160
|
|
156
161
|
## Ruby 2.5 backports
|
157
162
|
|
158
|
-
|
159
|
-
|
163
|
+
#### Array
|
164
|
+
- `append`, `prepend`
|
160
165
|
|
161
|
-
|
162
|
-
|
166
|
+
#### Dir
|
167
|
+
- `children`, `each_child`
|
163
168
|
|
164
|
-
|
165
|
-
|
169
|
+
#### Enumerable
|
170
|
+
- `any?`, `all?`, `none?`, `one?` (with pattern argument)
|
166
171
|
|
167
|
-
|
168
|
-
|
169
|
-
|
172
|
+
#### Hash
|
173
|
+
- `slice`
|
174
|
+
- `transform_keys`
|
170
175
|
|
171
|
-
|
172
|
-
|
173
|
-
|
176
|
+
#### Integer
|
177
|
+
- `sqrt`
|
178
|
+
- `allbits?`, `anybits?` and `nobits?`
|
174
179
|
|
175
|
-
|
176
|
-
|
180
|
+
#### Kernel
|
181
|
+
- `yield_self`
|
177
182
|
|
178
|
-
|
179
|
-
|
180
|
-
|
183
|
+
#### Module
|
184
|
+
- `attr`, `attr_accessor`, `attr_reader`, `attr_writer` (now public)
|
185
|
+
- `define_method`, `alias_method`, `undef_method`, `remove_method` (now
|
181
186
|
public)
|
182
187
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
188
|
+
#### String
|
189
|
+
- `delete_prefix`, `delete_prefix!`
|
190
|
+
- `delete_suffix`, `delete_suffix!`
|
191
|
+
- `undump`
|
187
192
|
|
188
|
-
|
189
|
-
|
193
|
+
#### Struct
|
194
|
+
- `new` (with `keyword_init: true`)
|
190
195
|
|
191
196
|
## Ruby 2.4 backports
|
192
197
|
|
193
|
-
|
194
|
-
|
198
|
+
#### Comparable
|
199
|
+
- `clamp`
|
195
200
|
|
196
|
-
|
197
|
-
|
198
|
-
|
201
|
+
#### Enumerable
|
202
|
+
- `sum`
|
203
|
+
- `uniq`
|
199
204
|
|
200
|
-
|
201
|
-
|
202
|
-
|
205
|
+
#### Hash
|
206
|
+
- `compact`, `compact!`
|
207
|
+
- `transform_values`, `transform_values!`
|
203
208
|
|
204
|
-
|
205
|
-
|
209
|
+
#### Regexp
|
210
|
+
- `match?`
|
206
211
|
|
207
|
-
|
208
|
-
|
212
|
+
#### String
|
213
|
+
- `match?`
|
209
214
|
|
210
|
-
|
211
|
-
|
215
|
+
#### FalseClass, Fixnum, Float, NilClass, TrueClass
|
216
|
+
- `dup`
|
212
217
|
|
213
218
|
## Ruby 2.3 backports
|
214
219
|
|
215
|
-
|
216
|
-
|
217
|
-
|
220
|
+
#### Array
|
221
|
+
- `bsearch_index`
|
222
|
+
- `dig`
|
218
223
|
|
219
|
-
|
220
|
-
|
221
|
-
|
224
|
+
#### Enumerable
|
225
|
+
- `chunk_while`
|
226
|
+
- `grep_v`
|
222
227
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
+
#### Hash
|
229
|
+
- `dig`
|
230
|
+
- `fetch_values`
|
231
|
+
- `to_proc`
|
232
|
+
- <=, <, >=, >
|
228
233
|
|
229
|
-
|
230
|
-
|
231
|
-
|
234
|
+
#### Numeric
|
235
|
+
- `negative?`
|
236
|
+
- `positive?`
|
232
237
|
|
233
|
-
|
234
|
-
|
238
|
+
#### String
|
239
|
+
- unary + and -
|
235
240
|
|
236
|
-
|
237
|
-
|
241
|
+
#### Struct
|
242
|
+
- `dig`
|
238
243
|
|
239
244
|
## Ruby 2.2 backports
|
240
245
|
|
241
|
-
|
242
|
-
|
243
|
-
|
246
|
+
#### Enumerable
|
247
|
+
- `slice_after`
|
248
|
+
- `slice_when`
|
244
249
|
|
245
|
-
|
246
|
-
|
247
|
-
|
250
|
+
#### Float
|
251
|
+
- `prev_float`
|
252
|
+
- `next_float`
|
248
253
|
|
249
|
-
|
250
|
-
|
254
|
+
#### Kernel
|
255
|
+
- `itself`
|
251
256
|
|
252
|
-
|
253
|
-
|
254
|
-
|
257
|
+
#### Method
|
258
|
+
- `curry`
|
259
|
+
- `super_method`
|
255
260
|
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
261
|
+
#### String
|
262
|
+
- `unicode_normalize`
|
263
|
+
- `unicode_normalize!`
|
264
|
+
- `unicode_normalize?`
|
260
265
|
|
261
266
|
## Ruby 2.1 backports
|
262
267
|
|
263
|
-
|
264
|
-
|
268
|
+
#### Array
|
269
|
+
- `to_h`
|
265
270
|
|
266
|
-
|
267
|
-
|
271
|
+
#### Bignum
|
272
|
+
- `bit_length`
|
268
273
|
|
269
|
-
|
270
|
-
|
274
|
+
#### Enumerable
|
275
|
+
- `to_h`
|
271
276
|
|
272
|
-
|
273
|
-
|
277
|
+
#### Fixnum
|
278
|
+
- `bit_length`
|
274
279
|
|
275
|
-
|
276
|
-
|
280
|
+
#### Module
|
281
|
+
- `include` (now public)
|
277
282
|
|
278
283
|
## Ruby 2.0 backports
|
279
284
|
|
280
|
-
|
281
|
-
|
285
|
+
#### Array
|
286
|
+
- `bsearch`
|
282
287
|
|
283
|
-
|
284
|
-
|
288
|
+
#### Enumerable
|
289
|
+
- `lazy`
|
285
290
|
|
286
|
-
|
287
|
-
|
291
|
+
#### Enumerator::Lazy
|
292
|
+
- all methods
|
288
293
|
|
289
|
-
|
290
|
-
|
291
|
-
|
294
|
+
#### Hash
|
295
|
+
- `default_proc=` (with nil argument)
|
296
|
+
- `to_h`
|
292
297
|
|
293
|
-
|
298
|
+
#### `nil.to_h`
|
294
299
|
|
295
|
-
|
296
|
-
|
300
|
+
#### Range
|
301
|
+
- `bsearch`
|
297
302
|
|
298
|
-
|
299
|
-
|
303
|
+
#### Struct
|
304
|
+
- `to_h`
|
300
305
|
|
301
306
|
## Ruby 1.9.3 backports
|
302
307
|
|
303
|
-
|
304
|
-
|
308
|
+
#### File
|
309
|
+
- `NULL`
|
305
310
|
|
306
|
-
|
307
|
-
|
308
|
-
|
311
|
+
#### IO
|
312
|
+
- `advise` (acts as a noop)
|
313
|
+
- `write`, `binwrite`
|
309
314
|
|
310
|
-
|
311
|
-
|
312
|
-
|
315
|
+
#### String
|
316
|
+
- `byteslice`
|
317
|
+
- `prepend`
|
313
318
|
|
314
319
|
## Ruby 1.9.2 backports
|
315
320
|
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
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)
|
323
328
|
|
324
|
-
|
325
|
-
|
329
|
+
#### Complex
|
330
|
+
- `to_r`
|
326
331
|
|
327
|
-
|
328
|
-
|
332
|
+
#### Dir
|
333
|
+
- `home`
|
329
334
|
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
+
#### Enumerable
|
336
|
+
- `chunk`
|
337
|
+
- `flat_map`, `collect_concat`
|
338
|
+
- `join`
|
339
|
+
- `slice_before`
|
335
340
|
|
336
|
-
|
341
|
+
#### Float::INFINITY, NAN
|
337
342
|
|
338
|
-
|
339
|
-
|
343
|
+
#### Hash
|
344
|
+
- `keep_if`, `select!`
|
340
345
|
|
341
|
-
|
342
|
-
|
346
|
+
#### Object
|
347
|
+
- `singleton_class`
|
343
348
|
|
344
|
-
|
349
|
+
#### Random (new class)
|
345
350
|
|
346
351
|
*Note*: The methods of `Random` can't be required individually; the class
|
347
352
|
can only be required whole with `require 'backports/1.9.2/random'`.
|
@@ -349,78 +354,78 @@ can only be required whole with `require 'backports/1.9.2/random'`.
|
|
349
354
|
## Ruby 1.9.1 backports
|
350
355
|
|
351
356
|
Additionally, the following Ruby 1.9 features have been backported:
|
352
|
-
|
353
|
-
|
354
|
-
|
357
|
+
#### Array
|
358
|
+
- `try_convert`
|
359
|
+
- `sample`
|
355
360
|
|
356
|
-
|
357
|
-
|
358
|
-
|
361
|
+
#### Enumerable
|
362
|
+
- `each_with_object`
|
363
|
+
- `each_with_index` (with arguments)
|
359
364
|
|
360
|
-
|
361
|
-
|
365
|
+
#### Enumerator
|
366
|
+
- `new` (with block)
|
362
367
|
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
368
|
+
#### File
|
369
|
+
- `binread`
|
370
|
+
- `to_path`
|
371
|
+
- All class methods accepting filenames will accept files or anything
|
367
372
|
with a `#to_path` method.
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
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
|
-
|
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`
|
424
429
|
|
425
430
|
`Enumerator` can be accessed directly (instead of `Enumerable::Enumerator`)
|
426
431
|
|
@@ -439,9 +444,9 @@ Complete Ruby 1.8.7 backporting (core language). Refer to the official list of
|
|
439
444
|
backports!
|
440
445
|
|
441
446
|
Only exceptions:
|
442
|
-
|
443
|
-
|
444
|
-
|
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)
|
445
450
|
|
446
451
|
## Libraries
|
447
452
|
|
@@ -451,18 +456,18 @@ The backports would be automatically used after requiring 'backports/std_lib' bu
|
|
451
456
|
|
452
457
|
The following libraries are up to date with Ruby 1.9.3:
|
453
458
|
|
454
|
-
|
455
|
-
|
456
|
-
|
459
|
+
#### Matrix
|
460
|
+
#### Prime
|
461
|
+
#### Set
|
457
462
|
|
458
463
|
The following library is to date with Ruby 2.0.0:
|
459
464
|
|
460
|
-
|
465
|
+
#### OpenStruct (ostruct)
|
461
466
|
|
462
467
|
I am aware of the following backport gem, which probably won't make it into
|
463
468
|
this gem:
|
464
469
|
|
465
|
-
|
470
|
+
#### Net::SMTP for Ruby 1.8.6:
|
466
471
|
[smtp_tls](http://seattlerb.rubyforge.org/smtp_tls/)
|
467
472
|
|
468
473
|
Requiring backports for a given version of Ruby will also load
|
@@ -474,14 +479,14 @@ Some backports would create incompatibilities in their current Ruby version
|
|
474
479
|
but could be useful in some projects. It is possible to request such
|
475
480
|
incompatible changes. Backports currently supports the following:
|
476
481
|
|
477
|
-
|
478
|
-
|
482
|
+
#### Hash
|
483
|
+
- `select` (returns a Hash instead of an Array)
|
479
484
|
|
480
|
-
|
481
|
-
|
485
|
+
#### Enumerable / Array
|
486
|
+
- `map` (returns an enumerator when called without a block)
|
482
487
|
|
483
|
-
|
484
|
-
|
488
|
+
#### String
|
489
|
+
- `length`, `size` (for UTF-8 support)
|
485
490
|
|
486
491
|
These must be imported in addition to the backports gem, for example:
|
487
492
|
|
@@ -492,10 +497,10 @@ These must be imported in addition to the backports gem, for example:
|
|
492
497
|
|
493
498
|
Thanks for the bug reports and patches, in particular the repeat offenders:
|
494
499
|
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
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) )
|
499
504
|
|
500
505
|
## Contributing
|
501
506
|
|