-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove OpenStruct
usage, will warn in Ruby 3.4, raise in Ruby 3.5
#321
Comments
OpenStruct
usage, will warn in Ruby 3.5, raise in Ruby 3.6OpenStruct
usage, will warn in Ruby 3.4, raise in Ruby 3.5
Furthermore, OpenStruct usage is generally discouraged, due to invalidating the global method cache in Ruby. From RuboCop documentation:
|
Ruby 3.3.5 now warns about this.
|
Ruby 3.4 will issue a warning for this, and Ruby 3.5 will raise. Also see https://bugs.ruby-lang.org/issues/20309, ruby/ruby#10428
There is a single place here that will need adjusting:
mailgun-ruby/lib/mailgun/response.rb
Lines 15 to 19 in 1a2d2dc
The other places are test only and can be fixed simply by adding it to the Gemfile (or alternativly just return a hash from
response_generator
and use thefrom_hash
method, seems like that should work). I suggest replacing the one usage with the following (untested, should be fine):The text was updated successfully, but these errors were encountered: