File tree Expand file tree Collapse file tree 3 files changed +5
-10
lines changed
src/main/ruby/truffleruby/core Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ Compatibility:
13
13
* Implemented ` Integer#{allbits?,anybits?,nobits?} ` .
14
14
* ` Integer#{ceil,floor,truncate} ` now accept a precision and ` Integer#round ` accepts a rounding mode.
15
15
* Added missing ` Enumerable#filter ` and ` Enumerator::Lazy#filter ` aliases to the respective ` select ` method (#1610 ).
16
- * Implement more ` Ripper ` methods as no-ops (#1694 ).
16
+ * Implemented more ` Ripper ` methods as no-ops (#1694 ).
17
17
* Implemented ` rb_enc_sprintf ` (#1702 ).
18
+ * Implemented ` ENV#{filter,filter!} ` aliases for ` select ` and ` select! ` .
18
19
19
20
Changes:
20
21
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
- # Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved. This
3
+ # Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved. This
4
4
# code is released under a tri EPL/GPL/LGPL license. You can use it,
5
5
# redistribute it and/or modify it under the terms of the:
6
6
#
@@ -245,6 +245,7 @@ def select(&blk)
245
245
return to_enum { size } unless block_given?
246
246
to_hash . select ( &blk )
247
247
end
248
+ alias_method :filter , :select
248
249
249
250
def to_a
250
251
ary = [ ]
@@ -292,6 +293,7 @@ def select!
292
293
return to_enum ( :select! ) { size } unless block_given?
293
294
reject! { |k , v | !yield ( k , v ) }
294
295
end
296
+ alias_method :filter! , :select!
295
297
296
298
def assoc ( key )
297
299
key = StringValue ( key )
You can’t perform that action at this time.
0 commit comments