From: Uri Guttman Date: Thu, 18 Dec 2008 19:17:42 +0000 (-0500) Subject: removing old trexy files X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=urisagit%2FTemplate-Simple.git;a=commitdiff_plain;h=6bc2e152b301f2226b865dca20b09079703073c1 removing old trexy files --- diff --git a/Trexy/Template.pm b/Trexy/Template.pm deleted file mode 100644 index 3a22e9f..0000000 --- a/Trexy/Template.pm +++ /dev/null @@ -1,108 +0,0 @@ - -package Trexy::Template; - -############################################################################### -# Nigel Hamilton -# -# Copyright Nigel Hamilton 2005 -# All Rights Reserved -# -# Author: Nigel Hamilton -# Filename: Trexy::Template.pm -# Description: Do simple, fast, "no code in the template" processing -# -# Based on Uri Guttman's sublime -# TinyTemplate module - released -# at YAPC::NA, 2006. -# -# This template module features: -# -# * implicit loops -# * template includes -# * template caching -# * no coding in the template -# -# Date Change -# ----------------------------------------------------------------------------- -# 24/09/2006 Took Uri's module and extended it slightly -# -############################################################################### - -use strict; -use warnings ; - -use base qw(Template::Simple); - -# escape Regex meta characters -my $start_delimiter = qr/\[\-/; -my $end_delimiter = qr/\-\]/; - - -############################################################################### -# -# new - construct a template -# -############################################################################### - -sub new { - - my ($class) = @_; - - return $class->SUPER::new( pre_delim => $start_delimiter, - post_delim => $end_delimiter ); - -} - - -############################################################################### -# -# render - fully render the template into a string -# -############################################################################### - -sub render { - - my ($this, $string, $tokens) = @_; - - # return a string from render - return ${ $this->SUPER::render($string, $tokens) }; - -} - - -############################################################################### -# -# render_as_ref - render as a string reference -# -############################################################################### - -sub render_as_ref { - - my ($this, $string, $tokens) = @_; - - # return a string from render - return $this->SUPER::render($string, $tokens); - -} - - -############################################################################### -# -# get_tokens - grab the tokens values out of a template -# -############################################################################### - -sub get_tokens { - - my ($string) = @_; - - my @found_tokens = $string =~ m/$start_delimiter(\w+)$end_delimiter/g; - - my %unique_tokens = map { $_ => 1 } @found_tokens; - - return keys %unique_tokens; - -} - - -1; diff --git a/bug.pl b/bug.pl deleted file mode 100644 index 0a4d9da..0000000 --- a/bug.pl +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/local/bin/perl - -use strict ; -use warnings ; - -use Trexy::Template ; - -my $template = < - [-start widgets-] - - [-anchor-] - - [-title-] -
[-description-] - - [-escaped_anchor-] - [-options-] - - [-end widgets-] - - -TEST - - -my $tokens = { - widgets => [ - { title => "bart" }, - { title => "marge" } - ], -}; - -print Trexy::Template->new->render($template, $tokens); - - - diff --git a/bug2.pl b/bug2.pl deleted file mode 100644 index ceac363..0000000 --- a/bug2.pl +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/local/bin/perl - -use warnings ; -use strict ; - -use Template::Simple ; - -my $data = { - widgets => [ - { - title => "bart", - }, - { - title => "marge", - } - ], -} ; - -my $template = <new() ; - -my $text = $renderer->render( $template, $data ) ; - -print ${$text} ; - -print "$Template::Simple::VERSION\n" ;