Template-Plugin-Calendar-Simple-1.00/ 0000755 0000156 0177776 00000000000 12641031715 017340 5 ustar jenkins nogroup Template-Plugin-Calendar-Simple-1.00/Changes 0000644 0000156 0177776 00000001043 12641031713 020627 0 ustar jenkins nogroup Revision history for Perl extension Template::Plugin::Calendar::Simple.
1.00
- update copyright date
- fix bug tracker location
0.06
- added github metadata to Makefile
0.05
- added real tests
- updated POD
- replace manifest with manifest skip
- promote readme to MD
- tabs to spaces
0.04 Mar 23 2013
- distro built with Module::Build
- added to github
0.02 Jan 01 2004
- doc updates
0.01 Aug 17 2003
- original version; created by h2xs 1.21 with options
-A -X Template::Plugin::Calendar::Simple
Template-Plugin-Calendar-Simple-1.00/lib/ 0000755 0000156 0177776 00000000000 12641031715 020106 5 ustar jenkins nogroup Template-Plugin-Calendar-Simple-1.00/lib/Template/ 0000755 0000156 0177776 00000000000 12641031715 021661 5 ustar jenkins nogroup Template-Plugin-Calendar-Simple-1.00/lib/Template/Plugin/ 0000755 0000156 0177776 00000000000 12641031715 023117 5 ustar jenkins nogroup Template-Plugin-Calendar-Simple-1.00/lib/Template/Plugin/Calendar/ 0000755 0000156 0177776 00000000000 12641031715 024630 5 ustar jenkins nogroup Template-Plugin-Calendar-Simple-1.00/lib/Template/Plugin/Calendar/Simple.pm 0000644 0000156 0177776 00000012512 12641031713 026416 0 ustar jenkins nogroup package Template::Plugin::Calendar::Simple;
use strict;
use warnings FATAL => 'all';
our $VERSION = '1.00';
use Calendar::Simple;
use Template::Plugin;
use Template::Iterator;
use Template::Exception;
use base qw( Template::Plugin );
sub new {
my ($class, $context, @args) = @_;
my @cal = Calendar::Simple::calendar( @args );
return bless {
_CONTEXT => $context,
rows => Template::Iterator->new( [@cal] ),
days => [qw( Sun Mon Tue Wed Thu Fri Sat )],
}, $class;
}
sub rows {
my ($self) = shift;
return $self->{rows};
}
sub days {
my ($self, $monday_starts_week) = @_;
my @days = @{ $self->{days} };
push @days, shift @days if $monday_starts_week;
return [@days];
}
1;
__END__
=head1 NAME
Template::Plugin::Calendar::Simple - Just another HTML calendar generator.
=head1 SYNOPSIS
[% USE cal = Calendar.Simple %]
[% FOREACH day = cal.days %]
[% day %] |
[% END %]
[% FOREACH row = cal.rows %]
[% FOREACH col = row %]
[% col || ' ' %] |
[% END %]
[% END %]
=head1 DESCRIPTION
Provides calendar delimiters for a Template Toolkit template via
L. This module supplies the data, you supply the HTML.
Defaults to current month within the current year. Past months and years
can be specified within the Template constructor:
[% USE cal = Calendar.Simple( 5, 2000 ) %]
Can generate calendars that start with Monday instead of Sunday like so:
[% USE cal = Calendar.Simple( 5, 2000, 1 ) %]
...
[% FOREACH day = cal.days( 1 ) %]
...
See the unit tests for more examples.
=head1 METHODS
=over 4
=item C
Constructor. Will be called for you by the Template Toolkit engine.
=item C
[% FOREACH row = cal.rows %]
Returns a Template::Iterator which contains the calendar rows.
Each row, however, is simply an array.
=item C
[% FOREACH day = cal.days %]
Most calendars have a header with the days - this method returns
an array of abbreviated day names (currently only in English). If
any argument is passed, then the week day starts with Monday instead
of Sunday.
=back
=head1 SEE ALSO
=over 4
=item * L
=item * L.
=back
=head1 BUGS AND LIMITATIONS
Please report any bugs or feature requests to either
=over 4
=item * Email: C
=item * Web: L
=back
I will be notified, and then you'll automatically be notified of progress
on your bug as I make changes.
=head1 GITHUB
The Github project is L
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Template::Plugin::Calendar::Simple
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker (report bugs here) L
=item * AnnoCPAN: Annotated CPAN documentation L
=item * CPAN Ratings L
=item * Search CPAN L
=back
=head1 AUTHOR
Jeff Anderson, C<< >>
=head1 LICENSE AND COPYRIGHT
Copyright 2016 Jeff Anderson.
This program is free software; you can redistribute it and/or modify it
under the terms of the the Artistic License (2.0). You may obtain a
copy of the full license at:
L
Any use, modification, and distribution of the Standard or Modified
Versions is governed by this Artistic License. By using, modifying or
distributing the Package, you accept this license. Do not use, modify,
or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made
by someone other than you, you are nevertheless required to ensure that
your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service
mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge
patent license to make, have made, use, offer to sell, sell, import and
otherwise transfer the Package with respect to any patent claims
licensable by the Copyright Holder that are necessarily infringed by the
Package. If you institute patent litigation (including a cross-claim or
counterclaim) against any party alleging that the Package constitutes
direct or contributory patent infringement, then this Artistic License
to you shall terminate on the date that such litigation is filed.
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=cut
Template-Plugin-Calendar-Simple-1.00/t/ 0000755 0000156 0177776 00000000000 12641031715 017603 5 ustar jenkins nogroup Template-Plugin-Calendar-Simple-1.00/t/pod.t 0000644 0000156 0177776 00000000401 12641031713 020543 0 ustar jenkins nogroup #!perl -T
use 5.006;
use strict;
use warnings FATAL => 'all';
use Test::More;
# Ensure a recent version of Test::Pod
my $min_tp = 1.22;
eval "use Test::Pod $min_tp";
plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
all_pod_files_ok();
Template-Plugin-Calendar-Simple-1.00/t/01-run.t 0000644 0000156 0177776 00000002414 12641031713 021011 0 ustar jenkins nogroup #!perl -T
use strict;
use warnings FATAL => 'all';
use Test::More tests => 1;
use Template;
use Template::Plugin::Calendar::Simple;
my $table = Template->new;
my $out = '';
$table->process( \*DATA, { year => 1970, month => 1 }, \$out ) or die $table->error, $/;
is $out, '
1 1970
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| | | | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
', "correct output for Jan 1970";
__DATA__
[% USE cal = Calendar.Simple( month, year ) %]
[% month %] [% year %]
[% FOREACH day = cal.days %][% day %] | [% END %]
[%- FOREACH row = cal.rows %]
[% FOREACH col = row %][% col || ' ' %] | [% END %]
[%- END %]
Template-Plugin-Calendar-Simple-1.00/t/pod-coverage.t 0000644 0000156 0177776 00000001113 12641031713 022335 0 ustar jenkins nogroup #!perl -T
use 5.006;
use strict;
use warnings FATAL => 'all';
use Test::More;
# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
if $@;
# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.18;
eval "use Pod::Coverage $min_pc";
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
if $@;
all_pod_coverage_ok();
Template-Plugin-Calendar-Simple-1.00/t/00-load.t 0000644 0000156 0177776 00000000241 12641031713 021117 0 ustar jenkins nogroup #!perl -T
use strict;
use warnings FATAL => 'all';
use Test::More tests => 1;
use_ok( 'Template::Plugin::Calendar::Simple' ) or BAIL_OUT( "can't use module" );
Template-Plugin-Calendar-Simple-1.00/t/02-monday.t 0000644 0000156 0177776 00000002437 12641031713 021502 0 ustar jenkins nogroup #!perl -T
use strict;
use warnings FATAL => 'all';
use Test::More tests => 1;
use Template;
use Template::Plugin::Calendar::Simple;
my $table = Template->new;
my $out = '';
$table->process( \*DATA, { year => 1970, month => 1 }, \$out ) or die $table->error, $/;
is $out, '
1 1970
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | |
', "correct output when Monday starts week";
__DATA__
[% USE cal = Calendar.Simple( month, year, 1 ) %]
[% month %] [% year %]
[% FOREACH day = cal.days( 1 ) %][% day %] | [% END %]
[%- FOREACH row = cal.rows %]
[% FOREACH col = row %][% col || ' ' %] | [% END %]
[%- END %]
Template-Plugin-Calendar-Simple-1.00/META.json 0000644 0000156 0177776 00000002240 12641031715 020757 0 ustar jenkins nogroup {
"abstract" : "Just another HTML calendar generator.",
"author" : [
"jeffa "
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.130880",
"license" : [
"unknown"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "Template-Plugin-Calendar-Simple",
"no_index" : {
"directory" : [
"t",
"inc"
]
},
"prereqs" : {
"build" : {
"requires" : {
"Test::More" : "0"
}
},
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
"requires" : {
"Calendar::Simple" : "1.04",
"Template" : "2.00",
"perl" : "5.006"
}
}
},
"release_status" : "stable",
"resources" : {
"homepage" : "https://github.com/jeffa/Template-Plugin-Calendar-Simple",
"repository" : {
"url" : "https://github.com/jeffa/Template-Plugin-Calendar-Simple.git"
}
},
"version" : "1.00"
}
Template-Plugin-Calendar-Simple-1.00/Makefile.PL 0000644 0000156 0177776 00000002150 12641031713 021306 0 ustar jenkins nogroup use 5.006;
use strict;
use warnings FATAL => 'all';
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Template::Plugin::Calendar::Simple',
AUTHOR => q{jeffa },
VERSION_FROM => 'lib/Template/Plugin/Calendar/Simple.pm',
ABSTRACT_FROM => 'lib/Template/Plugin/Calendar/Simple.pm',
LICENSE => 'Artistic_2_0',
PL_FILES => {},
MIN_PERL_VERSION => 5.006,
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => 0,
},
BUILD_REQUIRES => {
'Test::More' => 0,
},
PREREQ_PM => {
'Template' => '2.00',
'Calendar::Simple' => '1.04',
},
(! eval { ExtUtils::MakeMaker->VERSION(6.46) } ? () :
(META_ADD => {
resources => {
homepage => 'https://github.com/jeffa/Template-Plugin-Calendar-Simple',
repository => 'https://github.com/jeffa/Template-Plugin-Calendar-Simple.git',
},
})
),
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Template-Plugin-Calendar-Simple-*' },
);
Template-Plugin-Calendar-Simple-1.00/MANIFEST 0000644 0000156 0177776 00000000511 12641031715 020466 0 ustar jenkins nogroup Changes
lib/Template/Plugin/Calendar/Simple.pm
Makefile.PL
MANIFEST This list of files
readme.md
t/00-load.t
t/01-run.t
t/02-monday.t
t/pod-coverage.t
t/pod.t
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
Template-Plugin-Calendar-Simple-1.00/readme.md 0000644 0000156 0177776 00000003112 12641031713 021112 0 ustar jenkins nogroup Template::Plugin::Calendar::Simple
==================================
Just another HTML calendar generator. [](https://metacpan.org/pod/Template::Plugin::Calendar::Simple) [](https://travis-ci.org/jeffa/Template-Plugin-Calendar-Simple)
Description
-----------
Provides calendar delimiters for a Template Toolkit template. You supply the HTML.
Synopsis
--------
```html
[% USE cal = Calendar.Simple %]
[% FOREACH day = cal.days %]
[% day %] |
[% END %]
[% FOREACH row = cal.rows %]
[% FOREACH col = row %]
[% col || ' ' %] |
[% END %]
[% END %]
```
Installation
------------
To install this module, you should use CPAN. A good starting
place is [How to install CPAN modules](http://www.cpan.org/modules/INSTALL.html).
If you truly want to install from this github repo, then
be sure and create the manifest before you test and install:
```
perl Makefile.PL
make
make manifest
make test
make install
```
Support and Documentation
-------------------------
After installing, you can find documentation for this module with the
perldoc command.
```
perldoc Template::Plugin::Calendar::Simple
```
You can also find documentation at [metaCPAN](https://metacpan.org/pod/Template::Plugin::Calendar::Simple).
License and Copyright
---------------------
See [source POD](/lib/Template/Plugin/Calendar/Simple.pm).
Template-Plugin-Calendar-Simple-1.00/META.yml 0000644 0000156 0177776 00000001302 12641031715 020605 0 ustar jenkins nogroup ---
abstract: 'Just another HTML calendar generator.'
author:
- 'jeffa '
build_requires:
Test::More: 0
configure_requires:
ExtUtils::MakeMaker: 0
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.130880'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: Template-Plugin-Calendar-Simple
no_index:
directory:
- t
- inc
requires:
Calendar::Simple: 1.04
Template: 2.00
perl: 5.006
resources:
homepage: https://github.com/jeffa/Template-Plugin-Calendar-Simple
repository: https://github.com/jeffa/Template-Plugin-Calendar-Simple.git
version: 1.00