Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f4036abf12b8
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 56f9a243d8c3
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Nov 11, 2014

  1. allow both "jar:file:./my.jar!/" and "jar:file:./my.jar!" as LOAD_PAT…

    …H entries
    
    this was a regression introduced with jruby-1.7.13 - fixes #2017
    
    Sponsored by Lookout Inc.
    mkristian committed Nov 11, 2014
    Copy the full SHA
    56f9a24 View commit details
Showing with 8 additions and 0 deletions.
  1. +2 −0 core/src/main/java/org/jruby/util/JarResource.java
  2. +6 −0 test/test_jar_on_load_path.rb
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/util/JarResource.java
Original file line number Diff line number Diff line change
@@ -31,6 +31,8 @@ public static JarResource create(String pathname) {
int bang = sanitized.indexOf('!');
String jarPath = sanitized.substring(0, bang);
String entryPath = sanitized.substring(bang + 1);
// normalize path -- issue #2017
if (entryPath.startsWith("//")) entryPath = entryPath.substring(1);

// TODO: Do we really need to support both test.jar!foo/bar.rb and test.jar!/foo/bar.rb cases?
JarResource resource = createJarResource(jarPath, entryPath, false);
6 changes: 6 additions & 0 deletions test/test_jar_on_load_path.rb
Original file line number Diff line number Diff line change
@@ -6,4 +6,10 @@ def test_jar_on_load_path
require 'test_jruby_1332.rb'
assert($jruby_1332)
end

def test_jar_on_load_path_with_trailing_slash
$LOAD_PATH << "test/test_jruby_1332.jar!/"
require 'test_jruby_1332.rb'
assert($jruby_1332)
end
end