[Catalyst] catalyst.pl hack to use config file and run other helpers

Christopher H. Laco claco at chrislaco.com
Thu Nov 17 14:21:29 CET 2005


Zbigniew Lukasiak wrote:
> Hi,
> 
> In the config file you specify what components you want to generate
> and their parameters.  You than run it like this:
> 
> ./catalyst.pl Config.yaml
> 
> with the config file as the first parameter.
> 
> It than generates the application and configured components.  I
> believe that using that approach you could compress the catalyst movie
> to 2/3s of its length (and compete with RoR).
> 
> In attachments the hacked catalyst.pl and a sample config file.
> 
> -- zby

Some thoughts...and keep in mind it's early and I'm still asleep at the
wheel...

> my $config = LoadFile($ARGV[0])

It appears that your tweaking implies that I can no longer do

    $ catalyst MyApp

Or is this all just for demo purposes?

Thie other problem this presents is the model config:

>     model:
>         type: CDBI
>         tablename: Hint
>         dsn: dbi:SQLite:cataculous.db
>         user: 
>         password: 


Not all models are the same. Some models don't use dsns, tables, users,
or passwords. For example, the SVN model I'm working on taks two config
params: repository and revision.

The mk_component part of your example can't possibly kow every variation
of model params out there.

Instead, I'd suggestr simple using the order of params:


    model:
	name: Source
        type: SVN
        params:
            /my/repo/path
            HEAD


which then get's stuffed info

mk_component(appname, 'model' 'Source', 'SVN', '/my/repo/path')


Same deal doe DBI based things...


    model:
	name: MyTable
	type: CDBI
	params:
		mydsn
		myuser
		mypass

mk_component(appname, 'model', 'MyTable', 'CDBI', 'mydsn', 'myuser',
'mypass')


Other than that, I like the idea...

-=Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3178 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20051117/d72f0143/smime.bin


More information about the Catalyst mailing list