Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > How can I know if a program is running inside irb?

Reply
Thread Tools

How can I know if a program is running inside irb?

 
 
abc
Guest
Posts: n/a
 
      03-15-2009
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.
 
Reply With Quote
 
 
 
 
badboy
Guest
Posts: n/a
 
      03-15-2009
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

 
Reply With Quote
 
 
 
 
Thomas Preymesser
Guest
Posts: n/a
 
      03-15-2009
[Note: parts of this message were removed to make it a legal post.]

2009/3/15 abc <(E-Mail Removed)>

> 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.



see the gem sys-proctable!

-Thomas


--
Thomas Preymesser
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://thopre.googlepages.com/
http://thopre.wordpress.com/

Jean Anouilh - "What you get free costs too much."

 
Reply With Quote
 
abc
Guest
Posts: n/a
 
      03-15-2009
On 15 mar, 14:22, badboy <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Running a program (gperf) inside another C program Alexander Mahone C Programming 4 05-26-2008 09:31 PM
ISAKMP NAT problem (I know it can be done but don't know how) Rogier Mulder Cisco 1 01-13-2005 08:48 PM
Does anyone know where I can get a good calendar program (free) - one that I can enter information directly into the daily space??? Daveyboy Computer Support 3 07-28-2004 03:12 PM
I know, I know, I don't know Andries Perl Misc 3 04-23-2004 02:17 AM



Advertisments