Forum: Ruby LXR style cross references Ruby code

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.
List R. (Guest)
on 2005-12-12 23:55
(Received via mailing list)
While trying to navigate a large, unfamiliar application, I find a
cross referenced browser invaluable.

For statically typed languages, there exist a whole bunch: LXR, the
browser part of MSVC IDE, etc.

For Ruby, are there any?

I realize that it won't be perfect, as you can't always know excatly
where the method is defined.  But a simple algorithm which would
certainly be at least 80/20 would be:

1) If it is proceeded by a dot, it is a method name
2) To guess the class of any object: If you see: variable_name =
CapitalLetter.something, you can guess that variable_name is an
instance of CapitalLetter
3) To find a method definition, first look through the methods defined
for that class (RDoc is already able to parse them), then look through
the current file, then, through all the files required in.  Failing
that, link to a simple search page, listing all of the places where it
is defined.

For me, a simple browser like this makes all the difference navigating
unfamiliar code.

I have no experience with CTags - maybe it could be used to do
something like this?

---

PS For a radically different approach, how 'bout using Ruby to load the
app in a sandbox, and reflect across the entire ObjectSpace to figure
everything out?  Could this be done?  I know it's a lot of work -
beyond the scope of my initial request - but, if it could, it could add
code completion and refactoring to dynamic lang IDE's, something which
many developers truely miss.
List R. (Guest)
on 2005-12-13 05:38
(Received via mailing list)
Huh?!

I thought everyone would jump at this.

Am I the only one who finds these type of cross references TREMENDOUSLY
USEFUL?
Damphyr (Guest)
on 2005-12-14 11:47
(Received via mailing list)
removed_email_address@domain.invalid wrote:
> Huh?!
>
> I thought everyone would jump at this.
>
> Am I the only one who finds these type of cross references
> TREMENDOUSLY USEFUL?
Maybe because RDoc does most of the cross-references you want, if only
you follow the rules *and* you can read the code.
So you can use your normal browser :)
Cheers,
V.-
--
http://www.braveworld.net/riva
Christian N. (Guest)
on 2005-12-14 19:21
(Received via mailing list)
removed_email_address@domain.invalid writes:

> Huh?!
>
> I thought everyone would jump at this.
>
> Am I the only one who finds these type of cross references TREMENDOUSLY
> USEFUL?

Where are the millions of lines of Ruby they would be needed for? :-)
This topic is locked and can not be replied to.