Amon2-Lite
view release on metacpan or search on metacpan
"Text::Xslate::Bridge::TT2Like" : "0.00010",
"parent" : "0",
"perl" : "5.008008"
}
},
"test" : {
"requires" : {
"App::Prove" : "0",
"File::Temp" : "0",
"HTTP::Message::PSGI" : "0",
"HTTP::Request::Common" : "0",
"HTTP::Response" : "0",
"Plack::Test" : "0",
"Plack::Util" : "0",
"Test::More" : "0.98",
"Test::Requires" : "0",
"Test::WWW::Mechanize" : "0",
"Tiffany" : "0"
}
}
},
---
abstract: 'Sinatra-ish framework on Amon2!'
author:
- 'Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>'
build_requires:
App::Prove: '0'
File::Temp: '0'
HTTP::Message::PSGI: '0'
HTTP::Request::Common: '0'
HTTP::Response: '0'
Plack::Test: '0'
Plack::Util: '0'
Test::More: '0.98'
Test::Requires: '0'
Test::WWW::Mechanize: '0'
Tiffany: '0'
configure_requires:
Module::Build: '0.38'
dynamic_config: 0
requires 'Text::Xslate', '2.0010'; # 2.0010+ gets Perl 5.18+ compatibility
requires 'Text::Xslate::Bridge::TT2Like', '0.00010';
on test => sub {
requires 'Test::More', '0.98';
requires 'Test::Requires';
requires 'App::Prove';
requires 'File::Temp';
requires 'HTTP::Message::PSGI';
requires 'HTTP::Request::Common';
requires 'HTTP::Response';
requires 'Plack::Test';
requires 'Plack::Util';
requires 'Test::WWW::Mechanize';
requires 'Tiffany';
};
lib/Amon2/Setup/Flavor/Lite.pm view on Meta::CPAN
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;
my $req = HTTP::Request->new(GET => 'http://localhost/');
my $res = $cb->($req);
is $res->code, 200;
diag $res->content if $res->code != 200;
};
done_testing;
...
$self->write_file('xt/03_pod.t', <<'...');
use Test::More;
t/100_static/01_simple.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Plack::Test;
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(
handle_static => 1,
);
};
t/400_lite/01_simple.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Plack::Test;
use Test::Requires qw/HTTP::Request::Common/, 'Data::Section::Simple';
use Amon2::Lite;
get '/' => sub {
my ($c) = @_;
return Amon2::Web::Response->new(200, [], 'OK');
};
get '/hello' => sub {
my ($c) = @_;
t/400_lite/02_plugin.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::Requires 'JSON', 'Data::Section::Simple';
use Plack::Util;
use Plack::Test;
use HTTP::Request::Common;
my $app = Plack::Util::load_psgi('t/400_lite/02_plugin.psgi');
is(ref $app, 'CODE');
test_psgi $app, sub {
my $cb = shift;
my $res = $cb->(GET "/");
is $res->content, '{"ok":1}';
};
done_testing;
t/400_lite/03_kolon.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Plack::Test;
use Test::Requires qw/HTTP::Request::Common/, 'Data::Section::Simple';
use FindBin;
use File::Spec;
use lib File::Spec->catdir($FindBin::Bin, '../../lib');
use Amon2::Lite;
sub config {
+{
'Text::Xslate' => {
syntax => 'Kolon'
t/400_lite/03_kolon_simple.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Plack::Test;
use Test::Requires qw/HTTP::Request::Common/, 'Data::Section::Simple';
use FindBin;
use File::Spec;
use lib File::Spec->catdir($FindBin::Bin, '../../lib');
my $app = do {
use Amon2::Lite;
__PACKAGE__->template_options(
syntax => 'Kolon',
t/400_lite/04_template_options.t view on Meta::CPAN
use strict;
use warnings;
use Test::More;
use Plack::Test;
use Test::Requires qw/HTTP::Request::Common/, 'Data::Section::Simple';
use FindBin;
use File::Spec;
use lib File::Spec->catdir($FindBin::Bin, '../../lib');
my $app = do {
use Amon2::Lite;
__PACKAGE__->template_options(
syntax => 'Kolon',
module => ['Data::Dumper'],
t/400_lite/04_tmt.t view on Meta::CPAN
use 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 HTTP::Request::Common;
use Amon2::Lite;
sub create_view {
Tiffany::Text::MicroTemplate::File->new(+{
include_path => ['./t/tmpl/']
})
}
get '/' => sub {
t/400_lite/09_get_post.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::Requires 'HTTP::Request::Common';
use HTTP::Message::PSGI;
use HTTP::Response;
use HTTP::Request::Common;
{
package sandbox;
use Amon2::Lite;
get '/' => sub {
my $c = shift;
$c->create_response(200, [], ['get']);
};
post '/' => sub {
my $c = shift;
( run in 1.364 second using v1.01-cache-2.11-cpan-de7293f3b23 )