Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Use our optimized require over a bare require. #2082

Merged
merged 1 commit into from
Oct 8, 2015

Conversation

myronmarston
Copy link
Member

Besides being faster (at least for environments with lots
of directories on the load path), this avoids potentially
loading the file twice, since rspec-mocks loads it in this
fashion rather than with a bare require.

Fixes rspec/rspec-support#244.

Besides being faster (at least for environments with lots
of directories on the load path), this avoids potentially
loading the file twice, since rspec-mocks loads it in this
fashion rather than with a bare require.

Fixes rspec/rspec-support#244.
@@ -1,4 +1,4 @@
require 'rspec/support/reentrant_mutex'
RSpec::Support.require_rspec_support 'reentrant_mutex'
Copy link
Member

Choose a reason for hiding this comment

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

Ah that's how it's happening, it's probably using the require_relative in the optimised one and that counts as a different require to the bare one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep!

JonRowe added a commit that referenced this pull request Oct 8, 2015
Use our optimized require over a bare require.
@JonRowe JonRowe merged commit 7477810 into master Oct 8, 2015
@JonRowe JonRowe deleted the use-optimized-require branch October 8, 2015 01:36
@JonRowe
Copy link
Member

JonRowe commented Oct 8, 2015

LGTM

MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
Use our optimized require over a bare require.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants