Can I exclude a file.rb from irb?

Hello guys, a short question (I didn’t find the answer around inet):
Do exist some way to “exclude” any file “required” in Ruby irb?
I’ll show you why I’m asking: suppose that you load by the “require”
method a file which have a source code named anything.rb, so:

require “anything”

This program will run, you interact with it, and it will finish,
because it did the thing that supposed to do and it finished. Now, I
want to run it again, is tedious shut down the prompt and open it again.
Is there any way in which I can “exclude” this file anything.rb and then
“require” again…or something. Thanks for your time, I appreciate it.

On Oct 29, 2011, at 9:57 PM, Damin M. Gonzlez wrote:

Is there any way in which I can “exclude” this file anything.rb and then
“require” again…or something. Thanks for your time, I appreciate it.

“require” puts whatever it manages to load into an array globally
accessible via variable $". You can either remove the entry from $" or
simply use “load” instead of “require” – only make sure you specify the
extension, e.g.:

load “anything.rb”

Hope this helps,
Gennady.

You realy realy help me. That’s what I was talking about. Thank you my
friend.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs