jenkinsci/rake-plugin — pull request #13 by olivierdagenais (2013-07-18 20:25:08+00:00)
Title: Fix JENKINS-18822

[JENKINS-18822: Unable to use default rake on Windows with certain JREs](https://issues.jenkins-ci.org/browse/JENKINS-18822) is caused by [JDK-8016721 : (process) Behavior of %~dp0 in .cmd and .bat scripts has changed](http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8016721).

This pull request works around the bug in the JRE by resolving the rake executable through a scan of `PATH`. A side-effect of these changes is the absolute path to the rake executable will now be logged. For example, a build containing a rake step that I started after deploying `rake.hpi` contained this:

[workspace] $ C:\RubyTools\Ruby200-x64\bin\rake.bat all

While implementing my changes, I had made the mistake of using `File.pathSeparator`, which was incorrect (for example, when the master is running on Windows and a slave is running on Linux). When fixing that, I noticed there was another use of `File.pathSeparator` that was incorrect, so I fixed that one too.