Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.7
-
Fix Version/s: JRuby 1.7.0.RC1
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:This is in use on Ruboto where we unpack JAR contents and add dummy Ruby sources to satisfy require statements for the jars. Is does however affect all platforms on which JRuby runs (Tested on OS X Mountain Lion).
-
Number of attachments :
Description
This should work, I think:
irb(main):001:0> File.write 'some.jar.rb', '' => 0 irb(main):002:0> require './some.jar' LoadError: no such file to load -- ./some from org/jruby/RubyKernel.java:1018:in `require' from /Users/uwe/workspace/jruby/jruby/lib/ruby/shared/rubygems/custom_require.rb:36:in `require' from (irb):2:in `evaluate' from org/jruby/RubyKernel.java:1064:in `eval' from org/jruby/RubyKernel.java:1389:in `loop' from org/jruby/RubyKernel.java:1172:in `catch' from org/jruby/RubyKernel.java:1172:in `catch' from /Users/uwe/workspace/jruby/jruby/bin/jirb:13:in `(root)'
I realize JAR files are a special case, but if it doesn't exist, the standard Ruby behaviour should be followed and we should try to load a file with ".rb" appended.
Right?
Added a test and fox for this in b37a0bd:
https://github.com/jruby/jruby/commit/b37a0bd7e05955eecc9a6b60651df81cde78c58e