Forum: Ruby How can I import a ruby module in my script

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Anil G. (Guest)
on 2009-04-13 15:49
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.
Joel VanderWerf (Guest)
on 2009-04-14 01:33
(Received via mailing list)
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.
This topic is locked and can not be replied to.