From 3fc40135d773a95ede229e71efb48e07fdf3c418 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Mon, 26 May 2008 14:58:11 +0200 Subject: [PATCH] Initial commit of catalyst files --- Makefile.PL | 17 +++ README | 1 + lib/NDWeb.pm | 62 ++++++++++ lib/NDWeb/Controller/Root.pm | 62 ++++++++++ lib/NDWeb/View/TT.pm | 43 +++++++ ndweb.yml | 2 + root/lib/config/main.tt2 | 26 ++++ root/lib/config/url.tt2 | 6 + root/lib/site/footer.tt2 | 3 + root/lib/site/header.tt2 | 3 + root/lib/site/html.tt2 | 17 +++ root/lib/site/layout.tt2 | 8 ++ root/lib/site/leftbar.tt2 | 84 +++++++++++++ root/lib/site/wrapper.tt2 | 8 ++ root/src/error.tt2 | 10 ++ root/src/index.tt2 | 8 ++ .../stylesheets => root/static/css}/black.css | 0 .../static/css}/echoke.css | 0 .../stylesheets => root/static/css}/grey.css | 0 .../static/css}/hedgie.css | 0 .../static/css}/hedgie.jpg | Bin .../static/css}/thrackan.css | 0 {htdocs => root/static}/default.css | 4 + {htdocs => root/static}/images/down.png | Bin {htdocs => root/static}/images/stay.png | Bin {htdocs => root/static}/images/up.png | Bin {htdocs => root/static/js}/misc.js | 0 {htdocs => root/static/js}/raid.js | 0 script/ndweb_cgi.pl | 37 ++++++ script/ndweb_create.pl | 75 ++++++++++++ script/ndweb_fastcgi.pl | 80 ++++++++++++ script/ndweb_server.pl | 115 ++++++++++++++++++ script/ndweb_test.pl | 54 ++++++++ t/01app.t | 7 ++ t/02pod.t | 9 ++ t/03podcoverage.t | 9 ++ templates/skel.tmpl | 106 ---------------- 37 files changed, 750 insertions(+), 106 deletions(-) create mode 100644 Makefile.PL create mode 100644 README create mode 100644 lib/NDWeb.pm create mode 100644 lib/NDWeb/Controller/Root.pm create mode 100644 lib/NDWeb/View/TT.pm create mode 100644 ndweb.yml create mode 100644 root/lib/config/main.tt2 create mode 100644 root/lib/config/url.tt2 create mode 100644 root/lib/site/footer.tt2 create mode 100644 root/lib/site/header.tt2 create mode 100644 root/lib/site/html.tt2 create mode 100644 root/lib/site/layout.tt2 create mode 100644 root/lib/site/leftbar.tt2 create mode 100644 root/lib/site/wrapper.tt2 create mode 100644 root/src/error.tt2 create mode 100644 root/src/index.tt2 rename {htdocs/stylesheets => root/static/css}/black.css (100%) rename {htdocs/stylesheets => root/static/css}/echoke.css (100%) rename {htdocs/stylesheets => root/static/css}/grey.css (100%) rename {htdocs/stylesheets => root/static/css}/hedgie.css (100%) rename {htdocs/stylesheets => root/static/css}/hedgie.jpg (100%) rename {htdocs/stylesheets => root/static/css}/thrackan.css (100%) rename {htdocs => root/static}/default.css (98%) rename {htdocs => root/static}/images/down.png (100%) rename {htdocs => root/static}/images/stay.png (100%) rename {htdocs => root/static}/images/up.png (100%) rename {htdocs => root/static/js}/misc.js (100%) rename {htdocs => root/static/js}/raid.js (100%) create mode 100755 script/ndweb_cgi.pl create mode 100755 script/ndweb_create.pl create mode 100755 script/ndweb_fastcgi.pl create mode 100755 script/ndweb_server.pl create mode 100755 script/ndweb_test.pl create mode 100644 t/01app.t create mode 100644 t/02pod.t create mode 100644 t/03podcoverage.t delete mode 100644 templates/skel.tmpl diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..1b1b886 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,17 @@ +use inc::Module::Install; + +name 'NDWeb'; +all_from 'lib/NDWeb.pm'; + +requires 'Catalyst::Runtime' => '5.7013'; +requires 'Catalyst::Plugin::ConfigLoader'; +requires 'Catalyst::Plugin::Static::Simple'; +requires 'Catalyst::Action::RenderView'; +requires 'parent'; +requires 'YAML'; # This should reflect the config file format you've chosen + # See Catalyst::Plugin::ConfigLoader for supported formats +catalyst; + +install_script glob('script/*.pl'); +auto_install; +WriteAll; diff --git a/README b/README new file mode 100644 index 0000000..1cea057 --- /dev/null +++ b/README @@ -0,0 +1 @@ +Run script/ndweb_server.pl to test the application. diff --git a/lib/NDWeb.pm b/lib/NDWeb.pm new file mode 100644 index 0000000..2dbab22 --- /dev/null +++ b/lib/NDWeb.pm @@ -0,0 +1,62 @@ +package NDWeb; + +use strict; +use warnings; + +use Catalyst::Runtime '5.70'; + +# Set flags and add plugins for the application +# +# -Debug: activates the debug mode for very useful log messages +# ConfigLoader: will load the configuration from a YAML file in the +# application's home directory +# Static::Simple: will serve static files from the application's root +# directory + +use parent qw/Catalyst/; + +our $VERSION = '0.01'; + +# Configure the application. +# +# Note that settings in ndweb.yml (or other external +# configuration file that you set up manually) take precedence +# over this when using ConfigLoader. Thus configuration +# details given here can function as a default configuration, +# with a external configuration file acting as an override for +# local deployment. + +__PACKAGE__->config( name => 'NDWeb' ); + +# Start the application +__PACKAGE__->setup(qw/-Debug ConfigLoader Static::Simple/); + + +=head1 NAME + +NDWeb - Catalyst based application + +=head1 SYNOPSIS + + script/ndweb_server.pl + +=head1 DESCRIPTION + +[enter your description here] + +=head1 SEE ALSO + +L, L + +=head1 AUTHOR + +Catalyst developer + +=head1 LICENSE + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; diff --git a/lib/NDWeb/Controller/Root.pm b/lib/NDWeb/Controller/Root.pm new file mode 100644 index 0000000..4657f7a --- /dev/null +++ b/lib/NDWeb/Controller/Root.pm @@ -0,0 +1,62 @@ +package NDWeb::Controller::Root; + +use strict; +use warnings; +use parent 'Catalyst::Controller'; + +# +# Sets the actions in this controller to be registered with no prefix +# so they function identically to actions created in MyApp.pm +# +__PACKAGE__->config->{namespace} = ''; + +=head1 NAME + +NDWeb::Controller::Root - Root Controller for NDWeb + +=head1 DESCRIPTION + +[enter your description here] + +=head1 METHODS + +=cut + +=head2 default + +=cut + +sub index : Local Path Args(0) { + my ( $self, $c ) = @_; + + # Hello World + #$c->response->body( $c->welcome_message ); +} + +sub default : Path { + my ( $self, $c ) = @_; + $c->response->body( 'Page not found' ); + $c->response->status(404); + +} + +=head2 end + +Attempt to render a view, if needed. + +=cut + +sub end : ActionClass('RenderView') {} + +=head1 AUTHOR + +Catalyst developer + +=head1 LICENSE + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; diff --git a/lib/NDWeb/View/TT.pm b/lib/NDWeb/View/TT.pm new file mode 100644 index 0000000..fc22bae --- /dev/null +++ b/lib/NDWeb/View/TT.pm @@ -0,0 +1,43 @@ +package NDWeb::View::TT; + +use strict; +use base 'Catalyst::View::TT'; + +__PACKAGE__->config({ + INCLUDE_PATH => [ + NDWeb->path_to( 'root', 'src' ), + NDWeb->path_to( 'root', 'lib' ) + ], + PRE_PROCESS => 'config/main.tt2', + WRAPPER => 'site/wrapper.tt2', + ERROR => 'error.tt2', + TIMER => 0, + #DEBUG => 'undef', + TEMPLATE_EXTENSION => '.tt2', +}); + +=head1 NAME + +NDWeb::View::TT - Catalyst TTSite View + +=head1 SYNOPSIS + +See L + +=head1 DESCRIPTION + +Catalyst TTSite View. + +=head1 AUTHOR + +A clever guy + +=head1 LICENSE + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; + diff --git a/ndweb.yml b/ndweb.yml new file mode 100644 index 0000000..bd6aeb6 --- /dev/null +++ b/ndweb.yml @@ -0,0 +1,2 @@ +--- +name: NDWeb diff --git a/root/lib/config/main.tt2 b/root/lib/config/main.tt2 new file mode 100644 index 0000000..fe70a5e --- /dev/null +++ b/root/lib/config/main.tt2 @@ -0,0 +1,26 @@ +[% # config/main + # + # This is the main configuration template which is processed before + # any other page, by virtue of it being defined as a PRE_PROCESS + # template. This is the place to define any extra template variables, + # macros, load plugins, and perform any other template setup. + + IF c.debug; + # define a debug() macro directed to Catalyst's log + MACRO debug(message) CALL Catalyst.log.debug(message); + END; + + # define a data structure to hold sitewide data + site = { + title => 'NewDawn', + copyright => '2008 harv', + }; + + # load up any other configuration items + PROCESS config/url.tt2; + + # set defaults for variables, etc. + DEFAULT + message = 'There is no message'; + +-%] diff --git a/root/lib/config/url.tt2 b/root/lib/config/url.tt2 new file mode 100644 index 0000000..d789db6 --- /dev/null +++ b/root/lib/config/url.tt2 @@ -0,0 +1,6 @@ +[% base = c.req.base; + + site.url = { + base = base + } +-%] diff --git a/root/lib/site/footer.tt2 b/root/lib/site/footer.tt2 new file mode 100644 index 0000000..d16739b --- /dev/null +++ b/root/lib/site/footer.tt2 @@ -0,0 +1,3 @@ + + + diff --git a/root/lib/site/header.tt2 b/root/lib/site/header.tt2 new file mode 100644 index 0000000..35159db --- /dev/null +++ b/root/lib/site/header.tt2 @@ -0,0 +1,3 @@ + +

