File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
src/main/ruby/truffleruby/core Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ Compatibility:
25
25
* Add patch for ` digest ` so that TruffleRuby implementation is not overridden (@bjfish ).
26
26
* Handle encoding conversion errors when reading directory entries (@aardvark179 ).
27
27
* Follow symlinks when processing ` */ ` directory glob patterns. (#2589 , @aardvark179 ).
28
+ * Set ` @gem_prelude_index ` variable on the default load paths (#2586 , @bjfish )
28
29
29
30
Performance:
30
31
Original file line number Diff line number Diff line change @@ -835,6 +835,8 @@ def obj.foo2; yield; end
835
835
it "can be changed via <<" do
836
836
$: << "foo"
837
837
$:. should include ( "foo" )
838
+ ensure
839
+ $:. delete ( "foo" )
838
840
end
839
841
840
842
it "is read-only" do
@@ -850,6 +852,14 @@ def obj.foo2; yield; end
850
852
$-I = [ ]
851
853
} . should raise_error ( NameError )
852
854
end
855
+
856
+ it "default $LOAD_PATH entries until sitelibdir included have @gem_prelude_index set" do
857
+ $:. should . include? ( RbConfig ::CONFIG [ 'sitelibdir' ] )
858
+ idx = $:. index ( RbConfig ::CONFIG [ 'sitelibdir' ] )
859
+
860
+ $:[ idx ..-1 ] . all? { |p | p . instance_variable_defined? ( :@gem_prelude_index ) } . should be_true
861
+ $:[ 0 ...idx ] . all? { |p | !p . instance_variable_defined? ( :@gem_prelude_index ) } . should be_true
862
+ end
853
863
end
854
864
855
865
describe "Global variable $\" " do
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ def p(*a)
102
102
$LOAD_PATH. push "#{ ruby_home } /lib/truffle"
103
103
$LOAD_PATH. push "#{ ruby_home } /lib/mri"
104
104
$LOAD_PATH. push "#{ ruby_home } /lib/json/lib"
105
+
106
+ $LOAD_PATH. each { |p | p . instance_variable_set ( :@gem_prelude_index , p ) }
105
107
end
106
108
end
107
109
You can’t perform that action at this time.
0 commit comments