Permalink
Browse files

pod coverage

  • Loading branch information...
1 parent de3e165 commit b3f4b0df1917835de52dbfca4c347662a793a1ec Zbigniew Lukasiak committed Sep 10, 2010
Showing with 54 additions and 77 deletions.
  1. +13 −69 lib/WebNano.pm
  2. +8 −8 lib/WebNano/Controller.pm
  3. +4 −0 lib/WebNano/FindController.pm
  4. +29 −0 lib/WebNano/Renderer/TTiny.pm
View
82 lib/WebNano.pm
@@ -60,8 +60,7 @@ __END__
=head1 NAME
-WebNano - Really minimalistic PSGI based web framework
-
+WebNano - A minimalistic PSGI based web framework
=head1 VERSION
@@ -131,6 +130,17 @@ See for example the streaming_action method in t/lib/MyApp/Controller.pm.
This is a method which returns a subroutine reference suitable for PSGI.
The returned subrourine ref is a closure over the application object.
+=head2 controller_search_path
+
+Experimental.
+
+=head2 handle
+
+Application method that acts as the PSGI callback - takes environment
+as input and returns the response.
+
+=head2 renderer
+
=head1 DIAGNOSTICS
=for author to fill in:
@@ -153,53 +163,16 @@ The returned subrourine ref is a closure over the application object.
=back
-
-=head1 CONFIGURATION AND ENVIRONMENT
-
-=for author to fill in:
- A full explanation of any configuration system(s) used by the
- module, including the names and locations of any configuration
- files, and the meaning of any environment variables or properties
- that can be set. These descriptions must also include details of any
- configuration language used.
-
-WebNano requires no configuration files or environment variables.
-
-
=head1 DEPENDENCIES
-=for author to fill in:
- A list of all the other modules that this module relies upon,
- including any restrictions on versions, and an indication whether
- the module is part of the standard Perl distribution, part of the
- module's distribution, or must be installed separately. ]
-
-None.
-
+See Makefile.PL
=head1 INCOMPATIBILITIES
-=for author to fill in:
- A list of any modules that this module cannot be used in conjunction
- with. This may be due to name conflicts in the interface, or
- competition for system or program resources, or due to internal
- limitations of Perl (for example, many modules that use source code
- filters are mutually incompatible).
-
None reported.
-
=head1 BUGS AND LIMITATIONS
-=for author to fill in:
- A list of known problems with the module, together with some
- indication Whether they are likely to be fixed in an upcoming
- release. Also a list of restrictions on the features the module
- does provide: data types that cannot be handled, performance issues
- and the circumstances in which they may arise, practical
- limitations on the size of data sets, special cases that are not
- (yet) handled, etc.
-
No bugs have been reported.
Please report any bugs or feature requests to
@@ -212,33 +185,4 @@ L<http://rt.cpan.org>.
Zbigniew Lukasiak C<< <zby@cpan.org> >>
-=head1 LICENCE AND COPYRIGHT
-
-Copyright (c) 2009, Zbigniew Lukasiak C<< <zby@cpan.org> >>. All rights reserved.
-
-This module is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself. See L<perlartistic>.
-
-
-=head1 DISCLAIMER OF WARRANTY
-
-BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
-EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
-ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
-YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
-NECESSARY SERVICING, REPAIR, OR CORRECTION.
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
-LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
-OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
-THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
View
16 lib/WebNano/Controller.pm
@@ -26,20 +26,20 @@ sub render {
return $self->application->renderer->render( c => $self, @_ );
}
-sub self_path{
+sub _self_path{
my $self = shift;
my $path = ref $self;
$path =~ s/.*::Controller(?=(::|$))//;
$path =~ s{::}{/};
return $path . '/';
}
-sub external_dispatch {
+sub _external_dispatch {
my ( $self, $path ) = @_;
my( $path_part, $new_path ) = ( $path =~ qr{^([^/]*)/?(.*)} );
$path_part =~ s/::|'//g if defined( $path_part );
return if !length( $path_part );
- my $controller_class = $self->find_nested( $self->self_path . $path_part, $self->application->controller_search_path );
+ my $controller_class = $self->find_nested( $self->_self_path . $path_part, $self->application->controller_search_path );
return if !$controller_class;
return $controller_class->handle(
path => $new_path,
@@ -75,7 +75,7 @@ sub handle {
my $self = $class->new( %args );
my $out = $self->local_dispatch( $path );
return $out if defined $out;
- return $self->external_dispatch( $path );
+ return $self->_external_dispatch( $path );
};
1;
@@ -130,10 +130,6 @@ Dispatches the request to the action methods as described above.
Should return a Plack::Response object, a string containing the HTML page, a code ref
or undef (which is later interpreted as 404).
-=head2 controller_for
-
-Finds a next controller to forward to according to the path.
-
=head2 render
Renders a template.
@@ -142,6 +138,10 @@ Renders a template.
Finds the method to be called for a path and dispatches to it.
+=head2 request
+
+=head2 template_search_path
+
=head1 ATTRIBUTES
=head2 url_map
View
4 lib/WebNano/FindController.pm
@@ -32,3 +32,7 @@ sub find_nested {
1;
+__END__
+
+=head2 find_nested
+
View
29 lib/WebNano/Renderer/TTiny.pm
@@ -88,3 +88,32 @@ sub render {
1;
+__END__
+
+=head1 NAME
+
+WebNano::Renderer::TTiny - Template::Tiny renderer for WebNano
+
+=head1 SYNOPSIS
+
+see t/renderer.t
+
+=head1 ATTRIBUTES and METHODS
+
+=head2 render
+
+=head2 INCLUDE_PATH
+
+Global list of template search directories.
+
+=head2 root
+
+List of directories that are dynamically concatenated with controller names to form
+a dynamic search list of template directories.
+
+You can use INCLUDE_PATH or root or both.
+
+=head2 TEMPLATE_EXTENSION
+
+Postfix added to action name to form the template name ( for example 'edit.tt' from 'edit' + '.tt' ).
+

0 comments on commit b3f4b0d

Please sign in to comment.