From 0b5d4e4614a618d2ecac066279c53c8f89e341d3 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 26 Aug 2010 14:39:13 -0700 Subject: [PATCH] Write a bunch of POD for modules that don't have it. --- lib/WebGUI/Middleware/HTTPExceptions.pm | 13 ++++++++++++- lib/WebGUI/Middleware/Maintenance.pm | 10 ++++++++-- lib/WebGUI/Middleware/Session.pm | 19 +++++++++++++++++++ lib/WebGUI/Middleware/Snoop.pm | 10 +++++++++- lib/WebGUI/Middleware/WGAccess.pm | 8 ++++++++ lib/WebGUI/Session/Response.pm | 10 +++++++++- 6 files changed, 65 insertions(+), 5 deletions(-) diff --git a/lib/WebGUI/Middleware/HTTPExceptions.pm b/lib/WebGUI/Middleware/HTTPExceptions.pm index 132747452..c6b8192c5 100644 --- a/lib/WebGUI/Middleware/HTTPExceptions.pm +++ b/lib/WebGUI/Middleware/HTTPExceptions.pm @@ -18,6 +18,17 @@ use Try::Tiny; use Scalar::Util 'blessed'; use HTTP::Status (); +=head2 transform_error ($env) + +Transforms exceptions of the class WebGUI::Error::Fatal into HTTP 500 error messages, displaying +the contents of the exception to the user. + +=head3 $env + +A Plack environment hash + +=cut + sub transform_error { my $self = shift; my ($e, $env) = @_; @@ -33,4 +44,4 @@ sub transform_error { } } -1; \ No newline at end of file +1; diff --git a/lib/WebGUI/Middleware/Maintenance.pm b/lib/WebGUI/Middleware/Maintenance.pm index f994a7c0b..86035e8b3 100644 --- a/lib/WebGUI/Middleware/Maintenance.pm +++ b/lib/WebGUI/Middleware/Maintenance.pm @@ -38,9 +38,15 @@ These subroutines are available from this package: #------------------------------------------------------------------- -=head2 handler ( session ) +=head2 call ( $env ) -The content handler for this package. +Interface method for this middleware. It checks the settings for the special entry, upgradeState. +If this is set, then it returns an HTTP 503. It will also clear the maintenance state when the +upgrade is complete. + +=head3 $env + +A Plack environment hash. This is used to access the WebGUI Session object. =cut diff --git a/lib/WebGUI/Middleware/Session.pm b/lib/WebGUI/Middleware/Session.pm index 3b1e0d768..9ff4d7ca7 100644 --- a/lib/WebGUI/Middleware/Session.pm +++ b/lib/WebGUI/Middleware/Session.pm @@ -24,6 +24,14 @@ and not worry about closing it. It also sets C as appropriate. +=head2 call ($env) + +Interface method for this Middleware class. + +=head3 $env + +A plack environment hash + =cut sub call { @@ -77,6 +85,17 @@ sub call { ); } +=head2 canShowDebug ($env) + +Checks to see whether or not the owner of this session can see debug output. It checks +WebGUI settings showDebug and ipDebug for this. + +=head3 $env + +A Plack environment hash. + +=cut + sub canShowDebug { my $self = shift; my $env = shift; diff --git a/lib/WebGUI/Middleware/Snoop.pm b/lib/WebGUI/Middleware/Snoop.pm index ec88ae9ff..4ad6e2b82 100644 --- a/lib/WebGUI/Middleware/Snoop.pm +++ b/lib/WebGUI/Middleware/Snoop.pm @@ -16,6 +16,14 @@ L described itself as "A URL handler that should never be ca You might find this middleware useful as a template for creating other simple classes. +=head2 call ($env) + +Interface method for Plack to call, for this class. + +=head3 $env + +A Plack environment hash + =cut sub call { @@ -31,4 +39,4 @@ sub call { } } -1; \ No newline at end of file +1; diff --git a/lib/WebGUI/Middleware/WGAccess.pm b/lib/WebGUI/Middleware/WGAccess.pm index 74e23c169..0cbb40b0f 100644 --- a/lib/WebGUI/Middleware/WGAccess.pm +++ b/lib/WebGUI/Middleware/WGAccess.pm @@ -17,6 +17,14 @@ awareness. This middleware should really only be used in development, for production you want to be serving static files with something a lot faster. +=head2 call ($env) + +Interface subroutine to implement the privilege checks inside the WGaccess files. + +=head3 $env + +A Plack environment hash + =cut sub call { diff --git a/lib/WebGUI/Session/Response.pm b/lib/WebGUI/Session/Response.pm index f94b196e9..5af0d5d79 100644 --- a/lib/WebGUI/Session/Response.pm +++ b/lib/WebGUI/Session/Response.pm @@ -18,12 +18,20 @@ is created. =cut +=head2 stream + +=cut + sub stream { my $self = shift; $self->streamer(shift); $self->streaming(1); } +=head2 stream_write + +=cut + sub stream_write { my $self = shift; if (!$self->streaming) { @@ -33,4 +41,4 @@ sub stream_write { $self->writer->write(@_); } -1; \ No newline at end of file +1;