[LRUG] Tool to show included partials in RoR?

Richard Livsey richard at livsey.org
Thu Jan 21 09:34:02 PST 2010


>> 2010/1/21 Jocke Selin <jocke at selincite.com>:
>>> I'm wondering if there's some nice tool that I could point
>>> at a file in the app/views/ dir on my machine and it could
>>> render, ascii'ally of graphically, which files are "render
>>> partial" from there on. I'd like a tree with the file names,
>>> that's pretty much all I'd really need.

> That's (http://github.com/markevans/partial_identifier)  quite clever. Sadly it's again, runtime.
> And, according to Tom, I'm "lucky" enough to have most of my partials defined by strings.
>
> I just need to know which file is included by which file. :) I have two similar pieces of templates here, but they're named a bit differently so, I'm a bit confused. Would like it just printed out.
>
> Hacking away here... :)

Just spent a couple of mins on this and came up with the following to
produce a graphic using graphviz.

http://gist.github.com/282966

ruby graph.rb /path/to/app/views graph.png

It generates something like the attached graph.png

Code isn't very good to look at, I'm sure with a bit more work it
could produce something nicer, and with much better code!

Cheers.

-- 
Richard Livsey
Minutebase - Online Meeting Minutes
http://minutebase.com
http://livsey.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graph.png
Type: image/png
Size: 554353 bytes
Desc: not available
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100121/8bf831ef/attachment-0004.png>


More information about the Chat mailing list