mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
- fix LOGSTASH-1015 (problem was 'require openssl.rb' wanted to load
"../../1.9/openssl.rb" relative to __FILE__ when in the jar, __FILE__ is file:/some/logstash.jar!/openssl.rb So 'expand_path' was incorrectly going outside the jar when it should stay rooted in it.
This commit is contained in:
parent
25c6d79cdd
commit
56a9331c61
1 changed files with 8 additions and 0 deletions
|
@ -32,6 +32,7 @@ class File
|
|||
|
||||
def expand_path(path, dir=nil)
|
||||
if path =~ /(jar:)?file:\/.*\.jar!/
|
||||
p :expand_path_path => [path, dir]
|
||||
jar, resource = path.split("!", 2)
|
||||
#p :expand_path => [jar, resource]
|
||||
if resource.nil? || resource == ""
|
||||
|
@ -40,6 +41,13 @@ class File
|
|||
else
|
||||
return "#{jar}!#{expand_path_JRUBY_6970(resource, dir)}"
|
||||
end
|
||||
elsif dir =~ /(jar:)?file:\/.*\.jar!/
|
||||
jar, dir = dir.split("!", 2)
|
||||
if dir.empty?
|
||||
# sometimes the original dir is just 'file:/foo.jar!'
|
||||
return File.join("#{jar}!", path)
|
||||
end
|
||||
return "#{jar}!#{expand_path_JRUBY_6970(path, dir)}"
|
||||
else
|
||||
return expand_path_JRUBY_6970(path, dir)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue