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
···
On Apr 11, 2006, at 2:30 PM, 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
$
···
On Wed, 2006-04-12 at 03:30 +0900, Tom Allison wrote:
Is there any way to reset irb without closing and restarting it?
--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk
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.
···
On 4/11/2006, "Logan Capaldo" <logancapaldo@gmail.com> wrote:
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)
endEffectively its closing and restaring it, but its a little faster, I
think
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
Awesome, Logan. I didn't even know I could use an rc file.
···
On 4/11/06, Tom Allison <tallison@tacocat.net> wrote:
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.On 4/11/2006, "Logan Capaldo" <logancapaldo@gmail.com> wrote:
>
>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
>
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
\.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