[Rubygems-developers] Reduce the gap between posix and Windows

James Tucker jftucker at gmail.com
Fri Apr 25 08:32:18 EDT 2008

On 25 Apr 2008, at 13:09, Luis Lavena wrote:

> On Fri, Apr 25, 2008 at 8:58 AM, James Tucker <jftucker at gmail.com>  
> wrote:
>> assoc .=MaybeExecutable
>> ftype MaybeExecutable=c:\ruby\bin\ruby c:\pretend_posix\bin\execve  
>> %0 %*
>> Or something like that. N.B. I got most of the way to the above  
>> working,
>> and hit some problems (I was working off a network drive at the  
>> time, YMMV
>> with more local drives, hopefully, the solution can work).
>> Also, git solved this problem by implementing some compatibility  
>> wrappers:
>> http://marc.info/?l=git&m=120413867221197&w=2
> Well, what actually Git do is wrap the environment of msys around the
> batch file to avoid having it in the PATH.
> What we are facing is another problem here.

I didn't look at the ruby internals to see what was going on there, it  
appears you've prompted it to be altered in a suitable way.

I was more focusing on the fact that they interpret the shebang to  
look for scripts, as it kinda makes sense to me that it would be a  
good idea to try to make interpreted extension-less scripts actually  
executable on the platform. This is the reason I've been fiddling with  
PATHEXT and friends.

> RubyGems generated 2 files for each executable script that is
> installed, example:
> rake
> rake.bat
> spec
> spec.bat
> When Ruby is doing lookup (dln_find_exe) it consider the first it
> finds (rake) to be an executable, and not the later. Then it fails to
> use cmd.exe to fire the script and that ended you with borked results.

I see, `rake` is not at all executable on Windows however...

> In any case, Nobu committed a change in the lookup process that solved
> this, so now is possible do system('rake') without worry about
> platforms, .bat, .cmd or all that.

that's refreshing :D

More information about the Rubygems-developers mailing list