[% template.title or site.title %]

+ diff --git a/root/lib/site/html.tt2 b/root/lib/site/html.tt2 new file mode 100644 index 0000000..f7236e7 --- /dev/null +++ b/root/lib/site/html.tt2 @@ -0,0 +1,17 @@ + + + + + [% template.title or site.title %] + + + + + + + + + +[% content %] + diff --git a/root/lib/site/layout.tt2 b/root/lib/site/layout.tt2 new file mode 100644 index 0000000..ec17e5f --- /dev/null +++ b/root/lib/site/layout.tt2 @@ -0,0 +1,8 @@ +
[% PROCESS site/leftbar.tt2 %]
+ + +
+[% content %] +
+ + diff --git a/root/lib/site/leftbar.tt2 b/root/lib/site/leftbar.tt2 new file mode 100644 index 0000000..a5bfb75 --- /dev/null +++ b/root/lib/site/leftbar.tt2 @@ -0,0 +1,84 @@ +

Tick: [% game.tick %]

+[% IF user.isMember %] + [% IF user.isAttacker %] +

Member menu

+ + [% ELSE %] + [% IF user.planet %] +

Update your fleet to see member menu

+ [% ELSE %] +
+

We need your planet's coordinates: + + +

+
+ [% END %] + [% END %] +[% END %] +[% IF user.isAttacker %] +

