]> git.donarmstrong.com Git - deb_pkgs/libhtml-calendarmonth-perl.git/commitdiff
[svn-upgrade] new version libhtml-calendarmonth-perl (1.26)
authorDon Armstrong <don@donarmstrong.com>
Thu, 22 Sep 2011 21:23:11 +0000 (21:23 +0000)
committerDon Armstrong <don@donarmstrong.com>
Thu, 22 Sep 2011 21:23:11 +0000 (21:23 +0000)
19 files changed:
current/Changes
current/LICENSE
current/MANIFEST
current/META.json
current/Makefile.PL
current/bs.pm [new file with mode: 0644]
current/dist.ini
current/lib/HTML/CalendarMonth.pm
current/lib/HTML/CalendarMonth/DateTool.pm
current/lib/HTML/CalendarMonth/DateTool/Cal.pm
current/lib/HTML/CalendarMonth/DateTool/DateCalc.pm
current/lib/HTML/CalendarMonth/DateTool/DateManip.pm
current/lib/HTML/CalendarMonth/DateTool/DateTime.pm
current/lib/HTML/CalendarMonth/DateTool/Ncal.pm
current/lib/HTML/CalendarMonth/DateTool/TimeLocal.pm
current/lib/HTML/CalendarMonth/Locale.pm
current/t/author-critic.t
current/t/dat/head.dat [new file with mode: 0644]
current/t/testload.pm

index 6d946d9409a0adbf0cb6c199f9d877e497aff862..5bed277d155f640b692762bf4604b066aed9b2a9 100644 (file)
@@ -1,5 +1,9 @@
 Revision history for HTML-CalendarMonth
 
+1.26  Fri Aug 26 15:08:49 EDT 2011
+        - fixed css/header interactions
+        - updated tests
+
 1.25  Fri Sep 24 03:09:38 EDT 2010
         - Switched to File::Which for finding cal/ncal
         - Added some sanity checks for the cal/ncal output
index e26392a6680c22187df0a40c6c54503a4a744e15..e2cf05c2a535226e8ace6116a5b6d1d32965d102 100644 (file)
@@ -1,4 +1,4 @@
-This software is copyright (c) 2010 by Matthew Sisk.
+This software is copyright (c) 2011 by Matthew Sisk.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
@@ -12,21 +12,22 @@ b) the "Artistic License"
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2010 by Matthew Sisk.
+This software is Copyright (c) 2011 by Matthew Sisk.
 
 This is free software, licensed under:
 
   The GNU General Public License, Version 1, February 1989
 
-                   GNU GENERAL PUBLIC LICENSE
-                    Version 1, February 1989
+                    GNU GENERAL PUBLIC LICENSE
+                     Version 1, February 1989
 
  Copyright (C) 1989 Free Software Foundation, Inc.
-                59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+                    51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-                           Preamble
+                            Preamble
 
   The license agreements of most software companies try to keep users
 at the mercy of those companies.  By contrast, our General Public
@@ -67,7 +68,7 @@ authors' reputations.
   The precise terms and conditions for copying, distribution and
 modification follow.
 
-                   GNU GENERAL PUBLIC LICENSE
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License Agreement applies to any program or other work which
@@ -185,7 +186,7 @@ make exceptions for this.  Our decision will be guided by the two goals
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-                           NO WARRANTY
+                            NO WARRANTY
 
   9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -207,9 +208,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-                    END OF TERMS AND CONDITIONS
+                     END OF TERMS AND CONDITIONS
 
-       Appendix: How to Apply These Terms to Your New Programs
+        Appendix: How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to humanity, the best way to achieve this is to make it
@@ -235,8 +236,9 @@ the exclusion of warranty; and each file should have at least the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software Foundation,
-    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
+
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -270,7 +272,7 @@ That's all there is to it!
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2010 by Matthew Sisk.
+This software is Copyright (c) 2011 by Matthew Sisk.
 
 This is free software, licensed under:
 
index 54556bf983f85313943c3a3ee5f10aa837bf28e4..88af1422b9d0f5d6948e410a0ca890f62a633235 100644 (file)
@@ -5,6 +5,7 @@ MANIFEST.SKIP
 META.json
 Makefile.PL
 README
