[jifty-devel] Model Creation Questions

Jesse Vincent jesse at bestpractical.com
Sun Dec 25 21:00:28 EST 2005




On Sun, Dec 25, 2005 at 05:31:19PM -0800, chromatic wrote:
> Hi there,
> 
> Can I create an application with a multi-level name, such as 
> Games::GoldFarmer?  Looking at Jifty::Util, it looks unlikely.

It does look unlikely to work with the magic auto-intuit-name stuff,
but should be fixed. I'll see what I can do. :) It should be fine if you
manually set up a config file...which we have too few examples of. I
think the generator should probably write you a config file, possibly
commented out.


> (I'd like to do this to distribute an application on the CPAN without creating 
> a new top-level namespace.)
> 
> The tutorial suggests giving the name of the model in lowercase ("post") and 
> appears to create a model with an uppercase name.  When I try it, it matches 
> the case I use.  The attached patch fixes that.
>
> (The right fix might be to patch the tutorial instead.)

Well, I'd like to fix the tutorial. I wonder if it's closer to doing the
right thing to also apply your patch.

> -- c
> 

> === lib/Jifty/Script/Model.pm
> ==================================================================
> --- lib/Jifty/Script/Model.pm	(revision 11428)
> +++ lib/Jifty/Script/Model.pm	(local)
> @@ -54,7 +54,7 @@
>  sub run {
>      my $self = shift;
>      
> -    my $model = $self->{name} || '';
> +    my $model = ucfirst( $self->{name} || '' );
>      die "You need to give your new model a --name\n"
>        unless $model =~ /\w+/;
>  

> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel


-- 


More information about the jifty-devel mailing list