Attack menu

+ +
+[% END %] +[% IF user.isBC %] +

BC menu

+ +[% END %] +[% IF user.isDC %] +

DC menu

+ +[% END %] +[% IF user.isHC %] +

HC menu

+ +[% ELSE %] + [% IF user.isIntel %] +

Intel menu

+ + [% END %] +[% END %] diff --git a/root/lib/site/wrapper.tt2 b/root/lib/site/wrapper.tt2 new file mode 100644 index 0000000..37674ca --- /dev/null +++ b/root/lib/site/wrapper.tt2 @@ -0,0 +1,8 @@ +[% IF template.name.match('\.(css|js|txt)'); + debug("Passing page through as text: $template.name"); + content; + ELSE; + debug("Applying HTML page layout wrappers to $template.name\n"); + content WRAPPER site/html.tt2 + site/layout.tt2; + END; +-%] diff --git a/root/src/error.tt2 b/root/src/error.tt2 new file mode 100644 index 0000000..2ba47e3 --- /dev/null +++ b/root/src/error.tt2 @@ -0,0 +1,10 @@ +[% META title = 'Catalyst/TT Error' %] +

+ An error has occurred. We're terribly sorry about that, but it's + one of those things that happens from time to time. Let's just + hope the developers test everything properly before release... +

+

+ Here's the error message, on the off-chance that it means something + to you: [% error %] +

diff --git a/root/src/index.tt2 b/root/src/index.tt2 new file mode 100644 index 0000000..c3831a0 --- /dev/null +++ b/root/src/index.tt2 @@ -0,0 +1,8 @@ +[% META title = 'Catalyst/TT View!' %] +

+ Yay! You're looking at a page generated by the Catalyst::View::TT + plugin module. +

