From: Sean O'Halpin Date: 2010-08-30T23:48:51+09:00 Subject: Re: How to make a ruby script listining for interactivity? On Fri, Aug 27, 2010 at 2:01 PM, Bart Van bos wrote: > Hi folks, > > I would like to know if I can make a ruby script interactive. I don't > mean using IRB, but I would like to be able to interact within my > scripts after I press a certain 'magic' key. So far I have been looking > into trap and signals, but I don't really find the thing I need. > > For those who know/used TCL, I loved using package 'interactive'. This > package allowed me to 'pause' my scripts with , giving me a > command interpreter that allowed my to interact with me script. This is > very useful for debugging purposes, since it allows you to 'pause' your > script and check some variables, instances, etc... Pressing the magic > key again 'unpaused' the script and let it run further on. > > Really good stuff for debugging complex things without using 'puts' and > 'messing up' your nice coded scripts. > > Any idea on how to get this done anyone? You could try ruby-debug. Quick intro here: http://pivotallabs.com/users/chad/blog/articles/366-ruby-debug-in-30-seconds-we-don-t-need-no-stinkin-gui- Details here: http://bashdb.sourceforge.net/ruby-debug.html Regards, Sean