On Fri, Nov 24, 2006 at 12:46:36AM +0900, Robert Feldt wrote:
> On 11/23/06, Mauricio Fernandez <mfp / acm.org> wrote:
> >FastRI is an alternative to the ri command-line tool. It is *much* faster,
> >and also allows you to offer RI lookup services over DRb. FastRI is smarter
> >than ri, and can find classes anywhere in the hierarchy without specifying
> >the "full path". FastRI can perform full-text searching. Its RubyGems
> >support is better than ri's, and it knows which gem a method/class
> >definition came from.
> >
> Thanks, this looks nice. However,
> 
> $ fri flatten
> ------------------------------------------------------ Multiple choices:
> 
>     Array#flatten, Set#flatten
> $ fri A#flatten
> nil
> 
> so I need to fully spell out which one I'm interested in. Could you
> please add a simple string distance or something like that so that one
> can use shortcuts, ie fri A#flatten should choose Array#flatten since
> it is the closest one. If I don't misremember we discussed and added
> this functionality to ri way back then.

I have pushed a couple patches to HEAD
(http://eigenclass.org/repos/fastri/head) that implement these search methods:
* complete namespace (m)
* complete both namespace and method (f)

FastRI's search strategy can be specified with the -O option:

    -O, --order ORDER                Specify lookup order.
                                     (default: eEnNpPxX)
                                     Uppercase: case-indep.
                                     e:exact n:nested p:partial (completion)
                                     x:nested and partial m:complete namespace
                                     f:complete both class and method
                                     a:match method name anywhere

See [225037] for an explanation of the basic search modes.

You can make fri behave like ri (regarding partial completion of the namespace
name) by adding 'm' to the lookup order:

$ fri -Om A#flatten
---------------------------------------------------------- Array#flatten
     array.flatten -> an_array

Moreover,

$ fri -Of A#a
------------------------------------------------------ Multiple choices:

     ACL#allow_addr?, ACL#allow_socket?, Abbrev#abbrev, Array#abbrev, 
     Array#assoc, Array#at, Autotest#add_sigint_handler, 
     Autotest#all_good


However, I'm not sure about the position in the search strategy (currently
eEnNpPxX) at which the 'm' or 'f' modes could be added. 
Maybe  eEnNpPxXmM(fF)a  ?

Anyway, even if I left the default search strategy unchanged, it could be
overridden with --order (-O).

-- 
Mauricio Fernandez  -   http://eigenclass.org   -  singular Ruby