[LRUG] Tool to show included partials in RoR?

Richard Livsey richard at livsey.org
Thu Jan 21 14:20:34 PST 2010


On Thu, Jan 21, 2010 at 3:25 PM, Jocke Selin <jocke at selincite.com> wrote:
> Hi,
>
> 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.
>
> I know I could write a simple thing to do it, but if there's something out there already I'd rather use that.

A bit of hacking and I've made a simple gem to do just this.

$ gem install giraffe
$ giraffe /path/to/app/views/ graph.png

It requires graphviz, for more info see the github project:
http://github.com/rlivsey/giraffe

It's fairly naive and only works on partials required as strings, but
you say that's what yours mainly are anyway.

Hope it does what you want!

-- 
Richard Livsey
Minutebase - Online Meeting Minutes
http://minutebase.com
http://livsey.org



More information about the Chat mailing list