Skip to content
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

Fix warning: attribute accessor as module_function #1138

Merged

Commits on Dec 4, 2023

  1. Fix warning: attribute accessor as module_function

    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
    GeoffKarnov committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    7ebcbd8 View commit details
    Browse the repository at this point in the history