JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6875

JRuby should load "some_path/some_file.jar.rb" if "some_path/some_file.jar" is required and "some_path/some_file.jar" does not exist.

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major 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 :
      0

      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?

        Activity

        Hide
        Uwe Kubosch added a comment -
        Show
        Uwe Kubosch added a comment - Added a test and fox for this in b37a0bd: https://github.com/jruby/jruby/commit/b37a0bd7e05955eecc9a6b60651df81cde78c58e

          People

          • Assignee:
            Unassigned
            Reporter:
            Uwe Kubosch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: