From: abc Date: 2009-03-15T22:37:41+09:00 Subject: Re: How can I know if a program is running inside irb? On 15 mar, 14:22, badboy wrote: > abc schrieb:> Hi, > > > from a certain piece of code, how can I know if it's been run inside > > irb, or just ruby. I've tried looking in the IRB rdoc, but haven't > > found any relevant methods. > > > Thanks in advance. > > if it is really necessary  (I don't know why it should be) maybe it's an > option to use > Object.const_defined? :IRB Thanks. It's just a bit of an ugly hack to know whether I should start a Curses interface or not. A curses interface misbehaves within irb since irb is also using curses. That's all.