RBX standard input processing is different from MRI #1956

Closed
ioquatix opened this Issue Oct 15, 2012 · 11 comments

Projects

None yet

3 participants

@ioquatix

Hi,

RBX doesn't allow me to type in both code and input as is typical of MRI ruby:

$ ruby --version            
rubinius 2.0.0dev (1.8.7 78652b58 yyyy-mm-dd JI) [x86_64-apple-darwin12.2.0]
$ ruby -        
puts $stdin.readlines.inspect
<Ctrl-D>[]


$ ruby --version
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
$ ruby -
puts $stdin.readlines.inspect
<Ctrl-D>Hello World
<Ctrl-D>["Hello World\n"]

This is highly useful when working with Ruby via SSH, since it allows you to send both programs and data across the network trivially.

Thanks,
Samuel

@ioquatix

I managed to get the behaviour I was after with a hack:

$ ruby -
class IO; def reset!; @eof = false; @ibuffer.reset!; end; end;
STDIN.reset!; puts STDIN.read
^D
Foobar
^D
Foobar
@ioquatix

I'm not sure if this helps but here are several unit tests that fail due to the above incompatibility: https://travis-ci.org/#!/ioquatix/rexec

@Peeja

I can confirm all of the above behavior.

Where do specs for such things live?

@ioquatix

@Peeja I did hack on this and fix the issue but it was a horrible hack. Not sure how to go about it nicely.

@ioquatix

Hi, just bumping this issue, still causing problems.

@ioquatix ioquatix closed this May 9, 2013
@ioquatix ioquatix reopened this May 9, 2013
@ioquatix

Whoops, hit wrong button :/

@ioquatix

This is still a bug with the latest rubinius.

@ioquatix

@dbussink Perhaps this is something you can help with too?

@dbussink
Rubinius member

@ioquatix What was your hack that you're talking about here?

@ioquatix

@dbussink This one:

$ ruby -
class IO; def reset!; @eof = false; @ibuffer.reset!; end; end;
STDIN.reset!; puts STDIN.read
^D
Foobar
^D
Foobar
@dbussink dbussink closed this in 703cc7b Aug 28, 2013
@ioquatix

@dbussink Thanks for fixing this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment