Ado::Command::generate::adoplugin - Generates an Ado::Plugin
On the command-line:
$ cd ~/opt/public_dev # Ado is "globally" installed for the current perlbrew Perl $ ado generate adoplugin --name MyBlog $ ado generate adoplugin --name MyBlog --crud -t 'articles,news'
Programmatically:
use Ado::Command::generate::adoplugin; my $vhost = Ado::Command::generate::adoplugin->new; $vhost->run(-n => 'MyBlog', -c => 1, -t => 'articles,news');
Ado::Command::generate::adoplugin generates directory structures for fully functional Ado-specific plugins with optional MVC set of files in the newly created plugin directory. The new plugin is generated in the current directory.
This is a core command, that means it is always enabled and its code a more complex example for learning to build new commands. You're welcome to fork it.
Below are the options this command accepts, described in Getopt::Long notation.
Mandatory. String. The name of the plugin. The resulting full class name is the camelized version of Ado::Plugin::$$args{name}.
Ado::Plugin::$$args{name}
Boolean. When set you can pass in addition all the arguments accepted by Ado::Command::generate::crud. It is mandatory to pass at least the --tables option so the controllers can be generated.
--tables
When generating a plugin: --controller_namespace defaults to app->routes->namespaces->[0]; --home_dir defaults to the plugin base directory; --lib defaults to lib in the plugin base directory; --model_namespace defaults to Ado::Model; --templates_root defaults to templates in the plugin base directory.
--controller_namespace
app->routes->namespaces->[0]
--home_dir
--lib
lib
--model_namespace
--templates_root
templates
Ado::Command::generate::adoplugin inherits all attributes from Ado::Command::generate and implements the following new ones.
#returns $self. $self->crud(Ado::Command::generate::crud->new(app => $self->app)) #returns Ado::Command::generate::crud instance. my $crud = $self->crud->run(%options);
An instance of Ado::Command::generate::crud. Used by Ado::Command::generate::adoplugin to generate routes for controllers and possibly others.
my $description = $command->description; $command = $command->description('Foo!');
Short description of this command, used for the command list.
my $usage = $command->usage; $command = $command->usage('Foo!');
Usage information for this command, used for the help screen.
Ado::Command::generate::adoplugin inherits all methods from Ado::Command and implements the following new ones.
$plugin->run(@ARGV);
Run this command.
Mojolicious::Command::generate::plugin, Ado::Command::generate::crud, Ado::Command::generate::apache2vhost, Ado::Command::generate::apache2htaccess, Ado::Command::generate, Mojolicious::Command::generate, Getopt::Long, Ado::Command Ado::Manual, Mojolicious, "DEPLOYMENT" in Mojolicious::Guides::Cookbook
Красимир Беров (Krasimir Berov)
Copyright 2014 Красимир Беров (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.