-
-
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
Added uri to path when using file protocol to chdir #3127
Conversation
@@ -326,6 +326,9 @@ public static IRubyObject chdir(ThreadContext context, IRubyObject recv, IRubyOb | |||
if (adjustedPath.startsWith("uri:")){ | |||
realPath = adjustedPath; | |||
} | |||
else if (adjustedPath.startsWith("file:")){ | |||
realPath = "uri:" + adjustedPath; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a path with !/
is treated as jar uri whether this is a file: or jar: or jar:file: prefix or not. and this is the case where you want the uri: to add. but for uri:
to work properly it needs new URL(adjustedPath).openStream()
to work. i.e. in your case make sure there is jar:file: prefix
an path with file: onto the filesystem without the !/
better just remove the file: prefix and let jruby use the filesystem.
but I do not understand why your current patch fixes the warbler problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we all to chdir to all paths following this pattern: https://github.com/jruby/jruby/blob/jruby-1_7/core/src/main/java/org/jruby/RubyFile.java#L670
it feels wrong to switch one pseudo-uri to another
No, neither 1.7.21 nor 1.7.22.dev fixed this. I tried removing the
I will investigate the .jrubydir |
the .jrubydir will not help here with this concrete bundler problem. just passing on the yes, I did not run the sample repo at the beginning. |
Ah, i understand now. I will improve this |
Added uri to path when using file protocol to chdir
never saw the update - but saw your question on IRC :) |
@mkristian thanks for your help with this! |
See jruby/warbler#323