Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Perldoc Equivalent?

Reply
Thread Tools

Perldoc Equivalent?

 
 
James Edward Gray II
Guest
Posts: n/a
 
      08-27-2004
Does Ruby have a bundled documentation reader?

I'm guessing it might be rdoc, but we're not yet on speaking terms.
Anyone willing to introduce me? <laughs>

James Edward Gray II



 
Reply With Quote
 
 
 
 
James Britt
Guest
Posts: n/a
 
      08-28-2004
James Edward Gray II wrote:

> Does Ruby have a bundled documentation reader?
>
> I'm guessing it might be rdoc, but we're not yet on speaking terms.
> Anyone willing to introduce me? <laughs>
>
> James Edward Gray II
>
>
>


In general, you can run 'ri' at the command line, along with the name of
a class, module, or method, (and combinations) and see documentation
(the documentation comes from running rdoc over the source code):

% ri String.center
---------------------------------------------------------- String#center
str.center(integer) => new_str
------------------------------------------------------------------------
If _integer_ is greater than the length of _str_, returns a new
+String+ of length _integer_ with _str_ centered between spaces;
otherwise, returns _str_.

"hello".center(4) #=> "hello"

"hello".center(20) #=> " hello "


% ri String

---------------------------------------------------------- Class: String
A +String+ object holds and manipulates an arbitrary sequence of
bytes, typically representing characters. String objects may be
created using +String::new+ or as literals.

Because of aliasing issues, users of strings should be aware of the
methods that modify the contents of a +String+ object. Typically,
methods with names ending in ``!'' modify their receiver, while
those without a ``!'' return a new +String+. However, there are
exceptions, such as +String#[]=+.

------------------------------------------------------------------------


Includes:
---------
Comparable(<, <=, ==, >, >=, between?), Enumerable(all?, any?,
collect, detect, each_with_index, entries, find, find_all, grep,
include?, inject, map, max, member?, min, partition, reject,
select, sort, sort_by, to_a, to_set, zip)


Class methods:
--------------
new


Instance methods:
-----------------
%, *, +, <<, <=>, ==, =~, [], []=, capitalize, capitalize!,
casecmp, center, chomp, chomp!, chop, chop!, concat, count, crypt,
delete, delete!, downcase, downcase!, dump, each, each_byte,
each_line, empty?, eql?, gsub, gsub!, hash, hex, include?, index,
initialize_copy, insert, inspect, intern, length, ljust, lstrip,
lstrip!, match, next, next!, oct, replace, reverse, reverse!,
rindex, rjust, rstrip, rstrip!, scan, size, slice, slice!, split,
squeeze, squeeze!, strip, strip!, sub, sub!, succ, succ!, sum,
swapcase, swapcase!, to_f, to_i, to_s, to_str, to_sym, tr, tr!,
tr_s, tr_s!, unpack, upcase, upcase!, upto






 
Reply With Quote
 
 
 
 
James Edward Gray II
Guest
Posts: n/a
 
      08-28-2004
On Aug 27, 2004, at 7:34 PM, James Britt wrote:

> James Edward Gray II wrote:
>
>> Does Ruby have a bundled documentation reader?
>> I'm guessing it might be rdoc, but we're not yet on speaking terms.
>> Anyone willing to introduce me? <laughs>
>> James Edward Gray II

>
> In general, you can run 'ri' at the command line, along with the name
> of a class, module, or method, (and combinations) and see
> documentation


This sounds exactly like what I'm looking for, but when I tried it...

% ri String
No ri documentation found in:
/usr/local/share/ri/1.8/system
/usr/local/share/ri/1.8/site
/Users/james/.rdoc

Was rdoc run to create documentation?

So I tried:

% rdoc

Which scrolled a lot of source files. Unfortunately, it didn't change
ri's response. What am I missing here?

Thanks.

James Edward Gray II



 
Reply With Quote
 
Dave Thomas
Guest
Posts: n/a
 
      08-28-2004

On Aug 27, 2004, at 20:43, James Edward Gray II wrote:

> % ri String
> No ri documentation found in:
> /usr/local/share/ri/1.8/system
> /usr/local/share/ri/1.8/site
> /Users/james/.rdoc
>
> Was rdoc run to create documentation?
>
> So I tried:
>
> % rdoc
>
> Which scrolled a lot of source files. Unfortunately, it didn't change
> ri's response. What am I missing here?


Did you install Ruby from source. If so, go into the lib directory and
type sudo ri --system and it will install all the documentation.

Cheers

Dave



 
Reply With Quote
 
David A. Black
Guest
Posts: n/a
 
      08-28-2004
Hi --

On Sat, 28 Aug 2004, Dave Thomas wrote:

