S
Shane Liesegang
Is there a way to use the IRB module so that it evaluates code on-demand
only instead of running in a constant loop?
I don't need to use readline and have IRB wait for input -- I can
trigger its need to evaluate from elsewhere in the program. I was
hoping, though, that I could have the gets function from my
IRB::StdioInputMethod subclass return a properly formatted string, let
IRB do its thing, and then give me back control until it was needed
again.
It seems, though, that the eval_input function just keeps executing gets
and never returns control. I understand that's the intended behavior of
eval_input, but I'm a little surprised there's not a more asynchronous
way of requesting evaluation.
Am I just approaching the problem from the wrong angle? I keep feeling
like Ruby has to provide a way to do what I'm after, but I haven't been
able to track it down thus far.
Any help would be appreciated.
only instead of running in a constant loop?
I don't need to use readline and have IRB wait for input -- I can
trigger its need to evaluate from elsewhere in the program. I was
hoping, though, that I could have the gets function from my
IRB::StdioInputMethod subclass return a properly formatted string, let
IRB do its thing, and then give me back control until it was needed
again.
It seems, though, that the eval_input function just keeps executing gets
and never returns control. I understand that's the intended behavior of
eval_input, but I'm a little surprised there's not a more asynchronous
way of requesting evaluation.
Am I just approaching the problem from the wrong angle? I keep feeling
like Ruby has to provide a way to do what I'm after, but I haven't been
able to track it down thus far.
Any help would be appreciated.