How to use ri with a new package

Hi All,

I just used gem to install the package “sys-admin” from the RubyForge
sysadmin project by Daniel B… The example that Daniel provided
for using sys-admin worked fine.

I’d like to use ri to display the RDoc documentation, but I can’t
figure out how.

The package is installed at K:_Utilities\Ruby_1.8.2-15\ruby\lib\ruby
\gems\1.8\doc\sys-admin-1.4.2-mswin32.
The rdoc subdirectory had files like fr_???_index.html for ??? =
class, file, method. Double-clicking them does produce RDoc-style
documentation. But how can I use ri to bring up that documentation
without resorting to Windows Explorer?

I tried a few other things to no avail. The following ri command
produces documentation of the “class” method of the class Object, not
a list of classes of the sys-admin package:
K:_Utilities\Ruby_1.8.2-15\ruby\lib\ruby\gems\1.8\doc\sys-admin-1.4.2-
mswin32\rdoc>ri class

Object#class
obj.class => class

 Returns the class of _obj_, now preferred over +Object#type+, as

an
object’s type in Ruby is only loosely tied to that object’s
class.
This method must always be called with an explicit receiver, as
+class+ is also a reserved word in Ruby.

    1.class      #=> Fixnum
    self.class   #=> Object

I thought “ri index” might do it, but instead I got:
K:_Utilities\Ruby_1.8.2-15\ruby\lib\ruby\gems\1.8\doc\sys-admin-1.4.2-
mswin32\rdoc>ri index
More than one method matched your request. You can refine
your search by asking for information on one of:

 Array#each_index, Array#index, Array#indexes, Array#rindex,
 Enumerable#each_with_index, Generator#index, Hash#index,
 Hash#indexes, String#index, String#rindex

Thanks in advance,
Richard

RichardOnRails wrote:

Double-clicking them does produce RDoc-style
documentation. But how can I use ri to bring up that documentation
without resorting to Windows Explorer?

You could create a shortcut on your desktop to the docs, or you can
type the command:

…/…/> gem_server

and then open up a browser and enter the address:

http://localhost:8808

in your browser’s address bar. That should bring up a page that lists
all rubygems you’ve installed with links to their rdocs.

Personally, I think the shortcut method is easier.

On Oct 24, 12:31 am, 7stud – [email protected] wrote:

and then open up a browser and enter the address:

http://localhost:8808

in your browser’s address bar. That should bring up a page that lists
all rubygems you’ve installed with links to their rdocs.

Personally, I think the shortcut method is easier.


Posted viahttp://www.ruby-forum.com/.

Great response! I chose option #1. Getting something like
RDoc Documentation for my installed packages is exactly
what I wanted. Thanks.

I’m going to try to incorporate those commands in a Windows’ WHS
script.

Again, thanks.
Richard

On Oct 24, 10:44 am, RichardOnRails
[email protected] wrote:

all rubygems you’ve installed with links to their rdocs.
script.

Again, thanks.
Richard- Hide quoted text -

  • Show quoted text -

ri Sys::Admin

will get you the ri documentation you want