Hello community,

here is the log from the commit of package perl-Time-Period for openSUSE:Factory
checked in at Mon Feb 28 12:11:16 CET 2011.



--------
--- perl-Time-Period/perl-Time-Period.changes   2011-02-16 10:14:49.000000000 
+0100
+++ /mounts/work_src_done/STABLE/perl-Time-Period/perl-Time-Period.changes      
2011-02-28 10:53:06.000000000 +0100
@@ -1,0 +2,11 @@
+Mon Feb 28 09:38:38 UTC 2011 - [email protected]
+
+- update to 1.23
+  - Bug fixes:
+        - Validate min and max for right side of hour ranges (e.g.
+          hr { 20-25 } now correctly returns -1)
+        - Range for yd is now 1 to 366
+        - Years are no longer considered to be 365 days long for
+          calculating a 4-digit year.
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
  Time-Period-1.22.tar.bz2

New:
----
  Time-Period-1.23.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Time-Period.spec ++++++
--- /var/tmp/diff_new_pack.CLzwZA/_old  2011-02-28 12:10:49.000000000 +0100
+++ /var/tmp/diff_new_pack.CLzwZA/_new  2011-02-28 12:10:49.000000000 +0100
@@ -20,7 +20,7 @@
 
 Name:           perl-Time-Period
 %define cpan_name Time-Period
-Version:        1.22
+Version:        1.23
 Release:        1
 AutoReqProv:    on
 Group:          Development/Libraries/Perl

++++++ Time-Period-1.22.tar.bz2 -> Time-Period-1.23.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Time-Period-1.22/META.yml 
new/Time-Period-1.23/META.yml
--- old/Time-Period-1.22/META.yml       2011-02-15 12:33:00.000000000 +0100
+++ new/Time-Period-1.23/META.yml       2011-02-27 11:53:20.000000000 +0100
@@ -17,4 +17,4 @@
 requires:
   Exporter: 0
   perl: 5.001
-version: 1.22
+version: 1.23
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Time-Period-1.22/Makefile.PL 
new/Time-Period-1.23/Makefile.PL
--- old/Time-Period-1.22/Makefile.PL    2011-02-15 12:33:00.000000000 +0100
+++ new/Time-Period-1.23/Makefile.PL    2011-02-27 11:53:20.000000000 +0100
@@ -25,7 +25,7 @@
   'PREREQ_PM' => {
     'Exporter' => '0'
   },
-  'VERSION' => '1.22',
+  'VERSION' => '1.23',
   'test' => {
     'TESTS' => 't/*.t'
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Time-Period-1.22/dist.ini 
new/Time-Period-1.23/dist.ini
--- old/Time-Period-1.22/dist.ini       2011-02-15 12:32:59.000000000 +0100
+++ new/Time-Period-1.23/dist.ini       2011-02-27 11:53:19.000000000 +0100
@@ -2,7 +2,7 @@
 author  = Patrick Ryan, Paul Boyd <[email protected]>
 license = Perl_5
 
-version = 1.22
+version = 1.23
 
 [GatherDir]
 [PruneCruft]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Time-Period-1.22/lib/Time/Period.pm 
new/Time-Period-1.23/lib/Time/Period.pm
--- old/Time-Period-1.22/lib/Time/Period.pm     2011-02-15 12:33:00.000000000 
+0100
+++ new/Time-Period-1.23/lib/Time/Period.pm     2011-02-27 11:53:20.000000000 
+0100
@@ -43,7 +43,7 @@
        month  |  mo   | 1-12  or  jan, feb, mar, apr, may, jun, jul,
               |       |           aug, sep, oct, nov, dec
        week   |  wk   | 1-6
-       yday   |  yd   | 1-365
+       yday   |  yd   | 1-366
        mday   |  md   | 1-31
        wday   |  wd   | 1-7   or  su, mo, tu, we, th, fr, sa
        hour   |  hr   | 0-23  or  12am 1am-11am 12noon 12pm 1pm-11pm
@@ -160,10 +160,19 @@
 
 =head1 VERSION
 
-1.22
+1.23
 
 =head1 HISTORY
 
+        Version 1.23
+        ------------
+                - Bug fixes:
+                    - Validate min and max for right side of hour ranges (e.g.
+                      hr { 20-25 } now correctly returns -1)
+                    - Range for yd is now 1 to 366
+                    - Years are no longer considered to be 365 days long for
+                      calculating a 4-digit year.
+
         Version 1.22
         ------------
                 - Fixed tests
@@ -196,7 +205,7 @@
 
 Patrick Ryan <[email protected]> wrote it.
 
-Paul Boyd <[email protected]> fixed a bug and wrote some tests.
+Paul Boyd <[email protected]> fixed a few bugs.
 
 =head1 COPYRIGHT
 
@@ -213,7 +222,7 @@
 @ISA = qw(Exporter);
 @EXPORT = qw(inPeriod);
 
-$VERSION = "1.22";
+$VERSION = "1.23";
 
 sub inPeriod {
 
@@ -386,7 +395,7 @@
   # The assumption for the ranges from localtime are
   #   Year      ($yr)  = 0-99
   #   Month     ($mo)  = 0-11
-  #   Year Day  ($yd)  = 0-364
+  #   Year Day  ($yd)  = 0-365
   #   Month Day ($md)  = 1-31
   #   Week Day  ($wd)  = 0-6
   #   Hour      ($hr)  = 0-23
@@ -394,7 +403,7 @@
   #   Second    ($sec) = 0-59
 
   # Calculate the full year (yyyy).
-  $yr = int($time / 31536000) + 1970;
+  $yr += 1900;
 
   # Figure out which week $time is in ($wk) so that $wk goes from 0-5.
 
@@ -565,8 +574,8 @@
     return -1 if ( ($v1 =~ /\D/) || ($v2 =~ /\D/) );
     $v1--;
     $v2--;
-    return -1 if ( ($v1 < 0) || ($v1 > 364) );
-    return -1 if ( ($v2 < 0) || ($v2 > 364) );
+    return -1 if ( ($v1 < 0) || ($v1 > 365) );
+    return -1 if ( ($v2 < 0) || ($v2 > 365) );
     if ($v1 > $v2) {
       return 1 if ( ($v1 <= $yd) || ($v2 >= $yd) );
     } else {
@@ -574,7 +583,7 @@
     }
   } else {
     $range--;
-    return -1 if (($range =~ /\D/) || ($range < 0) || ($range > 364));
+    return -1 if (($range =~ /\D/) || ($range < 0) || ($range > 365));
     return 1 if ($range == $yd);
   }
 
@@ -712,6 +721,7 @@
       $v2 = $1;
     }
     return -1 if ( ($v1 =~ /\D/) || ($v1 < 0) || ($v1 > 23) );
