Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Newbie questions

Reply
Thread Tools

Newbie questions

 
 
Jim Frapper
Guest
Posts: n/a
 
      12-16-2003
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
 
Reply With Quote
 
 
 
 
Daniel Carrera
Guest
Posts: n/a
 
      12-16-2003

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


 
Reply With Quote
 
 
 
 
Jamis Buck
Guest
Posts: n/a
 
      12-16-2003
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
http://www.velocityreviews.com/forums/(E-Mail Removed)

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"'



 
Reply With Quote
 
Hal Fulton
Guest
Posts: n/a
 
      12-16-2003
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



 
Reply With Quote
 
Daniel Carrera
Guest
Posts: n/a
 
      12-16-2003
> 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


 
Reply With Quote
 
Luke A. Kanies
Guest
Posts: n/a
 
      12-16-2003
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 <library>' 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


 
Reply With Quote
 
Hal Fulton
Guest
Posts: n/a
 
      12-16-2003
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 <library>' 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


 
Reply With Quote
 
Rasputin
Guest
Posts: n/a
 
      12-16-2003
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 <library>' 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




 
Reply With Quote
 
Luke A. Kanies
Guest
Posts: n/a
 
      12-16-2003
On Wed, 17 Dec 2003, Rasputin wrote:

> 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 <library>' 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...


There was a bug in the version of CPAN shipped with 5.6.0, I believe,
which caused this. It's long since fixed, and I think it was only one
subrelease of CPAN.

> 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).


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.

So my basic point is, I definitely don't want to go back to using perl
(wow, that was fast) but there are definitely some things I miss about it,
and I'd like to do what I can to support bringing those features to ruby,
especially if ruby doesn't replicate perl's mistakes.

Luke

--
The death rate on Earth is: .... (computing) .... One per person.


 
Reply With Quote
 
Gavin Sinclair
Guest
Posts: n/a
 
      12-16-2003
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.


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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie with newbie questions JohnE ASP .Net 3 08-17-2009 10:10 PM
Malloc and free questions - learner questions pkirk25 C Programming 50 10-04-2006 02:22 PM
Questions on Canon 300D and etc. questions regarding digital photography Progressiveabsolution Digital Photography 12 03-24-2005 05:18 PM
Newbie questions - Couple of VC++ questions regarding dlls and VB6 Ali Syed C Programming 3 10-13-2004 10:15 PM
Re: Questions....questions....questions Patrick Michael A+ Certification 0 06-16-2004 04:53 PM



Advertisments