[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

FastRI, handling identical class names and methods

Daniel Berger

12/4/2006 2:48:00 AM

Hi,

FastRI 0.2.1
Ruby 1.8.5
Windows XP

With FastRI (or rather, fri) how do you distinguish a lookup on classes
with identical names and methods (and no namespace to distinguish them)?

For example, I have the Pathname class from the stdlib and my own
Pathname class from the 'pathname2' package. If I do 'fri
Pathname#descend' I get the documentation from the Pathname class in the
stdlib instead of my own. Is there a way to force the issue?

I tried using the -S and -F options, but I received the following error
(with -S):

Couldn't open the full-text index:
C:\Documents and Settings\djberge/.fastri-fulltext/full_text.dat
C:\Documents and Settings\djberge/.fastri-fulltext/suffixes.dat

The index needs to be rebuilt with fastri-server -B

Since I'm runnng FastRI as a service, rebuilding the index may be
problematic at the moment. :) But, even if that did work, I presume it
would give me all the results instead of just the one I'm looking for.

Suggestions?

Thanks,

Dan

2 Answers

Paul Lutus

12/4/2006 7:50:00 AM

0

Daniel Berger wrote:

> Hi,
>
> FastRI 0.2.1
> Ruby 1.8.5
> Windows XP
>
> With FastRI (or rather, fri) how do you distinguish a lookup on classes
> with identical names and methods (and no namespace to distinguish them)?
>
> For example, I have the Pathname class from the stdlib and my own
> Pathname class from the 'pathname2' package. If I do 'fri
> Pathname#descend' I get the documentation from the Pathname class in the
> stdlib instead of my own. Is there a way to force the issue?

Yes, there is. The best solution is to give your own class a different name.
It is not a good idea to use an existing class name for your own classes.

--
Paul Lutus
http://www.ara...

Mauricio Fernández

12/4/2006 1:44:00 PM

0

On Mon, Dec 04, 2006 at 11:47:44AM +0900, Daniel Berger wrote:
> With FastRI (or rather, fri) how do you distinguish a lookup on classes
> with identical names and methods (and no namespace to distinguish them)?
>
> For example, I have the Pathname class from the stdlib and my own
> Pathname class from the 'pathname2' package. If I do 'fri
> Pathname#descend' I get the documentation from the Pathname class in the
> stdlib instead of my own. Is there a way to force the issue?

What you're getting is the result of merging the documentation from the
Pathname class in the stdlib and that in the gem package, so you'll see
methods defined in both, but for a given method only the description from the
stdlib IIRC (that depends on the way RDoc defines "merging", which is not
commutative). Internally, FastRI knows where a class/module/method came from,
but there's no way to specify the scope of the search at the moment. Once that
functionality is exposed, you'll be able to do
fri --scope pathname2 Pathname

> I tried using the -S and -F options, but I received the following error
> (with -S):
>
> Couldn't open the full-text index:
> C:\Documents and Settings\djberge/.fastri-fulltext/full_text.dat
> C:\Documents and Settings\djberge/.fastri-fulltext/suffixes.dat
>
> The index needs to be rebuilt with fastri-server -B
>
> Since I'm runnng FastRI as a service, rebuilding the index may be
> problematic at the moment. :) But, even if that did work, I presume it
> would give me all the results instead of just the one I'm looking for.

It should work since fastri-server doesn't access the full-text index itself
at the moment. But it would show all the matches (and only the matching lines,
it doesn't show full entries).

--
Mauricio Fernandez - http://eige... - singular Ruby