using ri with gems

M

msoulier

When I install a new gem, it runs rdoc on the source to pull out docs
that are then available via the gem_server on localhost 8808. Being a
long-time Perl programmer, I want perldoc.

If I install say, Text::CSV from the CPAN, I can then run

perldoc Text::CSV

to get the docs from it.

Conversely, I just installed the net-ssh gem.

[msoulier@tigger ~]$ gem list --local | grep ssh
net-ssh (1.0.9)
[msoulier@tigger ~]$ ri net-ssh
Nothing known about net-ssh
[msoulier@tigger ~]$ ri net/ssh
Nothing known about net/ssh
[msoulier@tigger ~]$ ri Net::SSH
Nothing known about Net::SSH

So, what is ri for? Seems to work on built-in classes like Array, but
not gem code.

Thanks,
Mike
 
M

msoulier

Austin said:
Use gemri for now.

It's a new command in the latest RubyGems release, but it gives ri
capabilities to gems.

I have the latest release, and I don't see a gemri executable.

Mike
 
A

Austin Ziegler

msoulier said:
I have the latest release, and I don't see a gemri executable.

I just did:

gem update --system

Then I was able to do:

gemri

and get results. You must be using RubyGems 0.9.0.

-austin
 
M

msoulier

Austin said:
I just did:

gem update --system

Then I was able to do:

gemri

and get results. You must be using RubyGems 0.9.0.

Yup, that worked. Mind you...

[msoulier@tigger ~]$ gemri Net::SSH
Nothing known about Net::SSH
[msoulier@tigger ~]$ gemri net-ssh
Nothing known about net-ssh
[msoulier@tigger ~]$ gemri net/ssh
Nothing known about net/ssh

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'net/ssh'
=> true

So, how do I pull up the docs?

Mike
 
A

Austin Ziegler

msoulier said:
Yup, that worked. Mind you...

[msoulier@tigger ~]$ gemri Net::SSH
Nothing known about Net::SSH
[msoulier@tigger ~]$ gemri net-ssh
Nothing known about net-ssh
[msoulier@tigger ~]$ gemri net/ssh
Nothing known about net/ssh

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'net/ssh'
=> true

So, how do I pull up the docs?

If Net::SSH has rdoc disabled, you'll not get docs or ri. If you
installed Net::SSH before upgrading, you'll have to do something to
generate the ri data.

% gem rdoc net-ssh
% gemri Net::SSH

-austin
 
M

msoulier

Austin said:
If Net::SSH has rdoc disabled, you'll not get docs or ri. If you
installed Net::SSH before upgrading, you'll have to do something to
generate the ri data.

% gem rdoc net-ssh
% gemri Net::SSH

Ok, did that.

-------------------------------------------------------- Class:
Net::SSH
(no description...)
------------------------------------------------------------------------


Constants:
----------
EXTERNAL_SERVICES: Hash.new


Instance methods:
-----------------
register_service, start

Wow, not much there. There's a lot more in the html docs provided for
the gem_server. I guess for some reason these are not one and the same?
That's odd.

Mike
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top