How to use ri with a new package

R

RichardOnRails

Hi All,

I just used gem to install the package "sys-admin" from the RubyForge
sysadmin project by Daniel Berger. 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
 
7

7stud --

RichardOnRails said:
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.
 
R

RichardOnRails

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.

Great response! I chose option #1. Getting something like
http://www.ruby-doc.org/stdlib/ 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
 
B

bbiker

Great response! I chose option #1. Getting something likehttp://www.ruby-doc.org/stdlib/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- Hide quoted text -

- Show quoted text -

ri Sys::Admin

will get you the ri documentation you want
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top