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

Suppress method redefined warnings #510

Merged
merged 2 commits into from
Sep 5, 2019
Merged

Commits on Dec 10, 2018

  1. Suppress method redefined warnings

    Problem
    ===
    
    `Bugsnag::Configuration#track_sessions` and `Bugsnag::Configuration#track_sessions=` are defined twice. Ruby warns them.
    
    Reproduce
    ===
    
    ```
    $ bundle exec ruby -w -Ilib -rbugsnag -e ''
    /home/pocke/ghq/github.com/bugsnag/bugsnag-ruby/lib/bugsnag/configuration.rb:54: warning: method redefined; discarding old track_sessions
    /home/pocke/ghq/github.com/bugsnag/bugsnag-ruby/lib/bugsnag/configuration.rb:55: warning: method redefined; discarding old track_sessions=
    /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:288: warning: method redefined; discarding old max_attempts
    /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/core_ext/module/attribute_accessors.rb:67: warning: previous definition of max_attempts was here
    /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.6.0/gems/delayed_job-4.1.5/lib/delayed/worker.rb:292: warning: method redefined; discarding old max_run_time
    /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/core_ext/module/attribute_accessors.rb:67: warning: previous definition of max_run_time was here
    ```
    
    See the first two lines (other lines are dependency gem's warnings).
    
    Cause
    ===
    
    `track_sessions` and `track_sessions=` are defined by `attr_accessor` and `alias`. The definition by `attr_accessor` has no meaning because `alias` conceal it.
    
    Solution
    ===
    
    Remove the `attr_accessor` definition.
    pocke committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    15e32ea View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2019

  1. Configuration menu
    Copy the full SHA
    e1e50db View commit details
    Browse the repository at this point in the history