From 9d8d5103edda5befbcae635c8a6edebe7431e094 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 19 Jun 2008 19:10:26 +0000 Subject: [PATCH] [svn-upgrade] Integrating new upstream version, libhtml-calendarmonth-perl (1.19) --- current/Changes | 11 ++++++++++ current/META.yml | 22 ++++++++++--------- current/README | 6 ++--- current/lib/HTML/CalendarMonth.pm | 4 ++-- .../HTML/CalendarMonth/DateTool/DateCalc.pm | 4 ++-- .../HTML/CalendarMonth/DateTool/DateManip.pm | 4 ++-- .../HTML/CalendarMonth/DateTool/DateTime.pm | 4 ++-- current/t/20_i8n.t | 20 ++++++++++------- current/t/testload.pm | 18 ++++++++++++--- 9 files changed, 61 insertions(+), 32 deletions(-) diff --git a/current/Changes b/current/Changes index 7f67f72..9c7f964 100644 --- a/current/Changes +++ b/current/Changes @@ -1,5 +1,16 @@ Revision history for Perl extension HTML-CalendarMonth. +1.19 Sat Mar 15 00:47:26 EDT 2008 + - Fixed longstanding test failure due to HTML::Tree (properly) + deciding to put quotes around numeric attributes in tags. + - Also changed i8n test to Zulu rather than Basque since the + DateTime::Local::eu (Basque) module no longer has + abbreviated day names + - Some of the DateTool modules had a minor bug in add_days() not + checking for defined vs 0 + - I released a calendar-related module update on the Ides of + March. I'm just sayin'. + 1.18 Fri Feb 24 15:53:41 EST 2006 - Fixed some scoping issues in DateTool/DateCalc.pm (thanks Carl Franks) diff --git a/current/META.yml b/current/META.yml index 2048e06..fcb9c14 100644 --- a/current/META.yml +++ b/current/META.yml @@ -1,15 +1,17 @@ -# http://module-build.sourceforge.net/META-spec.html -#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# -name: HTML-CalendarMonth -version: 1.18 -version_from: lib/HTML/CalendarMonth.pm -installdirs: site -requires: +--- #YAML:1.0 +name: HTML-CalendarMonth +version: 1.19 +abstract: ~ +license: ~ +author: ~ +generated_by: ExtUtils::MakeMaker version 6.42 +distribution_type: module +requires: Class::Accessor: 0 DateTime::Locale: 0 File::Spec: 0 HTML::ElementTable: 1.15 Time::Local: 0 - -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.30 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.3.html + version: 1.3 diff --git a/current/README b/current/README index 42df8e0..efd6c40 100644 --- a/current/README +++ b/current/README @@ -62,11 +62,11 @@ ACKNOWLEDGMENTS Thanks to William R. Ward for some conceptual nudging. Thanks to Fabian Aichele, Jarkko Hietaniemi, Wolfgang Jürgensen, and David 'Sniper' Rigaudiere for some suggestions on global calendar customs. Thanks to -Gael Marziou, Raul Rivero, T. Bugra Uytun, and Philipp W. for some -helpful bug spotting. +Gael Marziou, Raul Rivero, Ricardo Signes, T. Bugra Uytun, and Philipp +W. for some helpful bug spotting. COPYRIGHT -Copyright (c) 1999-2005 Matthew P. Sisk. All rights reserved. All wrongs +Copyright (c) 1999-2008 Matthew P. Sisk. All rights reserved. All wrongs revenged. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/current/lib/HTML/CalendarMonth.pm b/current/lib/HTML/CalendarMonth.pm index a3dd380..e98133e 100644 --- a/current/lib/HTML/CalendarMonth.pm +++ b/current/lib/HTML/CalendarMonth.pm @@ -3,7 +3,7 @@ package HTML::CalendarMonth; use strict; use vars qw($VERSION @ISA); -$VERSION = '1.18'; +$VERSION = '1.19'; use Carp; @@ -1292,7 +1292,7 @@ Matthew P. Sisk, EFE =head1 COPYRIGHT -Copyright (c) 1998-2005 Matthew P. Sisk. All rights reserved. All wrongs +Copyright (c) 1998-2008 Matthew P. Sisk. All rights reserved. All wrongs revenged. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/current/lib/HTML/CalendarMonth/DateTool/DateCalc.pm b/current/lib/HTML/CalendarMonth/DateTool/DateCalc.pm index 17c3ed5..90612f6 100644 --- a/current/lib/HTML/CalendarMonth/DateTool/DateCalc.pm +++ b/current/lib/HTML/CalendarMonth/DateTool/DateCalc.pm @@ -9,7 +9,7 @@ use vars qw(@ISA $VERSION); @ISA = qw(HTML::CalendarMonth::DateTool); -$VERSION = '0.02'; +$VERSION = '0.03'; use Date::Calc qw(Days_in_Month Day_of_Week Add_Delta_Days Weeks_in_Year Week_of_Year Week_Number Mktime @@ -45,7 +45,7 @@ sub dow { sub add_days { my($self, $delta, $day, $month, $year) = @_; - $delta || croak "Delta (in days) required.\n"; + defined $delta || croak "Delta (in days) required.\n"; $day || croak "Day required.\n"; $month ||= $self->month; $year ||= $self->year; diff --git a/current/lib/HTML/CalendarMonth/DateTool/DateManip.pm b/current/lib/HTML/CalendarMonth/DateTool/DateManip.pm index 0dadef0..882aed6 100644 --- a/current/lib/HTML/CalendarMonth/DateTool/DateManip.pm +++ b/current/lib/HTML/CalendarMonth/DateTool/DateManip.pm @@ -9,7 +9,7 @@ use vars qw(@ISA $VERSION); @ISA = qw(HTML::CalendarMonth::DateTool); -$VERSION = '0.01'; +$VERSION = '0.02'; use Date::Manip qw(Date_DaysInMonth Date_DayOfWeek DateCalc UnixDate Date_SecsSince1970); @@ -47,7 +47,7 @@ sub dow { sub add_days { my($self, $delta, $day, $month, $year) = @_; - $delta || croak "Delta (in days) required.\n"; + defined $delta || croak "Delta (in days) required.\n"; $day || croak "Day required.\n"; $month ||= $self->month; $year ||= $self->year; diff --git a/current/lib/HTML/CalendarMonth/DateTool/DateTime.pm b/current/lib/HTML/CalendarMonth/DateTool/DateTime.pm index f6e366d..9e6e13c 100644 --- a/current/lib/HTML/CalendarMonth/DateTool/DateTime.pm +++ b/current/lib/HTML/CalendarMonth/DateTool/DateTime.pm @@ -9,7 +9,7 @@ use vars qw(@ISA $VERSION); @ISA = qw(HTML::CalendarMonth::DateTool); -$VERSION = '0.01'; +$VERSION = '0.02'; use DateTime; @@ -42,7 +42,7 @@ sub dow { sub add_days { my($self, $delta, $day, $month, $year) = @_; - $delta || croak "Delta (in days) required.\n"; + defined $delta || croak "Delta (in days) required.\n"; $day || croak "Day required.\n"; $month ||= $self->month; $year ||= $self->year; diff --git a/current/t/20_i8n.t b/current/t/20_i8n.t index e59361f..d019792 100755 --- a/current/t/20_i8n.t +++ b/current/t/20_i8n.t @@ -1,29 +1,33 @@ #!/usr/bin/perl use strict; +use FindBin; +use lib $FindBin::RealBin; + +use testload; use Test::More tests => 2; use HTML::CalendarMonth; use HTML::CalendarMonth::Locale; -my $basque; +my $zulu; eval do { local $/; }; die "Oops on eval: $@\n" if $@; +$zulu = dq_nums($zulu); -# i8n (use basque as example) +# i8n (use zulu as example) my @stoof = HTML::CalendarMonth::Locale->locales; ok(@stoof > 20, 'i8n: locale ids retreived'); -my($year, $month) = (2000, 12); +my($year, $month) = (2008, 3); my $b = HTML::CalendarMonth->new( year => $year, month => $month, - head_week => 1, - locale => 'eu', + locale => 'zu', ); -my $bstr = $b->as_HTML; +my $bstr = dq_nums($b->as_HTML); chomp($bstr); -cmp_ok($bstr, 'eq', $basque, "i8n: ($year/$month : Basque) using auto-detect"); +cmp_ok($bstr, 'eq', $zulu, "i8n: ($year/$month : Zulu) using auto-detect"); __DATA__ -$basque = '
abendua2000
igalasazogorlr 
          1248
