David Vallner
1/13/2006 7:39:00 PM
On Fri, 13 Jan 2006 18:50:59 +0100, Thomas <sanobast-2005a@yahoo.de> wrote:
>> Thanks. I didn't think about creating another ruby.bat file. There's a
>> "cygpath" utility in cygwin, but I didn't figure out yet how to use it
>> to call another program an to tell him which paths to use.
>
> I think you can run ruby using something like
>
> bash -c "ruby '$(cygpath -u %1)' %2 %3 %4 %5 %6 %7 %8 %9"
>
> Maybe you could put this into some kind of ruby.bat. I don't know if
> cmd.exe provided this kind of substitution which would make things
> easier.
>
There might be issues if ConTeXt is hardcoded ro run "ruby.exe", instead
of just "ruby" in a subshell. This is probably the first and last time I
see something that could be done with exec() instead of spawning a
subprocess...
The above command line should have "ruby.exe" instead of just ruby,
otherwise the BAT script would recurse forever. It seems you have the
Cygwin\bin on the path already, so that should be fine. Unfortunately,
despite the fact CMD came pretty close to a usable shell in XP, you still
have to do the batch argument hack there - it seems you can't specify "all
arguments after and including the second".
If by any chance the argument hack breaks ConTeXt, or that runs ruby with
some switches before the script filename, you can always have ruby.bat do
"ruby.js %*", and have the JScript play around with the arguments, like
finding the one that ends with ".rb" and then have cygpath have a go at
it. And afterwards, give your local admin a printout of this thread, and a
five dollar note saying "here, go buy a clue".
>> I don't have ConTeXt installed under cygwin
>
> But which probably is the way to go here.
>
> Even if you don't have administration rights, you should be able to
> compile it from source & install it in your user dir. (Maybe, somehow.)
>
>
It should be doable. Configure it with "./configure --prefix='~'" and it
should work. You might want to modify .profile to put ~/bin at the start
of PATH. And you also have to tell the linker where to find ~/lib, but
someone else will have to elucidate on that, I'm not very (at all)
experienced in ways *nixy that involve playing with the dynamic linking.
David Vallner