sparklemotion / mechanize

Mechanize is a ruby library that makes automated web interaction easy.
https://www.rubydoc.info/gems/mechanize/
MIT License
4.39k stars 473 forks source link

prefer `caller_locations` and `Thread::Backtrace::Location` methods to `Kernel#caller` #638

Closed flavorjones closed 6 months ago

flavorjones commented 6 months ago

Mechanize has still been using Kernel#caller whose string representation has changed enough in Ruby 3.4.0.dev to break how deprecation messages were being handrolled.

Replace all uses of caller with caller_locations which is both faster and returns an object with some nice methods we can use to isolate the method, the file, and the line number.

This should get us green again on ruby-head.