Ado - a rapid active commotion (framework for web-projects on Mojolicious)
require Mojolicious::Commands; Mojolicious::Commands->start_app('Ado');
Ado is a framework for web-projects based on Mojolicious, written in the Perl programming language. This is the base application class. Ado ISA Mojolicious. For a more detailed description on what Ado is and how to get started with Ado see Ado::Manual.
ISA
Ado inherits all attributes from Mojolicious and implements the following ones.
Returns an instance of Mojo::Home pointing to the base directory where Ado is installed.
~$ ado eval 'say app->ado_home' /home/berov/opt/public_dev/Ado
Returns the current CODENAME.
CODENAME
#/where/is/your_app/rootdir $app->home;
Returns the root directory into which $app is installed. The guessing order is the following:
$ENV{MOJO_HOME}
$app->moniker
bin/..
Access the Ado::Sessions instance. Instantiates one of Ado::Sessions::File, Ado::Sessions::Database or Mojolicious::Sessions depending on configuration and returns it. By default (no configuration in etc/ado.conf) a Mojolicious::Sessions is returned.
etc/ado.conf
Ado inherits all methods from Mojolicious and implements the following new ones.
Sets various default paths like templates, site_templates, public. Defines "secrets" in Mojolicious as sha1_sum of $moniker.$mode. $home. Sets "controller_class" in Mojolicious and "namespaces" in Mojolicious::Routes to ${CLASS}::Control. Sets "namespaces" in Mojolicious::Plugins to ['Mojolicious::Plugin', "${CLASS}::Plugin"]. Sets "namespaces" in Mojolicious::Commands to ${CLASS}::Command. $CLASS is usually Ado. Then calls the following methods in the order they are listed. Returns void.
templates
site_templates
public
$moniker.$mode. $home
['Mojolicious::Plugin', "${CLASS}::Plugin"]
${CLASS}::Command
$CLASS
You can amend this behavior in the application configuration file.
Checks $ENV{MOJO_CONFIG} and if not set sets it to $app->home/etc/ado.conf. Loads Mojolicious::Plugin::Config to do the rest of the dirty work. Returns $app.
$ENV{MOJO_CONFIG}
$app->home/etc/ado.conf
Does not accept any parameters. Loads plugins listed in $config->{plugins}. $config->{plugins} is an ARRAYREF in which each element is a HASHREF with keys name and config or string representing the plugin name. The name of the plugin is expected to be string that can be passed to "plugin" in Mojolicious. The config values is another HASHREF containing the configuration for the plugin. Plugins can be Mojolicious or Ado specific plugins. Every Ado::Plugin::Foo must inherit from Ado::Plugin which ISA Mojolicious::Plugin. Of course Mojolicious plugins can be used - we count on this. There are plenty of examples on CPAN. Returns $app.
$config->{plugins}
ARRAYREF
HASHREF
name
config
Does not accept any parameters. Loads predefined routes from $config->routes. $config->routes is an ARRAYREF in which each element is a HASHREF with keys corresponding to a method name and value the parameters that will be passed to the method. Currently we use the route value to pass it to "route" in Mojolicious::Routes,params value is the second parameter to instantiate the route. via and to values are passed to the newly created route. See Mojolicious::Routes::Route and Mojolicious::Guides::Routing for more.
$config->routes
route
params
via
to
Returns $app.
Defines any MIME types listed in ado.conf in types => {...}. Returns $app.
ado.conf
types => {...}
The original author.
Become a sponsor and help make Ado the ERP for the enterprise!
Mojolicious, Ado::Manual, http://www.thefreedictionary.com/ado,
Красимир Беров (Krasimir Berov)
Copyright 2013-2015 Красимир Беров (Krasimir Berov).
This program is free software, you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License v3 (LGPL-3.0). You may copy, distribute and modify the software provided that modifications are open source. However, software that includes the license may release under a different license.
See http://opensource.org/licenses/lgpl-3.0.html for more information.
To install Ado, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ado
CPAN shell
perl -MCPAN -e shell install Ado
For more information on module installation, please visit the detailed CPAN module installation guide.