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.
F05e172ec1523b228e8abc6e36ff39bc?d=identicon&s=25 Anil Gollaa (ganil_22)
on 2009-04-13 13: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.
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2009-04-13 23:33
(Received via mailing list)
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.
This topic is locked and can not be replied to.