On Feb 11, 2011, at 9:49 PM, Luis Lavena wrote:

> On Fri, Feb 11, 2011 at 11:27 PM, Erik Hollensbe <e...@hollensbe.org> wrote:
>> 
>> I can look into this tomorrow morning if you want, I'm responsible for those 
>> patches.
>> 
> 
> The only workaround I can think of is compare additionally is instead
> of doing tty? on the stream, do something like this?
> 
> return nil if not isarealtty?(@ins)
> 
> where you evaluate if @ins.fileno is not 3 (0 = STDIN, 1 = STDOUT, 2 =
> STDERR, 3 = NUL:)

This is actually a consequence of increasing file descriptors, if you:

File.open('foo', 'w')
File.open('NUL', 'r').fileno

You should get 4 or 5 back depending on how you do it (e.g., IRB)

So this is not reliable.

> That is the only thing I can think of right now, but dunno what cygwin
> is going to say about it (and is friday night, brain is really burnt
> by now)
> 
> Will think on another approach during the weekend.

I should have a patch for your RSN to consider, but I think a part of the 
consequence here is that more than a few tests will have to be skipped in the 
UI portion; my solution maintains state independently of the filehandle 
information and that really breaks some things in the test suite.

Anyhow, pull request should be in soon.

-Erik
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to