Re: Class::MOP browser

[email protected] (Stevan Little)
Newsgroups perl.moose
Message-ID <[email protected]>
Hey Sam,

On Sep 12, 2006, at 5:17 PM, Sam Vilain wrote:
> [ referring to http://www.iinteractive.com/cgi-bin/ 
> class_mop_browser/ ]
>
> Hey, nice!

Thanks :)

> The RAD application I built and never released started off
> as the Class::Tangram browser.

You had started on with Moose too didn't you? Or at least you were  
discussing it.

> Where is the source?

The source for that is here: http://code2.0beta.co.uk/moose/svn/Class- 
MOP/trunk/scripts/class_browser.pl

It works as both a CGI, and if you pass the -s flag in, it makes a  
HTTP::Server::Simple to run standalone. Although to be honest, I  
think the standalone will be more useful. It started life as a  
Catalyst app, but that seemed kind of bloated, so I stripped it down  
to just a single script file (actually just about *all* the logic is  
in the TT part). Currently it needs Class::MOP svn HEAD to run, and  
can play havoc with earlier versions of Moose too, but it is a start.

One of the coolest things about it was totally unintended too.

   perl -MMy::Moose::Project scripts/class_browser.pl -s

This will then include all the metaclasses from My::Moose::Project as  
well. Although, it is currently *very* Class::MOP centric, so it  
won't display all the Moose::Meta::Attribute fields, and doesn't  
handle roles either. But all that should be fairly easy to add on.

If you (or anyone) wants to hack on it, please be my guest. The HTML/ 
CSS could use some work, and the TT code could use some refactoring  
as well. It would be really really really cool if we could get it to  
display POD for methods too. I think I would like to keep it in a  
single file, at least the basic version, but I have nothing against  
adding things like command line parameters to pass in a different  
template and/or css or some such.


- Stevan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.