>
> On Aug 27, 2004, at 20:43, James Edward Gray II wrote:
>
> > % ri String
> > No ri documentation found in:
> > /usr/local/share/ri/1.8/system
> > /usr/local/share/ri/1.8/site
> > /Users/james/.rdoc
> >
> > Was rdoc run to create documentation?
> >
> > So I tried:
> >
> > % rdoc
> >
> > Which scrolled a lot of source files. Unfortunately, it didn't change
> > ri's response. What am I missing here?

>
> Did you install Ruby from source. If so, go into the lib directory and
> type sudo ri --system and it will install all the documentation.


Is that supposed to be rdoc --ri-system and/or rdoc --ri-site? I
couldn't find any ri that accepted a --system argument.


David

--
David A. Black
http://www.velocityreviews.com/forums/(E-Mail Removed)



 
Reply With Quote
 
James Edward Gray II
Guest
Posts: n/a
 
      08-28-2004
On Aug 27, 2004, at 8:08 PM, Dave Thomas wrote:

> Did you install Ruby from source.


I did, yes.

> If so, go into the lib directory


Does /usr/local/lib/ruby/1.8/ sound about right?

Would it have a ton of files like:

...
irb
irb.rb
...
uri
uri.rb
...

?

> and type sudo ri --system and it will install all the documentation.


The closest I could come up with was sudo rdoc --ri-system. That did a
lot of work, and even changed ri's responses. Now I get:

% ri String
Nothing known about String

Thanks.

James Edward Gray II



 
Reply With Quote
 
Dave Thomas
Guest
Posts: n/a
 
      08-28-2004

On Aug 27, 2004, at 21:35, David A. Black wrote:

> Is that supposed to be rdoc --ri-system and/or rdoc --ri-site? I
> couldn't find any ri that accepted a --system argument.


--ri-system


Cheers

Dave



 
Reply With Quote
 
Dave Thomas
Guest
Posts: n/a
 
      08-28-2004

On Aug 27, 2004, at 22:46, James Edward Gray II wrote:

> Does /usr/local/lib/ruby/1.8/ sound about right?
>
>


You want to go to the source distribution's lib/ directory.


Cheers

Dave



 
Reply With Quote
 
Mauricio Fernández
Guest
Posts: n/a
 
      08-28-2004
On Sat, Aug 28, 2004 at 09:43:19AM +0900, James Edward Gray II wrote:
> >In general, you can run 'ri' at the command line, along with the name
> >of a class, module, or method, (and combinations) and see
> >documentation

>
> This sounds exactly like what I'm looking for, but when I tried it...
>
> % ri String
> No ri documentation found in:
> /usr/local/share/ri/1.8/system
> /usr/local/share/ri/1.8/site
> /Users/james/.rdoc
>
> Was rdoc run to create documentation?


Many people have a hard time generating the documentation from the
sources -- it takes a long time, rdoc often dies in the process (after
processing for several minutes) and you have to download the sources,
etc...

I thought some of them would benefit from a packaged version of ri/rdoc's
runtime plus pre-generated RI data files. If you have rpa-base installed
just
rpa install ri-rpa
will get the RPAfied ri with all the needed documentation.
Additionally, ri-rpa provides ri integration for other libraries
installed through rpa-base, as shown in
http://rpa-base.rubyforge.org/wiki/w...Ri_Integration

You can find more information about rpa-base at
http://rpa-base.rubyforge.org/
and download it from there if you want.

--
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com



 
Reply With Quote
 
Dave Thomas
Guest
Posts: n/a
 
      08-28-2004

On Aug 28, 2004, at 5:41, Mauricio Fernández wrote:
> Many people have a hard time generating the documentation from the
> sources -- it takes a long time, rdoc often dies in the process (after
> processing for several minutes) and you have to download the sources,
> etc...


I do wish folks would tell me when they see this happening: if there's
a problem here I'd like to fix it.

If you run RDoc and it dies on you while processing the source tree,
please post the message it produces, along with a description of what
you were ding, and I'll work on it.

Cheers

Dave




 
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
ri and rdoc....like perldoc? Derek Smith Ruby 7 07-09-2010 03:56 PM
Tried Ruby (or, "what Python *really* needs" or "perldoc!") john_sips_tea@yahoo.com Python 27 03-17-2006 10:02 PM
A suggestion for perldoc Michele Dondi Perl Misc 9 09-05-2003 03:13 PM
root wants to use perldoc Dan Jacobson Perl Misc 2 08-26-2003 03:11 PM
Perl faq and posted to newsgroup but not to perldoc.com Upstart Perl Misc 1 08-11-2003 03:30 PM



Advertisments