On Thu, Sep 15, 2011 at 12:09 AM, Michal Suchanek <hramrach / centrum.cz> wrote:
>
> I don't care where it is *installed*, I care where it *is*.

Those are synonyms, since the user can execute Ruby programs. *How*
the user does that is simply none of your concern, but the user's
problem (i.e. whether it's a copied instance of Ruby, or a full system
installation, or an RVM managed Ruby, or a script executed against all
the Rubies pik knows about are all valid and common ways to run Ruby
scripts).

> The reason is quite simple and i said it in the first mail. I was
> trying to write a test for a function that redirects STDERR.
>
> Now I have a library of functions already tested that redirects
> everything but it runs a command with STD I/O/E redirected, not ruby.
>
> AFAICT it is not possible to pass a "-" into exec to have ruby
> re-executed, and exec is what I use.
>
> So to write the test I have to use fork and do manual redirections to
> check that the function works as I want.
>
> It would be much easier if I could just run Ruby and pass it a test
> program as argument.

And

$ `#{Gem.ruby} /path/to/testscript`

doesn't suffice?

Makes me wonder about what you've written, to be honest.

> On the other hand, OS X can run Ruby, has exec() and has linker
> support for moving whole applications with libraries and all. I am not
> sure how much Ruby would break by installing in this fashion, though.

That's Apple's problem, not yours.

-- 
Phillip Gawlowski

gplus.to/phgaw | twitter.com/phgaw

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
-- Leibniz