Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support foo.jar that is linked to extensionless jar files #826

Merged
merged 1 commit into from

2 participants

@ratnikov

No description provided.

@headius headius merged commit 148dc64 into jruby:master
@ratnikov ratnikov deleted the ratnikov:fix-symlink-load branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 24, 2013
  1. @ratnikov
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 2 deletions.
  1. +3 −2 src/org/jruby/runtime/load/LoadService.java
  2. +17 −0 test/test_load.rb
View
5 src/org/jruby/runtime/load/LoadService.java
@@ -1092,7 +1092,8 @@ protected Library createLibrary(SearchState state, LoadServiceResource resource)
if (resource == null) {
return null;
}
- String file = state.loadName;
+ String file = resource.getName();
+ String location = state.loadName;
if (file.endsWith(".so") || file.endsWith(".dll") || file.endsWith(".bundle")) {
if (runtime.getInstanceConfig().isCextEnabled()) {
return new CExtension(resource);
@@ -1104,7 +1105,7 @@ protected Library createLibrary(SearchState state, LoadServiceResource resource)
} else if (file.endsWith(".class")) {
return new JavaCompiledScript(resource);
} else {
- return new ExternalScript(resource, file);
+ return new ExternalScript(resource, location);
}
}
View
17 test/test_load.rb
@@ -262,4 +262,21 @@ def test_cwd_plus_dotdot_jar_loading
$hello
})
end
+
+ def test_symlinked_jar
+ Dir.chdir('test') do
+ FileUtils.cp 'jar_with_ruby_files.jar', 'jarwithoutextension' unless File.exists?('jarwithoutextension')
+ File.symlink 'jarwithoutextension', 'symlink.jar' unless File.symlink?('symlink.jar')
+ end
+
+ assert_in_sub_runtime %{
+ require 'test/symlink.jar'
+ }
+ ensure
+ Dir.chdir('test') do
+ [ 'jarwithoutextension', 'symlink.jar' ].each do |file|
+ File.delete(file)
+ end
+ end
+ end
end
Something went wrong with that request. Please try again.