-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Q] __dir__ variable in jar file. #4611
Comments
@hiroyuki-sato this is definitely a bug. We should be returing similarly to the FILE. |
Hello, @enebo Best regards. |
@hiroyuki-sato since the plugin packs in jruby ... any chance you could force it to use latest JRuby 9.1.10? |
I see now, this simply never worked (the |
@kares I think we need the same special-case logic here, or better, make this call hopefully-existing logic that does the right thing already. |
@kares Thank you for your comment. Yes, I tried it. The latest JRuby (9.1.10.0) got the same error. Best regards. SummariesThe Embulk use liquid gem. Reproduce stepsBuild embulk 0.8.20, update
And test
Error.
root causeThe 3.0.6 used Liquid-3.0.6 lib/liquid.rb Dir[File.dirname(__FILE__) + '/liquid/tags/*.rb'].each { |f| require f } Liquid-4.0.0 lib/liquid.rb Dir["#{__dir__}/liquid/tags/*.rb"].each { |f| require f } Reference. |
__dir__ won't work with embed paths such as uri:classloader: (#4611)
expected to be resolved with #4658 |
@kares Thank you for fixing this issue. |
I would like to ask about
__dir__
variable in jar archive.1. environment
2. expected and actual behavior
2.1 Expected Behavior
As the following test result, I think
__dir__
should return A or B2.2 Actual Behavior
The
__dir__
returns strange path like/path/cwd:classloader:/gems/liquid-4.0.0/lib
./path/cwd
is the current working directory which I executejava
command.3. Question
4. Details
This sample project make a single jar file with liquid-4.0.0 gem package.
The liquid package are locate below.
When I put the following codes in
gems/liquid-4.0.0/lib/liquid.rb
The result were below.
File.dirname(__FILE__)
File.expand_path(File.dirname(__FILE__)
__dir__
(
/private/tmp/jruby__dir_test
is the java execution directory)And I also test
Dir.exist?
command.__dir__
result5. Test codes.
this java code execute the following Ruby code.
The result is the below.
pp Liquid::Continue
raise an exception becauselib/liquid.rb in liquid-4.0.0 use the following code and
__dir__
return strange path.Best regards.
The text was updated successfully, but these errors were encountered: