Commits

Burak Gürsoy committed ba520ae

perlcritic fixes

Comments (0)

Files changed (11)

     local $SIG{__WARN__} = sub {
         my $w = shift;
         return if $w =~ m{Sys/Info}xms; # noise
-        warn $w;
+        warn "$w\n";
     };
     my $info = eval { require Sys::Info; return Sys::Info->new; };
     my $os   = $info ? $info->os->name( edition => 1 )  : $^O;
 
 =head1 NAME
 
-tts - Commandline interface to Text::Template::Simple
+C<tts> - Command line interface to Text::Template::Simple
 
 =head1 SYNOPSIS
 
 
 =head1 DESCRIPTION
 
-This a commandline front end to L<Text::Template::Simple>.
+This a command line front end to L<Text::Template::Simple>.
 
 =head1 AUTHOR
 
-Burak GE<252>rsoy, E<lt>burakE<64>cpan.orgE<gt>
+C<Burak Gursoy>, E<lt>burakE<64>cpan.orgE<gt>
 
 =head1 COPYRIGHT
 
-Copyright 2004-2010 Burak GE<252>rsoy. All rights reserved.
+Copyright 2004-2012 C<Burak Gursoy>. All rights reserved.
 
 =head1 LICENSE
 

lib/Text/Template/Simple.pm

 can be cached on disk or inside the memory via the internal cache 
 manager. It is also possible to use static/dynamic includes,
 pass parameters to includes and apply filters on them.
-Also see L<Text::Template::Simple::API> for the full API definiton.
+Also see L<Text::Template::Simple::API> for the full C<API> reference.
 
 =head1 SYNTAX
 
       my $foo = 42;
    %>
 
-If you want to include a text or html file, you can use the
+If you want to include a text or I<HTML> file, you can use the
 static include directive:
 
    <%+ my_other.html %>
 
 =head2 Chomping
 
-Chomping is the removal of whitespace before and after your directives. This
-can be useful if you're generating plain text (instead of HTML which'll ignore
+Chomping is the removal of white space before and after your directives. This
+can be useful if you're generating plain text (instead of HTML which will ignore
 spaces most of the time). You can either remove all space or replace multiple
-whitespace with a single space (collapse). Chomping can be enabled per
+white space with a single space (collapse). Chomping can be enabled per
 directive or globally via options to the constructor.
 See L<Text::Template::Simple::API/pre_chomp> and
 L<Text::Template::Simple::API/post_chomp> options to
    Foo Bar
 
 Chomping is inspired by Template Toolkit (mostly the same functionality,
-although TT seems to miss collapse/no-chomp per directive option).
+although C<TT> seems to miss collapse/no-chomp per directive option).
 
 =head2 Accessing Template Names
 
 
 =head2 Template Parameters
 
-You can fetch parameters (passed to compile) in the usual perl way:
+You can fetch parameters (passed to compile) in the usual C<perl> way:
 
    <%
       my $foo = shift;
 
 =over 4
 
-=item *
+=item C<PARAM>
 
-PARAM
+=item FILTER
 
-=item *
-
-FILTER
-
-=item *
-
-SHARE
+=item SHARE
 
 =back
 
    <%+ /path/to/static.tts  | FILTER: MyFilter %>
    <%* /path/to/dynamic.tts | FILTER: MyFilter | PARAM: test => 123 %>
 
-C<PARAM:> defines the parameter list to pass to the included file.
-C<FILTER:> defines the list of filters to apply to the output of the include.
-C<SHARE:> used to list the variables to share with the included template when
+C<PARAM> defines the parameter list to pass to the included file.
+C<FILTER> defines the list of filters to apply to the output of the include.
+C<SHARE> used to list the variables to share with the included template when
 the monolith option is disabled.
 
 =head3 INCLUDE FILTERS
    <%* dyna.inc | SHARE: $foo, $bar %>
 
 And then you can access C<$foo> and C<$bar> inside C<dyna.inc>. There is one
-drawback by shared variables: only SCALARs can be shared. You can not share
+drawback by shared variables: only C<SCALARs> can be shared. You can not share
 anything else. If you want to share an array, use an array reference instead:
 
    <%
 
 =head2 connector
 
-=head2 io
+=head2 C<io>
 
