Closed dmlary closed 4 years ago
Fixed by #49
I am still seeing these warnings and on Pry version 0.13.1 on Ruby 2.7.4. Any ideas?
/Users/stewartglover/code/toshi-web/app/models/journey.rb:59: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/Users/stewartglover/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/pry-0.12.2/lib/pry/commands/whereami.rb:40: warning: in `eval'
/Users/stewartglover/code/toshi-web/app/models/journey.rb:59: warning: __LINE__ in eval may not return location in binding; use Binding#source_location instead
/Users/stewartglover/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/pry-0.12.2/lib/pry/commands/whereami.rb:41: warning: in `eval'
/Users/stewartglover/code/toshi-web/app/models/journey.rb:59: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/Users/stewartglover/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/pry-0.12.2/lib/pry/method/weird_method_locator.rb:28: warning: in `eval'
/Users/stewartglover/code/toshi-web/app/models/journey.rb:59: warning: __LINE__ in eval may not return location in binding; use Binding#source_location instead
/Users/stewartglover/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/pry-0.12.2/lib/pry/method/weird_method_locator.rb:28: warning: in `eval'
@stewgloves according to your error message it seems like you're using pry 0.12.2 🤔
that is very strange. Thanks for the spot. @andrehjr Please ignore my comment as it would appear to be an environment issue on my end.
Ruby 2.7 introduced
Binding#source_location
, and with that addition warnings are now being generated each timebinding.eval('__FILE__')
andbinding.eval('__LINE__')
are called.This is the output using
pry-stack_explorer (0.4.9.3)