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.
···
--
Posted via http://www.ruby-forum.com/.
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.
"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.
···
On Oct 29, 2011, at 9:57 PM, Damián M. González wrote:
--
Posted via http://www.ruby-forum.com/\.
You realy realy help me. That's what I was talking about. Thank you my
friend.
···
--
Posted via http://www.ruby-forum.com/.