jamesmartin / inline_svg

Embed SVG documents in your Rails views and style them with CSS
MIT License
716 stars 73 forks source link

Prefer `require_relative` for internal requires #170

Closed tagliala closed 1 month ago

tagliala commented 2 months ago

require_relative is preferred over require for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path.

This change updates internal requires to use require_relative for consistency, performance, and improved portability.

However, the test directory makes an exception and there require is preferred

Fix Packaging/RequireRelativeHardcodingLib safe offense

Ref:

tagliala commented 1 month ago

@jamesmartin and ready for review

Then I will go for another round of RuboCop offenses

tagliala commented 1 month ago

Sorry, I forgot to remove draft

jamesmartin commented 1 month ago

Thanks, @tagliala! 🙇