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

Prefer require_relative for internal requires #622

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

tagliala
Copy link
Contributor

@tagliala tagliala commented Sep 19, 2024

Hi @deivid-rodriguez, I ran into an issue that you are probably familiar with while experimenting with GemBench

If you think this is a good change, I'll do the same for inherited_resources


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.

Ref:

`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.

Ref:
- ruby/psych#522
- ruby/logger#20
- ruby/rdoc#658
- panorama-ed/memo_wise#349
- rubocop/rubocop#8748
Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.31%. Comparing base (31c1487) to head (e122951).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #622   +/-   ##
=======================================
  Coverage   94.31%   94.31%           
=======================================
  Files          17       17           
  Lines         457      457           
=======================================
  Hits          431      431           
  Misses         26       26           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is awesome and a nice practice ❤️. Thank you!

@tagliala tagliala merged commit 984269d into activeadmin:master Sep 19, 2024
21 checks passed
@tagliala tagliala deleted the chore/prefer-require-relative branch September 19, 2024 12:07
tagliala added a commit to tagliala/inherited_resources that referenced this pull request Sep 19, 2024
`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.

Ref:
- activeadmin/arbre#622
tagliala added a commit to activeadmin/inherited_resources that referenced this pull request Sep 19, 2024
`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.

Ref:
- activeadmin/arbre#622
tagliala added a commit to tagliala/activeadmin that referenced this pull request Sep 19, 2024
`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.

Ref:
- activeadmin/arbre#622
- activeadmin/inherited_resources#939
tagliala added a commit to tagliala/activeadmin that referenced this pull request Sep 19, 2024
`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.

Ref:
- activeadmin/arbre#622
- activeadmin/inherited_resources#939
tagliala added a commit to tagliala/activeadmin that referenced this pull request Sep 19, 2024
`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.

Ref:
- activeadmin/arbre#622
- activeadmin/inherited_resources#939
tagliala added a commit to tagliala/activeadmin that referenced this pull request Sep 20, 2024
`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.

Ref:
- activeadmin/arbre#622
- activeadmin/inherited_resources#939
tagliala added a commit to activeadmin/activeadmin that referenced this pull request Sep 23, 2024
`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.

Ref:
- activeadmin/arbre#622
- activeadmin/inherited_resources#939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants