[libdancer-plugin-rest-perl] 04/04: Build results of 2f64ae1 (on master)
Jonas Smedegaard
dr at jones.dk
Wed Jul 2 11:45:10 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag v0.10
in repository libdancer-plugin-rest-perl.
commit d78de76b0c0a5f8de5b16c752a9a3e55f04b9bd2
Merge: 2f64ae1 cdb27f9
Author: Yanick Champoux <yanick at babyl.dyndns.org>
Date: Sat Mar 22 11:21:42 2014 -0400
Build results of 2f64ae1 (on master)
.gitignore | 9 -
.mailmap | 2 -
.perlcriticrc | 57 -------
.perltidyrc | 34 ----
Build.PL | 68 ++++++++
CONTRIBUTORS | 10 ++
Changes | 11 +-
INSTALL | 44 +++++
LICENSE | 379 +++++++++++++++++++++++++++++++++++++++++++
MANIFEST.SKIP | 11 --
META.json | 80 +++++++++
META.yml | 43 +++++
README | 114 ++++++++++++-
README.mkdn | 125 ++++++++++++++
SIGNATURE | 0
dist.ini | 14 --
lib/Dancer/Plugin/REST.pm | 45 ++++-
t/00-compile.t | 50 ++++++
t/000-report-versions-tiny.t | 82 ++++++++++
xt/release/unused-vars.t | 8 +
20 files changed, 1043 insertions(+), 143 deletions(-)
diff --cc Build.PL
index 0000000,0ef8c61..1c514b9
mode 000000,100644..100644
--- a/Build.PL
+++ b/Build.PL
@@@ -1,0 -1,68 +1,68 @@@
+
+ # This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v5.013.
+ use strict;
+ use warnings;
+
+ use Module::Build 0.3601;
+
+
+ my %module_build_args = (
+ "build_requires" => {
+ "Module::Build" => "0.3601"
+ },
+ "configure_requires" => {
+ "Module::Build" => "0.3601"
+ },
+ "dist_abstract" => "A plugin for writing RESTful apps with Dancer",
+ "dist_author" => [
+ "Alexis Sukrieh <sukria\@sukria.net>",
+ "Franck Cuny <franckc\@cpan.org>"
+ ],
+ "dist_name" => "Dancer-Plugin-REST",
- "dist_version" => "0.09",
++ "dist_version" => "0.10",
+ "license" => "perl",
+ "module_name" => "Dancer::Plugin::REST",
+ "recommends" => {},
+ "recursive_test_files" => 1,
+ "requires" => {
+ "Carp" => 0,
- "Dancer" => 0,
++ "Dancer" => "1.3111",
+ "Dancer::Plugin" => 0,
+ "strict" => 0,
+ "warnings" => 0
+ },
+ "script_files" => [],
+ "test_requires" => {
+ "Dancer::ModuleLoader" => 0,
+ "Dancer::Test" => 0,
+ "File::Spec" => 0,
+ "HTTP::Headers" => 0,
+ "IO::Handle" => 0,
+ "IPC::Open3" => 0,
+ "Test::More" => "0.88",
+ "perl" => "5.006"
+ }
+ );
+
+
+ my %fallback_build_requires = (
+ "Dancer::ModuleLoader" => 0,
+ "Dancer::Test" => 0,
+ "File::Spec" => 0,
+ "HTTP::Headers" => 0,
+ "IO::Handle" => 0,
+ "IPC::Open3" => 0,
+ "Module::Build" => "0.3601",
+ "Test::More" => "0.88",
+ "perl" => "5.006"
+ );
+
+
+ unless ( eval { Module::Build->VERSION(0.4004) } ) {
+ delete $module_build_args{test_requires};
+ $module_build_args{build_requires} = \%fallback_build_requires;
+ }
+
+ my $build = Module::Build->new(%module_build_args);
+
+ $build->create_build_script;
diff --cc Changes
index e2a8be8,84f9d91..8b4a56a
--- a/Changes
+++ b/Changes
@@@ -1,20 -1,5 +1,15 @@@
- Revision history for {{$DIST}}
-
- {{$NEXT}}
- [API CHANGES]
+ Revision history for
++0.10 2014-03-22
+ [BUG FIXES]
+ - Requires Dancer v1.3111 or better. (GH#2, reported by OverlordQ)
+
- [DOCUMENTATION]
-
+ [ENHANCEMENTS]
+ - 'resource' can now be used with a subset of its actions.
+
- [NEW FEATURES]
-
+ [STATISTICS]
++ - code churn: 4 files changed, 42 insertions(+), 25 deletions(-)
+
0.09 2014-03-11
[BUG FIXES]
- Skip test if XML::Simple is not installed.
diff --cc META.json
index 0000000,3fe5dcc..7d3d311
mode 000000,100644..100644
--- a/META.json
+++ b/META.json
@@@ -1,0 -1,80 +1,80 @@@
+ {
+ "abstract" : "A plugin for writing RESTful apps with Dancer",
+ "author" : [
+ "Alexis Sukrieh <sukria at sukria.net>",
+ "Franck Cuny <franckc at cpan.org>"
+ ],
+ "dynamic_config" : 0,
+ "generated_by" : "Dist::Zilla version 5.013, CPAN::Meta::Converter version 2.140640",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "Dancer-Plugin-REST",
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "Module::Build" : "0.3601"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "Module::Build" : "0.3601"
+ }
+ },
+ "develop" : {
+ "requires" : {
+ "version" : "0.9901"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Carp" : "0",
- "Dancer" : "0",
++ "Dancer" : "1.3111",
+ "Dancer::Plugin" : "0",
+ "strict" : "0",
+ "warnings" : "0"
+ }
+ },
+ "test" : {
+ "requires" : {
+ "Dancer::ModuleLoader" : "0",
+ "Dancer::Test" : "0",
+ "File::Spec" : "0",
+ "HTTP::Headers" : "0",
+ "IO::Handle" : "0",
+ "IPC::Open3" : "0",
+ "Test::More" : "0.88",
+ "perl" : "5.006"
+ }
+ }
+ },
+ "provides" : {
+ "Dancer::Plugin::REST" : {
+ "file" : "lib/Dancer/Plugin/REST.pm",
- "version" : "0.09"
++ "version" : "0.10"
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "bugtracker" : {
+ "web" : "https://github.com/perldancer/Dancer-Plugin-REST/issues"
+ },
+ "homepage" : "http://search.cpan.org/dist/Dancer-Plugin-REST/",
+ "repository" : {
+ "type" : "git",
+ "url" : "https://github.com/perldancer/Dancer-Plugin-REST.git",
+ "web" : "https://github.com/perldancer/Dancer-Plugin-REST"
+ }
+ },
- "version" : "0.09",
++ "version" : "0.10",
+ "x_authority" : "cpan:SUKRIA",
+ "x_contributors" : [
+ "James Aitken <loonypandora at gmail.com>",
+ "Yanick Champoux <yanick at babyl.dyndns.org>"
+ ]
+ }
+
diff --cc META.yml
index 0000000,61e47dc..4e0b62b
mode 000000,100644..100644
--- a/META.yml
+++ b/META.yml
@@@ -1,0 -1,43 +1,43 @@@
+ ---
+ abstract: 'A plugin for writing RESTful apps with Dancer'
+ author:
+ - 'Alexis Sukrieh <sukria at sukria.net>'
+ - 'Franck Cuny <franckc at cpan.org>'
+ build_requires:
+ Dancer::ModuleLoader: '0'
+ Dancer::Test: '0'
+ File::Spec: '0'
+ HTTP::Headers: '0'
+ IO::Handle: '0'
+ IPC::Open3: '0'
+ Module::Build: '0.3601'
+ Test::More: '0.88'
+ perl: '5.006'
+ configure_requires:
+ Module::Build: '0.3601'
+ dynamic_config: 0
+ generated_by: 'Dist::Zilla version 5.013, CPAN::Meta::Converter version 2.140640'
+ license: perl
+ meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: '1.4'
+ name: Dancer-Plugin-REST
+ provides:
+ Dancer::Plugin::REST:
+ file: lib/Dancer/Plugin/REST.pm
- version: '0.09'
++ version: '0.10'
+ requires:
+ Carp: '0'
- Dancer: '0'
++ Dancer: '1.3111'
+ Dancer::Plugin: '0'
+ strict: '0'
+ warnings: '0'
+ resources:
+ bugtracker: https://github.com/perldancer/Dancer-Plugin-REST/issues
+ homepage: http://search.cpan.org/dist/Dancer-Plugin-REST/
+ repository: https://github.com/perldancer/Dancer-Plugin-REST.git
-version: '0.09'
++version: '0.10'
+ x_authority: cpan:SUKRIA
+ x_contributors:
+ - 'James Aitken <loonypandora at gmail.com>'
+ - 'Yanick Champoux <yanick at babyl.dyndns.org>'
diff --cc README
index e1c8f7b,feeb5c3..e07cf36
--- a/README
+++ b/README
@@@ -1,5 -1,113 +1,113 @@@
- Dancer::Plugin::REST
+ NAME
+ Dancer::Plugin::REST - A plugin for writing RESTful apps with Dancer
- A Dancer plugin to transform your Dancer app in a RESTful
- webservice.
+ VERSION
- version 0.09
++ version 0.10
+
+ DESCRIPTION
+ This plugin helps you write a RESTful webservice with Dancer.
+
+ SYNOPSYS
+ package MyWebService;
+
+ use Dancer;
+ use Dancer::Plugin::REST;
+
+ prepare_serializer_for_format;
+
+ get '/user/:id.:format' => sub {
+ User->find(params->{id});
+ };
+
+ # curl http://mywebservice/user/42.json
+ { "id": 42, "name": "John Foo", email: "john.foo at example.com"}
+
+ # curl http://mywebservice/user/42.yml
+ --
+ id: 42
+ name: "John Foo"
+ email: "john.foo at example.com"
+
+ KEYWORDS
+ prepare_serializer_for_format
+ When this pragma is used, a before filter is set by the plugin to
+ automatically change the serializer when a format is detected in the
+ URI.
+
+ That means that each route you define with a :format token will trigger
+ a serializer definition, if the format is known.
+
+ This lets you define all the REST actions you like as regular Dancer
+ route handlers, without explicitly handling the outgoing data format.
+
+ resource
+ This keyword lets you declare a resource your application will handle.
+
+ resource user =>
+ get => sub { # return user where id = params->{id} },
+ create => sub { # create a new user with params->{user} },
+ delete => sub { # delete user where id = params->{id} },
+ update => sub { # update user with params->{user} };
+
+ # this defines the following routes:
+ # GET /user/:id
+ # GET /user/:id.:format
+ # POST /user
+ # POST /user.:format
+ # DELETE /user/:id
+ # DELETE /user/:id.:format
+ # PUT /user/:id
+ # PUT /user/:id.:format
+
+ helpers
+ Some helpers are available. This helper will set an appropriate HTTP
+ status for you.
+
+ status_ok
+ status_ok({users => {...}});
+
+ Set the HTTP status to 200
+
+ status_created
+ status_created({users => {...}});
+
+ Set the HTTP status to 201
+
+ status_accepted
+ status_accepted({users => {...}});
+
+ Set the HTTP status to 202
+
+ status_bad_request
+ status_bad_request("user foo can't be found");
+
+ Set the HTTP status to 400. This function as for argument a scalar that
+ will be used under the key error.
+
+ status_not_found
+ status_not_found("users doesn't exists");
+
+ Set the HTTP status to 404. This function as for argument a scalar that
+ will be used under the key error.
+
+ LICENCE
+ This module is released under the same terms as Perl itself.
+
+ AUTHORS
+ This module has been written by Alexis Sukrieh "<sukria at sukria.net>" and
+ Franck Cuny.
+
+ SEE ALSO
+ Dancer <http://en.wikipedia.org/wiki/Representational_State_Transfer>
+
+ AUTHORS
+ * Alexis Sukrieh <sukria at sukria.net>
+
+ * Franck Cuny <franckc at cpan.org>
+
+ COPYRIGHT AND LICENSE
+ This software is copyright (c) 2010 by Alexis Sukrieh.
+
+ This is free software; you can redistribute it and/or modify it under
+ the same terms as the Perl 5 programming language system itself.
diff --cc README.mkdn
index 0000000,3ed5fb1..2e1cc52
mode 000000,100644..100644
--- a/README.mkdn
+++ b/README.mkdn
@@@ -1,0 -1,125 +1,125 @@@
+ # NAME
+
+ Dancer::Plugin::REST - A plugin for writing RESTful apps with Dancer
+
+ # VERSION
+
-version 0.09
++version 0.10
+
+ # DESCRIPTION
+
+ This plugin helps you write a RESTful webservice with Dancer.
+
+ # SYNOPSYS
+
+ package MyWebService;
+
+ use Dancer;
+ use Dancer::Plugin::REST;
+
+ prepare_serializer_for_format;
+
+ get '/user/:id.:format' => sub {
+ User->find(params->{id});
+ };
+
+ # curl http://mywebservice/user/42.json
+ { "id": 42, "name": "John Foo", email: "john.foo at example.com"}
+
+ # curl http://mywebservice/user/42.yml
+ --
+ id: 42
+ name: "John Foo"
+ email: "john.foo at example.com"
+
+ # KEYWORDS
+
+ ## prepare\_serializer\_for\_format
+
+ When this pragma is used, a before filter is set by the plugin to automatically
+ change the serializer when a format is detected in the URI.
+
+ That means that each route you define with a __:format__ token will trigger a
+ serializer definition, if the format is known.
+
+ This lets you define all the REST actions you like as regular Dancer route
+ handlers, without explicitly handling the outgoing data format.
+
+ ## resource
+
+ This keyword lets you declare a resource your application will handle.
+
+ resource user =>
+ get => sub { # return user where id = params->{id} },
+ create => sub { # create a new user with params->{user} },
+ delete => sub { # delete user where id = params->{id} },
+ update => sub { # update user with params->{user} };
+
+ # this defines the following routes:
+ # GET /user/:id
+ # GET /user/:id.:format
+ # POST /user
+ # POST /user.:format
+ # DELETE /user/:id
+ # DELETE /user/:id.:format
+ # PUT /user/:id
+ # PUT /user/:id.:format
+
+ ## helpers
+
+ Some helpers are available. This helper will set an appropriate HTTP status for you.
+
+ ### status\_ok
+
+ status_ok({users => {...}});
+
+ Set the HTTP status to 200
+
+ ### status\_created
+
+ status_created({users => {...}});
+
+ Set the HTTP status to 201
+
+ ### status\_accepted
+
+ status_accepted({users => {...}});
+
+ Set the HTTP status to 202
+
+ ### status\_bad\_request
+
+ status_bad_request("user foo can't be found");
+
+ Set the HTTP status to 400. This function as for argument a scalar that will be used under the key __error__.
+
+ ### status\_not\_found
+
+ status_not_found("users doesn't exists");
+
+ Set the HTTP status to 404. This function as for argument a scalar that will be used under the key __error__.
+
+ # LICENCE
+
+ This module is released under the same terms as Perl itself.
+
+ # AUTHORS
+
+ This module has been written by Alexis Sukrieh `<sukria at sukria.net>` and Franck
+ Cuny.
+
+ # SEE ALSO
+
+ [Dancer](https://metacpan.org/pod/Dancer) [http://en.wikipedia.org/wiki/Representational\_State\_Transfer](http://en.wikipedia.org/wiki/Representational_State_Transfer)
+
+ # AUTHORS
+
+ - Alexis Sukrieh <sukria at sukria.net>
+ - Franck Cuny <franckc at cpan.org>
+
+ # COPYRIGHT AND LICENSE
+
+ This software is copyright (c) 2010 by Alexis Sukrieh.
+
+ This is free software; you can redistribute it and/or modify it under
+ the same terms as the Perl 5 programming language system itself.
diff --cc lib/Dancer/Plugin/REST.pm
index bdcc606,623270a..4d07878
--- a/lib/Dancer/Plugin/REST.pm
+++ b/lib/Dancer/Plugin/REST.pm
@@@ -1,6 -1,9 +1,9 @@@
package Dancer::Plugin::REST;
+ BEGIN {
+ $Dancer::Plugin::REST::AUTHORITY = 'cpan:SUKRIA';
+ }
# ABSTRACT: A plugin for writing RESTful apps with Dancer
-
-$Dancer::Plugin::REST::VERSION = '0.09';
++$Dancer::Plugin::REST::VERSION = '0.10';
use strict;
use warnings;
@@@ -181,6 -183,20 +185,20 @@@ __END_
=pod
+ =encoding UTF-8
+
+ =head1 NAME
+
+ Dancer::Plugin::REST - A plugin for writing RESTful apps with Dancer
+
+ =head1 VERSION
+
-version 0.09
++version 0.10
+
+ =head1 DESCRIPTION
+
+ This plugin helps you write a RESTful webservice with Dancer.
+
=head1 SYNOPSYS
package MyWebService;
diff --cc t/000-report-versions-tiny.t
index 0000000,c2e1de0..68e68a3
mode 000000,100644..100644
--- a/t/000-report-versions-tiny.t
+++ b/t/000-report-versions-tiny.t
@@@ -1,0 -1,82 +1,82 @@@
+ use strict;
+ use warnings;
+ use Test::More 0.88;
+ # This is a relatively nice way to avoid Test::NoWarnings breaking our
+ # expectations by adding extra tests, without using no_plan. It also helps
+ # avoid any other test module that feels introducing random tests, or even
+ # test plans, is a nice idea.
+ our $success = 0;
+ END { $success && done_testing; }
+
+ # List our own version used to generate this
+ my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n";
+
+ eval { # no excuses!
+ # report our Perl details
+ my $want = '5.006';
+ $v .= "perl: $] (wanted $want) on $^O from $^X\n\n";
+ };
+ defined($@) and diag("$@");
+
+ # Now, our module version dependencies:
+ sub pmver {
+ my ($module, $wanted) = @_;
+ $wanted = " (want $wanted)";
+ my $pmver;
+ eval "require $module;";
+ if ($@) {
+ if ($@ =~ m/Can't locate .* in \@INC/) {
+ $pmver = 'module not found.';
+ } else {
+ diag("${module}: $@");
+ $pmver = 'died during require.';
+ }
+ } else {
+ my $version;
+ eval { $version = $module->VERSION; };
+ if ($@) {
+ diag("${module}: $@");
+ $pmver = 'died during VERSION check.';
+ } elsif (defined $version) {
+ $pmver = "$version";
+ } else {
+ $pmver = '<undef>';
+ }
+ }
+
+ # So, we should be good, right?
+ return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n");
+ }
+
+ eval { $v .= pmver('Carp','any version') };
-eval { $v .= pmver('Dancer','any version') };
++eval { $v .= pmver('Dancer','1.3111') };
+ eval { $v .= pmver('Dancer::ModuleLoader','any version') };
+ eval { $v .= pmver('Dancer::Plugin','any version') };
+ eval { $v .= pmver('Dancer::Test','any version') };
+ eval { $v .= pmver('File::Spec','any version') };
+ eval { $v .= pmver('HTTP::Headers','any version') };
+ eval { $v .= pmver('IO::Handle','any version') };
+ eval { $v .= pmver('IPC::Open3','any version') };
+ eval { $v .= pmver('Module::Build','0.3601') };
+ eval { $v .= pmver('Test::More','0.88') };
+ eval { $v .= pmver('strict','any version') };
+ eval { $v .= pmver('warnings','any version') };
+
+
+ # All done.
+ $v .= <<'EOT';
+
+ Thanks for using my code. I hope it works for you.
+ If not, please try and include this output in the bug report.
+ That will help me reproduce the issue and solve your problem.
+
+ EOT
+
+ diag($v);
+ ok(1, "we really didn't test anything, just reporting data");
+ $success = 1;
+
+ # Work around another nasty module on CPAN. :/
+ no warnings 'once';
+ $Template::Test::NO_FLUSH = 1;
+ exit 0;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdancer-plugin-rest-perl.git
More information about the Pkg-perl-cvs-commits
mailing list