# Newbie questions

**URL:** <https://rubytalk.org/t/newbie-questions/9355>\
**Category:** ruby-talk\
**Created:** [16 December 2003 18:01 UTC](https://rubytalk.org/t/newbie-questions/9355 "2003-12-16T18:01:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jfrapper](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Jfrapper](https://rubytalk.org/u/Jfrapper)\
**Post date:** [16 December 2003 18:01 UTC](https://rubytalk.org/t/newbie-questions/9355/1 "2003-12-16T18:01:58Z")

</div>

I was wondering what the equivalent tools were to perldoc(ri is not)  
and the CPAN module (i.e. searching for and installing modules from  
the command line)?

Cheers,  
JF

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [16 December 2003 18:09 UTC](https://rubytalk.org/t/newbie-questions/9355/2 "2003-12-16T18:09:15Z")

</div>

I haven’t found any (and I’ve been around Ruby for over a year). I think  
that Ruby could really benefit from the kind of documentation that I’ve  
seen from Perl.

Cheers,  
Daniel.

> **···**
>
> On Wed, Dec 17, 2003 at 03:01:58AM +0900, Jim Frapper wrote:
> 
> > I was wondering what the equivalent tools were to perldoc(ri is not)  
> > and the CPAN module (i.e. searching for and installing modules from  
> > the command line)?
> > 
> > Cheers,  
> > JF
> 
> –  
> Daniel Carrera | “Software is like sex. It’s better when it’s free”.  
> PhD student. |  
> Math Dept. UMD | – Linus Torvalds

---

<div class="post-metadata">

**Author:** ![Chad\_Fowler](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@Chad\_Fowler](https://rubytalk.org/u/Chad_Fowler)\
**Post date:** [16 December 2003 21:10 UTC](https://rubytalk.org/t/newbie-questions/9355/3 "2003-12-16T21:10:19Z")

</div>

# I was wondering what the equivalent tools were to perldoc(ri is not)

# and the CPAN module (i.e. searching for and installing modules from

# the command line)?

> **···**
>
> On Wed, 17 Dec 2003, Jim Frapper wrote:
> 
> # 
> 
> Forgive me if this has been covered somewhere else in this thread (big  
> thread), but the CPAN-ish thing is being worked on and is called RubyGems.  
> Recursive download/installation currently works. You can get more info at  
> [http://rubygems.rubyforge.org](http://rubygems.rubyforge.org).
> 
> Chad

---

<div class="post-metadata">

**Author:** ![Jamis\_Buck4](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@Jamis\_Buck4](https://rubytalk.org/u/Jamis_Buck4)\
**Post date:** [16 December 2003 18:27 UTC](https://rubytalk.org/t/newbie-questions/9355/4 "2003-12-16T18:27:34Z")

</div>

Daniel Carrera wrote:

> I haven’t found any (and I’ve been around Ruby for over a year). I think  
> that Ruby could really benefit from the kind of documentation that I’ve  
> seen from Perl.

Any volunteers? 😉

> **···**
>
> –  
> Jamis Buck  
> jgb3@email.byu.edu
> 
> ruby -h | ruby -e ‘a=;readlines.join.scan(/-(.)[e|Kk(\S\*)|le.l(…)e|#!(\S\*)/) {|r| a \<\< r.compact.first };puts “\n\>#{a.join(%q/ /)}\<\n\n”’

---

<div class="post-metadata">

**Author:** ![Gavin\_Sinclair](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gavin\_Sinclair](https://rubytalk.org/u/Gavin_Sinclair)\
**Post date:** [16 December 2003 21:46 UTC](https://rubytalk.org/t/newbie-questions/9355/5 "2003-12-16T21:46:41Z")

</div>

Furthermore, RDoc is the perldoc semi-equivalent, and the new  
generation of RDoc (in the works) adds the following benefits:

- viewable via command-line (ri)
- installable to system-wide location for easy reference

RubyGems also enables the “installation” of generated documentation.

So it’s all starting to come together.

Gavin

> **···**
>
> On Wednesday, December 17, 2003, 8:10:19 AM, Chad wrote:
> 
> > On Wed, 17 Dec 2003, Jim Frapper wrote:
> 
> > # I was wondering what the equivalent tools were to perldoc(ri is not)
> > 
> > # and the CPAN module (i.e. searching for and installing modules from
> > 
> > # the command line)?
> > 
> > #
> 
> > Forgive me if this has been covered somewhere else in this thread (big  
> > thread), but the CPAN-ish thing is being worked on and is called RubyGems.  
> > Recursive download/installation currently works. You can get more info at  
> > [http://rubygems.rubyforge.org](http://rubygems.rubyforge.org).

---

<div class="post-metadata">

**Author:** ![Randy\_W\_Sims1](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@Randy\_W\_Sims1](https://rubytalk.org/u/Randy_W_Sims1)\
**Post date:** [17 December 2003 05:16 UTC](https://rubytalk.org/t/newbie-questions/9355/6 "2003-12-17T05:16:40Z")

</div>

Will this include a builder like perl’s MakeMaker[1] or its successor  
Module::Build[2]? I’ve been part of the perl community for a while now,  
and have been contributing to the Module::Build project, mostly the code  
working with the various compilers on each platform to build XS  
extensions (and a plugin prototype for extending functionality); I’ve  
also been pushing an update[3] of the META Specification[4] that CPAN is  
now being populated with.

I’m curious as to whether you’ve considered meta data for ruby  
distributions, and is there a chance Ruby and Perl can use the same  
format for meta data (which is simply YAML file with certain defined  
fields that describe a distribution). If I can help in any way let me know.

Regards,  
Randy.

1. [http://search.cpan.org/dist/ExtUtils-MakeMaker/](http://search.cpan.org/dist/ExtUtils-MakeMaker/)
2. [http://search.cpan.org/dist/Module-Build/](http://search.cpan.org/dist/Module-Build/)
3. [http://module-build.sourceforge.net/META-spec.html](http://module-build.sourceforge.net/META-spec.html)
4. [http://www.thepierianspring.org/META-spec.html](http://www.thepierianspring.org/META-spec.html)

> **···**
>
> On 12/16/2003 4:10 PM, Chad Fowler wrote:
> 
> > On Wed, 17 Dec 2003, Jim Frapper wrote:
> > 
> > # I was wondering what the equivalent tools were to perldoc(ri is not)
> > 
> > # and the CPAN module (i.e. searching for and installing modules from
> > 
> > # the command line)?
> > 
> > # 
> > 
> > Forgive me if this has been covered somewhere else in this thread (big  
> > thread), but the CPAN-ish thing is being worked on and is called RubyGems.  
> > Recursive download/installation currently works. You can get more info at  
> > [http://rubygems.rubyforge.org](http://rubygems.rubyforge.org).
> > 
> > Chad

---

<div class="post-metadata">

**Author:** ![HAL\_9000](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@HAL\_9000](https://rubytalk.org/u/HAL_9000)\
**Post date:** [16 December 2003 18:43 UTC](https://rubytalk.org/t/newbie-questions/9355/7 "2003-12-16T18:43:52Z")

</div>

Jamis Buck wrote:

> Daniel Carrera wrote:
> 
> > I haven’t found any (and I’ve been around Ruby for over a year). I  
> > think that Ruby could really benefit from the kind of documentation  
> > that I’ve seen from Perl.
> 
> Any volunteers? 😉

OK, I’ve heard this discussed before, but as I’m not a Perler, I don’t  
know what the big deal is with perldoc.

What is it, what can it do, how is it used, why is it better than ri,  
etc.?

Hal

---

<div class="post-metadata">

**Author:** ![Luke\_A\_Kanies](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@Luke\_A\_Kanies](https://rubytalk.org/u/Luke_A_Kanies)\
**Post date:** [16 December 2003 21:53 UTC](https://rubytalk.org/t/newbie-questions/9355/8 "2003-12-16T21:53:56Z")

</div>

This is definitely good to hear. I’ve seen mentions of most of it, but  
I’d not seen it clearly discussed in one place. Could this all be placed  
in the FAQ? There’s already a comparison to python in there; this would  
fit well under a comparison with perl, even though it’s a comparison of  
things that lie outside of the language itself.

Luke

> **···**
>
> On Wed, 17 Dec 2003, Gavin Sinclair wrote:
> 
> > On Wednesday, December 17, 2003, 8:10:19 AM, Chad wrote:
> > 
> > > Forgive me if this has been covered somewhere else in this thread (big  
> > > thread), but the CPAN-ish thing is being worked on and is called RubyGems.  
> > > Recursive download/installation currently works. You can get more info at  
> > > [http://rubygems.rubyforge.org](http://rubygems.rubyforge.org).
> > 
> > Furthermore, RDoc is the perldoc semi-equivalent, and the new  
> > generation of RDoc (in the works) adds the following benefits:
> > 
> > - viewable via command-line (ri)
> > - installable to system-wide location for easy reference
> > 
> > RubyGems also enables the “installation” of generated documentation.
> > 
> > So it’s all starting to come together.
> 
> –  
> “But these [serious NT security flaws] are not inherent flaws in the  
> operating system – they don’t happen by accident. They are the result  
> of deliberate and well-thought-out efforts.” --Mike Nash, Microsoft.  
> The _flaws_ are deliberate?

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [16 December 2003 22:03 UTC](https://rubytalk.org/t/newbie-questions/9355/9 "2003-12-16T22:03:47Z")

</div>

> Furthermore, RDoc is the perldoc semi-equivalent, and the new  
> generation of RDoc (in the works) adds the following benefits:
> 
> - viewable via command-line (ri)
> - installable to system-wide location for easy reference

Perldoc IS viewable via command-line. How else would you use it?

As for ri, I still think it shouldn’t just dump the whole documentation  
on the terminal, but it should let you scroll. Like man pages and  
perldoc.

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [16 December 2003 18:55 UTC](https://rubytalk.org/t/newbie-questions/9355/10 "2003-12-16T18:55:08Z")

</div>

> OK, I’ve heard this discussed before, but as I’m not a Perler, I don’t  
> know what the big deal is with perldoc.
> 
> What is it, what can it do, how is it used, why is it better than ri,  
> etc.?

Using perldoc feels much the same as using man. In fact, you can use  
perldoc to make man pages.

What makes perldoc betters is not perldoc but the documentation. Perl  
has an exceptional ammount of very thorough documentation in a very  
accessible (ie man-page) manner. When you install a module you have a  
reasonable expectation of it automatically installing a perldoc page.

The writing style of ri is different from that of man pages. It is more  
of a list of methods than an actual explanation of how to use them.

Try this:

man perl → You get a list of the standard pages that come with Perl.

man perlre  
man perlvar  
man perlreftut

…

Try these. You’ll see that Perl comes with a garganuous ammount of  
man-page-style documentation.

Compare that with :

ri Class

Notice that ri does not produce a scrollable output (yes, you can pipe  
ri to less, I know), and the descriptions are fairly limited.

Also, ri seems to be limited to explaining what a class does. Perldoc  
is limited only by the number of characters on your keyboard. With  
perldoc you get a lot of tutorials and descriptions of how things work.

It’s more of an issue of the ammount and style of documentation than of  
the actual technology. Documentation one of the things I like most  
about Perl and like least about Ruby.

I do think that ri should be scrollable though.

Cheers,

> **···**
>
> –  
> Daniel Carrera | “Software is like sex. It’s better when it’s free”.  
> PhD student. |  
> Math Dept. UMD | – Linus Torvalds

---

<div class="post-metadata">

**Author:** ![Luke\_A\_Kanies](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@Luke\_A\_Kanies](https://rubytalk.org/u/Luke_A_Kanies)\
**Post date:** [16 December 2003 20:05 UTC](https://rubytalk.org/t/newbie-questions/9355/11 "2003-12-16T20:05:05Z")

</div>

We’ve discussed a parallel to perldoc, but what about CPAN? I know that  
we have RAA, but CPAN’s recursive auto-installer is one of the really big  
reasons so many non-programmers can use perl-based software. People are  
much less likely to reinvent the wheel if it’s easy for them to explore  
existing wheels, and people are much more likely to use your ruby-based  
software if they just have to type 'cran install ’ and know it  
will download, compile, and install everything.

Perl’s CPAN has saved me hours and hours. It’s especially nice when  
you’re going to new machines, for instance at new clients, because a  
couple short commands and a coffee break are all that are necessary to get  
the complete latest and greatest list of all the modules you normally use.  
Even better, if you want you can write your own bundle that contains  
everything you want to install. Then it’s just one command.

I think having an equivalent to CPAN will help more than anything else,  
because all things flow from access. If people can easily get software,  
they’re much more likely to contribute documentation to that software.

The barrier to downloading and installing ruby modules (small as it may  
be) is one of the things keeping perl coders away, and I know it was the  
main reason I hesitated.

Luke

> **···**
>
> –  
> Once…in the wilds of Afghanistan, I lost my corkscrew, and we were  
> forced to live on nothing but food and water for days. – W. C. Fields

---

<div class="post-metadata">

**Author:** ![Luke\_A\_Kanies](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@Luke\_A\_Kanies](https://rubytalk.org/u/Luke_A_Kanies)\
**Post date:** [16 December 2003 22:07 UTC](https://rubytalk.org/t/newbie-questions/9355/12 "2003-12-16T22:07:45Z")

</div>

Shouldn’t it just use the PAGER or READER environment variable? I don’t  
really know what the difference is between the two, since they’re always  
set the same for me, but I know perldoc uses one of them, and ri should do  
the same, at least on Unix. That’s what they’re for, and it certainly  
provides a more consistent interface (consistent with man, that is).

Luke

> **···**
>
> On Wed, 17 Dec 2003, Daniel Carrera wrote:
> 
> > Perldoc IS viewable via command-line. How else would you use it?
> > 
> > As for ri, I still think it shouldn’t just dump the whole documentation  
> > on the terminal, but it should let you scroll. Like man pages and  
> > perldoc.
> 
> –  
> We’re not surrounded, we’re in a target-rich environment!

---

<div class="post-metadata">

**Author:** ![HAL\_9000](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@HAL\_9000](https://rubytalk.org/u/HAL_9000)\
**Post date:** [16 December 2003 22:09 UTC](https://rubytalk.org/t/newbie-questions/9355/13 "2003-12-16T22:09:39Z")

</div>

Daniel Carrera wrote:

> > Furthermore, RDoc is the perldoc semi-equivalent, and the new  
> > generation of RDoc (in the works) adds the following benefits:
> > 
> > - viewable via command-line (ri)
> > - installable to system-wide location for easy reference
> 
> Perldoc IS viewable via command-line. How else would you use it?

I think he meant this benefit was added to rdoc.

> As for ri, I still think it shouldn’t just dump the whole documentation  
> on the terminal, but it should let you scroll. Like man pages and  
> perldoc.

I see no reason why this wouldn’t be a good thing. If you’re  
writing to the console, invoke a pager.

Dave?

Hal

---

<div class="post-metadata">

**Author:** ![Chad\_Fowler](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@Chad\_Fowler](https://rubytalk.org/u/Chad_Fowler)\
**Post date:** [16 December 2003 22:21 UTC](https://rubytalk.org/t/newbie-questions/9355/14 "2003-12-16T22:21:16Z")

</div>

# \>

# \> Furthermore, RDoc is the perldoc semi-equivalent, and the new

# \> generation of RDoc (in the works) adds the following benefits:

# \> - viewable via command-line (ri)

# \> - installable to system-wide location for easy reference

> **···**
>
> On Wed, 17 Dec 2003, Daniel Carrera wrote:
> 
> # 
> 
> # Perldoc IS viewable via command-line. How else would you use it?
> 
> # 
> 
> # As for ri, I still think it shouldn’t just dump the whole documentation
> 
> # on the terminal, but it should let you scroll. Like man pages and
> 
> # perldoc.
> 
> # 
> 
> ri Array.zip |more
> 
> 😉

---

<div class="post-metadata">

**Author:** ![HAL\_9000](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@HAL\_9000](https://rubytalk.org/u/HAL_9000)\
**Post date:** [16 December 2003 20:38 UTC](https://rubytalk.org/t/newbie-questions/9355/15 "2003-12-16T20:38:19Z")

</div>

Luke A. Kanies wrote:

> We’ve discussed a parallel to perldoc, but what about CPAN? I know that  
> we have RAA, but CPAN’s recursive auto-installer is one of the really big  
> reasons so many non-programmers can use perl-based software. People are  
> much less likely to reinvent the wheel if it’s easy for them to explore  
> existing wheels, and people are much more likely to use your ruby-based  
> software if they just have to type ‘cran install ’ and know it  
> will download, compile, and install everything.
> 
> Perl’s CPAN has saved me hours and hours. It’s especially nice when  
> you’re going to new machines, for instance at new clients, because a  
> couple short commands and a coffee break are all that are necessary to get  
> the complete latest and greatest list of all the modules you normally use.  
> Even better, if you want you can write your own bundle that contains  
> everything you want to install. Then it’s just one command.
> 
> I think having an equivalent to CPAN will help more than anything else,  
> because all things flow from access. If people can easily get software,  
> they’re much more likely to contribute documentation to that software.
> 
> The barrier to downloading and installing ruby modules (small as it may  
> be) is one of the things keeping perl coders away, and I know it was the  
> main reason I hesitated.

The nascent RubyGems project is a big step toward dealing with this  
issue.

Hal

---

<div class="post-metadata">

**Author:** ![Dick\_Davies1](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@Dick\_Davies1](https://rubytalk.org/u/Dick_Davies1)\
**Post date:** [16 December 2003 20:53 UTC](https://rubytalk.org/t/newbie-questions/9355/16 "2003-12-16T20:53:03Z")

</div>

Luke A. Kanies wrote:

> We’ve discussed a parallel to perldoc, but what about CPAN? I know that  
> we have RAA, but CPAN’s recursive auto-installer is one of the really big  
> reasons so many non-programmers can use perl-based software. People are  
> much less likely to reinvent the wheel if it’s easy for them to explore  
> existing wheels, and people are much more likely to use your ruby-based  
> software if they just have to type ‘cpan install ’ and know it  
> will download, compile, and install everything.

In my experience it always tries to update Perl itself, which is a bit  
cheeky if you just wanted HTML-Parser…

Its better than what we have, but as I’ve said before, there are better  
models than CPAN to emulate (BSD ports/package tree and Debian apt-get  
spring to mind).

> **···**
>
> –  
> Rasputin :: Jack of All Trades - Master of Nuns

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [16 December 2003 22:09 UTC](https://rubytalk.org/t/newbie-questions/9355/17 "2003-12-16T22:09:32Z")

</div>

I didn’t know about those variables. How do they work?

> **···**
>
> On Wed, Dec 17, 2003 at 07:07:45AM +0900, Luke A. Kanies wrote:
> 
> > On Wed, 17 Dec 2003, Daniel Carrera wrote:
> > 
> > > Perldoc IS viewable via command-line. How else would you use it?
> > > 
> > > As for ri, I still think it shouldn’t just dump the whole documentation  
> > > on the terminal, but it should let you scroll. Like man pages and  
> > > perldoc.
> > 
> > Shouldn’t it just use the PAGER or READER environment variable? I don’t  
> > really know what the difference is between the two, since they’re always  
> > set the same for me, but I know perldoc uses one of them, and ri should do  
> > the same, at least on Unix. That’s what they’re for, and it certainly  
> > provides a more consistent interface (consistent with man, that is).
> 
> –  
> Daniel Carrera | “Software is like sex. It’s better when it’s free”.  
> PhD student. |  
> Math Dept. UMD | – Linus Torvalds

---

<div class="post-metadata">

**Author:** ![Berger\_Daniel2](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@Berger\_Daniel2](https://rubytalk.org/u/Berger_Daniel2)\
**Post date:** [16 December 2003 22:16 UTC](https://rubytalk.org/t/newbie-questions/9355/18 "2003-12-16T22:16:17Z")

</div>

“Luke A. Kanies” wrote:

> Frankly, it doesn’t matter to me which one, as long as there’s something.  
> I’m already starting to feel like a crack addict without a pipe or  
> lighter. I wrote a small amount in perl yesterday for the first time in  
> about a month, and it was, um, horrible. I left out all the semicolons  
> and parens and dollar signs, just like in ruby, and it didn’t work. ☹  
> Unfortunately, perl has a very mature selection of modules which I’ve come  
> to depend on, with Net::LDAP being at the top of the list for me (I’m a  
> sysadmin, and I store lotsa stuff in LDAP), because it’s all perl and  
> includes SSL support. I expect as I use ruby more I’ll delve into helping  
> out on the ldap module.

See ruby-ldap on the RAA. Dunno about ssl support.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [16 December 2003 22:20 UTC](https://rubytalk.org/t/newbie-questions/9355/19 "2003-12-16T22:20:54Z")

</div>

> > As for ri, I still think it shouldn’t just dump the whole documentation  
> > on the terminal, but it should let you scroll. Like man pages and  
> > perldoc.
> 
> I see no reason why this wouldn’t be a good thing. If you’re  
> writing to the console, invoke a pager.
> 
> Dave?

Well… I’m thinking of man pages here. A typical man page is a lot  
longer than the vertical size of a terminal, so sending the output to  
stdout is not, on itself, very useful. Something that scrolls would  
make more sense. The only good thing about stdout is that you can  
redirect the output and pipe it through grep, but you can already do  
that. You can pipe and redirect man pages already as it is.

I guess that the way it is now makes sense for short documents, that fit  
within the span of a termial. But I’m hoping that will change in the  
future.

Cheers,  
Daniel.

---

<div class="post-metadata">

**Author:** ![Dave\_Mail\_Archive](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Dave\_Mail\_Archive](https://rubytalk.org/u/Dave_Mail_Archive)\
**Post date:** [17 December 2003 05:27 UTC](https://rubytalk.org/t/newbie-questions/9355/20 "2003-12-17T05:27:31Z")

</div>

Your wish… I’ve added it here, so it’ll be in the next commit.

Cheers

Dave

> **···**
>
> On Dec 16, 2003, at 16:09, Hal Fulton wrote:
> 
> > I see no reason why this wouldn’t be a good thing. If you’re  
> > writing to the console, invoke a pager.

[Next page](https://rubytalk.org/t/newbie-questions/9355.md?page=2)
