Hiro Asari created JRUBY-6350: --------------------------------- Summary: If extension is given to 'require' or 'load', that file should be preferred Key: JRUBY-6350 URL: https://jira.codehaus.org/browse/JRUBY-6350 Project: JRuby Issue Type: Bug Components: Core Classes/Modules Affects Versions: JRuby 1.7 Reporter: Hiro Asari
Below, we create two empty files, and require one of them. As you can see, "foo.jar" is found (and loaded, presumably). {noformat} [system] temp [git:master] $ touch foo.jar foo.so [system] temp [git:master] $ jruby -Xdebug.loadService=true -e 'require "foo.so"' 2>&1 | tail 2012-01-16T01:38:13.537-05:00: LoadService: LoadService: trying builtinLib: foo.jar 2012-01-16T01:38:13.537-05:00: LoadService: LoadService: trying builtinLib: foo.bundle 2012-01-16T01:38:13.537-05:00: LoadService: LoadService: trying resourceFromLoadPath: '/Users/asari/Development/src/jruby/lib/ruby/site_ruby/1.8/foo.jar' false false 2012-01-16T01:38:13.537-05:00: LoadService: LoadService: trying resourceFromLoadPath: '/Users/asari/Development/src/jruby/lib/ruby/site_ruby/1.8/foo.bundle' false false 2012-01-16T01:38:13.537-05:00: LoadService: LoadService: trying resourceFromLoadPath: '/Users/asari/Development/src/jruby/lib/ruby/shared/foo.jar' false false 2012-01-16T01:38:13.538-05:00: LoadService: LoadService: trying resourceFromLoadPath: '/Users/asari/Development/src/jruby/lib/ruby/shared/foo.bundle' false false 2012-01-16T01:38:13.538-05:00: LoadService: LoadService: trying resourceFromLoadPath: '/Users/asari/Development/src/jruby/lib/ruby/1.8/foo.jar' false false 2012-01-16T01:38:13.538-05:00: LoadService: LoadService: trying resourceFromLoadPath: '/Users/asari/Development/src/jruby/lib/ruby/1.8/foo.bundle' false false 2012-01-16T01:38:13.538-05:00: LoadService: LoadService: trying resourceFromCWD: /Users/asari/Development/src/jruby/temp/foo.jar 2012-01-16T01:38:13.538-05:00: LoadService: LoadService: found: file:/Users/asari/Development/src/jruby/temp/foo.jar {noformat} MRI prefers the specified file if the extension is given: {noformat}[system] temp [git:master] $ rm * [system] temp [git:master] $ touch foo.rb foo.bundle [system] temp [git:master] $ ruby -e 'require "foo.bundle"' ./foo.bundle: dlopen(./foo.bundle, 9): no suitable image found. Did find: (LoadError) ./foo.bundle: file too short - ./foo.bundle from -e:1 {noformat} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email