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
Tom A. (Guest)
on 2006-04-11 22:33
(Received via mailing list)
Is there any way to reset irb without closing and restarting it?
Logan C. (Guest)
on 2006-04-11 22:40
(Received via mailing list)
On Apr 11, 2006, at 2:30 PM, Tom A. 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
Tom A. (Guest)
on 2006-04-11 22: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.
Michael G. (Guest)
on 2006-04-11 23:05
(Received via mailing list)
Awesome, Logan. I didn't even know I could use an rc file.
David V. (Guest)
on 2006-04-12 04:28
(Received via mailing list)
DÅ?a Utorok 11. Apríl 2006 20:43 Tom A. 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 V.
Ross B. (Guest)
on 2006-04-12 13:45
(Received via mailing list)
On Wed, 2006-04-12 at 03:30 +0900, Tom A. 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
$
Brian B. (Guest)
on 2006-04-12 20: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
Tomas M. (Guest)
on 2008-10-16 03:16
(Received via mailing list)
This should be more readable...
Ben H. (Guest)
on 2008-10-16 05: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 M.
Curt H. (Guest)
on 2008-10-16 09: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.