Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Compatibility:
* Add support for `Integer#[Range]` and `Integer#[start, length]` (#2182, @gogainda).
* Allow private calls with `self` as an explicit receiver (#2196, @wildmaples).
* Fixed `:perm` parameter for `File.write`.
* Added a `Array#minmax` to override `Enumerable#minmax` (#2199, @wildmaples).

Performance:

Expand Down
1 change: 0 additions & 1 deletion spec/tags/truffle/methods_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ fails:Public methods on Digest::Base should include reset
fails:Public methods on Digest::MD5 should not include block_length
fails:Public methods on Digest::SHA1 should not include block_length
fails:Public methods on Array should include deconstruct
fails:Public methods on Array should include minmax
fails:Public methods on Complex should include <=>
fails:Public methods on ENV.singleton_class should include freeze
fails:Public methods on Enumerable should include filter_map
Expand Down
8 changes: 8 additions & 0 deletions src/main/ruby/truffleruby/core/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,14 @@ def min(n=undefined)
super(n)
end

def minmax(&block)
if block_given?
super(&block)
else
[self.min, self.max]
end
end

def permutation_size(num)
n = self.size
if Primitive.undefined? num
Expand Down