S
S. Robert James
Lisp programmers often use the REPL (similar to IRB) as a simple way
to make an interactive interface to their app. I'd like to do the
same thing with irb - that is, define my classes, and load irb in the
context.
I can get about half way there:
require 'irb'
IRB.start
my_class = MyClass.new(...) # I want this to be the context
irb my_class
....works, but you have to type "quit" to load. Is there a better way
to leverage IRB from within my code? What do the Ruby hackers say? (I
know a lot have a Lisp background, and so wouldn't want Ruby to not
have a REPL shell...)
to make an interactive interface to their app. I'd like to do the
same thing with irb - that is, define my classes, and load irb in the
context.
I can get about half way there:
require 'irb'
IRB.start
my_class = MyClass.new(...) # I want this to be the context
irb my_class
....works, but you have to type "quit" to load. Is there a better way
to leverage IRB from within my code? What do the Ruby hackers say? (I
know a lot have a Lisp background, and so wouldn't want Ruby to not
have a REPL shell...)