Skip to content

Commit

Permalink
version 2.00
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@66 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information
abw committed Nov 1, 2000
1 parent c542301 commit 82cbea8
Show file tree
Hide file tree
Showing 49 changed files with 3,833 additions and 3,303 deletions.
280 changes: 190 additions & 90 deletions Changes

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions MANIFEST
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ lib/Template/Parser.pm
lib/Template/Parser.pod lib/Template/Parser.pod
lib/Template/Plugin.pm lib/Template/Plugin.pm
lib/Template/Plugin.pod lib/Template/Plugin.pod
lib/Template/Plugin/Autoformat.pm
lib/Template/Plugin/CGI.pm lib/Template/Plugin/CGI.pm
lib/Template/Plugin/DBI.pm lib/Template/Plugin/DBI.pm
lib/Template/Plugin/Datafile.pm lib/Template/Plugin/Datafile.pm
Expand All @@ -39,8 +40,10 @@ lib/Template/Plugin/Format.pm
lib/Template/Plugin/Iterator.pm lib/Template/Plugin/Iterator.pm
lib/Template/Plugin/Table.pm lib/Template/Plugin/Table.pm
lib/Template/Plugin/URL.pm lib/Template/Plugin/URL.pm
lib/Template/Plugin/Wrap.pm
lib/Template/Plugin/XML/DOM.pm lib/Template/Plugin/XML/DOM.pm
lib/Template/Plugin/XML/RSS.pm lib/Template/Plugin/XML/RSS.pm
lib/Template/Plugin/XML/XPath.pm
lib/Template/Plugins.pm lib/Template/Plugins.pm
lib/Template/Plugins.pod lib/Template/Plugins.pod
lib/Template/Provider.pm lib/Template/Provider.pm
Expand All @@ -58,6 +61,7 @@ parser/README
parser/yc parser/yc
t/README t/README
t/args.t t/args.t
t/autoform.t
t/base.t t/base.t
t/binop.t t/binop.t
t/block.t t/block.t
Expand Down Expand Up @@ -114,6 +118,7 @@ t/test/lib/default
t/test/lib/error t/test/lib/error
t/test/lib/footer t/test/lib/footer
t/test/lib/header t/test/lib/header
t/test/lib/header.tt2
t/test/lib/incblock t/test/lib/incblock
t/test/lib/menu t/test/lib/menu
t/test/lib/trimme t/test/lib/trimme
Expand Down Expand Up @@ -144,5 +149,6 @@ t/vars.t
t/varsv1.t t/varsv1.t
t/vmeth.t t/vmeth.t
t/while.t t/while.t
t/wrap.t
t/wrapper.t t/wrapper.t
t/xpath.t t/xpath.t
91 changes: 60 additions & 31 deletions Makefile.PL
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ IMPORTANT NOTE:
--------------- ---------------
You have version $Template::VERSION of the Template Toolkit installed. You have version $Template::VERSION of the Template Toolkit installed.
There are some minor incompatabilities between version 1.* and 2.* There are some minor incompatabilities between version 1 and 2
of the Template Toolkit which you should be aware of. Installing of the Template Toolkit which you should be aware of. Installing
this version will overwrite your version $Template::VERSION files this version will overwrite your version $Template::VERSION files
unless you take measures to install one or the other version in a unless you take measures to install one or the other version in a
different location (i.e. perl Makefile.PL LIB=/other/path). different location (i.e. perl Makefile.PL PREFIX=/other/path).
Please consult the README and Changes file for further details. Please consult the README and Changes file for further details.
Most of the changes are in the more obscure features and Most of the changes are in the more obscure features and
Expand All @@ -45,30 +45,39 @@ EOF


print <<EOF; print <<EOF;
The Template Toolkit includes a number of plugin modules, some of which The Template Toolkit includes a number of plugin modules, some of
interface to external Perl modules available from CPAN. All the plugins which interface to external Perl modules available from CPAN. All the
will be installed regardless (so that they will work automatically if and plugins will be installed regardless so that they will automatically
when you install the relevant modules) but the tests will be skipped for work as and when you install the relevant modules. The tests will be
plugins that require external modules not available on your system. skipped for plugins that require external modules not currently
available on your system.
EOF EOF


foreach my $mods ( [ XML::DOM => \&check_dom ], foreach my $mods ( Text::Wrap,
Text::Autoformat,
[ XML::DOM => \&check_dom ],
[ XML::RSS => \&check_rss ], [ XML::RSS => \&check_rss ],
[ XML::XPath => \&check_xpath ], [ XML::XPath => \&check_xpath ],
[ DBI => \&dbi_config ] ) { [ DBI => \&dbi_config ] ) {
my ($module, $code) = @$mods; my ($module, $code) = ref $mods ? @$mods : ($mods, 0);


printf(" %-12s - ", $module); printf(" %-16s ", $module);
eval "use $module"; eval "use $module";
if ($@) { if ($@) {
print "skipping test (module not installed)\n"; nope("module not installed");
} }
else { elsif ($code) {
&$code; &$code;
} }
else {
no strict qw( refs );
my $ver = ${"$module\::VERSION"};
yep("version $ver installed");
}
} }


print "\n";


