Path separators differ between jruby and jruby --ng on Windows
--------------------------------------------------------------
Key: JRUBY-3998
URL: http://jira.codehaus.org/browse/JRUBY-3998
Project: JRuby
Issue Type: Bug
Components: Windows
Affects Versions: JRuby 1.4
Environment: JVM 1.6 on WinXP
Reporter: Ian Dees
Priority: Minor
Fix For: JRuby 1.4
Attachments: ng-path-separator.patch
The following interaction illustrates the issue:
{noformat}
E:\src> jruby -S jirb
irb(main):001:0> Dir.pwd
=> "E:/src"
E:\src> jruby --ng -S jirb
irb(main):001:0> Dir.pwd
=> "E:\\src"
{noformat}
This causes two tests to fail in {{test_file.rb}}, but more importantly, it
causes tools like {{autospec}} and {{watchr}} to abort with an error inside
{{pathname.rb}} when they're run with Nailgun.
I've patched the specific implementation of {{Dir#pwd}} to normalize paths, so
that JRuby will act the same with or without Nailgun. As an aside, there are
lots of places where {{RubyDir.java}} gets the current directory. Some places
normalize the path, and some don't. I've striven not to disturb those other
uses in the scope of this change. It may be worth unifying all those
current-directory calls at some point in the future, but that's beyond the
scope of {{Dir#pwd}}.
This patch includes a test case for thoroughness' sake, but the existing JRuby
tests were sufficient to catch this issue.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email