-=head2 tts
+=head2 C<tts>
 
 See L<Text::Template::Simple::API> for the technical/gory details.
 
 =head1 EXAMPLES
 
-TODO
+   TODO
 
 =head1 ERROR HANDLING
 
 
 =head2 No mini language
 
-There is no mini-language. Only perl is used as the template
+There is no mini-language. Only C<perl> is used as the template
 language. So, this may or may not be I<safe> from your point
 of view. If this is a problem for you, just don't use this 
 module. There are plenty of template modules with mini-languages
-inside I<CPAN>.
+inside C<CPAN>.
 
 =head2 Speed
 
-There is an initialization cost and this'll show itself after
+There is an initialization cost and this will show itself after
 the first compilation process. The second and any following compilations
-will be much faster. Using cache can also improve speed, since this'll
+will be much faster. Using cache can also improve speed, since this will
 eliminate the parsing phase. Also, using memory cache will make
 the program run more faster under persistent environments. But the 
 overall speed really depends on your environment.

lib/Text/Template/Simple/Base/Include.pm

          fatal('tts.base.include._interpolate.bogus_share', $type_name, $var);
       }
       $var =~ tr/;//d;
-      if ( $var =~ m{ [^a-zA-Z0-9_\$] }xms ) {
+      if ( $var =~ m{ [^a-zA-Z0-9_\$] }xms ) { ## no critic (ProhibitEnumeratedClasses)
          fatal('tts.base.include._interpolate.bogus_share_notbare', $var);
       }
       push @buf, $var;

lib/Text/Template/Simple/Cache.pm

 
 =head1 SYNOPSIS
 
-TODO
+   TODO
 
 =head1 DESCRIPTION
 
    $template->cache->dumper( $type, \%opt );
 
 C<TYPE> can either be C<structure> or C<ids>.
-C<dumper> accepts some arguments as a hashref:
+C<dumper> accepts some arguments as a hash reference:
 
    $template->cache->dumper( $type, \%opt );
 
 =over 4
 
-=item *
-
-varname
+=item C<varname>
 
 Controls the name of the dumped structure.
 
-=item *
+=item no_deparse
 
-no_deparse
-
-If you set this to a true value, deparsing will be disabled
+If you set this to a true value, C<deparsing> will be disabled
 
 =back
 
 
 Early versions of C<Data::Dumper> don' t have a C<Deparse>
 method, so you may need to upgrade your C<Data::Dumper> or
-disable deparse-ing if you want to use this method.
+disable C<deparsing> if you want to use this method.
 
 =head3 ids
 
 
 =head2 hit
 
-TODO
+   TODO
 
 =head2 populate
 
-TODO
+   TODO
 
 =cut

lib/Text/Template/Simple/Cache/ID.pm

 
 =head1 SYNOPSIS
 
-TODO
+   TODO
 
 =head1 DESCRIPTION
 
-TODO
+   TODO
 
 =head1 METHODS
 

lib/Text/Template/Simple/Caller.pm

 
 =head2 stack
 
-Class method. Accepts parameters as a single hashref:
+Class method. Accepts parameters as a single hash reference:
 
    my $dump = Text::Template::Simple::Caller->stack(\%opts);
 

lib/Text/Template/Simple/Constants.pm

 use constant DELIM_START         => 0; # field id
 use constant DELIM_END           => 1; # field id
 use constant RE_NONFILE          => qr{ [ \n \r < > * ? ] }xmso;
-use constant RE_DUMP_ERROR       => qr{Can\'t \s locate \s object \s method \s "first" \s via \s package \s "B::SVOP"}xms;
+use constant RE_DUMP_ERROR       => qr{
+    \QCan't locate object method "first" via package "B::SVOP"\E
+}xms;
 use constant COMPILER            => PARENT   . '::Compiler';
 use constant COMPILER_SAFE       => COMPILER . '::Safe';
 use constant DUMMY_CLASS         => PARENT   . '::Dummy';
 
 =head1 SYNOPSIS
 
-TODO
+   TODO
 
 =head1 DESCRIPTION
 

lib/Text/Template/Simple/Dummy.pm

 
 =head1 SYNOPSIS
 
-TODO
+   TODO
 
 =head1 DESCRIPTION
 
 =head2 stack
 
 Issues a full stack trace and returns the output as string dump. Accepts
-options as a hashref:
+options as a hash reference:
 
    stack({ opt => $option, frame => $backtrace_level });
 

lib/Text/Template/Simple/IO.pm

 
 =head1 SYNOPSIS
 
-TODO
+   TODO
 
 =head1 DESCRIPTION
 
-TODO
+   TODO
 
 =head1 METHODS
 
 
 Constructor. Accepts an I/O layer name as the parameter.
 
-=head2 layer FH
+=head2 layer FILE_HANDLE
 
-Sets the I/O layer of the supplied filehandle if there is a layer and perl
+Sets the I/O layer of the supplied file handle if there is a layer and C<perl>
 version is greater or equal to C<5.8>.
 
 =head2 slurp FILE_PATH

lib/Text/Template/Simple/Tokenizer.pm

 
 =head1 NAME
 
-Text::Template::Simple::Tokenizer - Tokenizer
+Text::Template::Simple::Tokenizer - C<Tokenizer>
 
 =head1 SYNOPSIS
 
 
 =head1 DESCRIPTION
 
-Tokenizes the input with the defined delimiter pair.
+Splits the input into tokens with the defined delimiter pair.
 
 =head1 METHODS
 
 The object constructor. Accepts two parameters in this order:
 C<start_delimiter> and C<end_delimiter>.
 
-=head2 tokenize
+=head2 C<tokenize>
 
-Tokenizes the input with the supplied delimiter pair. Accepts a single
+Splits the input into tokens with the supplied delimiter pair. Accepts a single
 parameter: the raw template string.
 
 =head2 ESCAPE METHODS

lib/Text/Template/Simple/Util.pm

    }
 };
 
