Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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
Member

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

2 participants