zombocom / derailed_benchmarks

Go faster, off the Rails - Benchmarks for your whole Rails app
2.96k stars 141 forks source link

Allow `require_relative` to accept absolute paths #142

Closed michaelherold closed 5 years ago

michaelherold commented 5 years ago

Ruby's require_relative converts paths to absolute paths before calling require. This conversion effectively means that you can pass an absolute path to require_relative and have it load the file correctly, as if it were a relative path.

This is an idiosyncrasy of Ruby that doesn't match the semantics of the method. However, some libraries, like grpc, rely on the idiosyncrasy to load files. Because Derailed's implementation doesn't conform to this idiosyncrasy, it is unable to work when such libraries exist in a project.

This change makes Derailed's implementation of require_relative behave more closely to the implementation in Ruby. By making this change, you can use Derailed with any offending gem.

schneems commented 5 years ago

Thanks!

schneems commented 5 years ago

Released this in 1.4.0