From: Maciej Szatanik on
hi,

I made a GUI in wxruby to run ruby/watir test cases/test sets. Framework
has numerous of modules and global variables, which i can't require on
the start of the application.

i figured out that i can just 'load' files, but there is a problem with
global variables. i can load most of files, tho i still have problems
with few others.

my question is can i, and i i can - how do it unerquire files or check
are they already required.

meanwhile i'll try to move global variables to other files, which i
already require.
--
Posted via http://www.ruby-forum.com/.

From: Robert Klemme on
2010/5/19 Maciej Szatanik <mszatanik(a)gmail.com>:
> I made a GUI in wxruby to run ruby/watir test cases/test sets. Framework
> has numerous of modules and global variables, which i can't require on
> the start of the application.

Why?

> i figured out that i can just 'load' files, but there is a problem with
> global variables. i can load most of files, tho i still have problems
> with few others.

What problems do you have?

> my question is can i, and i i can - how do it unerquire files or check
> are they already required.

require checks that for you and ensures that a file is loaded only once.

> meanwhile i'll try to move global variables to other files, which i
> already require.

I don't have a clear picture of your problem. Maybe refactoring
global constants into other files that are required helps?

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/