Q
Quintus
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi there,
I'm trying to write something like a terminal emulator for use inside a
wxRuby GUI as a debugging console in the current context or just as a
possibility to issue some fast commands rather than clicking around. I
have to problems with this:
1. I wanted to use IRB to just allow the user to enter Ruby code in the
current project context, but IRB seems to only read from STDIN. I didn't
find a possibility to direct IRB somewhere else. So, is there one or can
I give up on this?
2. The second problem arises due to the first. I thought I may reassign
STDIN to a StringIO I write into what the text control I present to the
user gets inputted, but it seems that a #gets called on this StringIO
does not wait for the user to enter input, but just returns nil
immediately. So far I found out that this is because #tty? returns false
on the StringIO, but overriding the method to return true didn't work
for me. So, how do I make #gets and all the other inputting methods wait
until something is written to the StringIO, i.e. behave as if the
StringIO was a TTY?
A major part of this problems is that the code has to be
platform-independent, because the GUI is going to be run on Windows and
Linux systems (and maybe Macs as well)...
Thanks in advance,
Marvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkx1O8UACgkQDYShvwAbcNnQPwCaA5AHY4lozQsrSKm2Gj/zq34d
2rIAn3Z9oaM1ByxaT2q5uLW2c5Y7Fxbk
=GP0F
-----END PGP SIGNATURE-----
Hash: SHA1
Hi there,
I'm trying to write something like a terminal emulator for use inside a
wxRuby GUI as a debugging console in the current context or just as a
possibility to issue some fast commands rather than clicking around. I
have to problems with this:
1. I wanted to use IRB to just allow the user to enter Ruby code in the
current project context, but IRB seems to only read from STDIN. I didn't
find a possibility to direct IRB somewhere else. So, is there one or can
I give up on this?
2. The second problem arises due to the first. I thought I may reassign
STDIN to a StringIO I write into what the text control I present to the
user gets inputted, but it seems that a #gets called on this StringIO
does not wait for the user to enter input, but just returns nil
immediately. So far I found out that this is because #tty? returns false
on the StringIO, but overriding the method to return true didn't work
for me. So, how do I make #gets and all the other inputting methods wait
until something is written to the StringIO, i.e. behave as if the
StringIO was a TTY?
A major part of this problems is that the code has to be
platform-independent, because the GUI is going to be run on Windows and
Linux systems (and maybe Macs as well)...
Thanks in advance,
Marvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkx1O8UACgkQDYShvwAbcNnQPwCaA5AHY4lozQsrSKm2Gj/zq34d
2rIAn3Z9oaM1ByxaT2q5uLW2c5Y7Fxbk
=GP0F
-----END PGP SIGNATURE-----