How can I import a ruby module in my script


#1

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.


#2

Anil G. 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.