Amon2-Lite

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# =========================================================================
# THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA.
# DO NOT EDIT DIRECTLY.
# =========================================================================
 
use 5.008_001;
 
use strict;
use utf8;
 
 
my %args = (
    license              => 'perl',
    dynamic_config       => 0,
 
    configure_requires => {

lib/Amon2/Lite.pm  view on Meta::CPAN

201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
        *{"${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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use strict;
use utf8;
 
 
sub run {
    my ($self) = @_;
 
    require Amon2::Lite;
    require Amon2;
 
    $self->{amon2_version}      = $Amon2::VERSION;
    $self->{amon2_lite_version} = $Amon2::Lite::VERSION;
 
    $self->write_file('app.psgi', <<'...');
use strict;
use utf8;
use lib File::Spec->catdir(dirname(__FILE__), 'extlib', 'lib', 'perl5');
use lib File::Spec->catdir(dirname(__FILE__), 'lib');
 
our $VERSION = '0.13';
 
# put your configuration here
sub load_config {

lib/Amon2/Setup/Flavor/Lite.pm  view on Meta::CPAN

120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
    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 utf8;
use t::Util;
 
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

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires qw/HTTP::Request::Common/, 'Data::Section::Simple';
 
my $app = do {
    use Amon2::Lite;
 
    get '/' => sub { shift->create_response(200, ['Content-Length' => 2], ['OK']) };
 
    __PACKAGE__->to_app(

t/300_setup/04_lite.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires 'JSON', 'Plack::Middleware::ReverseProxy', 'Data::Section::Simple';
 
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

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires qw/HTTP::Request::Common/, 'Data::Section::Simple';
 
 
get '/' => sub {
    my ($c) = @_;
    return Amon2::Web::Response->new(200, [], 'OK');
};

t/400_lite/02_plugin.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires 'JSON', 'Data::Section::Simple';
 
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

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires qw/HTTP::Request::Common/, 'Data::Section::Simple';
use FindBin;
use lib File::Spec->catdir($FindBin::Bin, '../../lib');
 
 
sub config {

t/400_lite/03_kolon_simple.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires qw/HTTP::Request::Common/, 'Data::Section::Simple';
use FindBin;
use lib File::Spec->catdir($FindBin::Bin, '../../lib');
 
 
my $app = do {
    use Amon2::Lite;

t/400_lite/04_tmt.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires qw/Text::MicroTemplate Tiffany::Text::MicroTemplate::File/, 'Data::Section::Simple';
 
 
sub create_view {
    Tiffany::Text::MicroTemplate::File->new(+{
        include_path => ['./t/tmpl/']

t/400_lite/05_enable_session.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
 
use Test::Requires 'Test::WWW::Mechanize::PSGI';
 
my $app = do {
    package MyApp;
    use Amon2::Lite;
 
    get '/' => sub {
        my $c = shift;

t/400_lite/06_enable_middleware.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires 'Test::WWW::Mechanize::PSGI';
 
my $app = do {
    package MyApp;
    use Amon2::Lite;
 
    get '/' => sub {
        my $c = shift;

t/400_lite/07_http_method.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires 'Test::WWW::Mechanize::PSGI';
 
my $app = do {
    package MyApp;
    use Amon2::Lite;
 
    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

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires 'Test::WWW::Mechanize::PSGI';
 
subtest 'basic' => sub {
    my $app = do {
        package MyApp;
        use Amon2::Lite;
        get '/' => sub { shift->create_response(200, [], 'ok') };
        __PACKAGE__->to_app();
    };

t/400_lite/09_get_post.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
use Test::Requires 'HTTP::Request::Common';
 
{
    package sandbox;
    use Amon2::Lite;
    get '/' => sub {

t/TestFlavor.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use utf8;
 
package t::TestFlavor;
our @EXPORT = qw(test_flavor);
use File::Temp qw/tempdir/;
use Cwd;



( run in 0.350 second using v1.01-cache-2.11-cpan-95122f20152 )