App-Templer

 view release on metacpan or  search on metacpan

lib/Templer/Plugin/Factory.pm  view on Meta::CPAN


=head2 register_plugin

This method should be called by all variable-expanding plugins to register
themselves.  The expected argument is the class-name which may be instantiated
to expand variables.

L<Templer::Plugin::ShellCommand>, L<Templer::Plugin::FileGlob>, and
L<Templer::Plugin::FileContents> are examples of such plugins.

NOTE: The plugin is instantiated immediately, and kept alive for the duration
of a templer-run.

=cut

sub register_plugin
{
    my ( $self, $obj ) = (@_);

    push( @{ $self->{ 'plugins' } }, $obj->new() );
}

lib/Templer/Plugin/Redis.pm  view on Meta::CPAN

            #
            my $rkey = $1;

            #
            #  Strip leading/trailing whitespace and quotes
            #
            $rkey =~ s/^\s+|\s+$//g;
            $rkey =~ s/^["']|['"]$//g;

            #
            #  If we have redis, and it is alive/connected, then use it.
            #
            if ( $self->{ 'redis' } &&
                 $self->{ 'redis' }->ping() )
            {
                $hash{ $key } = $self->{ 'redis' }->get($rkey);
            }
        }

    }



( run in 1.176 second using v1.01-cache-2.11-cpan-df04353d9ac )