App-Chronicle

 view release on metacpan or  search on metacpan

lib/Chronicle/Template/GenericXslate.pm  view on Meta::CPAN

    ## no critic (Eval)
    eval($test);
    ## use critic

    if ($@)
    {
        die "Failed to load Text::Xslate module - $!";
    }

    my %options = @_;
    my $self    = $class->SUPER::new(@_);
    bless $self, $class;

    if ( $options{ tmpl_string } )
    {
        $self->{ render } = sub {
            return $self->{ xslate }
              ->render_string( $options{ tmpl_string }, $self->{ params } );
        };
    }
    else

lib/Chronicle/Template/HTMLTemplate.pm  view on Meta::CPAN

=head2 new

See L<Chronicle::Template> and C<%DEFAULT_OPTIONS> defined above.

=cut

sub new
{
    my $class   = shift;
    my %options = @_;
    my $self    = $class->SUPER::new(@_);
    bless $self, $class;

    if ( exists $options{ tmpl_string } )
    {
        $options{ scalarref } = \do {delete $options{ tmpl_string }};
    }
    else
    {
        my $filename = ( delete $options{ tmpl_file } ) . ".tmpl";
        $self->_theme_file_path($filename) or return;

lib/Chronicle/URI.pm  view on Meta::CPAN

=head2 new

The constructor takes only a single argument that will be assumed to be an http
URI, or in our case usually a path fragment thereof.

=cut

sub new
{
    my ( $class, $path ) = @_;
    my $self = $class->SUPER::new( normalize( $NORMALFORM, $path ), 'http' );
    return bless $self, $class;
}

=head2 unescaped

Return the URI or framgemt completely unescaped. That is, the result of
URI::as_iri with additionally all the ASCII characters unescaped. This method
is supposed to generate a filename from an URI.

=cut



( run in 1.154 second using v1.01-cache-2.11-cpan-49f99fa48dc )