SYNOPSIS

  catalyst.pl <myappname>

DESCRIPTION

This module is used by catalyst.pl to create a set of scripts for a new catalyst application. The scripts each contain documentation and will output help on how to use them if called incorrectly or in some cases, with no arguments.

It also provides some useful methods for a Helper module to call when creating a component. See \*(L"\s-1METHODS\s0\*(R".

SCRIPTS

_create.pl

Used to create new components for a catalyst application at the development stage.

_server.pl

The catalyst test server, starts an \s-1HTTPD\s0 which outputs debugging to the terminal.

_test.pl

A script for running tests from the command-line.

_cgi.pl

Run your application as a \s-1CGI\s0.

_fastcgi.pl

Run the application as a fastcgi app. Either by hand, or call this from FastCgiServer in your http server config.

HELPERS

The \*(L"_create.pl\*(R" script creates application components using Helper modules. The Catalyst team provides a good number of Helper modules for you to use. You can also add your own.

Helpers are classes that provide two methods.

* mk_compclass - creates the Component class * mk_comptest - creates the Component test

So when you call \*(C`scripts/myapp_create.pl view MyView TT\*(C', create will try to execute Catalyst::Helper::View::TT->mk_compclass and Catalyst::Helper::View::TT->mk_comptest.

See Catalyst::Helper::View::TT and Catalyst::Helper::Model::DBIC::Schema for examples.

All helper classes should be under one of the following namespaces.

Catalyst::Helper::Model:: Catalyst::Helper::View:: Catalyst::Helper::Controller::

\s-1COMMON\s0 \s-1HELPERS\s0

  • Catalyst::Helper::Model::DBIC::Schema - DBIx::Class models

  • Catalyst::Helper::View::TT - Template Toolkit view

  • Catalyst::Helper::Model::LDAP

  • Catalyst::Helper::Model::Adaptor - wrap any class into a Catalyst model

\s-1NOTE\s0

The helpers will read author name from /etc/passwd by default. To override, please export the \s-1AUTHOR\s0 variable.

METHODS

mk_compclass

This method in your Helper module is called with $helper which is a Catalyst::Helper object, and whichever other arguments the user added to the command-line. You can use the $helper to call methods described below.

If the Helper module does not contain a \*(C`mk_compclass\*(C' method, it will fall back to calling \*(L"render_file\*(R", with an argument of \*(C`compclass\*(C'.

mk_comptest

This method in your Helper module is called with $helper which is a Catalyst::Helper object, and whichever other arguments the user added to the command-line. You can use the $helper to call methods described below.

If the Helper module does not contain a \*(C`mk_compclass\*(C' method, it will fall back to calling \*(L"render_file\*(R", with an argument of \*(C`comptest\*(C'.

mk_stuff

This method is called if the user does not supply any of the usual component types \*(C`view\*(C', \*(C`controller\*(C', \*(C`model\*(C'. It is passed the $helper object (an instance of Catalyst::Helper), and any other arguments the user typed.

There is no fallback for this method.

INTERNAL METHODS

These are the methods that the Helper classes can call on the <$helper> object passed to them. Render and create a file from a template in \s-1DATA\s0 using Template Toolkit. $file is the relevent chunk of the _\|_DATA_\|_ section, $path is the path to the file, $vars is the hashref as expected by Template Toolkit and $perms are desired permissions (or system defaults if not set). Fetch file contents from the \s-1DATA\s0 section. This is used internally by \*(L"render_file\*(R". $class is the name of the class to get the \s-1DATA\s0 section from. _\|_PACKAGE_\|_ or ( caller\|(0) )[0] might be sensible values for this.

mk_app

Create the main application skeleton. This is called by catalyst.pl.

mk_component ($app)

This method is called by create.pl to make new components for your application.

mk_dir ($path)

Surprisingly, this function makes a directory. Writes content to a file. Called by \*(L"render_file\*(R".

next_test ($test_name)

Calculates the name of the next numbered test file and returns it. Don't give the number or the .t suffix for the test name.

get_sharedir_file

Method for getting a file out of share/

render_file_contents

Process a Template::Toolkit template.

render_sharedir_file

Render a template/image file from our share directory

NOTE

The helpers will read author name from /etc/passwd by default. To override, please export the \s-1AUTHOR\s0 variable.

RELATED TO Catalyst::Helper…

Catalyst::Manual, Catalyst::Test, Catalyst::Request, Catalyst::Response, Catalyst

AUTHORS

Catalyst Contributors, see Catalyst.pm

LICENSE

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.