require without .rb

M

MistryMan4000

[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
 
B

botp

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
 
J

Jair Rillo junior

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top