File Coverage

blib/lib/Dancer2/Plugin/Syntax/GetPost.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 18 100.0


line stmt bran cond sub pod time code
1 1     1   487237 use 5.008001;
  1         4  
2 1     1   5 use strict;
  1         9  
  1         25  
3 1     1   5 use warnings;
  1         2  
  1         63  
4              
5             package Dancer2::Plugin::Syntax::GetPost;
6             # ABSTRACT: Syntactic sugar for GET+POST handlers
7             our $VERSION = '0.002'; # VERSION
8              
9 1     1   780 use Dancer2::Plugin;
  1         2447  
  1         7  
10              
11             register get_post => sub {
12 1     1   34 my ( $dsl, @args ) = @_;
13 1         24 $dsl->any( [qw/get post/] => @args );
14             };
15              
16             register_plugin for_versions => [ 2 ];
17              
18             1;
19              
20              
21             # vim: ts=2 sts=2 sw=2 et:
22              
23             __END__
24              
25             =pod
26              
27             =head1 NAME
28              
29             Dancer2::Plugin::Syntax::GetPost - Syntactic sugar for GET+POST handlers
30              
31             =head1 VERSION
32              
33             version 0.002
34              
35             =head1 SYNOPSIS
36              
37             use Dancer2::Plugin::Syntax::GetPost;
38              
39             get_post '/myform' => sub { ... };
40              
41             =head1 DESCRIPTION
42              
43             This module provides very simple syntactic sugar to define a handler for GET and
44             POST requests. Instead of writing this:
45              
46             any [qw/get post/] => '/form' => sub { ... };
47              
48             You can write just this:
49              
50             get_post '/form' => sub { ... };
51              
52             =for Pod::Coverage method_names_here
53              
54             =head1 SEE ALSO
55              
56             =over 4
57              
58             =item *
59              
60             L<Dancer2>
61              
62             =back
63              
64             =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
65              
66             =head1 SUPPORT
67              
68             =head2 Bugs / Feature Requests
69              
70             Please report any bugs or feature requests through the issue tracker
71             at L<https://github.com/dagolden/dancer2-plugin-syntax-getpost/issues>.
72             You will be notified automatically of any progress on your issue.
73              
74             =head2 Source Code
75              
76             This is open source software. The code repository is available for
77             public review and contribution under the terms of the license.
78              
79             L<https://github.com/dagolden/dancer2-plugin-syntax-getpost>
80              
81             git clone git://github.com/dagolden/dancer2-plugin-syntax-getpost.git
82              
83             =head1 AUTHOR
84              
85             David Golden <dagolden@cpan.org>
86              
87             =head1 COPYRIGHT AND LICENSE
88              
89             This software is Copyright (c) 2012 by David Golden.
90              
91             This is free software, licensed under:
92              
93             The Apache License, Version 2.0, January 2004
94              
95             =cut