[Catalyst] [RFE] create.pl should remember -short from catalyst.pl

Christopher H. Laco claco at chrislaco.com
Mon Nov 21 15:12:15 CET 2005


This just came up when I tried the Handel scaffold under 5.5 (finally).

    catalyst.pl -short MyStore

It does what you would expect, and created M, V, and C directories.

    create.pl Handel::Scaffold

This creates the long names again:

> C:\MyStore>perl script/mystore_create.pl Handel::Scaffold dbi:SQLite:dbname=hand
> el.db
> created "C:\MyStore\lib\MyStore\View"
> created "C:\MyStore\t\View"
> created "C:\MyStore\lib\MyStore\View\TT.pm"
> created "C:\MyStore\t\View\TT.t"
> created "C:\MyStore\lib\MyStore\Model"
> created "C:\MyStore\t\Model"
> created "C:\MyStore\lib\MyStore\Model\Cart.pm"
> created "C:\MyStore\t\Model\Cart.t"
>  exists "C:\MyStore\lib\MyStore\Model"
>  exists "C:\MyStore\t\Model"
> created "C:\MyStore\lib\MyStore\Model\Orders.pm"
> created "C:\MyStore\t\Model\Orders.t"
> created "C:\MyStore\lib\MyStore\Controller"
> created "C:\MyStore\t\Controller"
> created "C:\MyStore\root\cart"
> created "C:\MyStore\lib\MyStore\Controller\Cart.pm"
> created "C:\MyStore\root\cart\view.tt"
> created "C:\MyStore\root\cart\list.tt"
> created "C:\MyStore\t\Controller\Cart.t"
>  exists "C:\MyStore\lib\MyStore\Controller"
>  exists "C:\MyStore\t\Controller"
> created "C:\MyStore\root\orders"
> created "C:\MyStore\lib\MyStore\Controller\Orders.pm"
> created "C:\MyStore\root\orders\list.tt"
> created "C:\MyStore\root\orders\view.tt"
> created "C:\MyStore\t\Controller\Orders.t"
>  exists "C:\MyStore\lib\MyStore\Controller"
>  exists "C:\MyStore\t\Controller"
> created "C:\MyStore\root\checkout"
> created "C:\MyStore\lib\MyStore\Controller\Checkout.pm"
> created "C:\MyStore\root\checkout\edit.tt"
> created "C:\MyStore\root\checkout\preview.tt"
> created "C:\MyStore\root\checkout\payment.tt"
> created "C:\MyStore\root\checkout\complete.tt"
> created "C:\MyStore\t\Controller\Checkout.t"


Using -short in create.pl does what I really expected it to do the first
time:

> C:\MyStore>perl script/mystore_create.pl -short Handel::Scaffold dbi:SQLite:dbna
> me=handel.db
>  exists "C:\MyStore\lib\MyStore\V"
>  exists "C:\MyStore\t\V"
> created "C:\MyStore\lib\MyStore\V\TT.pm"
> created "C:\MyStore\t\V\TT.t"
>  exists "C:\MyStore\lib\MyStore\M"
>  exists "C:\MyStore\t\M"
> created "C:\MyStore\lib\MyStore\M\Cart.pm"
> created "C:\MyStore\t\M\Cart.t"
>  exists "C:\MyStore\lib\MyStore\M"
>  exists "C:\MyStore\t\M"
> created "C:\MyStore\lib\MyStore\M\Orders.pm"
> created "C:\MyStore\t\M\Orders.t"
>  exists "C:\MyStore\lib\MyStore\C"
>  exists "C:\MyStore\t\C"
>  exists "C:\MyStore\root\cart"
> created "C:\MyStore\lib\MyStore\C\Cart.pm"
>  exists "C:\MyStore\root\cart\view.tt"
>  exists "C:\MyStore\root\cart\list.tt"
>  exists "C:\MyStore\lib\MyStore\C"
>  exists "C:\MyStore\t\C"
>  exists "C:\MyStore\root\orders"
> created "C:\MyStore\lib\MyStore\C\Orders.pm"
>  exists "C:\MyStore\root\orders\list.tt"
>  exists "C:\MyStore\root\orders\view.tt"
>  exists "C:\MyStore\lib\MyStore\C"
>  exists "C:\MyStore\t\C"
>  exists "C:\MyStore\root\checkout"
> created "C:\MyStore\lib\MyStore\C\Checkout.pm"
>  exists "C:\MyStore\root\checkout\edit.tt"
>  exists "C:\MyStore\root\checkout\preview.tt"
>  exists "C:\MyStore\root\checkout\payment.tt"
>  exists "C:\MyStore\root\checkout\complete.tt"
> 
> C:\MyStore>


So, my request for enhancement is thus one of two different things:

a) have create.pl do the same thing that catalyst.pl did to create the
app. If the app was -short, default create.pl to -short. If catalyst.pl
was long named, create.pl should default to long names.


b) provide a way in the Catalyst::Helper API so other helpers can
determine if the app they're creating in is using the short name, or
long name convention, so I can have my helpers DTRT.



Maybe it's just me, but I didn't expect to have to use -short during
create.pl.

-=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/20051121/a18986c5/smime-0001.bin


More information about the Catalyst mailing list