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: __FILE__ in eval may not return location in binding #458

Merged
merged 2 commits into from Apr 18, 2020

Conversation

@yuuu
Copy link
Contributor

yuuu commented Apr 13, 2020

When I used better_errors with rails-6.0.2.1 and ruby-2.7.0, I got the following warnings.

/Users/yuuu/src/github.com/fusic/mockmock-web/vendor/bundle/ruby/2.7.0/gems/better_errors-2.6.0/lib/better_errors/raised_exception.rb:40: warning: in `eval'
/Users/yuuu/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.2/libexec/bundle:46: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead

It has been modified to use Binding#source_location with reference to this issue.

pry/pry#2097

@RobinDaugherty RobinDaugherty added this to the v2.7 milestone Apr 18, 2020
@RobinDaugherty
Copy link
Member

RobinDaugherty commented Apr 18, 2020

Thank you @yuuu! This is a good change, but it isn't compatible with all of the versions of Ruby that we support. Can you change this use source_location only when binding responds to it, and fall back to the old behavior otherwise?

@RobinDaugherty
Copy link
Member

RobinDaugherty commented Apr 18, 2020

Please disregard my last message, I found the time to complete this.

@RobinDaugherty RobinDaugherty merged commit c993df6 into BetterErrors:master Apr 18, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.