[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

How can I import a ruby module in my script

Anil Gollaa

4/13/2009 11:50:00 AM

Hi,
I want to write a seperated module which contains all common functions
in file say common.rb And I want to use these functions in my ruby
script.
How can I achive these, can anybody help me in this regard.
--
Posted via http://www.ruby-....

1 Answer

Joel VanderWerf

4/13/2009 9:33:00 PM

0

Anil Gollaa wrote:
> Hi,
> I want to write a seperated module which contains all common functions
> in file say common.rb And I want to use these functions in my ruby
> script.
> How can I achive these, can anybody help me in this regard.

Just put this line:

require "common.rb"

at the beginning of the script. If the files are in the same dir, that's
enough.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407