Uh oh!
There was an error while loading. Please reload this page.
Removed Random::Formatter - #34
Conversation
ab4083a to
2fdde4fCompare2fdde4f to
40ddef8CompareFWIW 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: defalphanumeric(n=nil)n=16ifn.nil?choose(ALPHANUMERIC,n)end |
nevans
commented
Dec 2, 2024
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.2Fetching securerandom-0.3.2.gemSuccessfully installed securerandom-0.3.2Parsing documentation for securerandom-0.3.2Installing ri documentation for securerandom-0.3.2Done installing documentation for securerandom after 0 seconds1 gem installed
$ ruby -rsecurerandom -e "puts SecureRandom.uuid_v7"0193889a-f355-76b5-bff8-9e46efa743d0
$ gem install securerandom -v0.4.0Fetching securerandom-0.4.0.gemSuccessfully installed securerandom-0.4.0Parsing documentation for securerandom-0.4.0Installing ri documentation for securerandom-0.4.0Done installing documentation for securerandom after 0 seconds1 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.
hsbt
commented
Dec 3, 2024
@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