Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rubinius load file twice when first time developer require with .rb
Before patch when user require file with .rb suffix Rubinius recognize file as :ruby type and execute method :verify_load_path from Rubinius::CodeLoader. In this method interpreter interate via $LOAD_PATH and search for proper file. After that Rubinius add to $LOADED_FEATURES relative path. But when developer require witout .rb suffix Rubinius execute another method (because interpreter need guess extension). Method without .rb suffix add to $LOADED_FEATURES only short file path. Example require 'ruby.rb' $LOADED_FEATURES # => ["./ruby.rb"] require 'ruby' $LOAD_FEATURES # => ["ruby.rb"] In this way, the interpreter can load file twice. After patch: require 'ruby.rb' $LOADED_FEATURES # => ["ruby.rb"] require 'ruby' $LOAD_FEATURES # => ["ruby.rb"] * Fixes #1788 * Fixes #1571
- Loading branch information
Showing
3 changed files
with
46 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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