From: transfire@... Date: 2006-06-21T14:26:01+09:00 Subject: Re: creating and using modules Parv G wrote: > Hi, > Newbie Question: > > I'm trying to write a simple module/class, in it i'm trying to capture > the repetitive, that i can reuse to make my life easier. > > How do i setup this module, so i can make refernces to it? > Where do i need to store the actual file? > I would like to know how can i make references to this module? > > if somebody can point me to the right direction, that'll be very helpul. > appreciate the help. > Parvinder Well, you can store a module/class in with the rest of your code or as a separate file and use #require to bring it into your program. Generally these files are installed in a subdir of Ruby site_ruby location. For instance, if you are using Debian linux: /usr/local/lib/site_ruby/1.8/mydir/myfile.rb Then in your program: require 'mydir/myfile' You should definitely read the PickAxe: http://www.rubycentral.com/book/index.html HTH, T.