HTML-Template-Plugin-Dot-Helpers-0.04/0000755000175000017500000000000011100433325016310 5ustar rhesarhesaHTML-Template-Plugin-Dot-Helpers-0.04/META.yml0000444000175000017500000000130411100433325017555 0ustar rhesarhesa--- name: HTML-Template-Plugin-Dot-Helpers version: 0.04 author: - 'Rhesa Rozendaal ' abstract: Add useful objects to your templates license: perl resources: license: http://dev.perl.org/licenses/ requires: HTML::Template::Pluggable: 0.12 HTML::Template::Plugin::Dot: 0.96 Number::Format: 0 Test::More: 0 provides: HTML::Template::Plugin::Dot::Helpers: file: lib/HTML/Template/Plugin/Dot/Helpers.pm version: 0.04 HTML::Template::Plugin::Dot::Helpers::Number: file: lib/HTML/Template/Plugin/Dot/Helpers/Number.pm version: 0.01 generated_by: Module::Build version 0.280801 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.2.html version: 1.2 HTML-Template-Plugin-Dot-Helpers-0.04/lib/0000755000175000017500000000000011100433325017056 5ustar rhesarhesaHTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/0000755000175000017500000000000011100433325017622 5ustar rhesarhesaHTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/0000755000175000017500000000000011100433325021375 5ustar rhesarhesaHTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/Plugin/0000755000175000017500000000000011100433325022633 5ustar rhesarhesaHTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/Plugin/Dot/0000755000175000017500000000000011100433325023361 5ustar rhesarhesaHTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/Plugin/Dot/Helpers.pm0000444000175000017500000000417311100433325025324 0ustar rhesarhesapackage HTML::Template::Plugin::Dot::Helpers; use warnings; use strict; use HTML::Template::Pluggable; use HTML::Template::Plugin::Dot::Helpers::Number; HTML::Template::Pluggable->add_trigger('before_output' => sub { my $self = shift; $self->param('Number' => HTML::Template::Plugin::Dot::Helpers::Number->new); }); =head1 NAME HTML::Template::Plugin::Dot::Helpers - Add useful objects to your templates =head1 VERSION Version 0.04 =cut our $VERSION = '0.04'; =head1 SYNOPSIS use HTML::Template::Plugin::Dot::Helpers; Then in your template, you can do: =head1 DESCRIPTION This helper class adds some useful objects to your Dot-enabled templates (see L). =head2 Added objects =over 4 =item Number An extended Number::Format object. See L for documentation. Note that only the object oriented methods are supported here. I've added several generic numerical methods. Most (well, all in this release) are boolean methods, useful in C<< s >>. They are: =over 8 =item equals - test whether two numbers are equal (==) =item le, lt, ge, gt - test how two numbers compare (implemented with <=, <, >=, > respectively) =back The following is not yet implemented. =item String Adds generic string testing functions similar to the above: =over 8 =item equals - test whether two strings are equal (eq) =item le, lt, ge, gt - test how two strings compare lexically =back =back =head1 AUTHOR Rhesa Rozendaal, C<< >> =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 ACKNOWLEDGEMENTS =head1 COPYRIGHT & LICENSE Copyright 2005 Rhesa Rozendaal, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; # End of HTML::Template::Plugin::Dot::Helpers HTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/Plugin/Dot/Helpers/0000755000175000017500000000000011100433325024763 5ustar rhesarhesaHTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/Plugin/Dot/Helpers/Number.pm0000444000175000017500000000122511100433325026547 0ustar rhesarhesapackage HTML::Template::Plugin::Dot::Helpers::Number; use strict; use warnings; use base qw/Number::Format/; our $VERSION = 0.01; sub equals { return $_[1] == $_[2]; } sub le { return $_[1] <= $_[2]; } sub lt { return $_[1] < $_[2]; } sub ge { return $_[1] >= $_[2]; } sub gt { return $_[1] > $_[2]; } 1; =pod =head1 NAME HTML::Template::Plugin::Dot::Helpers::Number - Number formatting and comparison functions =head1 METHODS See L for formatting functions =over 4 =item equals =item le, lt, ge, gt =back =head1 SEE ALSO L for detailed help, license, and contact information. =cut HTML-Template-Plugin-Dot-Helpers-0.04/Changes0000444000175000017500000000052711100433325017605 0ustar rhesarhesaRevision history for HTML-Template-Plugin-Dot-Helpers 0.03 2007-12-21 Rhesa Rozendaal - fixed test. no functional changes 0.02 2005-10-09 Rhesa Rozendaal - fixed build problem: Makefile.PL wasn't bundled. 0.01 Date/time First version, released on an unsuspecting world. HTML-Template-Plugin-Dot-Helpers-0.04/t/0000755000175000017500000000000011100433325016553 5ustar rhesarhesaHTML-Template-Plugin-Dot-Helpers-0.04/t/pod-coverage.t0000444000175000017500000000025411100433325021312 0ustar rhesarhesa#!perl -T use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; all_pod_coverage_ok(); HTML-Template-Plugin-Dot-Helpers-0.04/t/00-load.t0000444000175000017500000000033211100433325020070 0ustar rhesarhesa#!perl -T use Test::More tests => 1; BEGIN { use_ok( 'HTML::Template::Plugin::Dot::Helpers' ); } diag( "Testing HTML::Template::Plugin::Dot::Helpers $HTML::Template::Plugin::Dot::Helpers::VERSION, Perl $], $^X" ); HTML-Template-Plugin-Dot-Helpers-0.04/t/pod.t0000444000175000017500000000021411100433325017515 0ustar rhesarhesa#!perl -T use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok(); HTML-Template-Plugin-Dot-Helpers-0.04/t/number.t0000444000175000017500000000410411100433325020225 0ustar rhesarhesa#!/usr/bin/perl use strict; use warnings; use Test::More; plan tests => 3 + 5; use_ok('HTML::Template::Pluggable'); use_ok('HTML::Template::Plugin::Dot'); use_ok('HTML::Template::Plugin::Dot::Helpers'); my $t1 = HTML::Template::Pluggable->new( scalarref => \q{=}, global_vars => 1, case_sensitive => 1, die_on_bad_params => 0, ); $t1->param( some => { value => 3_105_345.239_5 } ); my $o1 = $t1->output; # diag("output: ", $o1); like( $o1, qr/3,10/ ); my $t2 = HTML::Template::Pluggable->new( scalarref => \q{=No}, global_vars => 1, case_sensitive => 1, die_on_bad_params => 0, ); $t2->param( some => { value => 3_105_345.239_5 } ); my $o2 = $t2->output; # diag("output: ", $o2); like( $o2, qr/3,10/ ); $t2->param( some => { value => 1.053_45 } ); my $o3 = $t2->output; # diag("output: ", $o3); like( $o3, qr/No/ ); { package My::Obj; use overload q{""} => \&stringify, '0+' => \&stringify, fallback => 1; sub new { bless {id=>3}, shift } sub stringify { return $_[0]->{id} } } my $t3 = HTML::Template::Pluggable->new( scalarref => \q{YesNo ( )}, global_vars => 1, case_sensitive => 1, die_on_bad_params => 0, ); $t3->param( some => { value => 3_105_345.239_5, obj => My::Obj->new } ); my $o4 = $t3->output; # diag("output: ", $o4); like( $o4, qr/Yes/ ); my $t4 = HTML::Template::Pluggable->new( scalarref => \q{ }, global_vars => 1, case_sensitive => 1, die_on_bad_params => 0, ); $t4->param( o => { v => [ { n => 1.25 }, { n => 2.25 } ] } ); my $o5 = $t4->output; # diag("output: ", $o4); like( $o5, qr/USD 2.25/ ); __END__ HTML-Template-Plugin-Dot-Helpers-0.04/MANIFEST0000444000175000017500000000033611100433325017441 0ustar rhesarhesaBuild.PL Changes Makefile.PL MANIFEST META.yml # Will be created by "make dist" README lib/HTML/Template/Plugin/Dot/Helpers.pm lib/HTML/Template/Plugin/Dot/Helpers/Number.pm t/00-load.t t/pod-coverage.t t/pod.t t/number.t HTML-Template-Plugin-Dot-Helpers-0.04/Build.PL0000444000175000017500000000121711100433325017603 0ustar rhesarhesause strict; use warnings; use Module::Build; my $builder = Module::Build->new( module_name => 'HTML::Template::Plugin::Dot::Helpers', license => 'perl', dist_author => 'Rhesa Rozendaal ', dist_version_from => 'lib/HTML/Template/Plugin/Dot/Helpers.pm', requires => { 'Test::More' => 0, 'HTML::Template::Plugin::Dot' => 0.96, 'HTML::Template::Pluggable' => 0.12, 'Number::Format' => 0, }, add_to_cleanup => [ 'HTML-Template-Plugin-Dot-Helpers-*' ], create_makefile_pl => 'traditional', create_readme => 1, ); $builder->create_build_script(); HTML-Template-Plugin-Dot-Helpers-0.04/Makefile.PL0000444000175000017500000000117711100433325020266 0ustar rhesarhesa# Note: this file was auto-generated by Module::Build::Compat version 0.2808_01 use ExtUtils::MakeMaker; WriteMakefile ( 'PL_FILES' => {}, 'INSTALLDIRS' => 'site', 'NAME' => 'HTML::Template::Plugin::Dot::Helpers', 'EXE_FILES' => [], 'VERSION_FROM' => 'lib/HTML/Template/Plugin/Dot/Helpers.pm', 'PREREQ_PM' => { 'Test::More' => 0, 'Number::Format' => 0, 'HTML::Template::Plugin::Dot' => '0.96', 'HTML::Template::Pluggable' => '0.12' } ) ; HTML-Template-Plugin-Dot-Helpers-0.04/README0000444000175000017500000000335411100433325017173 0ustar rhesarhesaNAME HTML::Template::Plugin::Dot::Helpers - Add useful objects to your templates VERSION Version 0.04 SYNOPSIS use HTML::Template::Plugin::Dot::Helpers; Then in your template, you can do: DESCRIPTION This helper class adds some useful objects to your Dot-enabled templates (see HTML::Template::Plugin::Dot). Added objects Number An extended Number::Format object. See Number::Format for documentation. Note that only the object oriented methods are supported here. I've added several generic numerical methods. Most (well, all in this release) are boolean methods, useful in "s". They are: equals - test whether two numbers are equal (==) le, lt, ge, gt - test how two numbers compare (implemented with <=, <, >=, > respectively) The following is not yet implemented. String Adds generic string testing functions similar to the above: equals - test whether two strings are equal (eq) le, lt, ge, gt - test how two strings compare lexically AUTHOR Rhesa Rozendaal, "" BUGS Please report any bugs or feature requests to "bug-html-template-plugin-dot-helpers@rt.cpan.org", or through the web interface at . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. ACKNOWLEDGEMENTS COPYRIGHT & LICENSE Copyright 2005 Rhesa Rozendaal, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.