check if a file is already required ?

Discussion in 'Ruby' started by Maciej Szatanik, May 19, 2010.

  1. 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/.
     
    Maciej Szatanik, May 19, 2010
    #1
    1. Advertising

  2. 2010/5/19 Maciej Szatanik <>:
    > 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/
     
    Robert Klemme, May 19, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dino Buljubasic
    Replies:
    4
    Views:
    18,596
    Roedy Green
    Sep 23, 2005
  2. Fabio Pliger

    check instace already running...

    Fabio Pliger, Apr 9, 2005, in forum: Python
    Replies:
    3
    Views:
    444
    Fabio Pliger
    Apr 10, 2005
  3. Nick Sinclair

    How to check for already running program?

    Nick Sinclair, Jul 1, 2005, in forum: C Programming
    Replies:
    4
    Views:
    445
    Nick Sinclair
    Jul 4, 2005
  4. MikeTI

    Check form already open in browser

    MikeTI, Sep 5, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    330
    Patrice
    Sep 5, 2009
  5. Simon Gare

    CHECK IF USER ALREADY LOGGED IN

    Simon Gare, Apr 13, 2007, in forum: ASP General
    Replies:
    4
    Views:
    400
    Bob Barrows [MVP]
    Apr 13, 2007
Loading...

Share This Page