Skip to content

Commit ed36d4e

Browse files
committed
Initial commit
0 parents  commit ed36d4e

25 files changed

+461
-0
lines changed

Changes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This file documents the revision history for Perl extension BlueBox.
2+
3+
0.01 2014-05-03 11:34:00
4+
- initial revision, generated by Catalyst

Makefile.PL

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env perl
2+
# IMPORTANT: if you delete this file your app will not work as
3+
# expected. You have been warned.
4+
use inc::Module::Install 1.02;
5+
use Module::Install::Catalyst; # Complain loudly if you don't have
6+
# Catalyst::Devel installed or haven't said
7+
# 'make dist' to create a standalone tarball.
8+
9+
name 'BlueBox';
10+
all_from 'lib/BlueBox.pm';
11+
12+
requires 'Catalyst::Runtime' => '5.90062';
13+
requires 'Catalyst::Plugin::ConfigLoader';
14+
requires 'Catalyst::Plugin::Static::Simple';
15+
requires 'Catalyst::Action::RenderView';
16+
requires 'Moose';
17+
requires 'namespace::autoclean';
18+
requires 'Config::General'; # This should reflect the config file format you've chosen
19+
# See Catalyst::Plugin::ConfigLoader for supported formats
20+
test_requires 'Test::More' => '0.88';
21+
catalyst;
22+
23+
install_script glob('script/*.pl');
24+
auto_install;
25+
WriteAll;

README

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Run script/bluebox_server.pl to test the application.

bluebox.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# rename this file to bluebox.yml and put a ':' after 'name' if
2+
# you want to use YAML like in old versions of Catalyst
3+
name BlueBox

bluebox.psgi

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use strict;
2+
use warnings;
3+
4+
use BlueBox;
5+
6+
my $app = BlueBox->apply_default_middlewares(BlueBox->psgi_app);
7+
$app;
8+

lib/BlueBox.pm

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package BlueBox;
2+
use Moose;
3+
use namespace::autoclean;
4+
5+
use Catalyst::Runtime 5.80;
6+
7+
# Set flags and add plugins for the application.
8+
#
9+
# Note that ORDERING IS IMPORTANT here as plugins are initialized in order,
10+
# therefore you almost certainly want to keep ConfigLoader at the head of the
11+
# list if you're using it.
12+
#
13+
# -Debug: activates the debug mode for very useful log messages
14+
# ConfigLoader: will load the configuration from a Config::General file in the
15+
# application's home directory
16+
# Static::Simple: will serve static files from the application's root
17+
# directory
18+
19+
use Catalyst qw/
20+
-Debug
21+
ConfigLoader
22+
Static::Simple
23+
/;
24+
25+
extends 'Catalyst';
26+
27+
our $VERSION = '0.01';
28+
29+
# Configure the application.
30+
#
31+
# Note that settings in bluebox.conf (or other external
32+
# configuration file that you set up manually) take precedence
33+
# over this when using ConfigLoader. Thus configuration
34+
# details given here can function as a default configuration,
35+
# with an external configuration file acting as an override for
36+
# local deployment.
37+
38+
__PACKAGE__->config(
39+
name => 'BlueBox',
40+
# Disable deprecated behavior needed by old applications
41+
disable_component_resolution_regex_fallback => 1,
42+
enable_catalyst_header => 1, # Send X-Catalyst header
43+
);
44+
45+
# Start the application
46+
__PACKAGE__->setup();
47+
48+
=encoding utf8
49+
50+
=head1 NAME
51+
52+
BlueBox - Catalyst based application
53+
54+
=head1 SYNOPSIS
55+
56+
script/bluebox_server.pl
57+
58+
=head1 DESCRIPTION
59+
60+
[enter your description here]
61+
62+
=head1 SEE ALSO
63+
64+
L<BlueBox::Controller::Root>, L<Catalyst>
65+
66+
=head1 AUTHOR
67+
68+
Henry Van Styn
69+
70+
=head1 LICENSE
71+
72+
This library is free software. You can redistribute it and/or modify
73+
it under the same terms as Perl itself.
74+
75+
=cut
76+
77+
1;

