Skip to content

Commit 14559c7

Browse files
committed
Load boot scripts from classloader URI
This avoids doing a bunch of extra searches for these files and potentially loading an unexpected file from the file system.
1 parent 74249d2 commit 14559c7

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

core/src/main/ruby/jruby/java.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
###### END LICENSE BLOCK ######
3535

3636
# These are loads so they don't pollute LOADED_FEATURES
37-
load 'jruby/java/core_ext.rb'
38-
load 'jruby/java/java_ext.rb'
37+
load 'uri:classloader:jruby/java/core_ext.rb'
38+
load 'uri:classloader:jruby/java/java_ext.rb'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Extensions to Ruby classes
22

33
# These are loads so they don't pollute LOADED_FEATURES
4-
load 'jruby/java/core_ext/object.rb'
4+
load 'uri:classloader:jruby/java/core_ext/object.rb'

core/src/main/ruby/jruby/kernel.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@ module JRuby
77

88
begin
99
# Try to access ProcessBuilder; if it fails, don't define our special process logic
10-
load 'jruby/kernel/jruby/process_manager.rb'
10+
load 'uri:classloader:jruby/kernel/jruby/process_manager.rb'
1111
rescue Exception # java.lang.ProcessBuilder not available
1212
warn "ProcessBuilder unavailable; using default backtick" if $VERBOSE
1313
JRuby.send(:remove_const, :ProcessManager) rescue nil
1414
# leave old backtick logic in place
1515
end unless JRuby::Util.native_posix? # native POSIX uses new logic for back-quote
1616

1717
# These are loads so they don't pollute LOADED_FEATURES
18-
load 'jruby/kernel/signal.rb'
19-
load 'jruby/kernel/kernel.rb'
20-
load 'jruby/kernel/proc.rb'
21-
load 'jruby/kernel/process.rb'
22-
load 'jruby/kernel/enumerator.rb'
23-
load 'jruby/kernel/enumerable.rb'
24-
load 'jruby/kernel/io.rb'
25-
load 'jruby/kernel/gc.rb'
26-
load 'jruby/kernel/range.rb'
27-
load 'jruby/kernel/file.rb'
28-
load 'jruby/kernel/method.rb'
29-
load 'jruby/kernel/thread.rb'
30-
load 'jruby/kernel/integer.rb'
31-
load 'jruby/kernel/time.rb'
32-
load 'jruby/kernel/string.rb'
18+
load 'uri:classloader:jruby/kernel/signal.rb'
19+
load 'uri:classloader:jruby/kernel/kernel.rb'
20+
load 'uri:classloader:jruby/kernel/proc.rb'
21+
load 'uri:classloader:jruby/kernel/process.rb'
22+
load 'uri:classloader:jruby/kernel/enumerator.rb'
23+
load 'uri:classloader:jruby/kernel/enumerable.rb'
24+
load 'uri:classloader:jruby/kernel/io.rb'
25+
load 'uri:classloader:jruby/kernel/gc.rb'
26+
load 'uri:classloader:jruby/kernel/range.rb'
27+
load 'uri:classloader:jruby/kernel/file.rb'
28+
load 'uri:classloader:jruby/kernel/method.rb'
29+
load 'uri:classloader:jruby/kernel/thread.rb'
30+
load 'uri:classloader:jruby/kernel/integer.rb'
31+
load 'uri:classloader:jruby/kernel/time.rb'
32+
load 'uri:classloader:jruby/kernel/string.rb'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Load preludes
2-
load 'jruby/kernel/prelude.rb'
3-
load 'jruby/kernel/gem_prelude.rb'
2+
load 'uri:classloader:/jruby/kernel/prelude.rb'
3+
load 'uri:classloader:/jruby/kernel/gem_prelude.rb'

0 commit comments

Comments
 (0)