Conversation
ab4083a to
2fdde4f
Compare
2fdde4f to
40ddef8
Compare
|
FWIW I think this causes problems with Rails on ruby 3.2. Rails was using SecureRandom.alphanumeric here - https://github.com/rails/rails/blob/4060253ea7bf1a04c7b2368ffc17ddcf991997f9/activesupport/lib/active_support/core_ext/securerandom.rb#L20, but now throws With the removal of SecureRandom.alphanumeric, that falls back to Random.alphanumeric. On ruby 3.2, that only accepts a single argument: def alphanumeric(n=nil)
n = 16 if n.nil?
choose(ALPHANUMERIC, n)
end |
|
As far as I can tell, the only functional changes to Random::Formatter between v0.2.0 (which was installed with ruby 3.1.6) and v0.3.2 are:
$ rbenv shell 3.2.6
$ gem install securerandom -v0.3.2
Fetching securerandom-0.3.2.gem
Successfully installed securerandom-0.3.2
Parsing documentation for securerandom-0.3.2
Installing ri documentation for securerandom-0.3.2
Done installing documentation for securerandom after 0 seconds
1 gem installed
$ ruby -rsecurerandom -e "puts SecureRandom.uuid_v7"
0193889a-f355-76b5-bff8-9e46efa743d0
$ gem install securerandom -v0.4.0
Fetching securerandom-0.4.0.gem
Successfully installed securerandom-0.4.0
Parsing documentation for securerandom-0.4.0
Installing ri documentation for securerandom-0.4.0
Done installing documentation for securerandom after 0 seconds
1 gem installed
$ ruby -rsecurerandom -e "puts SecureRandom.uuid_v7"
-e:1:in `<main>': undefined method `uuid_v7' for SecureRandom:Module (NoMethodError)
puts SecureRandom.uuid_v7
^^^^^^^^
Did you mean? uuid |
In ruby/securerandom#34, Random::Formatter was removed from securerandom. This change broke the alphanumeric method signature in Ruby 3.2 since the `chars` parameter isn't available there yet.
|
@jdelStrother @nevans Thank you for sharing that. I and @nobu couldn't care these cases before removing |
In ruby/securerandom#34, Random::Formatter was removed from securerandom. This change broke the alphanumeric method signature in Ruby 3.2 since the `chars` parameter isn't available there yet.
In ruby/securerandom#34, Random::Formatter was removed from securerandom. This change broke the alphanumeric method signature in Ruby 3.2 since the `chars` parameter isn't available there yet.
|
@hsbt Would it be possible (this close to the 3.4 release) to create a new |
This is another try with #29