345678949
1011121314151650
1718192021222351
2425262728293052
31            1
'; +$zulu = '
Mashi2008
SonMsoBilThaSinHlaMgq
            1
2345678
9101112131415
16171819202122
23242526272829
3031         
' diff --git a/current/t/testload.pm b/current/t/testload.pm index cfb2546..9ee2181 100644 --- a/current/t/testload.pm +++ b/current/t/testload.pm @@ -12,6 +12,7 @@ require Exporter; @EXPORT = qw( $Dat_Dir check_datetool case_count check_basic_with_datetool check_woy_with_datetool + dq_nums ); use File::Spec; @@ -27,7 +28,7 @@ BEGIN { $pkg = File::Spec->canonpath($INC{$pkg}); my $file; ($vol, $dir, $file) = File::Spec->splitpath($pkg); - $base_dir = File::Spec->catpath($vol, $dir); + $base_dir = File::Spec->catpath($vol, $dir, ''); } $Dat_Dir = $base_dir; @@ -68,6 +69,17 @@ while () { close(D); +############# + +# guard against HTML::Tree starting to quote numeric attrs as of +# v3.19_02 + +sub dq_nums { + my $str = shift; + $str =~ s/\"(\d+)\"/$1/g; + return $str; +} + sub case_count { scalar @Cals } sub check_datetool { @@ -89,7 +101,7 @@ sub check_basic_with_datetool { datetool => $datetool, ); my $day1 = $days[$cal->[3] - 1]; - cmp_ok($c->as_HTML, 'eq', $cal->[2], + cmp_ok(dq_nums($c->as_HTML), 'eq', $cal->[2], sprintf("(%d/%-02d %s 1st day) using %s", $cal->[0], $cal->[1], $day1, $method)); if ($DEBUG && $c->as_HTML ne $cal->[2]) { @@ -109,7 +121,7 @@ sub check_woy_with_datetool { head_week => 1, datetool => $datetool, ); - my $ct = $cal->as_HTML; + my $ct = dq_nums($cal->as_HTML); chomp $ct; cmp_ok($ct, 'eq', $tc, "($year/$month week of year) using $datetool"); if ($DEBUG && $ct ne $tc) { -- 2.39.2