Forum: Ruby irb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
irb
201ab62b10b1ce61759a091d3b307fa1?d=identicon&s=25 Tom Allison (Guest)
on 2006-04-11 20:33
(Received via mailing list)
Is there any way to reset irb without closing and restarting it?
E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2006-04-11 20:40
(Received via mailing list)
On Apr 11, 2006, at 2:30 PM, Tom Allison wrote:

>
> Is there any way to reset irb without closing and restarting it?
>

I have this function in my .irbrc:
def reset_irb
   exec($0)
end

Effectively its closing and restaring it, but its a little faster, I
think
201ab62b10b1ce61759a091d3b307fa1?d=identicon&s=25 Tom Allison (Guest)
on 2006-04-11 20:46
(Received via mailing list)
cool.
I'll try it, as soon as I figure out what ~/.irbc equates to under
Windows.

I use Linux at home, but I can't get a linux machine at work.  So I'm
using my spare time at work to learn Ruby on Windows, hoping that all is
reasonably transferrable.
2c80e1b0837eec76d38d4f7fa1c15e87?d=identicon&s=25 Michael Gorsuch (Guest)
on 2006-04-11 21:05
(Received via mailing list)
Awesome, Logan. I didn't even know I could use an rc file.
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2006-04-12 02:28
(Received via mailing list)
DÅ?a Utorok 11. Apríl 2006 20:43 Tom Allison napísal:
> cool.
> I'll try it, as soon as I figure out what ~/.irbc equates to under
> Windows.
>

On Win2k and later, it should be by default C:\Documents and
Settings\<user
name>\.irbrc

Also, the Ruby interpreter should happily take "~" as a file path even
on
Windowsenso you can have it expand into the real path with one of the
file
name manipulation functions. (Which I've never used, so you're stuck to
reading the docs as to what tells you the absolute path.)

David Vallner
A9b6a93b860020caf9d2d1d58c32478f?d=identicon&s=25 Ross Bamford (Guest)
on 2006-04-12 11:45
(Received via mailing list)
On Wed, 2006-04-12 at 03:30 +0900, Tom Allison wrote:
> Is there any way to reset irb without closing and restarting it?

I don't know if this is any help, but do you know about IRB's
workspaces?


jobs
# => #0->irb on main (#<Thread:0xb7f296f8>: running)

irb "other object"

jobs
# => #0->irb on main (#<Thread:0xb7f296f8>: stop)
#1->irb#1 on other object (#<Thread:0xb7e29e68>: running)

self
# => "other object"

irb "and another"

jobs
# => #0->irb on main (#<Thread:0xb7f296f8>: stop)
#1->irb#1 on other object (#<Thread:0xb7e29e68>: stop)
#2->irb#2 on and another (#<Thread:0xb7e20fc0>: running)

self
# => "and another"

fg 0
# => #<IRB::Irb: @scanner=#<RubyLex:0xb7e40aa0>,
@context=#<IRB::Context:0xb7e40dfc>, @signal_status=:IN_EVAL>

jobs
# => #0->irb on main (#<Thread:0xb7f296f8>: running)
#1->irb#1 on other object (#<Thread:0xb7e29e68>: stop)
#2->irb#2 on and another (#<Thread:0xb7e20fc0>: stop)

self
# => main

fg 1
# => #<IRB::Irb: @scanner=#<RubyLex:0xb7e29db4>,
@context=#<IRB::Context:0xb7e29dc8>, @signal_status=:IN_EVAL>

exit
# => #<IRB::Irb: @scanner=#<RubyLex:0xb7e40aa0>,
@context=#<IRB::Context:0xb7e40dfc>, @signal_status=:IN_EVAL>

jobs
# => #0->irb on main (#<Thread:0xb7f296f8>: running)
#2->irb#2 on and another (#<Thread:0xb7e20fc0>: stop)

kill 2
# => [2]

jobs
# => #0->irb on main (#<Thread:0xb7f296f8>: running)

exit
$
9a46755c817121b0571a563e5ab02090?d=identicon&s=25 Brian Buckley (brian)
on 2006-04-12 18:35
(Received via mailing list)
>
> I don't know if this is any help, but do you know about IRB's
> workspaces?



Cool.

Workspaces seem to share class definitions (if a class is created or
modified in one workspace it is visible in all workspaces) but regular
objects created in one workspace are not available in other workspaces.

Brian
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2008-10-16 01:16
(Received via mailing list)
This should be more readable...
D4ced0fe3718f187173fc05dd7f33f57?d=identicon&s=25 Ben Hall (Guest)
on 2008-10-16 03:35
(Received via mailing list)
I migth have missed something along the way - what is rbr?

Ben

On Wed, Oct 15, 2008 at 7:13 AM, Tomas Matousek
F983f0c990cba2fe743ef62a975ec99c?d=identicon&s=25 Curt Hagenlocher (Guest)
on 2008-10-16 07:45
(Received via mailing list)
In our standard set of aliases, it resolves to the release build of
IronRuby.  rbd resolves to the debug build.
This topic is locked and can not be replied to.