+

+ This is the welcome page. Why not try the equally-exciting +

diff --git a/htdocs/stylesheets/black.css b/root/static/css/black.css similarity index 100% rename from htdocs/stylesheets/black.css rename to root/static/css/black.css diff --git a/htdocs/stylesheets/echoke.css b/root/static/css/echoke.css similarity index 100% rename from htdocs/stylesheets/echoke.css rename to root/static/css/echoke.css diff --git a/htdocs/stylesheets/grey.css b/root/static/css/grey.css similarity index 100% rename from htdocs/stylesheets/grey.css rename to root/static/css/grey.css diff --git a/htdocs/stylesheets/hedgie.css b/root/static/css/hedgie.css similarity index 100% rename from htdocs/stylesheets/hedgie.css rename to root/static/css/hedgie.css diff --git a/htdocs/stylesheets/hedgie.jpg b/root/static/css/hedgie.jpg similarity index 100% rename from htdocs/stylesheets/hedgie.jpg rename to root/static/css/hedgie.jpg diff --git a/htdocs/stylesheets/thrackan.css b/root/static/css/thrackan.css similarity index 100% rename from htdocs/stylesheets/thrackan.css rename to root/static/css/thrackan.css diff --git a/htdocs/default.css b/root/static/default.css similarity index 98% rename from htdocs/default.css rename to root/static/default.css index 6affe18..9349e08 100644 --- a/htdocs/default.css +++ b/root/static/default.css @@ -7,6 +7,10 @@ body,html { padding-left: 15em; /*padding-right: 12em;*/ } +#header { + padding-left: 15em; + /*padding-right: 12em;*/ +} #leftbar,#rightbar{ padding: 0; margin: 0; diff --git a/htdocs/images/down.png b/root/static/images/down.png similarity index 100% rename from htdocs/images/down.png rename to root/static/images/down.png diff --git a/htdocs/images/stay.png b/root/static/images/stay.png similarity index 100% rename from htdocs/images/stay.png rename to root/static/images/stay.png diff --git a/htdocs/images/up.png b/root/static/images/up.png similarity index 100% rename from htdocs/images/up.png rename to root/static/images/up.png diff --git a/htdocs/misc.js b/root/static/js/misc.js similarity index 100% rename from htdocs/misc.js rename to root/static/js/misc.js diff --git a/htdocs/raid.js b/root/static/js/raid.js similarity index 100% rename from htdocs/raid.js rename to root/static/js/raid.js diff --git a/script/ndweb_cgi.pl b/script/ndweb_cgi.pl new file mode 100755 index 0000000..835d4e7 --- /dev/null +++ b/script/ndweb_cgi.pl @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w + +BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' } + +use strict; +use warnings; +use FindBin; +use lib "$FindBin::Bin/../lib"; +use NDWeb; + +NDWeb->run; + +1; + +=head1 NAME + +ndweb_cgi.pl - Catalyst CGI + +=head1 SYNOPSIS + +See L + +=head1 DESCRIPTION + +Run a Catalyst application as a cgi script. + +=head1 AUTHOR + +Sebastian Riedel, C + +=head1 COPYRIGHT + + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/script/ndweb_create.pl b/script/ndweb_create.pl new file mode 100755 index 0000000..35ca6a5 --- /dev/null +++ b/script/ndweb_create.pl @@ -0,0 +1,75 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use Getopt::Long; +use Pod::Usage; +use Catalyst::Helper; + +my $force = 0; +my $mech = 0; +my $help = 0; + +GetOptions( + 'nonew|force' => \$force, + 'mech|mechanize' => \$mech, + 'help|?' => \$help + ); + +pod2usage(1) if ( $help || !$ARGV[0] ); + +my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } ); + +pod2usage(1) unless $helper->mk_component( 'NDWeb', @ARGV ); + +1; + +=head1 NAME + +ndweb_create.pl - Create a new Catalyst Component + +=head1 SYNOPSIS + +ndweb_create.pl [options] model|view|controller name [helper] [options] + + Options: + -force don't create a .new file where a file to be created exists + -mechanize use Test::WWW::Mechanize::Catalyst for tests if available + -help display this help and exits + + Examples: + ndweb_create.pl controller My::Controller + ndweb_create.pl controller My::Controller BindLex + ndweb_create.pl -mechanize controller My::Controller + ndweb_create.pl view My::View + ndweb_create.pl view MyView TT + ndweb_create.pl view TT TT + ndweb_create.pl model My::Model + ndweb_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\ + dbi:SQLite:/tmp/my.db + ndweb_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\ + dbi:Pg:dbname=foo root 4321 + + See also: + perldoc Catalyst::Manual + perldoc Catalyst::Manual::Intro + +=head1 DESCRIPTION + +Create a new Catalyst Component. + +Existing component files are not overwritten. If any of the component files +to be created already exist the file will be written with a '.new' suffix. +This behavior can be suppressed with the C<-force> option. + +=head1 AUTHOR + +Sebastian Riedel, C +Maintained by the Catalyst Core Team. + +=head1 COPYRIGHT + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/script/ndweb_fastcgi.pl b/script/ndweb_fastcgi.pl new file mode 100755 index 0000000..cf0ad8b --- /dev/null +++ b/script/ndweb_fastcgi.pl @@ -0,0 +1,80 @@ +#!/usr/bin/perl -w + +BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' } + +use strict; +use warnings; +use Getopt::Long; +use Pod::Usage; +use FindBin; +use lib "$FindBin::Bin/../lib"; +use NDWeb; + +my $help = 0; +my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr ); + +GetOptions( + 'help|?' => \$help, + 'listen|l=s' => \$listen, + 'nproc|n=i' => \$nproc, + 'pidfile|p=s' => \$pidfile, + 'manager|M=s' => \$manager, + 'daemon|d' => \$detach, + 'keeperr|e' => \$keep_stderr, +); + +pod2usage(1) if $help; + +NDWeb->run( + $listen, + { nproc => $nproc, + pidfile => $pidfile, + manager => $manager, + detach => $detach, + keep_stderr => $keep_stderr, + } +); + +1; + +=head1 NAME + +ndweb_fastcgi.pl - Catalyst FastCGI + +=head1 SYNOPSIS + +ndweb_fastcgi.pl [options] + + Options: + -? -help display this help and exits + -l -listen Socket path to listen on + (defaults to standard input) + can be HOST:PORT, :PORT or a + filesystem path + -n -nproc specify number of processes to keep + to serve requests (defaults to 1, + requires -listen) + -p -pidfile specify filename for pid file + (requires -listen) + -d -daemon daemonize (requires -listen) + -M -manager specify alternate process manager + (FCGI::ProcManager sub-class) + or empty string to disable + -e -keeperr send error messages to STDOUT, not + to the webserver + +=head1 DESCRIPTION + +Run a Catalyst application as fastcgi. + +=head1 AUTHOR + +Sebastian Riedel, C +Maintained by the Catalyst Core Team. + +=head1 COPYRIGHT + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/script/ndweb_server.pl b/script/ndweb_server.pl new file mode 100755 index 0000000..2a50e5e --- /dev/null +++ b/script/ndweb_server.pl @@ -0,0 +1,115 @@ +#!/usr/bin/perl -w + +BEGIN { + $ENV{CATALYST_ENGINE} ||= 'HTTP'; + $ENV{CATALYST_SCRIPT_GEN} = 31; + require Catalyst::Engine::HTTP; +} + +use strict; +use warnings; +use Getopt::Long; +use Pod::Usage; +use FindBin; +use lib "$FindBin::Bin/../lib"; + +my $debug = 0; +my $fork = 0; +my $help = 0; +my $host = undef; +my $port = $ENV{NDWEB_PORT} || $ENV{CATALYST_PORT} || 3000; +my $keepalive = 0; +my $restart = $ENV{NDWEB_RELOAD} || $ENV{CATALYST_RELOAD} || 0; +my $restart_delay = 1; +my $restart_regex = '(?:/|^)(?!\.#).+(?:\.yml$|\.yaml$|\.pm)$'; +my $restart_directory = undef; +my $follow_symlinks = 0; + +my @argv = @ARGV; + +GetOptions( + 'debug|d' => \$debug, + 'fork' => \$fork, + 'help|?' => \$help, + 'host=s' => \$host, + 'port=s' => \$port, + 'keepalive|k' => \$keepalive, + 'restart|r' => \$restart, + 'restartdelay|rd=s' => \$restart_delay, + 'restartregex|rr=s' => \$restart_regex, + 'restartdirectory=s@' => \$restart_directory, + 'followsymlinks' => \$follow_symlinks, +); + +pod2usage(1) if $help; + +if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) { + $ENV{CATALYST_ENGINE} = 'HTTP::Restarter'; +} +if ( $debug ) { + $ENV{CATALYST_DEBUG} = 1; +} + +# This is require instead of use so that the above environment +# variables can be set at runtime. +require NDWeb; + +NDWeb->run( $port, $host, { + argv => \@argv, + 'fork' => $fork, + keepalive => $keepalive, + restart => $restart, + restart_delay => $restart_delay, + restart_regex => qr/$restart_regex/, + restart_directory => $restart_directory, + follow_symlinks => $follow_symlinks, +} ); + +1; + +=head1 NAME + +ndweb_server.pl - Catalyst Testserver + +=head1 SYNOPSIS + +ndweb_server.pl [options] + + Options: + -d -debug force debug mode + -f -fork handle each request in a new process + (defaults to false) + -? -help display this help and exits + -host host (defaults to all) + -p -port port (defaults to 3000) + -k -keepalive enable keep-alive connections + -r -restart restart when files get modified + (defaults to false) + -rd -restartdelay delay between file checks + -rr -restartregex regex match files that trigger + a restart when modified + (defaults to '\.yml$|\.yaml$|\.pm$') + -restartdirectory the directory to search for + modified files, can be set mulitple times + (defaults to '[SCRIPT_DIR]/..') + -follow_symlinks follow symlinks in search directories + (defaults to false. this is a no-op on Win32) + See also: + perldoc Catalyst::Manual + perldoc Catalyst::Manual::Intro + +=head1 DESCRIPTION + +Run a Catalyst Testserver for this application. + +=head1 AUTHOR + +Sebastian Riedel, C +Maintained by the Catalyst Core Team. + +=head1 COPYRIGHT + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/script/ndweb_test.pl b/script/ndweb_test.pl new file mode 100755 index 0000000..a69d3e4 --- /dev/null +++ b/script/ndweb_test.pl @@ -0,0 +1,54 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use Getopt::Long; +use Pod::Usage; +use FindBin; +use lib "$FindBin::Bin/../lib"; +use Catalyst::Test 'NDWeb'; + +my $help = 0; + +GetOptions( 'help|?' => \$help ); + +pod2usage(1) if ( $help || !$ARGV[0] ); + +print request($ARGV[0])->content . "\n"; + +1; + +=head1 NAME + +ndweb_test.pl - Catalyst Test + +=head1 SYNOPSIS + +ndweb_test.pl [options] uri + + Options: + -help display this help and exits + + Examples: + ndweb_test.pl http://localhost/some_action + ndweb_test.pl /some_action + + See also: + perldoc Catalyst::Manual + perldoc Catalyst::Manual::Intro + +=head1 DESCRIPTION + +Run a Catalyst action from the command line. + +=head1 AUTHOR + +Sebastian Riedel, C +Maintained by the Catalyst Core Team. + +=head1 COPYRIGHT + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/t/01app.t b/t/01app.t new file mode 100644 index 0000000..0f6e010 --- /dev/null +++ b/t/01app.t @@ -0,0 +1,7 @@ +use strict; +use warnings; +use Test::More tests => 2; + +BEGIN { use_ok 'Catalyst::Test', 'NDWeb' } + +ok( request('/')->is_success, 'Request should succeed' ); diff --git a/t/02pod.t b/t/02pod.t new file mode 100644 index 0000000..251640d --- /dev/null +++ b/t/02pod.t @@ -0,0 +1,9 @@ +use strict; +use warnings; +use Test::More; + +eval "use Test::Pod 1.14"; +plan skip_all => 'Test::Pod 1.14 required' if $@; +plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; + +all_pod_files_ok(); diff --git a/t/03podcoverage.t b/t/03podcoverage.t new file mode 100644 index 0000000..ae59d4c --- /dev/null +++ b/t/03podcoverage.t @@ -0,0 +1,9 @@ +use strict; +use warnings; +use Test::More; + +eval "use Test::Pod::Coverage 1.04"; +plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; +plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; + +all_pod_coverage_ok(); diff --git a/templates/skel.tmpl b/templates/skel.tmpl deleted file mode 100644 index 2b9e527..0000000 --- a/templates/skel.tmpl +++ /dev/null @@ -1,106 +0,0 @@ - - - - - NewDawn: <TMPL_VAR NAME=TITLE> - - - - - - - - - -
-

Tick:

- - -

Member menu

- - - -

Update your fleet to see member menu

- -
-

We need your planet's coordinates: - - -

-
-
-
-
- -

Attack menu

- -
-
- -

BC menu

- -
- -

DC menu

- -
- -

HC menu

- - - -

Intel menu

- -
-
- -
-
- - -
- - -- 2.39.2