[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

like man or apropos for Ruby

Phlip

7/20/2007 11:57:00 PM

Rubiods:

After years of studying Ruby, one factoid has eluded me. Actually, more than
one, but I have to start somewhere...

How, on a command line, can I do the equivalent of 'apropos' or 'man'? How
can I search the RDoc knowledge base installed on my own computer, with a
'less' interface, without Googling for everything all the time?

--
Phlip
http://www.oreilly.com/catalog/9780...
"Test Driven Ajax (on Rails)"
assert_xpath, assert_javascript, & assert_ajax


11 Answers

Tim Hunter

7/21/2007 12:08:00 AM

0

Phlip wrote:
> Rubiods:
>
> After years of studying Ruby, one factoid has eluded me. Actually, more than
> one, but I have to start somewhere...
>
> How, on a command line, can I do the equivalent of 'apropos' or 'man'? How
> can I search the RDoc knowledge base installed on my own computer, with a
> 'less' interface, without Googling for everything all the time?
>
>
Assuming you installed the documentation, you can use ri.

ri String#to_i

for example.

--
RMagick OS X Installer [http://rubyforge.org/project...]
RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?for...]
RMagick Installation FAQ [http://rmagick.rubyforge.org/instal...]


John Joyce

7/21/2007 12:10:00 AM

0


On Jul 20, 2007, at 7:00 PM, Phlip wrote:

> Rubiods:
>
> After years of studying Ruby, one factoid has eluded me. Actually,
> more than
> one, but I have to start somewhere...
>
> How, on a command line, can I do the equivalent of 'apropos' or
> 'man'? How
> can I search the RDoc knowledge base installed on my own computer,
> with a
> 'less' interface, without Googling for everything all the time?
>
> --
> Phlip
> http://www.oreilly.com/catalog/9780...
> "Test Driven Ajax (on Rails)"
> assert_xpath, assert_javascript, & assert_ajax
>
>
>
ri

example:
ri ClassName
ri method_name
ri Class#method
ri Class.method


Rick DeNatale

7/21/2007 3:04:00 AM

0

On 7/20/07, Tim Hunter <TimHunter@nc.rr.com> wrote:
> Phlip wrote:
> > Rubiods:
> >
> > After years of studying Ruby, one factoid has eluded me. Actually, more than
> > one, but I have to start somewhere...
> >
> > How, on a command line, can I do the equivalent of 'apropos' or 'man'? How
> > can I search the RDoc knowledge base installed on my own computer, with a
> > 'less' interface, without Googling for everything all the time?
> >
> >
> Assuming you installed the documentation, you can use ri.
>
> ri String#to_i
>
> for example.

And for a better performing alternative, get Mauricio Fernandez fastri
http://eigenclass.org/hiki...

It provides a qri command which pretty much directly substitutes for
ri. It's available as a gem.

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...

M. Edward (Ed) Borasky

7/21/2007 3:09:00 AM

0

Rick DeNatale wrote:
> On 7/20/07, Tim Hunter <TimHunter@nc.rr.com> wrote:
>> Phlip wrote:
>> > Rubiods:
>> >
>> > After years of studying Ruby, one factoid has eluded me. Actually,
>> more than
>> > one, but I have to start somewhere...
>> >
>> > How, on a command line, can I do the equivalent of 'apropos' or
>> 'man'? How
>> > can I search the RDoc knowledge base installed on my own computer,
>> with a
>> > 'less' interface, without Googling for everything all the time?
>> >
>> >
>> Assuming you installed the documentation, you can use ri.
>>
>> ri String#to_i
>>
>> for example.
>
> And for a better performing alternative, get Mauricio Fernandez fastri
> http://eigenclass.org/hiki...
>
> It provides a qri command which pretty much directly substitutes for
> ri. It's available as a gem.
>
IIRC it is *significantly* faster if you install from a tarball rather
than as a gem, but I don't remember why. Can someone enlighten me?

Alex Young

7/21/2007 10:09:00 AM

0

M. Edward (Ed) Borasky wrote:
> Rick DeNatale wrote:
>> On 7/20/07, Tim Hunter <TimHunter@nc.rr.com> wrote:
>>> Phlip wrote:
>>>> Rubiods:
>>>>
>>>> After years of studying Ruby, one factoid has eluded me. Actually,
>>> more than
>>>> one, but I have to start somewhere...
>>>>
>>>> How, on a command line, can I do the equivalent of 'apropos' or
>>> 'man'? How
>>>> can I search the RDoc knowledge base installed on my own computer,
>>> with a
>>>> 'less' interface, without Googling for everything all the time?
>>>>
>>>>
>>> Assuming you installed the documentation, you can use ri.
>>>
>>> ri String#to_i
>>>
>>> for example.
>> And for a better performing alternative, get Mauricio Fernandez fastri
>> http://eigenclass.org/hiki...
>>
>> It provides a qri command which pretty much directly substitutes for
>> ri. It's available as a gem.
>>
> IIRC it is *significantly* faster if you install from a tarball rather
> than as a gem, but I don't remember why. Can someone enlighten me?
>
Presumably (and this is a wild stab in the dark) if it's installed as a
gem, it requires rubygems before doing anything to do with your query.
Loading rubygems is itself a slow operation.

--
Alex

Eugen Minciu

7/21/2007 12:40:00 PM

0

Excerpts from M. Edward (Ed) Borasky's message of Sat Jul 21 06:09:14 +0300 2007:
> Rick DeNatale wrote:
> > On 7/20/07, Tim Hunter <TimHunter@nc.rr.com> wrote:
> >> Phlip wrote:
> >> > Rubiods:
> >> >
> >> > After years of studying Ruby, one factoid has eluded me. Actually,
> >> more than
> >> > one, but I have to start somewhere...
> >> >
> >> > How, on a command line, can I do the equivalent of 'apropos' or
> >> 'man'? How
> >> > can I search the RDoc knowledge base installed on my own computer,
> >> with a
> >> > 'less' interface, without Googling for everything all the time?
> >> >
> >> >
> >> Assuming you installed the documentation, you can use ri.
> >>
> >> ri String#to_i
> >>
> >> for example.
> >
> > And for a better performing alternative, get Mauricio Fernandez fastri
> > http://eigenclass.org/hiki...
> >
> > It provides a qri command which pretty much directly substitutes for
> > ri. It's available as a gem.
> >
> IIRC it is *significantly* faster if you install from a tarball rather
> than as a gem, but I don't remember why. Can someone enlighten me?
During the build I see:
A small note about RubyGems + FastRI
====================================
RubyGems adds a noticeable overhead to fri, making it run slower than if
you
installed it directly from the tarball with setup.rb.


--
Eugen Minciu.

Wasting valuable time since 1985.

Rick DeNatale

7/21/2007 6:41:00 PM

0

On 7/20/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
> Rick DeNatale wrote:

> > It provides a qri command which pretty much directly substitutes for
> > ri. It's available as a gem.
> >
> IIRC it is *significantly* faster if you install from a tarball rather
> than as a gem, but I don't remember why. Can someone enlighten me?

This is true, BUT even when installed as a gem, it's significantly
faster than ri.

The difference kicks in when you use it a lot, for example when you
use Mauricio's tools which invoke it from inside textmate or vim.


--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...

IPMS/USA Region 12 Coordinator
http://ipmsr12.denh...

Visit the Project Mercury Wiki Site
http://www.mercuryspace...

Marc Heiler

7/21/2007 6:50:00 PM

0

I am a dreamer and i also admit i like CSS and good looking, visual
clean documentation in a browser, but i still hope that one day a huge,
up-to-date ruby reference can be read online, maintained with useful
remarks (optional) by a community - and that we can leave rdoc as a
relict of the past - or keept it for those that want it, while I could
read the fancy, stylish online docu! Dont take this too serious, i am
just wishing and hoping! And yeah, I do think that rdoc looks not very
... satisfying :>

--
Posted via http://www.ruby-....

benjohn

7/22/2007 2:18:00 PM

0



I've just had a quick play about with qri and ri...

> benjohn # qri syntax
> nil
> benjohn # qri nitro
> nil
> benjohn # qri ramaze
> nil
> benjohn # qri httpserver
> nil
> benjohn # qri tcpserver
> nil
> benjohn # qri TCP
> nil

I guess either I don't have much indexed, or I'm in need of a looser
search than the default? Do I need to do something to make sure ruby
and the Gems I've got installed are indexed? :-) I guess the likely
answer is YES!

Cheers,
Benj


SonOfLilit

7/22/2007 2:26:00 PM

0

On 7/21/07, Marc Heiler <shevegen@linuxmail.org> wrote:
> I am a dreamer and i also admit i like CSS and good looking, visual
> clean documentation in a browser, but i still hope that one day a huge,
> up-to-date ruby reference can be read online, maintained with useful
> remarks (optional) by a community - and that we can leave rdoc as a
> relict of the past - or keept it for those that want it, while I could
> read the fancy, stylish online docu! Dont take this too serious, i am
> just wishing and hoping! And yeah, I do think that rdoc looks not very
> ... satisfying :>

I've compiled my own rdoc of every library I have use and the core,
using a template I found online, and it looks VERY good, including
stuff like javascript search-as-you-type of the whole index (separate
for methods, files, classes).

Try that.

Aur