The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

catalyst-fatstart.pl - catalyst starter that tries to know better than you

VERSION

This app and its module is version 0.9.1

SYNOPSIS

catalyst-fatstart.pl -n MyCatApp [options]

 Options:
  --TT         Adds a C::View::TT component, defaults to HTML.pm
  --JSON       Adds a C::View::JSON component, defaults to JSON.pm
  --dsn        Specify a dsn for a model
  --model      Set model name. Default: name . "DB"
  --schema     Schema class. Default: name . "::Schema"
  a lot more, see --usage, --man, --help

DESCRIPTION

This script starts a new catalyst project. It uses catalyst.pl that comes with Catalyst::Runtime to do the dirty work.

Furthermore it optionally does zero or more of the following:

  • Adds a TT view, see --TT. Also see --views which is short for doing both TT and JSON.

  • Adds a JSON view, see --JSON

  • Adds a HTML5 template. Currently a twitter bootstrap template from initializr.com.

  • Adds a model with a schema. If not spesified, they get default names. Note:

    ·

    Only ever does DBIC::Schema models. Do not use this if you use other types of models.

    ·

    Always uses create=static to create schema files. Do not create a model with this tool if you don't mean to create schema files. Also requires a working db connection somewhere that contains at least one sql schema.

REQUIRED ARGUMENTS

-[-]n[ame] [=] <name>

Name of catalyst app, what you would otherwise specify like this: catalyst.pl name

OPTIONS

-[-]TT [=] [<HTML>]

Add a Catalyst::View::TT view, defaults to YourApp::View::HTML.

In addition to defaults created with Catalyst::Helper it will also be configured with:

    TEMPLATE_EXTENSION => 'tt2',
    WRAPPER => 'wrapper.tt2',

The ::HTML part of the package name can be changed by giving the argument a value, ie --TT MyView would create YourApp::View::MyView instead.

The 'YourApp::View::' part of the package name is automatic and unchangable here.

Also touches root/index.tt2 and root/wrapper.tt2. If wrapper.tt2 is empty it inserts [% content %] in it.

-[-]JSON [=] [<JSON>]

Add a Catalyst::View::JSON view, defaults to YourApp::View::JSON. The same rules and options applies as to --TT

In addition to any defaults set by Catalyst::Helper, it also configures:

    export_stash => [ qw(json) ],

This means that only data in $c->stash->{json} will be included in output. Remove this config line afterwards if you do not want it.

-[-]html5 | -[-]h5

Set up a html5 template with twitter bootstrap and jquery downloaded from http://www.initializr.com.

When downloaded it fills root/wrapper.tt2 with content from the index.html from initializr.com and inserts [% content %] and puts sample input in root/index.tt2.

-[-]views

Short hand for saying --TT and --JSON with default names

-[-]model [=] [<modelname>]

Package name to use for your model. If modelname not specified, defaults to the catalyst name and "DB", ie "CatNameDB"

You can also put a dsn in here. It will then be reassigned to the --dsn option, and the default model name will be used.

Note, *only* does DBIC::Schema. Do not use any of the model logic if you do not want a DBIC::Schema model.

-[-]schema [=] <SchemaClass>

The name of the schema class to go with the dbic model. Defaults to CatName::Schema, where CatName is the name of the catalyst app.

-[-]dsn [=] <dsn>

A DSN to set up a db connection for one model in your catalyst app.

If user and pass are not specified it will try the dsn without credentials. Expects connection to succeed.

Important: Will set --model and --schema with default names unless they are also specified. Default names currently are CatNameDB and CatName::Schema.

-[-][no]dsnfix

Checks and corrects the dsn input

Fixes case of known drivers, adds missing leading dbi:, tries to verify and correct sqlite file paths, checks that hostnames can be resolved

-[-][no]pgpass

If set, will look in ~/.pgpass to complete dbi information.

Will currently only suplement the dsn if it finds a matching database name.

It will set --dbuser and --dbpass as spropriate unless they are set.

-[-]dbuser [=] <dbuser>

Username for the db connection.

-[-]dbpass [=] <dbpass>

Db for the db connection.

-[-]pgpass

Causes it to look through $HOME/.pgpass for credentials for postgresql connections.

-[-][no]test

Run all tests when done

-[-]debug | -d

Set debug level for logging.

Currently there is no other interface to log level.

--verbose

Run more verbosely - shows stdout on all system calls made. Stderr is always shown.

--version | -V

Prints version

DESCRIPTION

DIAGNOSTICS

Error message here, perhaps with %s placeholders

[Description of error here]

Another error message here

[Description of error here]

[Et cetera, et cetera]

CONFIGURATION AND ENVIRONMENT

App::CatalystStarter::Bloated requires no configuration files or environment variables.

DEPENDENCIES

None.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-app-catalyststarter-bloated@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Torbjørn Lindahl <torbjorn.lindahl@gmail.com>

LICENCE AND COPYRIGHT

Copyright (c) 2014, Torbjørn Lindahl <torbjorn.lindahl@gmail.com>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.