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

Use require_relative in the Lrama codebase #419

Merged
merged 1 commit into from May 17, 2024

Conversation

koic
Copy link
Contributor

@koic koic commented May 12, 2024

If there are many searches in the $LOAD_PATH in the user environment, require will perform unnecessary searches that are not needed. In contrast, require_relative is efficient because it uses a relative path.

Lrama requires Ruby 2.5+, it is possible to use require_relative, which was introduced in Ruby 1.9.
https://github.com/ruby/lrama/blob/v0.6.9/lrama.gemspec#L14

If there are many searches in the `$LOAD_PATH` in the user environment,
require will perform unnecessary searches that are not needed.
In contrast, `require_relative` is efficient because it uses a relative path.

Lrama requires Ruby 2.5+, it is possible to use `require_relative`,
which was introduced in Ruby 1.9.
https://github.com/ruby/lrama/blob/v0.6.9/lrama.gemspec#L14
Copy link
Collaborator

@ydah ydah left a comment

Choose a reason for hiding this comment

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

Thank you!

@ydah ydah merged commit c3e37e8 into ruby:master May 17, 2024
16 checks passed
@koic koic deleted the use_require_relative branch May 17, 2024 00:36
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.

None yet

2 participants