On 15 September 2011 01:12, Phillip Gawlowski <cmdjackryan / gmail.com> wrote:
> 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.

So long as I always use gems, sure.

It's probably the user's problem if they delete the Ruby interpreter
in the location where it was initially installed.

While it's totally possible to move the interpreter and still run it
many other things would likely break.

>
>> 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.

That's true so long as I don't try to run anything on such Ruby installation.

Also Apple sidestepped this by including Ruby in the system core where
it is always installed in /usr.

But since Ruby works on Windows it should work as a standalone
application on OS X too.

Thanks

Michal