[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Newbie question: Where to put library .rb files?

Kenneth McDonald

11/4/2008 5:23:00 PM

At our site, newly started using Ruby, we're now starting to get code
we'd like to make generally available via 'require'. What is the
standard location/method for doing this? Can it be done in such a
manner that rdoc and ri documentation is made available to the site,
preferably integrated with the rest of the ruby docs on this site?

Thanks,
Ken McDonald

3 Answers

Aldric Giacomoni

11/5/2008 3:33:00 PM

0

I don't have a direct answer to your question - but what you're looking
for is how to create a gem..
Best of luck on your research!

--Aldric

Kenneth McDonald wrote:
> At our site, newly started using Ruby, we're now starting to get code
> we'd like to make generally available via 'require'. What is the
> standard location/method for doing this? Can it be done in such a
> manner that rdoc and ri documentation is made available to the site,
> preferably integrated with the rest of the ruby docs on this site?
>
> Thanks,
> Ken McDonald
>

RichardOnRails

11/5/2008 9:18:00 PM

0

On Nov 4, 12:22 pm, Kenneth McDonald
<kenneth.m.mcdon...@sbcglobal.net> wrote:
> At our site, newly started using Ruby, we're now starting to get code  
> we'd like to make generally available via 'require'. What is the  
> standard location/method for doing this? Can it be done in such a  
> manner that rdoc and ri documentation is made available to the site,  
> preferably integrated with the rest of the ruby docs on this site?
>
> Thanks,
> Ken McDonald

The place you want is ruby\lib\ruby\site_ruby.

For example, I have my home-grown utility Search.rb stored there,
which defines a Search class. Then a Ruby program stored anywhere can
simply include:

require 'search' # case-insensitive on WinXP, e.g.
s = Seach.new # etc.

HTH,
Richard

Jeff Moore

11/6/2008 12:19:00 AM

0

Kenneth McDonald wrote:
> At our site, newly started using Ruby, we're now starting to get code
> we'd like to make generally available via 'require'. What is the
> standard location/method for doing this? Can it be done in such a
> manner that rdoc and ri documentation is made available to the site,
> preferably integrated with the rest of the ruby docs on this site?
>
> Thanks,
> Ken McDonald

To see what your current config is set to cut-n-paste this into
irb:


puts "ruby load directories"
puts
$:.each do |e|
puts e
end


Since I work across a variety of platforms, I prefer to set the
RUBYLIB environment variable on each of my systems to a directory
of my choosing. This directory is added to load paths in $:

--
Posted via http://www.ruby-....