[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ri enhancements

Dick Davies

2/11/2005 9:13:00 PM


Just a quick check, really:

is there any way to have ri pick up the rdoc of installed third-party
packages?

It's the one thing I feel ruby is lacking at the moment.
(I'm about to go grepping for require_dependency through all my rails
libs to override it and wish I could just do 'ri require_dependency'
to find out what class/module defines it).

--
'Some people, when confronted with a problem, think I know, I'll use
regular expressions. Now they have two problems.'
-- Jamie Zawinski
Rasputin :: Jack of All Trades - Master of Nuns


2 Answers

James Britt

2/12/2005 1:03:00 AM

0

Dick Davies wrote:
> Just a quick check, really:
>
> is there any way to have ri pick up the rdoc of installed third-party
> packages?

Yes, but.

You can run rdoc -[R|r|Y] on any installed code, and it will create the
ri data files corresponding to the rdoc for that code.

The 'but' is that the integration between built-in classes and other
code is not always smooth. If the code, for example, extends String,
then those new methods will end up as part of the core String ri.

There may be ways around this, but my experience trying to add the
standard lib to ri caused all sorts of ri issues.

>
> It's the one thing I feel ruby is lacking at the moment.
> (I'm about to go grepping for require_dependency through all my rails
> libs to override it and wish I could just do 'ri require_dependency'
> to find out what class/module defines it).

If you installed Rails via rubygems you should have rdoc documentation
viewable through rubygem's built-in 'gem_server' app. You could also
view the docs directly in the gems/docs dir.

James Britt


Dick Davies

2/13/2005 11:20:00 AM

0

* James Britt <jamesUNDERBARb@neurogami.com> [0203 01:03]:
> Dick Davies wrote:
> >Just a quick check, really:
> >
> >is there any way to have ri pick up the rdoc of installed third-party
> >packages?
>
> Yes, but.
>
> You can run rdoc -[R|r|Y] on any installed code, and it will create the
> ri data files corresponding to the rdoc for that code.

Thanks James, that's what I was after. (wonder if there's a way to have
rubygems do that by default).

> There may be ways around this, but my experience trying to add the
> standard lib to ri caused all sorts of ri issues.

Oh. And you know what you're doing too. Oh well, scratch the 'have rubygems
screw up my ri install by default' request :).

> If you installed Rails via rubygems you should have rdoc documentation
> viewable through rubygem's built-in 'gem_server' app. You could also
> view the docs directly in the gems/docs dir.

Yeah, I just started getting into irb, and know that has iHelp now to hook
into ri.

The api docs are great but I had no browser until recently (don't ask).
Turns out elinks can do frames, so I'm in gravy now - just did:

alias railsapi="elinks http://rails.rubyonrails...

and now have a nice easy reference in an xterm - cheers!

--
'Power corrupts. Absolute power - is kind of neat.'
-- John Lehman, Secretary of the Navy, 1981-1987
Rasputin :: Jack of All Trades - Master of Nuns