lib/BlueBox/Controller/Root.pm

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package BlueBox::Controller::Root;
2+
use Moose;
3+
use namespace::autoclean;
4+
5+
BEGIN { extends 'Catalyst::Controller' }
6+
7+
#
8+
# Sets the actions in this controller to be registered with no prefix
9+
# so they function identically to actions created in MyApp.pm
10+
#
11+
__PACKAGE__->config(namespace => '');
12+
13+
=encoding utf-8
14+
15+
=head1 NAME
16+
17+
BlueBox::Controller::Root - Root Controller for BlueBox
18+
19+
=head1 DESCRIPTION
20+
21+
[enter your description here]
22+
23+
=head1 METHODS
24+
25+
=head2 index
26+
27+
The root page (/)
28+
29+
=cut
30+
31+
sub index :Path :Args(0) {
32+
my ( $self, $c ) = @_;
33+
34+
# Hello World
35+
$c->response->body( $c->welcome_message );
36+
}
37+
38+
=head2 default
39+
40+
Standard 404 error page
41+
42+
=cut
43+
44+
sub default :Path {
45+
my ( $self, $c ) = @_;
46+
$c->response->body( 'Page not found' );
47+
$c->response->status(404);
48+
}
49+
50+
=head2 end
51+
52+
Attempt to render a view, if needed.
53+
54+
=cut
55+
56+
sub end : ActionClass('RenderView') {}
57+
58+
=head1 AUTHOR
59+
60+
Henry Van Styn
61+
62+
=head1 LICENSE
63+
64+
This library is free software. You can redistribute it and/or modify
65+
it under the same terms as Perl itself.
66+
67+
=cut
68+
69+
__PACKAGE__->meta->make_immutable;
70+
71+
1;

root/favicon.ico

2.49 KB
Binary file not shown.
3.74 KB
Loading
3.59 KB
Loading
3.77 KB
Loading
3.59 KB
Loading
2.46 KB
Loading
2.22 KB
Loading
2.48 KB
Loading
2.25 KB
Loading

root/static/images/catalyst_logo.png

13.4 KB
Loading

script/bluebox_cgi.pl

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env perl
2+
3+
use Catalyst::ScriptRunner;
4+
Catalyst::ScriptRunner->run('BlueBox', 'CGI');
5+
6+
1;
7+
8+
=head1 NAME
9+
10+
bluebox_cgi.pl - Catalyst CGI
11+
12+
=head1 SYNOPSIS
13+
14+
See L<Catalyst::Manual>
15+
16+
=head1 DESCRIPTION
17+
18+
Run a Catalyst application as a CGI script.
19+
20+
=head1 AUTHORS
21+
22+
Catalyst Contributors, see Catalyst.pm
23+
24+
=head1 COPYRIGHT
25+
26+
This library is free software. You can redistribute it and/or modify
27+
it under the same terms as Perl itself.
28+
29+
=cut
30+

script/bluebox_create.pl

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env perl
2+
3+
use strict;
4+
use warnings;
5+
6+
use Catalyst::ScriptRunner;
7+
Catalyst::ScriptRunner->run('BlueBox', 'Create');
8+
9+
1;
10+
11+
=head1 NAME
12+
13+
bluebox_create.pl - Create a new Catalyst Component
14+
15+
=head1 SYNOPSIS
16+
17+
bluebox_create.pl [options] model|view|controller name [helper] [options]
18+
19+
Options:
20+
--force don't create a .new file where a file to be created exists
21+
--mechanize use Test::WWW::Mechanize::Catalyst for tests if available
22+
--help display this help and exits
23+
24+
Examples:
25+
bluebox_create.pl controller My::Controller
26+
bluebox_create.pl --mechanize controller My::Controller
27+
bluebox_create.pl view My::View
28+
bluebox_create.pl view HTML TT
29+
bluebox_create.pl model My::Model
30+
bluebox_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
31+
dbi:SQLite:/tmp/my.db
32+
bluebox_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
33+
[Loader opts like db_schema, naming] dbi:Pg:dbname=foo root 4321
34+
[connect_info opts like quote_char, name_sep]
35+
36+
See also:
37+
perldoc Catalyst::Manual
38+
perldoc Catalyst::Manual::Intro
39+
perldoc Catalyst::Helper::Model::DBIC::Schema
40+
perldoc Catalyst::Model::DBIC::Schema
41+
perldoc Catalyst::View::TT
42+
43+
=head1 DESCRIPTION
44+
45+
Create a new Catalyst Component.
46+
47+
Existing component files are not overwritten. If any of the component files
48+
to be created already exist the file will be written with a '.new' suffix.
49+
This behavior can be suppressed with the C<-force> option.
50+
51+
=head1 AUTHORS
52+
53+
Catalyst Contributors, see Catalyst.pm
54+
55+
=head1 COPYRIGHT
56+
57+
This library is free software. You can redistribute it and/or modify
58+
it under the same terms as Perl itself.
59+
60+
=cut