+bs.pm
 dist.ini
 lib/HTML/CalendarMonth.pm
 lib/HTML/CalendarMonth/DateTool.pm
@@ -27,6 +28,7 @@ t/20_i8n.t
 t/21_narrow.t
 t/author-critic.t
 t/dat/bulk.dat
+t/dat/head.dat
 t/dat/i8n.dat
 t/dat/narrow.dat
 t/dat/odd.dat
index 6b466b34ce62614718f16cc2e2010e2f80858ecf..f73c0d840c1f011281b9cbf348ffd318d874113c 100644 (file)
@@ -4,7 +4,7 @@
       "Matthew P. Sisk <msisk@cpan.org>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Dist::Zilla version 4.101612, CPAN::Meta::Converter version 2.101610",
+   "generated_by" : "Dist::Zilla version 4.300000, CPAN::Meta::Converter version 2.112150",
    "license" : [
       "perl_5"
    ],
@@ -16,7 +16,7 @@
    "prereqs" : {
       "configure" : {
          "requires" : {
-            "ExtUtils::MakeMaker" : "6.31"
+            "ExtUtils::MakeMaker" : "6.30"
          }
       },
       "runtime" : {
             "File::Which" : 0,
             "HTML::ElementTable" : "1.18",
             "Time::Local" : 0,
-            "constant" : 0
+            "base" : 0,
+            "constant" : 0,
+            "strict" : 0,
+            "warnings" : 0
          }
       },
       "test" : {
@@ -43,6 +46,6 @@
       }
    },
    "release_status" : "stable",
-   "version" : "1.25"
+   "version" : "1.26"
 }
 
index dbaf014ee391d54a57ce04023ccbb93245bd7244..a682cfc8dff4fdfb508b54e0971326378f4abd49 100644 (file)
@@ -4,41 +4,44 @@ use warnings;
 
 
 
