HTML-Template-Plugin-Dot-Helpers-0.04/ 0000755 0001750 0001750 00000000000 11100433325 016310 5 ustar rhesa rhesa HTML-Template-Plugin-Dot-Helpers-0.04/META.yml 0000444 0001750 0001750 00000001304 11100433325 017555 0 ustar rhesa rhesa ---
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/ 0000755 0001750 0001750 00000000000 11100433325 017056 5 ustar rhesa rhesa HTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/ 0000755 0001750 0001750 00000000000 11100433325 017622 5 ustar rhesa rhesa HTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/ 0000755 0001750 0001750 00000000000 11100433325 021375 5 ustar rhesa rhesa HTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/Plugin/ 0000755 0001750 0001750 00000000000 11100433325 022633 5 ustar rhesa rhesa HTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/Plugin/Dot/ 0000755 0001750 0001750 00000000000 11100433325 023361 5 ustar rhesa rhesa HTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/Plugin/Dot/Helpers.pm 0000444 0001750 0001750 00000004173 11100433325 025324 0 ustar rhesa rhesa package 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/ 0000755 0001750 0001750 00000000000 11100433325 024763 5 ustar rhesa rhesa HTML-Template-Plugin-Dot-Helpers-0.04/lib/HTML/Template/Plugin/Dot/Helpers/Number.pm 0000444 0001750 0001750 00000001225 11100433325 026547 0 ustar rhesa rhesa package 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/Changes 0000444 0001750 0001750 00000000527 11100433325 017605 0 ustar rhesa rhesa Revision 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/ 0000755 0001750 0001750 00000000000 11100433325 016553 5 ustar rhesa rhesa HTML-Template-Plugin-Dot-Helpers-0.04/t/pod-coverage.t 0000444 0001750 0001750 00000000254 11100433325 021312 0 ustar rhesa rhesa #!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.t 0000444 0001750 0001750 00000000332 11100433325 020070 0 ustar rhesa rhesa #!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.t 0000444 0001750 0001750 00000000214 11100433325 017515 0 ustar rhesa rhesa #!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.t 0000444 0001750 0001750 00000004104 11100433325 020225 0 ustar rhesa rhesa #!/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/MANIFEST 0000444 0001750 0001750 00000000336 11100433325 017441 0 ustar rhesa rhesa Build.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.PL 0000444 0001750 0001750 00000001217 11100433325 017603 0 ustar rhesa rhesa use 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.PL 0000444 0001750 0001750 00000001177 11100433325 020266 0 ustar rhesa rhesa # 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/README 0000444 0001750 0001750 00000003354 11100433325 017173 0 ustar rhesa rhesa NAME
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.