[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

require without .rb

MistryMan4000@Yahoo.com

1/9/2008 1:45:00 PM

[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.
2 Answers

botp

1/9/2008 1:57:00 PM

0

On Jan 9, 2008 9:45 PM, MistryMan4000@Yahoo.com <mistryman4000@yahoo.com> 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

Jair Rillo junior

1/9/2008 2:36:00 PM

0

MistryMan4000@Yahoo.com 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-....