From 4219e4f6082a902c68575614409453c7f1af25f5 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Tue, 30 Mar 2010 15:36:54 +0200 Subject: fix mail, update --- Makefile.PL | 7 ++++--- README | 6 +++++- lib/Plack/Middleware/APIRateLimit.pm | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index d83486c..c8d7db2 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,17 +1,18 @@ use inc::Module::Install; name 'Plack-Middleware-APIRateLimit'; all_from 'lib/Plack/Middleware/APIRateLimit.pm'; +readme_from 'lib/Plack/Middleware/APIRateLimit.pm'; -# requires ''; +requires 'AnyEvent::Redis'; tests 't/*.t'; -author_tests 'xt'; author 'Franck Cuny'; license 'perl'; -readme_from 'lib/Plack/Middleware/APIRateLimit.pm'; build_requires 'Test::More'; use_test_base; auto_include; +author_tests 'xt'; +auto_set_repository; WriteAll; diff --git a/README b/README index 5ab97aa..7f8bbe1 100644 --- a/README +++ b/README @@ -8,6 +8,9 @@ SYNOPSIS enable "APIRateLimit", requests_per_hour => 2, backend => "Hash"; # or enable "APIRateLimit", requests_per_hour => 2, backend => ["Redis", {port => 6379, server => '127.0.0.1'}]; + # or + enable "APIRateLimit", request_per_hour => 2, backend => Redis->new(server => '127.0.0.1:6379'); + sub { [ '200', [ 'Content-Type' => 'text/html' ], ['hello world'] ] }; }; @@ -30,7 +33,8 @@ DESCRIPTION VARIABLES backend Which backend to use. Currently only Hash and Redis are supported. - If no backend is specified, Hash is used by default. + If no backend is specified, Hash is used by default. Backend must + implement set, get and incr. requests_per_hour How many requests is allowed by hour. diff --git a/lib/Plack/Middleware/APIRateLimit.pm b/lib/Plack/Middleware/APIRateLimit.pm index 6a86446..8584416 100644 --- a/lib/Plack/Middleware/APIRateLimit.pm +++ b/lib/Plack/Middleware/APIRateLimit.pm @@ -173,7 +173,7 @@ How many requests is allowed by hour. =head1 AUTHOR -franck cuny Efranck@linkfluence.netE +franck cuny Efranck@lumberjaph.netE =head1 SEE ALSO -- cgit 1.4.1