-my @WHITESPACE_SYMBOLS = map { '\\' . $_ } qw( r n f s );
+my @WHITESPACE_SYMBOLS = map { q{\\} . $_ } qw( r n f s );
 
 my $DEBUG = 0; # Disabled by default
 my $DIGEST;    # Will hold digester class name.
 
 =head1 SYNOPSIS
 
-TODO
+   TODO
 
 =head1 DESCRIPTION
 
 
 =head2 DIGEST
 
-Returns the digester object.
+Returns the C<digester> object.
 
-=head2 binary_mode FH, LAYER
+=head2 binary_mode FILE_HANDLE, LAYER
 
-Sets the I/O layer of FH in modern perls, only sets binmode on FH otherwise.
+Sets the I/O layer of C<FILE_HANDLE> in modern C<perls>, only sets C<binmode>
+on C<FILE_HANDLE> otherwise.
 
-=head2 L TYPE, ID [, PARAMS]
+=head2 L TYPE, ID [, PARAMETERS]
 
 Internal method.
 
-=head2 fatal ID [, PARAMS]
+=head2 fatal ID [, PARAMETERS]
 
 Internal method.
 
-=head2 isaref THING
+=head2 C<isaref THING>
 
 Returns true if C<THING> is an ARRAY.
 
-=head2 ishref THING
+=head2 C<ishref THING>
 
 Returns true if C<THING> is a HASH.
 
-=head2 iscref THING
+=head2 C<iscref THING>
 
 Returns true if C<THING> is a CODE.
 
-=head2 trim STRING
+=head2 C<trim STRING>
 
 Returns the trimmed version of the C<STRING>.
 
-=head2 ltrim STRING
+=head2 C<ltrim STRING>
 
 Returns the left trimmed version of the C<STRING>.
 
-=head2 rtrim STRING
+=head2 C<rtrim STRING>
 
 Returns the right trimmed version of the C<STRING>.
 
 =head2 escape CHAR, STRING
 
-Escapes all occurrances of C<CHAR> in C<STRING> with backslashes.
+Escapes all occurrences of C<CHAR> in C<STRING> with backslashes.
 
 =head2 visualize_whitespace STRING
 
-Replaces the whitespace in C<STRING> with visual representations.
+Replaces the white space in C<STRING> with visual representations.
 
-=head1 OVERRIDABLE FUNCTIONS
+=head1 C<OVERRIDABLE FUNCTIONS>
 
 =head2 LOG