script/bluebox_fastcgi.pl

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env perl
2+
3+
use Catalyst::ScriptRunner;
4+
Catalyst::ScriptRunner->run('BlueBox', 'FastCGI');
5+
6+
1;
7+
8+
=head1 NAME
9+
10+
bluebox_fastcgi.pl - Catalyst FastCGI
11+
12+
=head1 SYNOPSIS
13+
14+
bluebox_fastcgi.pl [options]
15+
16+
Options:
17+
-? --help display this help and exit
18+
-l --listen socket path to listen on
19+
(defaults to standard input)
20+
can be HOST:PORT, :PORT or a
21+
filesystem path
22+
-n --nproc specify number of processes to keep
23+
to serve requests (defaults to 1,
24+
requires --listen)
25+
-p --pidfile specify filename for pid file
26+
(requires --listen)
27+
-d --daemon daemonize (requires --listen)
28+
-M --manager specify alternate process manager
29+
(FCGI::ProcManager sub-class)
30+
or empty string to disable
31+
-e --keeperr send error messages to STDOUT, not
32+
to the webserver
33+
--proc_title Set the process title (if possible)
34+
35+
=head1 DESCRIPTION
36+
37+
Run a Catalyst application as FastCGI.
38+
39+
=head1 AUTHORS
40+
41+
Catalyst Contributors, see Catalyst.pm
42+
43+
=head1 COPYRIGHT
44+
45+
This library is free software. You can redistribute it and/or modify
46+
it under the same terms as Perl itself.
47+
48+
=cut

script/bluebox_server.pl

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env perl
2+
3+
BEGIN {
4+
$ENV{CATALYST_SCRIPT_GEN} = 40;
5+
}
6+
7+
use Catalyst::ScriptRunner;
8+
Catalyst::ScriptRunner->run('BlueBox', 'Server');
9+
10+
1;
11+
12+
=head1 NAME
13+
14+
bluebox_server.pl - Catalyst Test Server
15+
16+
=head1 SYNOPSIS
17+
18+
bluebox_server.pl [options]
19+
20+
-d --debug force debug mode
21+
-f --fork handle each request in a new process
22+
(defaults to false)
23+
-? --help display this help and exits
24+
-h --host host (defaults to all)
25+
-p --port port (defaults to 3000)
26+
-k --keepalive enable keep-alive connections
27+
-r --restart restart when files get modified
28+
(defaults to false)
29+
-rd --restart_delay delay between file checks
30+
(ignored if you have Linux::Inotify2 installed)
31+
-rr --restart_regex regex match files that trigger
32+
a restart when modified
33+
(defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
34+
--restart_directory the directory to search for
35+
modified files, can be set multiple times
36+
(defaults to '[SCRIPT_DIR]/..')
37+
--follow_symlinks follow symlinks in search directories
38+
(defaults to false. this is a no-op on Win32)
39+
--background run the process in the background
40+
--pidfile specify filename for pid file
41+
42+
See also:
43+
perldoc Catalyst::Manual
44+
perldoc Catalyst::Manual::Intro
45+
46+
=head1 DESCRIPTION
47+
48+
Run a Catalyst Testserver for this application.
49+
50+
=head1 AUTHORS
51+
52+
Catalyst Contributors, see Catalyst.pm
53+
54+
=head1 COPYRIGHT
55+
56+
This library is free software. You can redistribute it and/or modify
57+
it under the same terms as Perl itself.
58+
59+
=cut
60+

0 commit comments

Comments
 (0)