+    return -1 if ( ($v2 =~ /\D/) || ($v2 < 0) || ($v2 > 23) );
 
     if ($v1 > $v2) {
       return 1 if ( ($v1 <= $hr) || ($v2 >= $hr) );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Time-Period-1.22/t/03_year.t 
new/Time-Period-1.23/t/03_year.t
--- old/Time-Period-1.22/t/03_year.t    2011-02-15 12:32:59.000000000 +0100
+++ new/Time-Period-1.23/t/03_year.t    2011-02-27 11:53:19.000000000 +0100
@@ -29,14 +29,9 @@
 is(inPeriod(0, 'yr {_ - 2000}'), -1, 'should return -1 for non-alphnumeric 
years (left)');
 is(inPeriod(0, 'yr {2000 - _}'), -1, 'should return -1 for non-alphnumeric 
years (right)');
 
-TODO: {
-    local $TODO='years should have 366 days in leap year, but they don\'t';
-
-    # This is an old bug, the 4-digit year calculation used to assume 365 days
-    # were in a year, consequently the last day of the a leap year appeared to
-    # be in the following year. See
-    # https://rt.cpan.org/Public/Bug/Display.html?id=6353
-    #
-    # (1356930000 = Mon Dec 31 00:00:00 EST 2012)
-    is(inPeriod(1356930000, 'yr {2012}'), 1, 'should be able to match the last 
day of the year on leap year');
-}
+# This is an old bug, the 4-digit year calculation used to assume 365 days were
+# in a year, consequently the last day of the a leap year appeared to be in
+# the following year. See https://rt.cpan.org/Public/Bug/Display.html?id=6353
+#
+# (1356930000 = Mon Dec 31 00:00:00 EST 2012)
+is(inPeriod(1356930000, 'yr {2012}'), 1, 'should be able to match the last day 
of the year on leap year');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Time-Period-1.22/t/06_year_day.t 
new/Time-Period-1.23/t/06_year_day.t
--- old/Time-Period-1.22/t/06_year_day.t        2011-02-15 12:32:59.000000000 
+0100
+++ new/Time-Period-1.23/t/06_year_day.t        2011-02-27 11:53:19.000000000 
+0100
@@ -33,9 +33,6 @@
 is(inPeriod(0, 'yd {367-1}'), -1, 'should return -1 for day numbers greater 
than 366 (left)');
 is(inPeriod(0, 'yd {1-367}'), -1, 'should return -1 for day numbers greater 
than 366 (right)');
 
-TODO: {
-    local $TODO='should support matching day 366 in leap year, but it 
doesn\'t';
-    # Dec 31 00:00:00 2012
-    my $last_day = POSIX::mktime(0, 0, 0, 31, 11, 112);
-    is(inPeriod($last_day, 'yd {366}'), 1, 'should be able to match the last 
day of the year on leap year');
-}
+# Dec 31 00:00:00 2012
+my $last_day = POSIX::mktime(0, 0, 0, 31, 11, 112);
+is(inPeriod($last_day, 'yd {366}'), 1, 'should be able to match the last day 
of the year on leap year');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Time-Period-1.22/t/08_hour.t 
new/Time-Period-1.23/t/08_hour.t
--- old/Time-Period-1.22/t/08_hour.t    2011-02-15 12:32:59.000000000 +0100
+++ new/Time-Period-1.23/t/08_hour.t    2011-02-27 11:53:19.000000000 +0100
@@ -51,8 +51,5 @@
 is(inPeriod($base_date + $hour * 12, 'hr {12pm-13}'), 1, '12pm should be 
treated as noon (left)');
 is(inPeriod($base_date + $hour * 12, 'hr {11-12pm}'), 1, '12pm should be 
treated as noon (right)');
 
-TODO: {
-    local $TODO = "missing checks for right side of range";
-    is(inPeriod(0, 'hr {3 - one}'), -1, 'should return -1 for non-numeric 
hours (right)');
-    is(inPeriod(0, 'hr {1-24}'), -1, 'should return -1 for hours greater than 
23 (right)');
-}
+is(inPeriod(0, 'hr {3 - one}'), -1, 'should return -1 for non-numeric hours 
(right)');
+is(inPeriod(0, 'hr {1-24}'), -1, 'should return -1 for hours greater than 23 
(right)');


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to