Newbie questions

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

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

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.

Chad

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? :wink:

···


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”’

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.

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/
  2. http://search.cpan.org/dist/Module-Build/
  3. http://module-build.sourceforge.net/META-spec.html
  4. 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.

Chad

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? :wink:

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

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.

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?

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.

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

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

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!

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

>

> 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

:wink:

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

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

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

“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. :frowning:
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

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.

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.