-use ExtUtils::MakeMaker 6.31;
+use ExtUtils::MakeMaker 6.30;
 
 
 
 my %WriteMakefileArgs = (
-  'ABSTRACT' => 'Generate and manipulate HTML calendar months',
-  'AUTHOR' => 'Matthew P. Sisk <msisk@cpan.org>',
-  'BUILD_REQUIRES' => {
-    'Cwd' => '0',
-    'English' => '0',
-    'Exporter' => '0',
-    'File::Spec' => '0',
-    'FindBin' => '0',
-    'Test::More' => '0',
-    'vars' => '0'
+  "ABSTRACT" => "Generate and manipulate HTML calendar months",
+  "AUTHOR" => "Matthew P. Sisk <msisk\@cpan.org>",
+  "BUILD_REQUIRES" => {
+    "Cwd" => 0,
+    "English" => 0,
+    "Exporter" => 0,
+    "File::Spec" => 0,
+    "FindBin" => 0,
+    "Test::More" => 0,
+    "vars" => 0
   },
-  'CONFIGURE_REQUIRES' => {
-    'ExtUtils::MakeMaker' => '6.31'
+  "CONFIGURE_REQUIRES" => {
+    "ExtUtils::MakeMaker" => "6.30"
   },
-  'DISTNAME' => 'HTML-CalendarMonth',
-  'EXE_FILES' => [],
-  'LICENSE' => 'perl',
-  'NAME' => 'HTML::CalendarMonth',
-  'PREREQ_PM' => {
-    'Carp' => '0',
-    'Class::Accessor' => '0',
-    'DateTime::Locale' => '0.45',
-    'File::Which' => '0',
-    'HTML::ElementTable' => '1.18',
-    'Time::Local' => '0',
-    'constant' => '0'
+  "DISTNAME" => "HTML-CalendarMonth",
+  "EXE_FILES" => [],
+  "LICENSE" => "perl",
+  "NAME" => "HTML::CalendarMonth",
+  "PREREQ_PM" => {
+    "Carp" => 0,
+    "Class::Accessor" => 0,
+    "DateTime::Locale" => "0.45",
+    "File::Which" => 0,
+    "HTML::ElementTable" => "1.18",
+    "Time::Local" => 0,
+    "base" => 0,
+    "constant" => 0,
+    "strict" => 0,
+    "warnings" => 0
   },
-  'VERSION' => '1.25',
-  'test' => {
-    'TESTS' => 't/*.t'
+  "VERSION" => "1.26",
+  "test" => {
+    "TESTS" => "t/*.t"
   }
 );
 
diff --git a/current/bs.pm b/current/bs.pm
new file mode 100644 (file)
index 0000000..e97acbe
--- /dev/null
@@ -0,0 +1,23 @@
+package bs;
+
+use Moose;
+with 'Dist::Zilla::Role::VersionProvider';
+with 'Dist::Zilla::Role::ModuleInfo';
+
+sub provide_version {
+  my ($self) = @_;
+
+  my $main_module = $self->zilla->main_module;
+  my $module = $main_module->name;
+
+  my $pm_info = $self->get_module_info($main_module);
+  my $ver     = $pm_info->version;
+
+  die "Unable to get version from $module" unless defined $ver;
+
+  $self->log("dist version $ver (from $module)");
+
+  "$ver";
+}
+
+1;
index 11692d649fc5bac16d4c0e5c936b05f563993ae3..c4d6cf1203dfb649115111880a545aa2b87efcc9 100644 (file)
@@ -1,10 +1,9 @@
 name             = HTML-CalendarMonth
+version          = 1.26
 author           = Matthew P. Sisk <msisk@cpan.org>
 license          = Perl_5
 copyright_holder = Matthew Sisk
 
-[VersionFromModule]
-
 [NextRelease]
 format =  %-5v %{eee LLL dd HH:MM:ss zzz yyyy}d
 
@@ -24,7 +23,7 @@ format =  %-5v %{eee LLL dd HH:MM:ss zzz yyyy}d
 
 [PkgVersion]
 
-[AutoPrereq]
+[AutoPrereqs]
 skip = ^testload|Date::Calc|Date::Manip|DateTime$
 
 [Manifest]
index 0e66eb89c06497b755b322810a9594ac063edc65..e618ffd3d83e83d1f595373d5e05149ce6d4cb95 100644 (file)
@@ -1,14 +1,12 @@
 package HTML::CalendarMonth;
-BEGIN {
-  $HTML::CalendarMonth::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::VERSION = '1.26';
 }
 
 use strict;
 use warnings;
 use Carp;
 
-BEGIN { $HTML::CalendarMonth::VERSION = 1.25 }
-
 use HTML::ElementTable 1.18;
 use HTML::CalendarMonth::Locale;
 use HTML::CalendarMonth::DateTool;
@@ -241,17 +239,15 @@ sub _gencal {
   $self->item($self->year)->replace_content($self->item_alias($self->year));
 
   if ($self->_head_my) {
-    if ($self->head_m) {
-      $self->item($self->month)->attr('colspan',$width - $self->year_span);
+    if ($self->head_m && $self->head_y) {
+      $self->item($self->year) ->attr('colspan', $self->year_span);
+      $self->item($self->month)->attr('colspan', $width - $self->year_span);
     }
-    else {
+    elsif ($self->head_y) {
       $self->item($self->month)->mask(1);
       $self->item($self->year)->attr('colspan', $width);
     }
-    if ($self->head_y) {
-      $self->item($self->year)->attr('colspan',$self->year_span);
-    }
-    else {
+    elsif ($self->head_m) {
       $self->item($self->year)->mask(1);
       $self->item($self->month)->attr('colspan', $width);
     }
@@ -307,11 +303,14 @@ sub _gencal {
 
   # css classes
   if ($self->enable_css) {
-    $self                             ->push_attr(class => 'hcm-table'     );
-    $self->item_row($self->dayheaders)->push_attr(class => 'hcm-day-head'  );
-    $self->item    ($self->year)      ->push_attr(class => 'hcm-year-head' );
-    $self->item    ($self->month)     ->push_attr(class => 'hcm-month-head');
-    $self->item    ($self->week_nums) ->push_attr(class => 'hcm-week-head' )
+    $self->push_attr(class => 'hcm-table');
+    $self->item_row($self->dayheaders)->push_attr(class => 'hcm-day-head')
+      if $self->head_dow;
+    $self->item($self->year)->push_attr(class => 'hcm-year-head')
+      if $self->head_y;
+    $self->item($self->month)->push_attr(class => 'hcm-month-head')
+      if $self->head_m;
+    $self->item($self->week_nums) ->push_attr(class => 'hcm-week-head')
       if $self->head_week;
   }
 
@@ -1076,6 +1075,10 @@ Specifies whether to display the year header. Default 1.
 
 Specifies whether to display days of the week header. Default 1.
 
+=item head_week
+
+Specifies whether to display the week-of-year numbering. Default 0.
+
 =item locale
 
 Specifies the id of the locale in which to render the calendar. Default
@@ -1104,10 +1107,6 @@ custom label you prefer. Lookups, such as C<day('Sun')>, will still use
 the locale string, but when the calendar is rendered the aliased value
 will appear.
 
-=item head_week
-
-Specifies whether to display the week-of-year numbering. Default 0.
-
 =item week_begin
 
 Specify first day of the week, which can be 1..7, starting with Sunday.
index 91df572ca0e895746e7c6eecdc9446c694260a19..0e752a3d5f9456c87045ba94b1f95d73ba68cf2a 100644 (file)
@@ -1,6 +1,6 @@
 package HTML::CalendarMonth::DateTool;
-BEGIN {
-  $HTML::CalendarMonth::DateTool::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::DateTool::VERSION = '1.26';
 }
 
 # Base class for determining what date calculation package to use.
@@ -210,6 +210,8 @@ sub _summon_date_class {
   my $self = shift;
   my @tools;
   if (my $c = $self->datetool) {
+    eval "use $c";
+    die "invalid date tool $c : $@" if $@;
     @tools = $c->_name;
   }
   else {
@@ -228,7 +230,7 @@ sub _summon_date_class {
   }
   return $dc if $dc;
   if (@tools == 1) {
-    croak "invalid date tool " . join(': ', @{$fails[0]}) if @tools == 1;
+    croak "invalid date tool " . join(': ', @{$fails[0]});
   }
   else {
     croak join("\n",
@@ -301,6 +303,8 @@ sub _datemanip_fails {
   return "not installed" unless $self->_datemanip_present;
   return "historic mode prior to 1752/09 not supported"
     if $self->historic && $self->_is_julian;
+  eval { require Date::Manip && Date::Manip::Date_Init() };
+  return "init failure: $@" if $@;
   return;
 }
 
@@ -311,6 +315,7 @@ sub _datemanip_present { eval "require Date::Manip"; return !$@ }
 sub _ncal_present      { shift->_ncal_cmd }
 sub _cal_present       { shift->_cal_cmd  };
 
+
 1;
 
 __END__
index 2d63e006f77fadb7b886aaceb415440a5e00396e..e416528bc178b51daf9f943e1c783263252b71a4 100644 (file)
@@ -1,6 +1,6 @@
 package HTML::CalendarMonth::DateTool::Cal;
-BEGIN {
-  $HTML::CalendarMonth::DateTool::Cal::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::DateTool::Cal::VERSION = '1.26';
 }
 
 # Interface to unix 'cal' command
index 38cbcbb3869b7bcacb585f0e90081ffbe49ce3c2..c359994bddfd255b0eff8ad753b692368ceeb99e 100644 (file)
@@ -1,6 +1,6 @@
 package HTML::CalendarMonth::DateTool::DateCalc;
-BEGIN {
-  $HTML::CalendarMonth::DateTool::DateCalc::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::DateTool::DateCalc::VERSION = '1.26';
 }
 
 # Interface to Date::Calc
index d13283a7c4552ed945f837895ae243c4c384d1c0..2531d1d97595e6f3466eea5ceded29369e51f94a 100644 (file)
@@ -1,6 +1,6 @@
 package HTML::CalendarMonth::DateTool::DateManip;
-BEGIN {
-  $HTML::CalendarMonth::DateTool::DateManip::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::DateTool::DateManip::VERSION = '1.26';
 }
 
 # Interface to Date::Manip
index a0b98b315f6df9be60bcaa6022bd534e031c2f07..b0727ac0151b372eb14c9dff4842be65a28af6bf 100644 (file)
@@ -1,6 +1,6 @@
 package HTML::CalendarMonth::DateTool::DateTime;
-BEGIN {
-  $HTML::CalendarMonth::DateTool::DateTime::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::DateTool::DateTime::VERSION = '1.26';
 }
 
 # Interface to DateTime
index 22fff0f107851c3158b111dad0f13d6a156aaaba..144f0a15272310286c5c0697f6ec2026aaf35d42 100644 (file)
@@ -1,6 +1,6 @@
 package HTML::CalendarMonth::DateTool::Ncal;
-BEGIN {
-  $HTML::CalendarMonth::DateTool::Ncal::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::DateTool::Ncal::VERSION = '1.26';
 }
 
 # Interface to linux 'ncal' command
index e04321b71938749fa927a71f5a0aa12eb27338e0..d107edb420b00cfce141b3613058eb4730e716b9 100644 (file)
@@ -1,6 +1,6 @@
 package HTML::CalendarMonth::DateTool::TimeLocal;
-BEGIN {
-  $HTML::CalendarMonth::DateTool::TimeLocal::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::DateTool::TimeLocal::VERSION = '1.26';
 }
 
 # Interface to Time::Local
index 248a90c318dc212edb978ce086a708333d2a2b29..1de33d9f47dd2070846b1f172e14fdde604fc3e1 100644 (file)
@@ -1,6 +1,6 @@
 package HTML::CalendarMonth::Locale;
-BEGIN {
-  $HTML::CalendarMonth::Locale::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::Locale::VERSION = '1.26';
 }
 
 # Front end class around DateTime::Locale. In addition to providing
index 7f4738749dc7419ed6b0eabcb0ad9834c9c414fb..af7f7ea243717699f778c0c0a79c393518052b4e 100644 (file)
@@ -16,4 +16,5 @@ use English qw(-no_match_vars);
 
 eval "use Test::Perl::Critic";
 plan skip_all => 'Test::Perl::Critic required to criticise code' if $@;
+Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc";
 all_critic_ok();
diff --git a/current/t/dat/head.dat b/current/t/dat/head.dat
new file mode 100644 (file)
index 0000000..2e410b7
--- /dev/null
@@ -0,0 +1,16 @@
+2010/01 0 0 0 0 1
+<table class="hcm-table"><tr><td></td><td></td><td></td><td></td><td></td><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td></tr><tr><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td></tr><tr><td>17</td><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td></tr><tr><td>24</td><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td></tr><tr><td>31</td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
+2010/01 0 0 0 0 2
+<table class="hcm-table"><tr><td></td><td></td><td></td><td></td><td>1</td><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td></tr><tr><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td></tr><tr><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td></tr><tr><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td>31</td></tr></table>
+2010/01 0 0 0 1 1
+<table class="hcm-table"><tr><td></td><td></td><td></td><td></td><td></td><td>1</td><td>2</td><td class="hcm-week-head">53</td></tr><tr><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td class="hcm-week-head">1</td></tr><tr><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td class="hcm-week-head">2</td></tr><tr><td>17</td><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td class="hcm-week-head">3</td></tr><tr><td>24</td><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td class="hcm-week-head">4</td></tr><tr><td>31</td><td></td><td></td><td></td><td></td><td></td><td></td><td class="hcm-week-head">5</td></tr></table>
+2010/01 0 0 0 1 2
+<table class="hcm-table"><tr><td></td><td></td><td></td><td></td><td>1</td><td>2</td><td>3</td><td class="hcm-week-head">53</td></tr><tr><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td class="hcm-week-head">1</td></tr><tr><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td class="hcm-week-head">2</td></tr><tr><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td><td class="hcm-week-head">3</td></tr><tr><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td>31</td><td class="hcm-week-head">4</td></tr></table>
+2010/01 0 0 1 0 1
+<table class="hcm-table"><tr><td class="hcm-day-head">Sun</td><td class="hcm-day-head">Mon</td><td class="hcm-day-head">Tue</td><td class="hcm-day-head">Wed</td><td class="hcm-day-head">Thu</td><td class="hcm-day-head">Fri</td><td class="hcm-day-head">Sat</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td></tr><tr><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td></tr><tr><td>17</td><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td></tr><tr><td>24</td><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td></tr><tr><td>31</td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
+2010/01 0 0 1 0 2
+<table class="hcm-table"><tr><td class="hcm-day-head">Mon</td><td class="hcm-day-head">Tue</td><td class="hcm-day-head">Wed</td><td class="hcm-day-head">Thu</td><td class="hcm-day-head">Fri</td><td class="hcm-day-head">Sat</td><td class="hcm-day-head">Sun</td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td></tr><tr><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td></tr><tr><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td></tr><tr><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td>31</td></tr></table>
+2010/01 0 0 1 1 1
+<table class="hcm-table"><tr><td class="hcm-day-head">Sun</td><td class="hcm-day-head">Mon</td><td class="hcm-day-head">Tue</td><td class="hcm-day-head">Wed</td><td class="hcm-day-head">Thu</td><td class="hcm-day-head">Fri</td><td class="hcm-day-head">Sat</td><td class="hcm-day-head"></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>1</td><td>2</td><td class="hcm-week-head">53</td></tr><tr><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td class="hcm-week-head">1</td></tr><tr><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td class="hcm-week-head">2</td></tr><tr><td>17</td><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td class="hcm-week-head">3</td></tr><tr><td>24</td><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td class="hcm-week-head">4</td></tr><tr><td>31</td><td></td><td></td><td></td><td></td><td></td><td></td><td class="hcm-week-head">5</td></tr></table>
+2010/01 0 0 1 1 2
+<table class="hcm-table"><tr><td class="hcm-day-head">Mon</td><td class="hcm-day-head">Tue</td><td class="hcm-day-head">Wed</td><td class="hcm-day-head">Thu</td><td class="hcm-day-head">Fri</td><td class="hcm-day-head">Sat</td><td class="hcm-day-head">Sun</td><td class="hcm-day-head"></td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>2</td><td>3</td><td class="hcm-week-head">53</td></tr><tr><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td class="hcm-week-head">1</td></tr><tr><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td class="hcm-week-head">2</td></tr><tr><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td><td class="hcm-week-head">3</td></tr><tr><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td>31</td><td class="hcm-week-head">4</td></tr></table>
index 1c30d0fa30547e619c749acd5940eb51bc7b74fa..fc4f23048a8c6b333ad591faf7487690760fff90 100644 (file)
@@ -16,6 +16,7 @@ require Exporter;
 use vars qw(
   $Dat_Dir
   $Bulk_File
+  $Head_File
   $Odd_File
   $Woy_File
   $I8N_File
@@ -24,7 +25,7 @@ use vars qw(
 
 @EXPORT = qw(
   $Dat_Dir
-  $Bulk_File $Odd_File $Woy_File $I8N_File $Narrow_File
+  $Bulk_File $Head_File $Odd_File $Woy_File $I8N_File $Narrow_File
   check_datetool
   check_bulk_with_datetool
   check_odd_with_datetool
@@ -53,12 +54,13 @@ BEGIN {
 }
 
 $Bulk_File   = File::Spec->catdir($Dat_Dir,   'bulk.dat');
+$Head_File   = File::Spec->catdir($Dat_Dir,   'head.dat');
 $Odd_File    = File::Spec->catdir($Dat_Dir,    'odd.dat');
 $Woy_File    = File::Spec->catdir($Dat_Dir,    'woy.dat');
 $I8N_File    = File::Spec->catdir($Dat_Dir,    'i8n.dat');
 $Narrow_File = File::Spec->catdir($Dat_Dir, 'narrow.dat');
 
-my(@Bulk, @Odd, @Woy, @I8N, @Nar);
+my(@Bulk, @Head, @Odd, @Woy, @I8N, @Nar);
 
 sub _load_file {
   my $f   = shift;
@@ -67,22 +69,24 @@ sub _load_file {
   return unless open(F, '<', $f);
   while (my $h = <F>) {
     chomp $h;
-    my($d, $wb) = split(/\s+/, $h);
+    my($d, $wb, @other) = split(/\s+/, $h);
     my($y, $m) = split(/\//, $d);
     my $c = <F>;
     chomp $c;
-    push(@$cal, [$d, $y, $m, $wb, clean($c)]);
+    push(@$cal, [$d, $y, $m, $wb, \@other, clean($c)]);
   }
   $cal;
 }
 
-_load_file($Bulk_File, \@Bulk   );
-_load_file($Odd_File,   \@Odd   );
-_load_file($Woy_File,    \@Woy  );
-_load_file($I8N_File,     \@I8N );
-_load_file($Narrow_File,   \@Nar);
+_load_file($Bulk_File, \@Bulk    );
+_load_file($Head_File,  \@Head   );
+_load_file($Odd_File,    \@Odd   );
+_load_file($Woy_File,     \@Woy  );
+_load_file($I8N_File,      \@I8N );
+_load_file($Narrow_File,    \@Nar);
 
 sub bulk_count   { scalar @Bulk }
+sub head_count   { scalar @Head }
 sub odd_count    { scalar @Odd  }
 sub woy_count    { scalar @Woy  }
 sub i8n_count    { scalar @I8N  }
@@ -121,7 +125,7 @@ sub check_bulk_with_datetool {
   my $datetool = shift;
   my @days;
   foreach (@Bulk) {
-    my($d, $y, $m, $wb, $tc) = @$_;
+    my($d, $y, $m, $wb, $other, $tc) = @$_;
     my $c = HTML::CalendarMonth->new(
       year       => $y,
       month      => $m,
@@ -140,11 +144,37 @@ sub check_bulk_with_datetool {
   }
 }
 
+sub check_head_with_datetool {
+  my $datetool = shift;
+  my @days;
+  foreach (@Head) {
+    my($d, $y, $m, $wb, $other, $tc) = @$_;
+    my($hm, $hy, $hd, $hw) = @$other;
+    my $c = HTML::CalendarMonth->new(
+      year       => $y,
+      month      => $m,
+      week_begin => $wb,
+      head_m     => $hm,
+      head_y     => $hy,
+      head_dow   => $hd,
+      head_week  => $hw,
+      datetool   => $datetool,
+    );
+    my $method = $c->_caltool->_name;
+    $method = "auto-select ($method)" unless $datetool;
+    my $msg = sprintf(
+      "(%d/%02d hm:%d hy:%d hd:%d hw:%d) using %s",
+      $y, $m, $hm, $hy, $hd, $hw, $method
+    );
+    cmp_ok(clean($c->as_HTML), 'eq', $tc, $msg);
+  }
+}
+
 sub check_odd_with_datetool {
   my $datetool = shift;
   my @days;
   foreach (@Odd) {
-    my($d, $y, $m, $wb, $tc) = @$_;
+    my($d, $y, $m, $wb, $other, $tc) = @$_;
     SKIP: {
       my $c;
       eval {
@@ -157,7 +187,7 @@ sub check_odd_with_datetool {
       };
       if ($@ || !$c) {
         croak $@ unless $@ =~ /(no|in)\s*valid date tool/i;
-        skip("$datetool skip odd $y/$m", 1);
+        skip("$datetool odd $y/$m", 1);
       }
       @days = $c->dayheaders unless @days;
       my $day1 = $days[$wb - 1];
@@ -175,7 +205,7 @@ sub check_odd_with_datetool {
 sub check_woy_with_datetool {
   my $datetool = shift;
   foreach (@Woy) {
-    my($d, $y, $m, $wb, $tc) = @$_;
+    my($d, $y, $m, $wb, $other, $tc) = @$_;
     my $c = HTML::CalendarMonth->new(
       year       => $y,
       month      => $m,
@@ -189,7 +219,7 @@ sub check_woy_with_datetool {
 
 sub check_i8n {
   foreach (@I8N) {
-    my($d, $y, $m, $id, $tc) = @$_;
+    my($d, $y, $m, $id, $other, $tc) = @$_;
     my $c = HTML::CalendarMonth->new(
       year   => $y,
       month  => $m,
@@ -207,7 +237,7 @@ sub check_i8n {
 sub check_narrow {
   my @days;
   foreach (@Nar) {
-    my($d, $y, $m, $wb, $tc) = @$_;
+    my($d, $y, $m, $wb, $other, $tc) = @$_;
     my $c = HTML::CalendarMonth->new(
       year       => $y,
       month      => $m,