require without .rb

Discussion in 'Ruby' started by MistryMan4000@Yahoo.com, Jan 9, 2008.

  1. Guest

    [Note: parts of this message were removed to make it a legal post.]

    How can I make my programs not need to be called *.rb in the require statment? If I have a script called notepad/component.rb, how do make it so that notepad.rb can say require "notepad/component" instead of "notepad/component.rb"?

    Thank you


    ---------------------------------
    Looking for last minute shopping deals? Find them fast with Yahoo! Search.
    , Jan 9, 2008
    #1
    1. Advertising

  2. botp Guest

    On Jan 9, 2008 9:45 PM, <> wrote:
    > How can I make my programs not need to be called *.rb in the require
    > statment? If I have a script called notepad/component.rb, how do make
    > it so that notepad.rb can say require "notepad/component" instead of
    > "notepad/component.rb"?



    have you tried it? (pls post your sample code)

    kind regards -botp
    botp, Jan 9, 2008
    #2
    1. Advertising

  3. wrote:
    > How can I make my programs not need to be called *.rb in the require
    > statment? If I have a script called notepad/component.rb, how do make it
    > so that notepad.rb can say require "notepad/component" instead of
    > "notepad/component.rb"?
    >
    > Thank you


    Hi
    You do not need to put the .rb in require.
    Try a simple command:
    require "dbi" and see the result.
    --
    Posted via http://www.ruby-forum.com/.
    Jair Rillo junior, Jan 9, 2008
    #3
    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. Dan
    Replies:
    8
    Views:
    8,213
  2. Paul W
    Replies:
    4
    Views:
    7,781
    Nick Gilbert
    Jun 2, 2005
  3. Greg Ercolano
    Replies:
    5
    Views:
    279
    Greg Ercolano
    Mar 6, 2006
  4. Julian Mehnle
    Replies:
    17
    Views:
    842
    Julian Mehnle
    May 18, 2006
  5. Replies:
    1
    Views:
    137
Loading...

Share This Page