Forum: Ruby like man or apropos for Ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1040215636f35f752ce36af2cdd61458?d=identicon&s=25 Phlip (Guest)
on 2007-07-21 02:00
(Received via mailing list)
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?
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2007-07-21 02:10
(Received via mailing list)
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.
E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2007-07-21 02:11
(Received via mailing list)
On 7/20/07, Phlip <phlipcpp@yahoo.com> wrote:
>
> --
>   Phlip
>   http://www.oreilly.com/catalog/9780596510657/
>   "Test Driven Ajax (on Rails)"
>   assert_xpath, assert_javascript, & assert_ajax
>
>
>
>
It's spelled "ri".

ri Array

ri String

ri Hash#each

ri Object::new
1c0cd550766a3ee3e4a9c495926e4603?d=identicon&s=25 John Joyce (Guest)
on 2007-07-21 02:14
(Received via mailing list)
On Jul 20, 2007, at 7:00 PM, Phlip wrote:

> 'less' interface, without Googling for everything all the time?
>
> --
>   Phlip
>   http://www.oreilly.com/catalog/9780596510657/
>   "Test Driven Ajax (on Rails)"
>   assert_xpath, assert_javascript, & assert_ajax
>
>
>
ri

example:
ri ClassName
ri method_name
ri Class#method
ri Class.method
8f6f95c4bd64d5f10dfddfdcd03c19d6?d=identicon&s=25 Rick Denatale (rdenatale)
on 2007-07-21 05:04
(Received via mailing list)
On 7/20/07, Tim Hunter <TimHunter@nc.rr.com> wrote:
> >
> 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.rb?fastri

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.denhaven2.com/
3bb23e7770680ea44a2d79e6d10daaed?d=identicon&s=25 M. Edward (Ed) Borasky (Guest)
on 2007-07-21 05:09
(Received via mailing list)
Rick DeNatale wrote:
>> > can I search the RDoc knowledge base installed on my own computer,
> And for a better performing alternative, get Mauricio Fernandez fastri
> http://eigenclass.org/hiki.rb?fastri
>
> 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?
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (regularfry)
on 2007-07-21 12:10
(Received via mailing list)
M. Edward (Ed) Borasky wrote:
>>> 'man'? How
>> And for a better performing alternative, get Mauricio Fernandez fastri
>> http://eigenclass.org/hiki.rb?fastri
>>
>> 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.
E62019cf0f85efb27e685cbd08db4c59?d=identicon&s=25 Eugen Minciu (Guest)
on 2007-07-21 14:41
(Received via mailing list)
Excerpts from M. Edward (Ed) Borasky's message of Sat Jul 21 06:09:14
+0300 2007:
> >> 'man'? How
> >
> > And for a better performing alternative, get Mauricio Fernandez fastri
> > http://eigenclass.org/hiki.rb?fastri
> >
> > 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.
8f6f95c4bd64d5f10dfddfdcd03c19d6?d=identicon&s=25 Rick Denatale (rdenatale)
on 2007-07-21 20:42
(Received via mailing list)
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.denhaven2.com/

IPMS/USA Region 12 Coordinator
http://ipmsr12.denhaven2.com/

Visit the Project Mercury Wiki Site
http://www.mercuryspacecraft.com/
4828d528e2e46f7c8160c336eb332836?d=identicon&s=25 Robert Heiler (shevegen)
on 2007-07-21 20:49
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 :>
Ffcb418e17cac2873d611c2b8d8d891c?d=identicon&s=25 Benjohn Barnes (Guest)
on 2007-07-22 16:19
(Received via mailing list)
I've just had a quick play about with qri and ri...

> 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
7b4707f974af261f71943e1f2046c9ee?d=identicon&s=25 SonOfLilit (Guest)
on 2007-07-22 16:27
(Received via mailing list)
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
C40020a47c6b625af6422b5b1302abaf?d=identicon&s=25 Stefano Crocco (crocco)
on 2007-07-22 16:56
(Received via mailing list)
Alle domenica 22 luglio 2007, Benjohn Barnes ha scritto:
> > benjohn # qri tcpserver
>   Benj
If I remember correctly, you need to do

fastri-server -b

I hope this helps

Stefano
This topic is locked and can not be replied to.