From: Ryan Davis Date: 2007-12-26T05:16:03+09:00 Subject: Re: Calling Irb from inside an application On Dec 25, 2007, at 05:08 , Bertram Scharpf wrote: > In common my classes are not so easy to type in. So, I would like > to call Irb from somewhere inside the application as I do here: > > if $0 == __FILE__ then > require "irb" > $c = C.new > IRB.start > end I'm a bit confused. Your subject line IS handled by this code. Indeed, this is what I grabbed from some of my code when I read the subject line: def explore Object.const_set :"G", self require 'irb' puts "Your grammar is in the constant G" IRB.start(__FILE__) end So, what is the actual subject of this question? It doesn't seem to be "long-windedness" (below) either. > and then > > user@host $ ./call_irb.rb > irb(main):001:0> irb $c > irb#1(#):001:0> f > => "F" > irb#1(#):002:0> > > Is there a way how I can call C.new's Irb directly without doing > the long-winded definition of a global variable first? I already > examined the irb sources but this seems to be well-hidden to me. I'm confused and havet o assume the question is a bit vague. How is "$c = " long winded? What do you actually want to know?