Add spec for require after $LOAD_PATH change#1881
Merged
dbussink merged 3 commits intorubinius:masterfrom Apr 26, 2013
LTe:require_after_load_patch_change
Merged
Add spec for require after $LOAD_PATH change#1881dbussink merged 3 commits intorubinius:masterfrom LTe:require_after_load_patch_change
dbussink merged 3 commits intorubinius:masterfrom
LTe:require_after_load_patch_change
Conversation
Contributor
|
Did you work further on implementing these changes on the Rubinius side to pass these specs? |
Contributor
Author
|
No, but I can add fail tag and after that this pull request can be merged. |
Contributor
|
Can you add this fail tag, so we can merge the spec? |
When developer add something to $LOAD_PATH and require once again the same file ruby should not require it once again. Example: Rubinius have lib/racc/parser.rb file. And this file will require after bootstrap. require 'racc/parser' After require 'rubygems' $LOAD_PATH will change and now we have access to two version on 'racc/parser' (from Rubinius /lib and /gems/racc). When user try to require once again rubinius will search via $LOAD_PATH and hit racc/parser from _RUBYGEMS_. In ruby 1.9 mode all paths are expanded so rubinius will require once again 'racc/parser'. This is because in $LOADED_FEATURES we can find only "[rubinius_path]/lib/racc/parser.rb". When CodeLoader will find file in $LOAD_PATH ([rubygems]/racc/parser.rb) and full path is not part of $LOADED_FEATURES this file will be load once again.
Contributor
Author
|
@stouset updated ;) |
Contributor
|
Your push doesn't seem to have had the desired effect of making Travis pass — the tests you added are still failing. You can either figure out the issue and solve it on your end, or I can try and take a look this weekend if I get a chance. |
dbussink
added a commit
that referenced
this pull request
Apr 26, 2013
Add spec for require after $LOAD_PATH change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When developer add something to $LOAD_PATH and require once again the same file ruby should not require it once again.
Example:
Rubinius have
lib/racc/parser.rbfile. And this file will require after bootstrap.After require
rubygems$LOAD_PATHwill change and now we have access to two version onracc/parser(from Rubinius/liband/gems/racc). When user try to require once again rubinius will search via$LOAD_PATHand hitracc/parserfrom RUBYGEMS. In ruby 1.9 mode all paths are expanded so rubinius will require once againracc/parser. This is because in$LOADED_FEATURESwe can find only[rubinius_path]/lib/racc/parser.rb. When CodeLoader will find file in$LOAD_PATH([rubygems]/racc/parser.rb) and full path of this file is not part of$LOADED_FEATURESsoparser.rbfile will be load once again.Any ideas how to recognize already loaded file (but from other full path)?
This spec reproduce @txus gist click
Related to issue #1571