From: Dan Dascalescu Date: Thu, 11 Jun 2009 07:27:56 +0000 (+0000) Subject: Cosmetic: removed trailing whitespace X-Git-Tag: 5.80006~56 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=b0ad47c12a21862b08d8e2942095065ac2f7edf2 Cosmetic: removed trailing whitespace --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index ce492cb..dbc5fdf 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -2504,7 +2504,7 @@ the plugin name does not begin with C. $plugins ||= []; my @plugins = map { s/\A\+// ? $_ : "Catalyst::Plugin::$_" } @$plugins; - + for my $plugin ( reverse @plugins ) { Class::MOP::load_class($plugin); my $meta = find_meta($plugin); @@ -2518,7 +2518,7 @@ the plugin name does not begin with C. grep { $_ && blessed($_) && $_->isa('Moose::Meta::Role') } map { find_meta($_) } @plugins; - + Moose::Util::apply_all_roles( $class => @roles ) if @roles; diff --git a/lib/Catalyst/ClassData.pm b/lib/Catalyst/ClassData.pm index fd6cd82..f252f05 100644 --- a/lib/Catalyst/ClassData.pm +++ b/lib/Catalyst/ClassData.pm @@ -13,7 +13,7 @@ sub mk_classdata { my $slot = '$'.$attribute; my $accessor = sub { my $pkg = ref $_[0] || $_[0]; - my $meta = Moose::Util::find_meta($pkg) + my $meta = Moose::Util::find_meta($pkg) || Moose::Meta::Class->initialize( $pkg ); if (@_ > 1) { $meta->namespace->{$attribute} = \$_[1]; diff --git a/lib/Catalyst/Component/ApplicationAttribute.pm b/lib/Catalyst/Component/ApplicationAttribute.pm index 3f041d1..bf86bed 100644 --- a/lib/Catalyst/Component/ApplicationAttribute.pm +++ b/lib/Catalyst/Component/ApplicationAttribute.pm @@ -31,9 +31,9 @@ Catalyst::Component::ApplicationAttribute - Moose Role for components which capt use Moose; extends 'Catalyst::Component'; with 'Catalyst::Component::ApplicationAttribute'; - + # Your code here - + 1; =head1 DESCRIPTION diff --git a/lib/Catalyst/DispatchType.pm b/lib/Catalyst/DispatchType.pm index 67be7b2..75de1c5 100644 --- a/lib/Catalyst/DispatchType.pm +++ b/lib/Catalyst/DispatchType.pm @@ -44,7 +44,7 @@ sub match { die "Abstract method!" } =head2 $self->register( $c, $action ) abstract method, to be implemented by dispatchtypes. Takes a -context object and a L object. +context object and a L object. Should return true if it registers something, or false otherwise. diff --git a/lib/Catalyst/DispatchType/Chained.pm b/lib/Catalyst/DispatchType/Chained.pm index 8549f06..94a8a4c 100644 --- a/lib/Catalyst/DispatchType/Chained.pm +++ b/lib/Catalyst/DispatchType/Chained.pm @@ -238,7 +238,7 @@ sub recurse_match { # No best action currently # OR This one matches with fewer parts left than the current best action, # And therefore is a better match - # OR No parts and this expects 0 + # OR No parts and this expects 0 # The current best action might also be Args(0), # but we couldn't chose between then anyway so we'll take the last seen @@ -376,7 +376,7 @@ sub uri_for_action { =head2 $c->expand_action($action) -Return a list of actions that represents a chained action. See +Return a list of actions that represents a chained action. See L for more info. You probably want to use the expand_action it provides rather than this directly. @@ -559,7 +559,7 @@ this debugging output: '-----------------------+------------------------------' ... -Here's a more detailed specification of the attributes belonging to +Here's a more detailed specification of the attributes belonging to C<:Chained>: =head2 Attributes diff --git a/lib/Catalyst/DispatchType/Path.pm b/lib/Catalyst/DispatchType/Path.pm index 56c1083..6be3893 100644 --- a/lib/Catalyst/DispatchType/Path.pm +++ b/lib/Catalyst/DispatchType/Path.pm @@ -49,7 +49,7 @@ Debug output for Path dispatch points sub list { my ( $self, $c ) = @_; my $column_width = Catalyst::Utils::term_width() - 35 - 9; - my $paths = Text::SimpleTable->new( + my $paths = Text::SimpleTable->new( [ 35, 'Path' ], [ $column_width, 'Private' ] ); foreach my $path ( sort keys %{ $self->_paths } ) { diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 91ee0c6..3a97c87 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -61,7 +61,7 @@ application based on the attributes you set. =head1 METHODS -=head2 new +=head2 new Construct a new dispatcher. @@ -411,7 +411,7 @@ sub get_action { return $self->_action_hash->{"${namespace}/${name}"}; } -=head2 $self->get_action_by_path( $path ); +=head2 $self->get_action_by_path( $path ); Returns the named action by its full private path. @@ -661,7 +661,7 @@ sub _load_dispatch_types { Get the DispatchType object of the relevant type, i.e. passing C<$type> of C would return a L object (assuming -of course it's being used.) +of course it's being used.) =cut @@ -692,12 +692,12 @@ use Moose; # See also t/lib/TestApp/Plugin/AddDispatchTypes.pm # Alias _method_name to method_name, add a before modifier to warn.. -foreach my $public_method_name (qw/ - tree - dispatch_types - registered_dispatch_types - method_action_class - action_hash +foreach my $public_method_name (qw/ + tree + dispatch_types + registered_dispatch_types + method_action_class + action_hash container_hash /) { my $private_method_name = '_' . $public_method_name; diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index d66bb5d..b9ec98a 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -248,7 +248,7 @@ EOF } /* from http://users.tkk.fi/~tkarvine/linux/doc/pre-wrap/pre-wrap-css3-mozilla-opera-ie.html */ /* Browser specific (not valid) styles to make preformatted text wrap */ - pre { + pre { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ @@ -323,7 +323,7 @@ sub prepare_body { $request->_body->tmpdir( $c->config->{uploadtmp} ) if exists $c->config->{uploadtmp}; } - + while ( my $buffer = $self->read($c) ) { $c->prepare_body_chunk($buffer); } @@ -356,15 +356,15 @@ sub prepare_body_chunk { =head2 $self->prepare_body_parameters($c) -Sets up parameters from body. +Sets up parameters from body. =cut sub prepare_body_parameters { my ( $self, $c ) = @_; - + return unless $c->request->_body; - + $c->request->body_parameters( $c->request->_body->param ); } @@ -444,7 +444,7 @@ process the query string and extract query parameters. sub prepare_query_parameters { my ( $self, $c, $query_string ) = @_; - + # Check for keywords (no = signs) # (yes, index() is faster than a regex :)) if ( index( $query_string, '=' ) < 0 ) { @@ -456,17 +456,17 @@ sub prepare_query_parameters { # replace semi-colons $query_string =~ s/;/&/g; - + my @params = grep { length $_ } split /&/, $query_string; for my $item ( @params ) { - - my ($param, $value) + + my ($param, $value) = map { $self->unescape_uri($_) } split( /=/, $item, 2 ); - + $param = $self->unescape_uri($item) unless defined $param; - + if ( exists $query{$param} ) { if ( ref $query{$param} ) { push @{ $query{$param} }, $value; @@ -494,7 +494,7 @@ sub prepare_read { # Initialize the read position $self->read_position(0); - + # Initialize the amount of data we think we need to read $self->read_length( $c->request->header('Content-Length') || 0 ); } @@ -628,17 +628,17 @@ sub write { $self->prepare_write($c); $self->_prepared_write(1); } - + return 0 if !defined $buffer; - + my $len = length($buffer); my $wrote = syswrite STDOUT, $buffer; - + if ( !defined $wrote && $! == EWOULDBLOCK ) { # Unable to write on the first try, will retry in the loop below $wrote = 0; } - + if ( defined $wrote && $wrote < $len ) { # We didn't write the whole buffer while (1) { @@ -650,11 +650,11 @@ sub write { next if $! == EWOULDBLOCK; return; } - + last if $wrote >= $len; } } - + return $wrote; } diff --git a/lib/Catalyst/Engine/CGI.pm b/lib/Catalyst/Engine/CGI.pm index fa32902..48dc201 100644 --- a/lib/Catalyst/Engine/CGI.pm +++ b/lib/Catalyst/Engine/CGI.pm @@ -139,21 +139,21 @@ sub prepare_path { # set the request URI my $path = $base_path . ( $ENV{PATH_INFO} || '' ); $path =~ s{^/+}{}; - + # Using URI directly is way too slow, so we construct the URLs manually my $uri_class = "URI::$scheme"; - + # HTTP_HOST will include the port even if it's 80/443 $host =~ s/:(?:80|443)$//; - + if ( $port !~ /^(?:80|443)$/ && $host !~ /:/ ) { $host .= ":$port"; } - + # Escape the path $path =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go; $path =~ s/\?/%3F/g; # STUPID STUPID SPECIAL CASE - + my $query = $ENV{QUERY_STRING} ? '?' . $ENV{QUERY_STRING} : ''; my $uri = $scheme . '://' . $host . '/' . $path . $query; @@ -162,7 +162,7 @@ sub prepare_path { # set the base URI # base must end in a slash $base_path .= '/' unless $base_path =~ m{/$}; - + my $base_uri = $scheme . '://' . $host . $base_path; $c->request->base( bless \$base_uri, $uri_class ); diff --git a/lib/Catalyst/Engine/FastCGI.pm b/lib/Catalyst/Engine/FastCGI.pm index d8f21dd..125a762 100644 --- a/lib/Catalyst/Engine/FastCGI.pm +++ b/lib/Catalyst/Engine/FastCGI.pm @@ -20,7 +20,7 @@ This is the FastCGI engine. This class overloads some methods from C. =head2 $self->run($c, $listen, { option => value, ... }) - + Starts the FastCGI server. If C<$listen> is set, then it specifies a location to listen for FastCGI requests; @@ -64,7 +64,7 @@ Specify a filename for the pid file Specify a FCGI::ProcManager sub-class -=item detach +=item detach Detach from console @@ -161,11 +161,11 @@ sub write { $self->prepare_write($c); $self->_prepared_write(1); } - + # XXX: We can't use Engine's write() method because syswrite # appears to return bogus values instead of the number of bytes # written: http://www.fastcgi.com/om_archive/mail-archive/0128.html - + # Prepend the headers if they have not yet been sent if ( $self->_has_header_buf ) { $buffer = $self->_clear_header_buf . $buffer; @@ -220,7 +220,7 @@ sub _fix_env my $self = shift; my $env = shift; - # we are gonna add variables from current system environment %ENV to %env + # we are gonna add variables from current system environment %ENV to %env # that contains at this moment just variables taken from FastCGI request foreach my $k (keys(%ENV)) { $env->{$k} = $ENV{$k} unless defined($env->{$k}); @@ -259,7 +259,7 @@ __END__ =head2 Standalone FastCGI Server -In server mode the application runs as a standalone server and accepts +In server mode the application runs as a standalone server and accepts connections from a web server. The application can be on the same machine as the web server, on a remote machine, or even on multiple remote machines. Advantages of this method include running the Catalyst application as a @@ -270,14 +270,14 @@ To start your application in server mode, install the FCGI::ProcManager module and then use the included fastcgi.pl script. $ script/myapp_fastcgi.pl -l /tmp/myapp.socket -n 5 - + Command line options for fastcgi.pl include: -d -daemon Daemonize the server. -p -pidfile Write a pidfile with the pid of the process manager. -l -listen Listen on a socket path, hostname:port, or :port. -n -nproc The number of processes started to handle requests. - + See below for the specific web server configurations for using the external server. @@ -286,20 +286,20 @@ server. Apache requires the mod_fastcgi module. The same module supports both Apache 1 and 2. -There are three ways to run your application under FastCGI on Apache: server, +There are three ways to run your application under FastCGI on Apache: server, static, and dynamic. =head3 Standalone server mode FastCgiExternalServer /tmp/myapp.fcgi -socket /tmp/myapp.socket Alias /myapp/ /tmp/myapp/myapp.fcgi/ - + # Or, run at the root Alias / /tmp/myapp.fcgi/ - + # Optionally, rewrite the path when accessed without a trailing slash RewriteRule ^/myapp$ myapp/ [R] - + The FastCgiExternalServer directive tells Apache that when serving /tmp/myapp to use the FastCGI application listenting on the socket @@ -308,7 +308,7 @@ it's a virtual file name. With some versions of C or C, you can use any name you like, but some require that the virtual filename end in C<.fcgi>. -It's likely that Apache is not configured to serve files in /tmp, so the +It's likely that Apache is not configured to serve files in /tmp, so the Alias directive maps the url path /myapp/ to the (virtual) file that runs the FastCGI application. The trailing slashes are important as their use will correctly set the PATH_INFO environment variable used by Catalyst to @@ -326,14 +326,14 @@ FastCGI script to run your application. FastCgiServer /path/to/myapp/script/myapp_fastcgi.pl -processes 3 Alias /myapp/ /path/to/myapp/script/myapp_fastcgi.pl/ - + FastCgiServer tells Apache to start three processes of your application at startup. The Alias command maps a path to the FastCGI application. Again, the trailing slashes are important. - + =head3 Dynamic mode -In FastCGI dynamic mode, Apache will run your application on demand, +In FastCGI dynamic mode, Apache will run your application on demand, typically by requesting a file with a specific extension (e.g. .fcgi). ISPs often use this type of setup to provide FastCGI support to many customers. @@ -365,7 +365,7 @@ Here is a complete example: Then a request for /script/myapp_fastcgi.pl will run the application. - + For more information on using FastCGI under Apache, visit L @@ -399,7 +399,7 @@ These configurations were tested with Lighttpd 1.4.7. =head3 Static mode server.document-root = "/var/www/MyApp/root" - + fastcgi.server = ( "" => ( "MyApp" => ( @@ -412,12 +412,12 @@ These configurations were tested with Lighttpd 1.4.7. ) ) ) - + Note that in newer versions of lighttpd, the min-procs and idle-timeout values are disabled. The above example would start 5 processes. =head3 Non-root configuration - + You can also run your application at any non-root location with either of the above modes. Note the required mod_rewrite rule. @@ -435,11 +435,11 @@ L =head2 Microsoft IIS -It is possible to run Catalyst under IIS with FastCGI, but only on IIS 6.0 +It is possible to run Catalyst under IIS with FastCGI, but only on IIS 6.0 (Microsoft Windows 2003), IIS 7.0 (Microsoft Windows 2008 and Vista) and hopefully its successors. -Even if it is declared that FastCGI is supported on IIS 5.1 (Windows XP) it +Even if it is declared that FastCGI is supported on IIS 5.1 (Windows XP) it does not support some features (specifically: wildcard mappings) that prevents running Catalyst application. @@ -457,18 +457,18 @@ Let us assume that our server has the following layout: FastCGI is not a standard part of IIS 6 - you have to install it separately. For more info and download go to L. Choose -approptiate version (32-bit/64-bit), installation is quite simple +approptiate version (32-bit/64-bit), installation is quite simple (in fact no questions, no options). =item Create a new website -Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager". +Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager". Click "Action" > "New" > "Web Site". After you finish the installation wizard -you need to go to the new website's properties. +you need to go to the new website's properties. =item Set website properties -On tab "Web site" set proper values for: +On tab "Web site" set proper values for: Site Description, IP Address, TCP Port, SSL Port etc. On tab "Home Directory" set the following: @@ -477,7 +477,7 @@ On tab "Home Directory" set the following: Local path permission flags: check only "Read" + "Log visits" Execute permitions: "Scripts only" -Click "Configuration" button (still on Home Directory tab) then click "Insert" +Click "Configuration" button (still on Home Directory tab) then click "Insert" the wildcard application mapping and in the next dialog set: Executable: "c:\windows\system32\inetsrv\fcgiext.dll" @@ -487,7 +487,7 @@ Close all dialogs with "OK". =item Edit fcgiext.ini -Put the following lines into c:\windows\system32\inetsrv\fcgiext.ini (on 64-bit +Put the following lines into c:\windows\system32\inetsrv\fcgiext.ini (on 64-bit system c:\windows\syswow64\inetsrv\fcgiext.ini): [Types] @@ -498,19 +498,19 @@ system c:\windows\syswow64\inetsrv\fcgiext.ini): ; to list websites: "cscript adsutil.vbs ENUM /P /W3SVC" ; to get site name: "cscript adsutil.vbs GET /W3SVC//ServerComment" ; to get all details: "cscript adsutil.vbs GET /W3SVC/" - ; - or look where are the logs located: - ; c:\WINDOWS\SYSTEM32\Logfiles\W3SVC7\whatever.log + ; - or look where are the logs located: + ; c:\WINDOWS\SYSTEM32\Logfiles\W3SVC7\whatever.log ; means that the corresponding number is "7" - ;if you are running just one website using FastCGI you can use '*=CatalystApp' + ;if you are running just one website using FastCGI you can use '*=CatalystApp' [CatalystApp] ExePath=d:\strawberry\perl\bin\perl.exe Arguments="d:\WWW\WebApp\script\webapp_fastcgi.pl -e" - ;by setting this you can instruct IIS to serve Catalyst static files + ;by setting this you can instruct IIS to serve Catalyst static files ;directly not via FastCGI (in case of any problems try 1) IgnoreExistingFiles=0 - + ;do not be fooled by Microsoft doc talking about "IgnoreExistingDirectories" ;that does not work and use "IgnoreDirectories" instead IgnoreDirectories=1 @@ -527,22 +527,22 @@ any addons. =item Necessary steps during IIS7 installation During IIS7 installation after you have added role "Web Server (IIS)" -you need to check to install role feature "CGI" (do not be nervous that it is -not FastCGI). If you already have IIS7 installed you can add "CGI" role feature -through "Control panel" > "Programs and Features". +you need to check to install role feature "CGI" (do not be nervous that it is +not FastCGI). If you already have IIS7 installed you can add "CGI" role feature +through "Control panel" > "Programs and Features". =item Create a new website -Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager" +Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager" > "Add Web Site". site name: "CatalystSite" - content directory: "d:\WWW\WebApp\root" + content directory: "d:\WWW\WebApp\root" binding: set proper IP address, port etc. =item Configure FastCGI -You can configure FastCGI extension using commandline utility +You can configure FastCGI extension using commandline utility "c:\windows\system32\inetsrv\appcmd.exe" =over 4 @@ -555,7 +555,7 @@ You can configure FastCGI extension using commandline utility appcmd.exe set config "CatalystSite" -section:system.webServer/handlers /+"[name='CatalystFastCGI',path='*',verb='GET,HEAD,POST',modules='FastCgiModule',scriptProcessor='d:\strawberry\perl\bin\perl.exe|d:\www\WebApp\script\webapp_fastcgi.pl -e',resourceType='Unspecified',requireAccess='Script']" /commit:apphost -Note: before launching the commands above do not forget to change site +Note: before launching the commands above do not forget to change site name and paths to values relevant for your server setup. =back diff --git a/lib/Catalyst/Engine/HTTP.pm b/lib/Catalyst/Engine/HTTP.pm index a41912c..d58e508 100644 --- a/lib/Catalyst/Engine/HTTP.pm +++ b/lib/Catalyst/Engine/HTTP.pm @@ -72,8 +72,8 @@ sub finalize_headers { # Should we keep the connection open? my $connection = $c->request->header('Connection'); - if ( $self->options->{keepalive} - && $connection + if ( $self->options->{keepalive} + && $connection && $connection =~ /^keep-alive$/i ) { $res_headers->header( Connection => 'keep-alive' ); @@ -116,7 +116,7 @@ before prepare_read => sub { sub read_chunk { my $self = shift; my $c = shift; - + # If we have any remaining data in the input buffer, send it back first if ( $_[0] = delete $self->{inputbuf} ) { my $read = length( $_[0] ); @@ -359,11 +359,11 @@ sub _handler { my $sel = IO::Select->new; $sel->add( \*STDIN ); - + REQUEST: while (1) { my ( $path, $query_string ) = split /\?/, $uri, 2; - + # Initialize CGI environment local %ENV = ( PATH_INFO => $path || '', @@ -390,38 +390,38 @@ sub _handler { $class->handle_request( env => \%ENV ); } - + DEBUG && warn "Request done\n"; - + # Allow keepalive requests, this is a hack but we'll support it until # the next major release. if ( $self->_is_keepalive ) { $self->_clear_keepalive; - + DEBUG && warn "Reusing previous connection for keep-alive request\n"; - - if ( $sel->can_read(1) ) { + + if ( $sel->can_read(1) ) { if ( !$self->_read_headers ) { # Error reading, give up last REQUEST; } ( $method, $uri, $protocol ) = $self->_parse_request_line; - + DEBUG && warn "Parsed request: $method $uri $protocol\n"; - + # Force HTTP/1.0 $protocol = '1.0'; - + next REQUEST; } - + DEBUG && warn "No keep-alive request within 1 second\n"; } - + last REQUEST; } - + DEBUG && warn "Closing connection\n"; close Remote; @@ -493,19 +493,19 @@ sub _parse_headers { } } $headers->push_header( $key, $val ) if $key; - + DEBUG && warn "Parsed headers: " . dump($headers) . "\n"; # Convert headers into ENV vars $headers->scan( sub { my ( $key, $val ) = @_; - + $key = uc $key; $key = 'COOKIE' if $key eq 'COOKIES'; $key =~ tr/-/_/; $key = 'HTTP_' . $key unless $key =~ m/\A(?:CONTENT_(?:LENGTH|TYPE)|COOKIE)\z/; - + if ( exists $ENV{$key} ) { $ENV{$key} .= ", $val"; } @@ -519,16 +519,16 @@ sub _socket_data { my ( $self, $handle ) = @_; my $remote_sockaddr = getpeername($handle); - my ( undef, $iaddr ) = $remote_sockaddr - ? sockaddr_in($remote_sockaddr) + my ( undef, $iaddr ) = $remote_sockaddr + ? sockaddr_in($remote_sockaddr) : (undef, undef); - + my $local_sockaddr = getsockname($handle); my ( undef, $localiaddr ) = sockaddr_in($local_sockaddr); # This mess is necessary to keep IE from crashing the server my $data = { - peeraddr => $iaddr + peeraddr => $iaddr ? ( inet_ntoa($iaddr) || '127.0.0.1' ) : '127.0.0.1', localname => gethostbyaddr( $localiaddr, AF_INET ) || 'localhost', diff --git a/lib/Catalyst/Engine/HTTP/Restarter.pm b/lib/Catalyst/Engine/HTTP/Restarter.pm index dd25edf..dfb414c 100644 --- a/lib/Catalyst/Engine/HTTP/Restarter.pm +++ b/lib/Catalyst/Engine/HTTP/Restarter.pm @@ -27,8 +27,8 @@ around run => sub { if !Catalyst::Engine::HTTP::Restarter::Watcher::DETECT_PACKAGE_COMPILATION; my $watcher = Catalyst::Engine::HTTP::Restarter::Watcher->new( - directory => ( - $options->{restart_directory} || + directory => ( + $options->{restart_directory} || File::Spec->catdir( $FindBin::Bin, '..' ) ), follow_symlinks => $options->{follow_symlinks}, diff --git a/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm b/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm index 32ee0ed..8890646 100644 --- a/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm +++ b/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm @@ -45,7 +45,7 @@ sub watch { my @changes; my @changed_files; - + my $delay = ( defined $self->delay ) ? $self->delay : 1; sleep $delay if $delay > 0; @@ -177,7 +177,7 @@ files regex => '\.yml$|\.yaml$|\.conf|\.pm$', delay => 1, ); - + while (1) { my @changed_files = $watcher->watch(); } diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index afaa414..2a03f7f 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -106,7 +106,7 @@ has _body => ( is => 'rw', clearer => '_clear_body', predicate => '_has_body', ); # Eugh, ugly. Should just be able to rename accessor methods to 'body' -# and provide a custom reader.. +# and provide a custom reader.. sub body { my $self = shift; $self->_context->prepare_body(); @@ -327,7 +327,7 @@ Contains the keywords portion of a query string, when no '=' signs are present. http://localhost/path?some+keywords - + $c->request->query_keywords will contain 'some keywords' =head2 $req->match @@ -342,7 +342,7 @@ Contains the request method (C, C, C, etc). =head2 $req->param -Returns GET and POST parameters with a CGI.pm-compatible param method. This +Returns GET and POST parameters with a CGI.pm-compatible param method. This is an alternative method for accessing parameters in $c->req->parameters. $value = $c->request->param( 'foo' ); @@ -451,7 +451,7 @@ be either a scalar or an arrayref containing scalars. print $c->request->query_parameters->{field}; print $c->request->query_parameters->{field}->[0]; - + =head2 $req->read( [$maxlength] ) Reads a chunk of data from the request body. This method is intended to be @@ -546,7 +546,7 @@ sub upload { =head2 $req->uploads Returns a reference to a hash containing uploads. Values can be either a -L object, or an arrayref of +L object, or an arrayref of L objects. my $upload = $c->request->uploads->{field}; @@ -567,7 +567,7 @@ preserved. sub uri_with { my( $self, $args ) = @_; - + carp( 'No arguments passed to uri_with()' ) unless $args; foreach my $value ( values %$args ) { @@ -577,7 +577,7 @@ sub uri_with { utf8::encode( $_ ) if utf8::is_utf8($_); } }; - + my $uri = $self->uri->clone; my %query = ( %{ $uri->query_form_hash }, %$args ); diff --git a/lib/Catalyst/Request/Upload.pm b/lib/Catalyst/Request/Upload.pm index e9ba6f2..aee3625 100644 --- a/lib/Catalyst/Request/Upload.pm +++ b/lib/Catalyst/Request/Upload.pm @@ -108,7 +108,7 @@ Returns an L object for the request. =head2 $upload->link_to -Creates a hard link to the temporary file. Returns true for success, +Creates a hard link to the temporary file. Returns true for success, false for failure. $upload->link_to('/path/to/target'); diff --git a/lib/Catalyst/Response.pm b/lib/Catalyst/Response.pm index faa34ae..a6328d5 100644 --- a/lib/Catalyst/Response.pm +++ b/lib/Catalyst/Response.pm @@ -103,7 +103,7 @@ The keys of the hash reference on the right correspond to the L parameters of the same name, except they are used without a leading dash. Possible parameters are: -=over +=over =item value @@ -173,7 +173,7 @@ Sets or returns the HTTP status. $c->response->status(404); $res->code is an alias for this, to match HTTP::Response->code. - + =head2 $res->write( $data ) Writes $data to the output stream. @@ -199,7 +199,7 @@ sub print { defined $self->write($,) or return; defined $self->write($_) or return; } - + return 1; } @@ -209,7 +209,7 @@ Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT -This library is free software. You can redistribute it and/or modify +This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. =cut diff --git a/lib/Catalyst/Stats.pm b/lib/Catalyst/Stats.pm index b6cf7b6..46b5ed4 100644 --- a/lib/Catalyst/Stats.pm +++ b/lib/Catalyst/Stats.pm @@ -121,7 +121,7 @@ sub _get_uid { $visitor->searchForUID($uid); $self->accept($visitor); return $visitor->getResult; -} +} sub addChild { my $self = shift; @@ -206,7 +206,7 @@ be like this: $c->stats->profile("completed second part of critical bit"); # more code ... - $c->stats->profile(end => "mysub"); + $c->stats->profile(end => "mysub"); } Supposing mysub was called from the action "process" inside a Catalyst @@ -233,7 +233,7 @@ part 0.111s. =head2 new -Constructor. +Constructor. $stats = Catalyst::Stats->new; @@ -252,7 +252,7 @@ Enable or disable stats collection. By default, stats are enabled after object Marks a profiling point. These can appear in pairs, to time the block of code between the begin/end pairs, or by themselves, in which case the time of -execution to the previous profiling point will be reported. +execution to the previous profiling point will be reported. The argument may be either a single comment string or a list of name-value pairs. Thus the following are equivalent: diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index d485ab0..f47909d 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -21,7 +21,7 @@ See L. =head1 DESCRIPTION -Catalyst Utilities. +Catalyst Utilities. =head1 METHODS @@ -297,7 +297,7 @@ sub merge_hashes { my ( $lefthash, $righthash ) = @_; return $lefthash unless defined $righthash; - + my %merged = %$lefthash; for my $key ( keys %$righthash ) { my $right_ref = ( ref $righthash->{ $key } || '' ) eq 'HASH'; @@ -311,7 +311,7 @@ sub merge_hashes { $merged{ $key } = $righthash->{ $key }; } } - + return \%merged; } @@ -346,10 +346,10 @@ All you need to get this work, is: 1) Install Term::Size::Any, or -2) Export $COLUMNS from your shell. +2) Export $COLUMNS from your shell. (Warning to bash users: 'echo $COLUMNS' may be showing you the bash -variable, not $ENV{COLUMNS}. 'export COLUMNS=$COLUMNS' and you should see +variable, not $ENV{COLUMNS}. 'export COLUMNS=$COLUMNS' and you should see that 'env' now lists COLUMNS.) As last resort, default value of 80 chars will be used. diff --git a/lib/Catalyst/View.pm b/lib/Catalyst/View.pm index 9f759c0..4c07562 100644 --- a/lib/Catalyst/View.pm +++ b/lib/Catalyst/View.pm @@ -19,15 +19,15 @@ Catalyst::View - Catalyst View base class =head1 DESCRIPTION -This is the Catalyst View base class. It's meant to be used as +This is the Catalyst View base class. It's meant to be used as a base class by Catalyst views. -As a convention, views are expected to read template names from +As a convention, views are expected to read template names from $c->stash->{template}, and put the output into $c->res->body. Some views default to render a template named after the dispatched action's private name. (See L.) -=head1 METHODS +=head1 METHODS Implements the same methods as other Catalyst components, see L