Nephia::Setup - Base class of setup tool
This class is used in setup tool internally.
my $setup = Nephia::Setup->new( appname => 'YourApp::Web', plugins => ['Normal'], ); $setup->do_task;
Application name. This attribute is required when instantiate.
Application root directory. Default is "./Appname".
Plugins for using when setup. Default is [] .
Dependencies for application as hashref. Default is following.
{ requires => ['Nephia' => 0], test => { requires => ['Test::More' => 0], }, };
Returns application name.
Returns application root as array.
Returns dependencies as hashref.
Returns path for classfile as array.
Example.
my $setup = Nephia::Setup->new(appname => 'MyApp::Web'); my @path = $setup->classfile; # ( 'lib', 'MyApp', 'Web.pm' );
Returns action chain as Nephia::Chain object.
Returns Nephia::MetaTemplate object.
Create specified directory recursively.
my $setup = Nephia::Setup->new( appname => 'MyApp::Web' ); $setup->makepath('misc', 'data', 'xml'); # create ./MyApp-Web/misc/data/xml
Create specified file with specified content.
my $xmldata = ...; # read some xml data... $setup->spew('misc', 'data', 'xml', 'foo.xml', $xmldata); # create ./MyApp-Web/misc/data/xml/foo.xml
Process file-template.
my $setup = Nephia::Setup->new(appname => 'MyApp::Web'); my $str = 'Application name is "{{$self->appname}}"'; my $processed = $setup->process_template($str); # 'Application name is "MyApp::Web"'
Run actions in action chain.
Output some message to STDERR.
Output some message to STDERR and exit setup.
Output cpanfile script.
my $cpanfile_data = $setup->cpanfile;
Download a file from url and save to specified file.
# download somefile-0.1.2.js as ./MyApp-Web/static/js/somefile.js $setup->assets( 'http://example.com/files/somefile-0.1.2.js', qw/static js somefile.js/ );
Download an archive-file from url and extract into specified path.
# download somearch-0.1.2.tar.gz and extract into ./MyApp-Web/static/foo/ $setup->assets_archive( 'ftp://example.com/files/somearch-0.1.2.tar.gz', qw/static foo/ );
ytnobody <ytnobody@gmail.com>
To install Nephia, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Nephia
CPAN shell
perl -MCPAN -e shell install Nephia
For more information on module installation, please visit the detailed CPAN module installation guide.