Closed uvlad7 closed 7 months ago
In JRuby I can load jars like this
require File.join(Dir.home, '.m2', 'repository', 'com', 'squareup', 'okio', 'okio', '1.15.0', 'okio-1.15.0.jar') require File.join(Dir.home, '.m2', 'repository', 'com', 'squareup', 'okhttp3', 'okhttp', '3.12.12', 'okhttp-3.12.12.jar')
but it doesn't work in rjb after require 'rjb/extension' because of the following check
rjb
require 'rjb/extension'
found_path = $LOAD_PATH.reverse.find{|p| File.exist?(File.join(p,path))}
so I had to do this
$LOAD_PATH << File.join(Dir.home, '.m2', 'repository') require File.join('com', 'squareup', 'okio', 'okio', '1.15.0', 'okio-1.15.0.jar') require File.join('com', 'squareup', 'okhttp3', 'okhttp', '3.12.12', 'okhttp-3.12.12.jar')
probably this check should be omitted for absolute paths.
Note: c ruby itself requires absolute path just fine
require File.join(Dir.home, 'rjb/lib/rjb/extension')
I believe it's possible to reuse Ruby's own logic used to resolve load path?
Additionally patch require_relative would be nice too
require_relative
@uvlad7 Thank you for your report. rjb-1.7.1.gem skips load path test if an absolute path was given.
In JRuby I can load jars like this
but it doesn't work in
rjb
afterrequire 'rjb/extension'
because of the following checkso I had to do this
probably this check should be omitted for absolute paths.
Note: c ruby itself requires absolute path just fine
I believe it's possible to reuse Ruby's own logic used to resolve load path?
Additionally patch
require_relative
would be nice too