#------------------------------------------------------------------------ #------------------------------------------------------------------------
# build options and write Makefile # build options and write Makefile
Expand Down Expand Up @@ -96,6 +105,12 @@ if ($ExtUtils::MakeMaker::VERSION >= 5.43) {


WriteMakefile( %opts ); WriteMakefile( %opts );


print <<EOF;
Configuration complete. You should now run 'make', 'make test' and then
'make install'. Please don't forget to read the README file.
EOF


#======================================================================== #========================================================================


Expand All @@ -115,18 +130,32 @@ EOF
} }




#------------------------------------------------------------------------
# yep($text)
# nope($text)
#------------------------------------------------------------------------

sub yep {
print '[X] ', shift, "\n";
}

sub nope {
print '[ ] ', shift, "\n";
}


#------------------------------------------------------------------------ #------------------------------------------------------------------------
# check_dom() # check_dom()
# #
# XML::DOM version 1.25 (and earlier?) dump core with Perl 5.6.0 # XML::DOM version 1.25 (and earlier?) dump core with Perl 5.6.0
#------------------------------------------------------------------------ #------------------------------------------------------------------------


sub check_dom { sub check_dom {
if ($] == 5.006 && $XML::DOM::VERSION <= 1.25) { if ($] >= 5.006 && $XML::DOM::VERSION <= 1.25) {
print "version $XML::DOM::VERSION may not work with Perl $], skipping\n"; nope("version $XML::DOM::VERSION may not work with Perl $]");
} }
else { else {
print "version $XML::DOM::VERSION installed, including tests\n"; yep("version $XML::DOM::VERSION installed");
} }
} }


Expand All @@ -139,11 +168,11 @@ sub check_dom {
#------------------------------------------------------------------------ #------------------------------------------------------------------------


sub check_rss { sub check_rss {
if ($] == 5.006 && $XML::RSS::VERSION < 0.9) { if ($] >= 5.006 && $XML::RSS::VERSION < 0.9) {
print "please upgrade to version 0.9 or later ($XML::RSS::VERSION installed)\n"; nope("requires version 0.9 or later ($XML::RSS::VERSION installed)");
} }
else { else {
print "version $XML::RSS::VERSION installed, including tests\n"; yep("version $XML::RSS::VERSION installed");
} }
} }


Expand All @@ -156,10 +185,10 @@ sub check_rss {


sub check_xpath { sub check_xpath {
if ($XML::XPath::VERSION < 1.00) { if ($XML::XPath::VERSION < 1.00) {
print "please upgrade to version 1.00 or later ($XML::XPath::VERSION installed)\n"; nope("requires version 1.00 or later ($XML::XPath::VERSION installed)");
} }
else { else {
print "version $XML::XPath::VERSION installed, including tests\n"; yep("version $XML::XPath::VERSION installed");
} }
} }


Expand All @@ -174,10 +203,10 @@ sub dbi_config {
my ($dsn, $user, $pass, $run); my ($dsn, $user, $pass, $run);
$run = 1; $run = 1;


print "version $DBI::VERSION installed, configuring tests\n"; print "[X] version $DBI::VERSION installed, configuring tests\n";


if (prompt("- Do you want to run the DBI tests?\n" . if (prompt(" - Do you want to run the DBI tests?\n" .
" It requires access to an existing test database.", " It requires access to an existing test database.",
"y") =~ /y/i) { "y") =~ /y/i) {


my ($driver, $dbname); my ($driver, $dbname);
Expand All @@ -186,24 +215,24 @@ sub dbi_config {


my $default = (grep(/m.?sql/i, @drivers))[0]; my $default = (grep(/m.?sql/i, @drivers))[0];


print "- Please enter the driver name for the test database.\n"; print " - Please enter the driver name for the test database.\n";
print " The DBD drivers installed on your system are\n\n"; print " The DBD drivers installed on your system are\n\n";
print " @drivers\n\n"; print " @drivers\n\n";


while (! $driver) { while (! $driver) {
$driver = prompt("- Enter driver name: ", $default); $driver = prompt(" - Enter driver name: ", $default);
print("! No such DBD driver\n"), undef $driver print(" No such DBD driver\n"), undef $driver
unless grep(/^$driver$/, @drivers); unless grep(/^$driver$/, @drivers);
} }


while (! $dbname) { while (! $dbname) {
$dbname = prompt('- Enter database name: ', 'test'); $dbname = prompt(' - Enter database name: ', 'test');
} }


$dsn = "dbi:$driver:$dbname"; $dsn = "dbi:$driver:$dbname";


$user = prompt('- Enter user name : ', ''); $user = prompt(' - Enter user name : ', '');
$pass = prompt('- Enter password : ', ''); $pass = prompt(' - Enter password : ', '');


$user = '' unless defined $user; $user = '' unless defined $user;
$pass = '' unless defined $pass; $pass = '' unless defined $pass;
Expand All @@ -212,7 +241,7 @@ sub dbi_config {
$run = 0; $run = 0;
} }


print "- writing $DBI_CONFIG_FILE\n"; print " - writing $DBI_CONFIG_FILE\n";
open(CFGFILE, ">$DBI_CONFIG_FILE") || die "$DBI_CONFIG_FILE: $!\n"; open(CFGFILE, ">$DBI_CONFIG_FILE") || die "$DBI_CONFIG_FILE: $!\n";
print CFGFILE <<EOF; print CFGFILE <<EOF;
\$run = $run; \$run = $run;
Expand Down
Loading

0 comments on commit 82cbea8

Please sign in to comment.