invoke irb during execution of code

J

Junkone

how do i invoke the irb during the execution of my code.
for eg
require "watir"
ie = Watir::IE.start( url)
invoke irb so that i can inspect the ie and use the ie object
interactively.

Appreciate any help.
seede
 
L

Leslie Viljoen

First, run "gem install -r ruby-debug"

I have the following programmed into a hotkey in my text editor:

require 'ruby-debug'
Debugger.start
debugger

...so whenever I need a breakpoint I hit the key and rerun my program.

Les
 
J

Joel VanderWerf

Junkone said:
thanks for trying to help. But i am lost with this code. do i have to
call this code from my ruby code or should i call my ruby code from
this code. any additional details would be very very useful.

Copy the module..end and class..end part into your code. Then look at
the stuff at the bottom. The simplest use is:

IRB.start_session(x)

where x is the object that will be "self" in the irb session. If you
want the user to be able to look at some local variables as well, use
the form with "binding" as the first argument.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top