view release on metacpan or search on metacpan
1234567891011121314151617181920# =========================================================================
# THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA.
# DO NOT EDIT DIRECTLY.
# =========================================================================
use
5.008_001;
use
strict;
use
warnings;
use
utf8;
use
Module::Build;
use
File::Basename;
use
File::Spec;
my
%args
= (
license
=>
'perl'
,
dynamic_config
=> 0,
configure_requires
=> {
lib/Amon2/Lite.pm view on Meta::CPAN
201202203204205206207208209210211212213214215216217218219220221
*{
"${base_class}::load_config"
} =
sub
{ +{ } };
}
}
1;
__END__
=for stopwords TinyURL
=encoding utf8
=head1 NAME
Amon2::Lite - Sinatra-ish framework on Amon2!
=head1 SYNOPSIS
use Amon2::Lite;
get '/' => sub {
lib/Amon2/Setup/Flavor/Lite.pm view on Meta::CPAN
123456789101112131415161718192021222324252627282930use
strict;
use
warnings;
use
utf8;
package
Amon2::Setup::Flavor::Lite;
sub
run {
my
(
$self
) =
@_
;
$self
->{amon2_version} =
$Amon2::VERSION
;
$self
->{amon2_lite_version} =
$Amon2::Lite::VERSION
;
$self
->write_file(
'app.psgi'
, <<
'...'
);
use
strict;
use
warnings;
use
utf8;
use
File::Spec;
use
File::Basename;
use
Amon2::Lite;
our
$VERSION
=
'0.13'
;
# put your configuration here
sub
load_config {
lib/Amon2/Setup/Flavor/Lite.pm view on Meta::CPAN
120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
unless
(
$ENV
{PLACK_ENV}) {
$ENV
{PLACK_ENV} =
'test'
;
}
}
use
Test::More 0.96;
our
@EXPORT
=
qw//
;
{
# utf8 hack.
binmode
Test::More->builder->
$_
,
":utf8"
for
qw/output failure_output todo_output/
;
no
warnings
'redefine'
;
my
$code
= \
&Test::Builder::child
;
*Test::Builder::child
=
sub
{
my
$builder
=
$code
->(
@_
);
binmode
$builder
->output,
":utf8"
;
binmode
$builder
->failure_output,
":utf8"
;
binmode
$builder
->todo_output,
":utf8"
;
return
$builder
;
};
}
1;
...
$self
->write_file(
't/01_root.t'
, <<
'...'
);
use
strict;
use
warnings;
use
utf8;
use
t::Util;
use
Plack::Test;
use
Plack::Util;
use
Test::More;
my
$app
= Plack::Util::load_psgi
'app.psgi'
;
test_psgi
app
=>
$app
,
client
=>
sub
{
my
$cb
=
shift
;
t/100_static/01_simple.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
use
Plack::Test;
my
$app
=
do
{
get
'/'
=>
sub
{
shift
->create_response(200, [
'Content-Length'
=> 2], [
'OK'
]) };
__PACKAGE__->to_app(
t/300_setup/04_lite.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
use
t::TestFlavor;
test_flavor(
sub
{
ok(-f
'app.psgi'
,
'app.psgi exists'
);
ok((
do
'app.psgi'
),
'app.psgi is valid'
) or
do
{
diag $@;
diag
do
{
open
my
$fh
,
'<'
,
'app.psgi'
or
die
;
t/400_lite/01_simple.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
use
Plack::Test;
use
Amon2::Lite;
get
'/'
=>
sub
{
my
(
$c
) =
@_
;
return
Amon2::Web::Response->new(200, [],
'OK'
);
};
t/400_lite/02_plugin.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
use
Plack::Util;
use
Plack::Test;
my
$app
= Plack::Util::load_psgi(
't/400_lite/02_plugin.psgi'
);
is(
ref
$app
,
'CODE'
);
test_psgi
$app
,
sub
{
my
$cb
=
shift
;
t/400_lite/03_kolon.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
use
Plack::Test;
use
FindBin;
use
File::Spec;
use
Amon2::Lite;
sub
config {
t/400_lite/03_kolon_simple.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
use
Plack::Test;
use
FindBin;
use
File::Spec;
my
$app
=
do
{
t/400_lite/04_tmt.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
use
Plack::Test;
use
Test::Requires
qw/Text::MicroTemplate Tiffany::Text::MicroTemplate::File/
,
'Data::Section::Simple'
;
use
Amon2::Lite;
sub
create_view {
Tiffany::Text::MicroTemplate::File->new(+{
include_path
=> [
'./t/tmpl/'
]
t/400_lite/05_enable_session.t view on Meta::CPAN
12345678910111213
t/400_lite/06_enable_middleware.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
use
HTTP::Response;
my
$app
=
do
{
get
'/'
=>
sub
{
my
$c
=
shift
;
t/400_lite/07_http_method.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
my
$app
=
do
{
get
'/g'
=>
sub
{
shift
->create_response(200, [],
'get_ok'
) };
post
'/p'
=>
sub
{
shift
->create_response(200, [],
'post_ok'
) };
any
'/a'
=>
sub
{
shift
->create_response(200, [],
'any_ok'
) };
t/400_lite/08_x_nantoka.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
subtest
'basic'
=>
sub
{
my
$app
=
do
{
get
'/'
=>
sub
{
shift
->create_response(200, [],
'ok'
) };
__PACKAGE__->to_app();
};
t/400_lite/09_get_post.t view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
use
Test::More;
use
HTTP::Message::PSGI;
use
HTTP::Response;
{
get
'/'
=>
sub
{
t/TestFlavor.pm view on Meta::CPAN
12345678910111213use
strict;
use
warnings;
use
utf8;
package
t::TestFlavor;
our
@EXPORT
=
qw(test_flavor)
;
use
App::Prove;
use
File::Basename;
use
Cwd;
use
File::Spec;
use
Plack::Util;