ri and rdoc....like perldoc?

D

Derek Smith

Hi All,

Will anyone kindly help? I want to get my ruby docs fully functional,
meaning I can view any type of help on methods, keywords, etc.
As in Perl I can type perldoc perlop or perldoc -f chomp. The latter
give me a whole page dedicated to perl operators and the former gives me
one page on what is chomp and how to use it.

thank u!


See below for my current config:

# ruby -v
ruby 1.8.7 (2009-04-08 patchlevel 160) [hppa2.0w-hpux11.23]

# gem list --l

*** LOCAL GEMS ***

actionmailer (2.3.4, 2.3.2)
actionpack (2.3.4, 2.3.2)
activerecord (2.3.4, 2.3.2)
activeresource (2.3.4, 2.3.2)
activesupport (2.3.4, 2.3.2)
archive-tar-minitar (0.5.2)
Ascii85 (1.0.0)
columnize (0.3.1)
pdf-reader (0.7.7)
rack (1.0.0)
rails (2.3.4, 2.3.2)
rake (0.8.7, 0.8.5)
rdoc (2.5.8)
rdoc-data (2.5.3)
ruby_core_source (0.1.4)
rubygems-update (1.3.7)
rubyntlm (0.1.1)

root@xxxx [/root/.rdoc]
# ll -R
total 0
drwxr-xr-x 2 root sys 96 Jul 7 11:33 doc

/doc:
total 0
root@xxxx [/root/.rdoc]
 
X

Xavier Noria

Will anyone kindly help? =C2=A0I want to get my ruby docs fully functiona= l,
meaning I can view any type of help on methods, keywords, etc.
As in Perl I can type perldoc perlop or perldoc -f chomp. =C2=A0The latte= r
give me a whole page dedicated to perl operators and the former gives me
one page on what is chomp and how to use it.

Unfortunately documentation is not one of Ruby strengths, there's
nothing as comprehensive as Perl builtin documentation (though there
are few languages that can compare with Perl documentation). Generally
speaking, libraries are not as well-documented as Perl modules either.

If anyone is surprised by the previous paragraph just type

perldoc perl

in a shell.

If you want to learn about the Ruby language you normally get a book,
as reference I personally use Flanagan & Matsumoto. There are some
free tutorials online, there's also an old version of the Pickaxe.
 
D

Derek Smith

Xavier said:
Unfortunately documentation is not one of Ruby strengths, there's
nothing as comprehensive as Perl builtin documentation (though there
are few languages that can compare with Perl documentation). Generally
speaking, libraries are not as well-documented as Perl modules either.


thats unfortunate, will this likely change in the future?
so if I want to look up how to use a function, how do i do this using
ruby?
 
X

Xavier Noria

thats unfortunate, will this likely change in the future?

I don't know, everything is Open Source, if Perl could so does Ruby,
it all depends on the community. And Perl has no "documentation team",
mind you, everything happens in the -porters ML.
so if I want to look up how to use a function, how do i do this using
ruby?

In the command line you check it with ri. Online you check some of the
references listed in http://www.ruby-lang.org/en/documentation/.
 
D

Derek Smith

Xavier said:
I don't know, everything is Open Source, if Perl could so does Ruby,
it all depends on the community. And Perl has no "documentation team",
mind you, everything happens in the -porters ML.


In the command line you check it with ri. Online you check some of the
references listed in http://www.ruby-lang.org/en/documentation/.

ok thank you! I prefer Ruby, it neater and more quaint!

peace.
 
R

Ryan Davis

=20
And for installed gems, type
=20
gem server --daemon
=20
then point your web browser at http://127.0.0.1:8808/

That's not strictly necessary. ri picks up gem rdoc too.

Do make sure you have the rdoc gem installed so you have the latest =
version of ri and rdoc.
 
R

Roger Pack

Unfortunately documentation is not one of Ruby strengths, there's
nothing as comprehensive as Perl builtin documentation (though there
are few languages that can compare with Perl documentation). Generally
speaking, libraries are not as well-documented as Perl modules either.

True. I've been trying to help it by fleshing out the ruby wikibook:

http://en.wikibooks.org/wiki/Ruby_Programming
If you want to learn about the Ruby language you normally get a book,
as reference I personally use Flanagan & Matsumoto. There are some
free tutorials online, there's also an old version of the Pickaxe.

Here's a list of some online books:
http://en.wikibooks.org/wiki/Ruby_Programming#Online
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top