From 7923e420c49b366db7b10bbeaf17653c3acc24c0 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 16 Dec 2024 14:02:39 +0900 Subject: [ruby/securerandom] Only define compatible method in < Ruby 3.3 https://github.com/ruby/securerandom/commit/2c8cdfba7b --- lib/securerandom.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/securerandom.rb b/lib/securerandom.rb index 0bcd2b6af0..442a71177d 100644 --- a/lib/securerandom.rb +++ b/lib/securerandom.rb @@ -53,13 +53,9 @@ module SecureRandom # Compatibility methods for Ruby 3.2, we can remove this after dropping to support Ruby 3.2 def alphanumeric(n = nil, chars: ALPHANUMERIC) - if RUBY_VERSION < '3.3' - n = 16 if n.nil? - choose(chars, n) - else - super n, chars: chars - end - end + n = 16 if n.nil? + choose(chars, n) + end if RUBY_VERSION < '3.3' private -- cgit v1.2.3