-
Notifications
You must be signed in to change notification settings - Fork 281
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
"warning: attribute accessor as module_function" (with JRuby) #1108
Comments
Probably related to: |
GeoffKarnov
added a commit
to GeoffKarnov/rollbar-gem
that referenced
this issue
Dec 4, 2023
When Running rspec with --warnings enabled a warning is emitted by the rollbar gem. ``` $ rspec --warnings /my/path/ruby-3.2.2/gems/rollbar-3.4.1/lib/rollbar/json.rb:8: warning: attribute accessor as module_function ``` This is caused by the line ``` attr_writer :options_module ``` Within [lib/rollbar/json.rb](https://github.com/rollbar/rollbar-gem/blob/8c6a9e94629c0a8b964f0a3b13eab742c3800841/lib/rollbar/json.rb#L8) The line was introduced here, when there was a more complicated way of configuring the json parser. rollbar@e33f10e#diff-9e64389290ff8e4e50cba9436521333bdd3307baa63ed84b74f0f9b28a6cfceaR13 However in 2019 this code was removed, and replaced with Ruby's JSON module rollbar@de45e80#diff-9e64389290ff8e4e50cba9436521333bdd3307baa63ed84b74f0f9b28a6cfceaL39-L41 But the attr_writer was (accidentally?) not removed. As the `options_module` attribute writer is not documented or referenced anywhere else in the project I believe it can be removed. This commit removes the unused `attr_writer` and fixes the warning. Fixes: rollbar#1108
12 tasks
waltjones
pushed a commit
that referenced
this issue
Dec 19, 2023
When Running rspec with --warnings enabled a warning is emitted by the rollbar gem. ``` $ rspec --warnings /my/path/ruby-3.2.2/gems/rollbar-3.4.1/lib/rollbar/json.rb:8: warning: attribute accessor as module_function ``` This is caused by the line ``` attr_writer :options_module ``` Within [lib/rollbar/json.rb](https://github.com/rollbar/rollbar-gem/blob/8c6a9e94629c0a8b964f0a3b13eab742c3800841/lib/rollbar/json.rb#L8) The line was introduced here, when there was a more complicated way of configuring the json parser. e33f10e#diff-9e64389290ff8e4e50cba9436521333bdd3307baa63ed84b74f0f9b28a6cfceaR13 However in 2019 this code was removed, and replaced with Ruby's JSON module de45e80#diff-9e64389290ff8e4e50cba9436521333bdd3307baa63ed84b74f0f9b28a6cfceaL39-L41 But the attr_writer was (accidentally?) not removed. As the `options_module` attribute writer is not documented or referenced anywhere else in the project I believe it can be removed. This commit removes the unused `attr_writer` and fixes the warning. Fixes: #1108
Thanks for the fix @waltjones! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've noticed a warning during our test suite with JRuby (9.3.1.0, 9.3.8.0), so I'm reporting it here:
I do not know yet why it appears only with JRuby (a good part of the test suite is also compatible with MRI 2.7.x), nor if it is problematic at this point.
The text was updated successfully, but these errors were encountered: