@@ -1,34 +1,65 @@
+# =========================================================================
+# 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 $build = Module::Build->new(
+my %args = (
license => 'perl',
dynamic_config => 0,
- build_requires => {
- 'Test::More' => '0.98',
- 'Test::Requires' => 0,
- },
- configure_requires => { 'Module::Build' => '0.38' },
- requires => {
- 'Amon2' => '3.25',
- 'Data::Section::Simple' => '0.03',
- perl => '5.008008',
- 'Text::Xslate::Bridge::TT2Like' => '0.00010',
- 'Router::Simple' => '0.13',
+ configure_requires => {
+ 'Module::Build' => 0.38,
},
- no_index => { 'directory' => [ 'inc' ] },
- name => 'Amon2-Lite',
- module_name => 'Amon2::Lite',
+ name => 'Amon2-Lite',
+ module_name => 'Amon2::Lite',
+ allow_pureperl => 0,
- # script_files => [''],
+ script_files => [glob('script/*'), glob('bin/*')],
+ c_source => [qw()],
+ PL_files => {},
- test_files => (-d '.git' || $ENV{RELEASE_TESTING}) ? 't/ xt/' : 't/',
+ test_files => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/',
recursive_test_files => 1,
-
- create_readme => 1,
- create_license => 1,
+
+
);
-$build->create_build_script();
+if (-d 'share') {
+ $args{share_dir} = 'share';
+}
+
+my $builder = Module::Build->subclass(
+ class => 'MyBuilder',
+ code => q{
+ sub ACTION_distmeta {
+ die "Do not run distmeta. Install Minilla and `minil install` instead.\n";
+ }
+ sub ACTION_installdeps {
+ die "Do not run installdeps. Run `cpanm --installdeps .` instead.\n";
+ }
+ }
+)->new(%args);
+$builder->create_build_script();
+
+use File::Copy;
+
+print "cp META.json MYMETA.json\n";
+copy("META.json","MYMETA.json") or die "Copy failed(META.json): $!";
+
+if (-f 'META.yml') {
+ print "cp META.yml MYMETA.yml\n";
+ copy("META.yml","MYMETA.yml") or die "Copy failed(META.yml): $!";
+} else {
+ print "There is no META.yml... You may install this module from the repository...\n";
+}
+
@@ -1,5 +1,31 @@
Revision history for Perl extension Amon2::Lite
+0.13 2014-08-28T09:41:58Z
+
+ - Fixed deps.
+ (Reported by andk)
+
+0.12 2014-03-25T01:06:43Z
+
+ - Fix default DB name to expand environment name
+ (moznion)
+ - Fixed testing issues
+ (Kosuke Asami)
+
+0.11 2013-10-08T23:29:10Z
+
+ - Amon2::Lite with Text::Xslate 2.0010- gets Perl 5.18+ issue.
+ Just updated deps.
+ ref. http://blog.64p.org/entry/2013/10/08/093236
+ (tokuhirom)
+ - Tiny fix for Amon2 5.00 compatibility.
+ (tokuhirom)
+
+0.10 2013-08-14T01:14:41Z
+
+ - minil migrate
+ (tokuhirom)
+
0.09
- Allows "get '/'" and "post '/'" in same router.
@@ -1,12 +1,11 @@
Build.PL
Changes
-lib/Amon2/Lite.pm
-lib/Amon2/Setup/Flavor/Lite.pm
LICENSE
-MANIFEST This list of files
META.json
-META.yml
-README
+README.md
+cpanfile
+lib/Amon2/Lite.pm
+lib/Amon2/Setup/Flavor/Lite.pm
t/00_compile.t
t/100_static/01_simple.t
t/100_static/static/foo
@@ -26,9 +25,6 @@ t/400_lite/08_x_nantoka.t
t/400_lite/09_get_post.t
t/TestFlavor.pm
t/tmpl/foo.mt
-xt/01_podspell.t
xt/02_perlcritic.t
-xt/03_pod.t
-xt/04_minimum_version.t
-xt/05_cpan_meta.t
-xt/06_meta_author.t
+META.yml
+MANIFEST
\ No newline at end of file
@@ -1,10 +1,10 @@
{
"abstract" : "Sinatra-ish framework on Amon2!",
"author" : [
- "Tokuhiro Matsuno E<lt>tokuhirom AAJKLFJEF@ GMAIL COME<gt>"
+ "Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>"
],
"dynamic_config" : 0,
- "generated_by" : "Module::Build version 0.4003, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "Minilla/v2.1.1",
"license" : [
"perl_5"
],
@@ -15,46 +15,91 @@
"name" : "Amon2-Lite",
"no_index" : {
"directory" : [
- "inc"
+ "t",
+ "xt",
+ "inc",
+ "share",
+ "eg",
+ "examples",
+ "author",
+ "builder"
]
},
"prereqs" : {
- "build" : {
+ "configure" : {
"requires" : {
- "Test::More" : "0.98",
- "Test::Requires" : "0"
+ "Module::Build" : "0.38"
}
},
- "configure" : {
+ "develop" : {
"requires" : {
- "Module::Build" : "0.38"
+ "Test::CPAN::Meta" : "0",
+ "Test::MinimumVersion::Fast" : "0.04",
+ "Test::PAUSE::Permissions" : "0.04",
+ "Test::Pod" : "1.41",
+ "Test::Spellunker" : "v0.2.7"
}
},
"runtime" : {
"requires" : {
"Amon2" : "3.25",
+ "Amon2::Config::Simple" : "0",
+ "Amon2::Plugin::Web::CSRFDefender" : "0",
+ "Amon2::Setup::Flavor" : "0",
+ "Amon2::Web" : "0",
"Data::Section::Simple" : "0.03",
+ "Plack::App::File" : "0",
+ "Plack::Middleware::Session" : "0",
+ "Plack::Session::State::Cookie" : "0",
"Router::Simple" : "0.13",
+ "Text::Xslate" : "2.0010",
"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"
+ }
}
},
"provides" : {
"Amon2::Lite" : {
"file" : "lib/Amon2/Lite.pm",
- "version" : "0.09"
+ "version" : "0.13"
},
"Amon2::Setup::Flavor::Lite" : {
"file" : "lib/Amon2/Setup/Flavor/Lite.pm",
- "version" : "0.01"
+ "version" : "0.13"
}
},
"release_status" : "stable",
"resources" : {
- "license" : [
- "http://dev.perl.org/licenses/"
- ]
+ "bugtracker" : {
+ "web" : "https://github.com/tokuhirom/Amon2-Lite/issues"
+ },
+ "homepage" : "https://github.com/tokuhirom/Amon2-Lite",
+ "repository" : {
+ "url" : "git://github.com/tokuhirom/Amon2-Lite.git",
+ "web" : "https://github.com/tokuhirom/Amon2-Lite"
+ }
},
- "version" : "0.09"
+ "version" : "0.13",
+ "x_contributors" : [
+ "Syohei YOSHIDA <syohex@gmail.com>",
+ "Kosuke Asami <tfortress58@gmail.com>",
+ "moznion <moznion@gmail.com>",
+ "Tokuhiro Matsuno <tokuhirom@gmail.com>"
+ ]
}
@@ -1,35 +1,67 @@
---
abstract: 'Sinatra-ish framework on Amon2!'
author:
- - 'Tokuhiro Matsuno E<lt>tokuhirom AAJKLFJEF@ GMAIL COME<gt>'
+ - 'Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>'
build_requires:
- Test::More: 0.98
- Test::Requires: 0
+ 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
+ Module::Build: '0.38'
dynamic_config: 0
-generated_by: 'Module::Build version 0.4003, CPAN::Meta::Converter version 2.120921'
+generated_by: 'Minilla/v2.1.1, CPAN::Meta::Converter version 2.141520'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: Amon2-Lite
no_index:
directory:
+ - t
+ - xt
- inc
+ - share
+ - eg
+ - examples
+ - author
+ - builder
provides:
Amon2::Lite:
file: lib/Amon2/Lite.pm
- version: 0.09
+ version: '0.13'
Amon2::Setup::Flavor::Lite:
file: lib/Amon2/Setup/Flavor/Lite.pm
- version: 0.01
+ version: '0.13'
requires:
- Amon2: 3.25
- Data::Section::Simple: 0.03
- Router::Simple: 0.13
- Text::Xslate::Bridge::TT2Like: 0.00010
- perl: 5.008008
+ Amon2: '3.25'
+ Amon2::Config::Simple: '0'
+ Amon2::Plugin::Web::CSRFDefender: '0'
+ Amon2::Setup::Flavor: '0'
+ Amon2::Web: '0'
+ Data::Section::Simple: '0.03'
+ Plack::App::File: '0'
+ Plack::Middleware::Session: '0'
+ Plack::Session::State::Cookie: '0'
+ Router::Simple: '0.13'
+ Text::Xslate: '2.0010'
+ Text::Xslate::Bridge::TT2Like: '0.00010'
+ parent: '0'
+ perl: '5.008008'
resources:
- license: http://dev.perl.org/licenses/
-version: 0.09
+ bugtracker: https://github.com/tokuhirom/Amon2-Lite/issues
+ homepage: https://github.com/tokuhirom/Amon2-Lite
+ repository: git://github.com/tokuhirom/Amon2-Lite.git
+version: '0.13'
+x_contributors:
+ - 'Syohei YOSHIDA <syohex@gmail.com>'
+ - 'Kosuke Asami <tfortress58@gmail.com>'
+ - 'moznion <moznion@gmail.com>'
+ - 'Tokuhiro Matsuno <tokuhirom@gmail.com>'
@@ -1,133 +0,0 @@
-NAME
- Amon2::Lite - Sinatra-ish framework on Amon2!
-
-SYNOPSIS
- use Amon2::Lite;
-
- get '/' => sub {
- my ($c) = @_;
- return $c->render('index.tt');
- };
-
- __PACKAGE__->to_app();
-
- __DATA__
-
- @@ index.tt
- <!doctype html>
- <html>
- <body>Hello</body>
- </html>
-
-DESCRIPTION
- This is a Sinatra-ish wrapper for Amon2.
-
- THIS MODULE IS BETA STATE. API MAY CHANGE WITHOUT NOTICE.
-
-FUNCTIONS
- any(\@methods, $path, \&code)
- any($path, \&code)
- Register new route for router.
-
- get($path, $code->($c))
- Register new route for router.
-
- post($path, $code->($c))
- Register new route for router.
-
- __PACKAGE__->load_plugin($name, \%opts)
- Load a plugin to the context object.
-
- [EXPERIMENTAL] __PACKAGE__->enable_session(%args)
- This method enables Plack::Middleware::Session.
-
- %args would be pass to enabled to "Plack::Middleware::Session->new".
-
- The default state class is Plack::Session::State::Cookie, and store
- class is Plack::Session::Store::File.
-
- This option enables a response filter, that adds " Cache-Control:
- private " header.
-
- [EXPERIMENTAL] __PACKAGE__->enable_middleware($klass, %args)
- __PACKAGE__->enable_middleware('Plack::Middleware::XFramework', framework => 'Amon2::Lite');
-
- Enable the Plack middlewares.
-
- __PACKAGE__->to_app(%args)
- Create new PSGI application instance.
-
- There is a options.
-
- no_x_content_type_options : default false
- __PACKAGE__->to_app(no_x_content_type_options => 1);
-
- Amon2::Lite puts "X-Content-Type-Options" header by default for
- security reason. You can disable this feature by this option.
-
- no_x_frame_options
- __PACKAGE__->to_app(no_x_frame_options => 1);
-
- Amon2::Lite puts "X-Frame-Options: DENY" header by default for
- security reason. You can disable this feature by this option.
-
-FAQ
- How can I configure the options for Xslate?
- You can provide a constructor arguments by configuration. Write
- following lines on your app.psgi.
-
- __PACKAGE__->template_options(
- syntax => 'Kolon',
- );
-
- How can I use other template engines instead of Text::Xslate?
- You can use any template engine with Amon2::Lite. You can overwrite
- create_view method same as normal Amon2.
-
- This is a example to use Text::MicroTemplate::File.
-
- use Tiffany::Text::MicroTemplate::File;
-
- sub create_view {
- Tiffany::Text::MicroTemplate::File->new(+{
- include_path => ['./tmpl/']
- })
- }
-
- How can I handle static files?
- If you pass the 'handle_static' option to 'to_app' method,
- Amon2::Lite handles /static/ path to ./static/ directory.
-
- use Amon2::Lite;
- __PACKAGE__->to_app(handle_static => 1);
-
- Where is a example codes?
- There is a tiny TinyURL example:
- <https://github.com/tokuhirom/MyTinyURL/blob/master/app.psgi>.
-
- How can I use session?
- You can enable session by "__PACKAGE__->enable_session()". And you
- can access the session object by "$c->session" accessor.
-
- use Amon2::Lite;
-
- get '/' => sub {
- my $c = shift;
- my $cnt = $c->session->get('cnt') || 1;
- $c->session->set('cnt' => $cnt+1);
- return $c->create_response(200, [], [$cnt]);
- };
-
- __PACKAGE__->enable_session(); #
- __PACKAGE__->to_app();
-
-AUTHOR
- Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>
-
-SEE ALSO
-LICENSE
- Copyright (C) Tokuhiro Matsuno
-
- This library is free software; you can redistribute it and/or modify it
- under the same terms as Perl itself.
-
@@ -0,0 +1,148 @@
+# NAME
+
+Amon2::Lite - Sinatra-ish framework on Amon2!
+
+# SYNOPSIS
+
+ use Amon2::Lite;
+
+ get '/' => sub {
+ my ($c) = @_;
+ return $c->render('index.tt');
+ };
+
+ __PACKAGE__->to_app();
+
+ __DATA__
+
+ @@ index.tt
+ <!doctype html>
+ <html>
+ <body>Hello</body>
+ </html>
+
+# DESCRIPTION
+
+This is a Sinatra-ish wrapper for Amon2.
+
+**THIS MODULE IS BETA STATE. API MAY CHANGE WITHOUT NOTICE**.
+
+# FUNCTIONS
+
+- `any(\@methods, $path, \&code)`
+- `any($path, \&code)`
+
+ Register new route for router.
+
+- `get($path, $code->($c))`
+
+ Register new route for router.
+
+- `post($path, $code->($c))`
+
+ Register new route for router.
+
+- `__PACKAGE__->load_plugin($name, \%opts)`
+
+ Load a plugin to the context object.
+
+- \[EXPERIMENTAL\] `__PACKAGE__->enable_session(%args)`
+
+ This method enables [Plack::Middleware::Session](https://metacpan.org/pod/Plack::Middleware::Session).
+
+ `%args` would be pass to enabled to `Plack::Middleware::Session->new`.
+
+ The default state class is [Plack::Session::State::Cookie](https://metacpan.org/pod/Plack::Session::State::Cookie), and store class is [Plack::Session::Store::File](https://metacpan.org/pod/Plack::Session::Store::File).
+
+ This option enables a response filter, that adds ` Cache-Control: private ` header.
+
+- \[EXPERIMENTAL\] `__PACKAGE__->enable_middleware($klass, %args)`
+
+ __PACKAGE__->enable_middleware('Plack::Middleware::XFramework', framework => 'Amon2::Lite');
+
+ Enable the Plack middlewares.
+
+- `__PACKAGE__->to_app(%args)`
+
+ Create new PSGI application instance.
+
+ There is a options.
+
+ - `no_x_content_type_options : default false`
+
+ __PACKAGE__->to_app(no_x_content_type_options => 1);
+
+ Amon2::Lite puts `X-Content-Type-Options` header by default for security reason.
+ You can disable this feature by this option.
+
+ - `no_x_frame_options`
+
+ __PACKAGE__->to_app(no_x_frame_options => 1);
+
+ Amon2::Lite puts `X-Frame-Options: DENY` header by default for security reason.
+ You can disable this feature by this option.
+
+# FAQ
+
+- How can I configure the options for Xslate?
+
+ You can provide a constructor arguments by configuration.
+ Write following lines on your app.psgi.
+
+ __PACKAGE__->template_options(
+ syntax => 'Kolon',
+ );
+
+- How can I use other template engines instead of Text::Xslate?
+
+ You can use any template engine with Amon2::Lite. You can overwrite create\_view method same as normal Amon2.
+
+ This is a example to use [Text::MicroTemplate::File](https://metacpan.org/pod/Text::MicroTemplate::File).
+
+ use Tiffany::Text::MicroTemplate::File;
+
+ sub create_view {
+ Tiffany::Text::MicroTemplate::File->new(+{
+ include_path => ['./tmpl/']
+ })
+ }
+
+- How can I handle static files?
+
+ If you pass the 'handle\_static' option to 'to\_app' method, Amon2::Lite handles /static/ path to ./static/ directory.
+
+ use Amon2::Lite;
+ __PACKAGE__->to_app(handle_static => 1);
+
+- Where is a example codes?
+
+ There is a tiny TinyURL example: [https://github.com/tokuhirom/MyTinyURL/blob/master/app.psgi](https://github.com/tokuhirom/MyTinyURL/blob/master/app.psgi).
+
+- How can I use session?
+
+ You can enable session by `__PACKAGE__->enable_session()`. And you can access the session object by `$c->session` accessor.
+
+ use Amon2::Lite;
+
+ get '/' => sub {
+ my $c = shift;
+ my $cnt = $c->session->get('cnt') || 1;
+ $c->session->set('cnt' => $cnt+1);
+ return $c->create_response(200, [], [$cnt]);
+ };
+
+ __PACKAGE__->enable_session(); #
+ __PACKAGE__->to_app();
+
+# AUTHOR
+
+Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>
+
+# SEE ALSO
+
+# LICENSE
+
+Copyright (C) Tokuhiro Matsuno
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
@@ -0,0 +1,30 @@
+requires 'perl', '5.008008';
+
+requires 'Amon2', '3.25';
+requires 'Amon2::Config::Simple';
+requires 'Amon2::Setup::Flavor';
+requires 'Amon2::Web';
+requires 'Amon2::Plugin::Web::CSRFDefender';
+requires 'Data::Section::Simple', '0.03';
+requires 'parent';
+requires 'Plack::App::File';
+requires 'Plack::Middleware::Session';
+requires 'Plack::Session::State::Cookie';
+requires 'Router::Simple', '0.13';
+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';
+};
@@ -2,7 +2,7 @@ package Amon2::Lite;
use strict;
use warnings;
use 5.008008;
-our $VERSION = '0.09';
+our $VERSION = '0.13';
use parent qw/Amon2 Amon2::Web/;
use Router::Simple 0.04;
@@ -206,6 +206,8 @@ sub import {
1;
__END__
+=for stopwords TinyURL
+
=encoding utf8
=head1 NAME
@@ -241,25 +243,25 @@ B<THIS MODULE IS BETA STATE. API MAY CHANGE WITHOUT NOTICE>.
=over 4
-=item any(\@methods, $path, \&code)
+=item C<< any(\@methods, $path, \&code) >>
-=item any($path, \&code)
+=item C<< any($path, \&code) >>
Register new route for router.
-=item get($path, $code->($c))
+=item C<< get($path, $code->($c)) >>
Register new route for router.
-=item post($path, $code->($c))
+=item C<< post($path, $code->($c)) >>
Register new route for router.
-=item __PACKAGE__->load_plugin($name, \%opts)
+=item C<< __PACKAGE__->load_plugin($name, \%opts) >>
Load a plugin to the context object.
-=item [EXPERIMENTAL] __PACKAGE__->enable_session(%args)
+=item [EXPERIMENTAL] C<< __PACKAGE__->enable_session(%args) >>
This method enables L<Plack::Middleware::Session>.
@@ -269,13 +271,13 @@ The default state class is L<Plack::Session::State::Cookie>, and store class is
This option enables a response filter, that adds C< Cache-Control: private > header.
-=item [EXPERIMENTAL] __PACKAGE__->enable_middleware($klass, %args)
+=item [EXPERIMENTAL] C<< __PACKAGE__->enable_middleware($klass, %args) >>
__PACKAGE__->enable_middleware('Plack::Middleware::XFramework', framework => 'Amon2::Lite');
Enable the Plack middlewares.
-=item __PACKAGE__->to_app(%args)
+=item C<< __PACKAGE__->to_app(%args) >>
Create new PSGI application instance.
@@ -283,14 +285,14 @@ There is a options.
=over 4
-=item no_x_content_type_options : default false
+=item C<< no_x_content_type_options : default false >>
__PACKAGE__->to_app(no_x_content_type_options => 1);
Amon2::Lite puts C<< X-Content-Type-Options >> header by default for security reason.
You can disable this feature by this option.
-=item no_x_frame_options
+=item C<< no_x_frame_options >>
__PACKAGE__->to_app(no_x_frame_options => 1);
@@ -3,13 +3,14 @@ use warnings;
use utf8;
package Amon2::Setup::Flavor::Lite;
-use parent qw/Amon2::Setup::Flavor/;
-use Amon2::Lite;
-use Amon2;
+use parent qw(Amon2::Setup::Flavor);
sub run {
my ($self) = @_;
+ require Amon2::Lite;
+ require Amon2;
+
$self->{amon2_version} = $Amon2::VERSION;
$self->{amon2_lite_version} = $Amon2::Lite::VERSION;
@@ -23,7 +24,7 @@ use lib File::Spec->catdir(dirname(__FILE__), 'extlib', 'lib', 'perl5');
use lib File::Spec->catdir(dirname(__FILE__), 'lib');
use Amon2::Lite;
-our $VERSION = '0.01';
+our $VERSION = '0.13';
# put your configuration here
sub load_config {
@@ -33,7 +34,7 @@ sub load_config {
+{
'DBI' => [
- 'dbi:SQLite:dbname=$mode.db',
+ "dbi:SQLite:dbname=$mode.db",
'',
'',
],
@@ -46,7 +47,9 @@ get '/' => sub {
};
# load plugins
-__PACKAGE__->load_plugin('Web::CSRFDefender');
+__PACKAGE__->load_plugin('Web::CSRFDefender' => {
+ post_only => 1,
+});
# __PACKAGE__->load_plugin('DBI');
# __PACKAGE__->load_plugin('Web::FillInFormLite');
# __PACKAGE__->load_plugin('Web::JSON');
@@ -64,9 +67,10 @@ __DATA__
<meta charset="utf-8">
<title><% $module %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="[% uri_for('/static/js/main.js') %]"></script>
- <link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
+ <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
+ <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="[% uri_for('/static/css/main.css') %]">
</head>
<body>
@@ -14,12 +14,12 @@ use Plack::Util;
use Test::More;
sub test_flavor {
- my ($code, $flavor) = @_;
+ my ($code, $flavor_class) = @_;
local $ENV{PLACK_ENV} = 'development';
- $flavor = Plack::Util::load_class($flavor, 'Amon2::Setup::Flavor');
+ $flavor_class = Plack::Util::load_class($flavor_class, 'Amon2::Setup::Flavor');
- my $libpath = File::Spec->rel2abs(File::Spec->catfile(dirname(__FILE__), '..', '..', 'lib'));
+ my $libpath = File::Spec->rel2abs(File::Spec->catfile(dirname(__FILE__), '..', 'lib'));
unshift @INC, $libpath;
my $dir = tempdir(CLEANUP => $ENV{DEBUG} ? 0 : 1);
@@ -28,12 +28,13 @@ sub test_flavor {
note $dir;
{
- $flavor->new(module => 'My::App')->run;
+ my $flavor = $flavor_class->new(module => 'My::App');
+ $flavor->run;
$code->($flavor);
# run prove
my $app = App::Prove->new();
- $app->process_args('-Ilib', "-I$libpath", <t/*.t>);
+ $app->process_args('--norc', '--exec', "$^X -Ilib -Mlib=$libpath", <t/*.t>);
ok($app->run);
}
@@ -1,69 +0,0 @@
-use strict;
-use Test::More;
-eval q{ use Test::Spelling };
-plan skip_all => "Test::Spelling is not installed." if $@;
-add_stopwords(map { split /[\s\:\-]/ } <DATA>);
-$ENV{LANG} = 'C';
-my $spell_cmd;
-foreach my $path (split(/:/, $ENV{PATH})) {
- -x "$path/spell" and $spell_cmd="spell", last;
- -x "$path/ispell" and $spell_cmd="ispell -l", last;
- -x "$path/aspell" and $spell_cmd="aspell list", last;
-}
-plan skip_all => "no spell/ispell/aspell" unless $spell_cmd;
-
-set_spell_cmd($spell_cmd);
-all_pod_files_spelling_ok('lib');
-__DATA__
-Tokuhiro Matsuno
-Amon2::Lite
-tokuhirom
-AAJKLFJEF
-GMAIL
-COM
-Tatsuhiko
-Miyagawa
-Kazuhiro
-Osawa
-lestrrat
-typester
-cho45
-charsbar
-coji
-clouder
-gunyarakun
-hio_d
-hirose31
-ikebe
-kan
-kazeburo
-daisuke
-maki
-TODO
-API
-URL
-URI
-db
-TTerse
-irc
-org
-CSS
-Amon
-Tokuhiro
-Matsuno
-Svn
-svn
-diff
-Gosuke
-Miyashita
-mysqldiff
-mmm
-FAQ
-PSGI
-Xslate
-app
-ish
-psgi
-TinyURL
-Plack
-middlewares
@@ -1,12 +1,49 @@
use strict;
+use warnings;
use Test::More;
-eval q{
- use Test::Perl::Critic 1.02 -exclude => [
- 'Subroutines::ProhibitSubroutinePrototypes',
- 'Subroutines::ProhibitExplicitReturnUndef',
- 'TestingAndDebugging::ProhibitNoStrict',
- 'ControlStructures::ProhibitMutatingListFunctions',
- ]
+
+eval {
+ require Perl::Critic;
+ Perl::Critic->VERSION(1.105);
+
+ require Test::Perl::Critic;
+ Test::Perl::Critic->VERSION(1.02);
+ Test::Perl::Critic->import(
+ -profile => \(join q{}, <DATA>)
+ );
};
-plan skip_all => "Test::Perl::Critic 1.02+ is not installed." if $@;
-all_critic_ok('lib');
+note $@ if $@;
+plan skip_all => "Perl::Critic 1.105+ or Test::Perl::Critic 1.02+ is not installed." if $@;
+
+all_critic_ok('lib', 'script', 'bin');
+
+__END__
+
+only=1
+
+# -------------------------------------------------------------------------
+# Not important.
+
+[BuiltinFunctions::ProhibitSleepViaSelect]
+[BuiltinFunctions::RequireGlobFunction]
+[ClassHierarchies::ProhibitOneArgBless]
+
+# -------------------------------------------------------------------------
+# Bug detection
+[InputOutput::ProhibitBarewordFileHandles]
+[Modules::RequireFilenameMatchesPackage]
+[Subroutines::ProhibitNestedSubs]
+[Subroutines::ProhibitReturnSort]
+[TestingAndDebugging::RequireUseStrict]
+[Variables::ProhibitConditionalDeclarations]
+[Variables::RequireLexicalLoopIterators]
+
+[TestingAndDebugging::ProhibitNoStrict]
+allow=refs
+
+# -------------------------------------------------------------------------
+# Security issue detection
+[InputOutput::RequireEncodingWithUTF8Layer]
+[Modules::ProhibitEvilModules]
+[InputOutput::ProhibitTwoArgOpen]
+
@@ -1,4 +0,0 @@
-use Test::More;
-eval "use Test::Pod 1.00";
-plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
-all_pod_files_ok();
@@ -1,4 +0,0 @@
-use Test::More;
-eval "use Test::MinimumVersion 0.101080";
-plan skip_all => "Test::Minimumversion required for testing perl minimum version" if $@;
-all_minimum_version_from_metayml_ok();
@@ -1,5 +0,0 @@
-use Test::More;
-eval "use Test::CPAN::Meta";
-plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
-plan skip_all => "There is no META.yml" unless -f "META.yml";
-meta_yaml_ok();
@@ -1,11 +0,0 @@
-use strict;
-use Test::More;
-eval "use Parse::CPAN::Meta";
-plan skip_all => "Parse::CPAN::Meta required for testing META.yml" unless eval "use Parse::CPAN::Meta; 1;";
-plan skip_all => "There is no META.yml" unless -f "META.yml";
-
-my $meta = Parse::CPAN::Meta->load_file('META.yml');
-isnt($meta->{author}->[0], 'unknown', 'author info');
-cmp_ok($meta->{'build_requires'}->{'Test::More'}, '>=', '0.98');
-ok($meta->{'requires'}->{'perl'}, 'metayml_declares_perl_version');
-done_testing;