Template-Plugin-Calendar-Simple-1.04/0000755000016200001720000000000014555245065017273 5ustar jenkinsjenkinsTemplate-Plugin-Calendar-Simple-1.04/META.json0000644000016200001720000000233114555245065020713 0ustar jenkinsjenkins{ "abstract" : "Just another HTML calendar generator.", "author" : [ "jeffa " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "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.04", "x_serialization_backend" : "JSON::PP version 2.97001" } Template-Plugin-Calendar-Simple-1.04/lib/0000755000016200001720000000000014555245065020041 5ustar jenkinsjenkinsTemplate-Plugin-Calendar-Simple-1.04/lib/Template/0000755000016200001720000000000014555245065021614 5ustar jenkinsjenkinsTemplate-Plugin-Calendar-Simple-1.04/lib/Template/Plugin/0000755000016200001720000000000014555245065023052 5ustar jenkinsjenkinsTemplate-Plugin-Calendar-Simple-1.04/lib/Template/Plugin/Calendar/0000755000016200001720000000000014555245065024563 5ustar jenkinsjenkinsTemplate-Plugin-Calendar-Simple-1.04/lib/Template/Plugin/Calendar/Simple.pm0000644000016200001720000001251214555245064026352 0ustar jenkinsjenkinspackage Template::Plugin::Calendar::Simple; use strict; use warnings FATAL => 'all'; our $VERSION = '1.04'; 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 %] [% END %] [% FOREACH row = cal.rows %] [% FOREACH col = row %] [% END %] [% END %]
[% day %]
[% col || ' ' %]
=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 2024 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.04/META.yml0000644000016200001720000000141214555245065020542 0ustar jenkinsjenkins--- 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 7.34, CPAN::Meta::Converter version 2.150010' 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.04' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' Template-Plugin-Calendar-Simple-1.04/readme.md0000644000016200001720000000265014555245064021054 0ustar jenkinsjenkinsTemplate::Plugin::Calendar::Simple ================================== Just another HTML calendar generator. [![CPAN Version](https://badge.fury.io/pl/Template-Plugin-Calendar-Simple.svg)](https://metacpan.org/pod/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 %] [% END %] [% FOREACH row = cal.rows %] [% FOREACH col = row %] [% END %] [% END %]
[% day %]
[% col || ' ' %]
``` 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.04/Changes0000644000016200001720000000130414555245064020563 0ustar jenkinsjenkinsRevision history for Perl extension Template::Plugin::Calendar::Simple. 1.04 - clean up from derusting recalling how to CPAN 1.02 - update copyright date - fix bug caused by dependecy change 1.01 - update copyright date 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.04/t/0000755000016200001720000000000014555245065017536 5ustar jenkinsjenkinsTemplate-Plugin-Calendar-Simple-1.04/t/01-run.t0000644000016200001720000000241714555245064020750 0ustar jenkinsjenkins#!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
SunMonTueWedThuFriSat
    123
45678910
11121314151617
18192021222324
25262728293031
', "correct output for Jan 1970"; __DATA__ [% USE cal = Calendar.Simple( month, year, 0 ) %] [% FOREACH day = cal.days %][% END %] [%- FOREACH row = cal.rows %] [% FOREACH col = row %][% END %] [%- END %]
[% month %] [% year %]
[% day %]
[% col || ' ' %]
Template-Plugin-Calendar-Simple-1.04/t/pod-coverage.t0000644000016200001720000000111314555245064022271 0ustar jenkinsjenkins#!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.04/t/02-monday.t0000644000016200001720000000243714555245064021436 0ustar jenkinsjenkins#!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
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 
', "correct output when Monday starts week"; __DATA__ [% USE cal = Calendar.Simple( month, year, 1 ) %] [% FOREACH day = cal.days( 1 ) %][% END %] [%- FOREACH row = cal.rows %] [% FOREACH col = row %][% END %] [%- END %]
[% month %] [% year %]
[% day %]
[% col || ' ' %]
Template-Plugin-Calendar-Simple-1.04/t/pod.t0000644000016200001720000000040114555245064020477 0ustar jenkinsjenkins#!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.04/t/00-load.t0000644000016200001720000000024114555245064021053 0ustar jenkinsjenkins#!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.04/Makefile.PL0000644000016200001720000000215014555245064021242 0ustar jenkinsjenkinsuse 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.04/MANIFEST0000644000016200001720000000051114555245065020421 0ustar jenkinsjenkinsChanges 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)