Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-DateTime-Calendar-Julian for 
openSUSE:Factory checked in at 2022-02-11 23:06:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-DateTime-Calendar-Julian (Old)
 and      /work/SRC/openSUSE:Factory/.perl-DateTime-Calendar-Julian.new.1956 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-DateTime-Calendar-Julian"

Fri Feb 11 23:06:52 2022 rev:9 rq:952741 version:0.107

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-DateTime-Calendar-Julian/perl-DateTime-Calendar-Julian.changes
      2021-09-30 23:43:45.788494645 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-DateTime-Calendar-Julian.new.1956/perl-DateTime-Calendar-Julian.changes
    2022-02-11 23:07:32.586628100 +0100
@@ -1,0 +2,14 @@
+Mon Jan 31 03:06:09 UTC 2022 - Tina M??ller <timueller+p...@suse.de>
+
+- updated to 0.107
+   see /usr/share/doc/packages/perl-DateTime-Calendar-Julian/Changes
+
+  0.107                2022-01-30      T. R. Wyant
+      Add method calendar_name(), which returns 'Julian'.
+      Require DateTime 1.48 for is_last_day_of_quarter().  This is a
+      significant bump, since the previous was 0.08.
+      Update Perl requirement in metadata to 5.008004.  It was always this
+      in fact, since DateTime requires this, as does Makefile.PL.
+      Add support for quarters.
+
+-------------------------------------------------------------------

Old:
----
  DateTime-Calendar-Julian-0.106.tar.gz

New:
----
  DateTime-Calendar-Julian-0.107.tar.gz

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

Other differences:
------------------
++++++ perl-DateTime-Calendar-Julian.spec ++++++
--- /var/tmp/diff_new_pack.FLLbjC/_old  2022-02-11 23:07:34.066632211 +0100
+++ /var/tmp/diff_new_pack.FLLbjC/_new  2022-02-11 23:07:34.070632222 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-DateTime-Calendar-Julian
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define cpan_name DateTime-Calendar-Julian
 Name:           perl-DateTime-Calendar-Julian
-Version:        0.106
+Version:        0.107
 Release:        0
 Summary:        Dates in the Julian calendar
 License:        Artistic-1.0 OR GPL-1.0-or-later
@@ -28,9 +28,9 @@
 BuildArch:      noarch
 BuildRequires:  perl
 BuildRequires:  perl-macros
-BuildRequires:  perl(DateTime) >= 0.08
+BuildRequires:  perl(DateTime) >= 1.48
 BuildRequires:  perl(Test::More) >= 0.88
-Requires:       perl(DateTime) >= 0.08
+Requires:       perl(DateTime) >= 1.48
 %{perl_requires}
 
 %description

++++++ DateTime-Calendar-Julian-0.106.tar.gz -> 
DateTime-Calendar-Julian-0.107.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Calendar-Julian-0.106/Changes 
new/DateTime-Calendar-Julian-0.107/Changes
--- old/DateTime-Calendar-Julian-0.106/Changes  2021-09-25 14:56:27.000000000 
+0200
+++ new/DateTime-Calendar-Julian-0.107/Changes  2022-01-30 15:15:58.000000000 
+0100
@@ -1,3 +1,14 @@
+0.107          2022-01-30      T. R. Wyant
+    Add method calendar_name(), which returns 'Julian'.
+
+    Require DateTime 1.48 for is_last_day_of_quarter().  This is a
+    significant bump, since the previous was 0.08.
+
+    Update Perl requirement in metadata to 5.008004.  It was always this
+    in fact, since DateTime requires this, as does Makefile.PL.
+
+    Add support for quarters.
+
 0.106          2021-09-25      T. R. Wyant
     Correct repository links in metadata.  Thanks to Keith Thompson for
     finding and reporting this.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Calendar-Julian-0.106/MANIFEST 
new/DateTime-Calendar-Julian-0.107/MANIFEST
--- old/DateTime-Calendar-Julian-0.106/MANIFEST 2021-02-25 23:28:01.000000000 
+0100
+++ new/DateTime-Calendar-Julian-0.107/MANIFEST 2022-01-20 01:22:17.000000000 
+0100
@@ -9,6 +9,7 @@
 t/1.t
 t/4doy.t
 t/5week.t
+t/6quarter.t
 xt/author/basic.t
 xt/author/changes.t
 xt/author/critic.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Calendar-Julian-0.106/META.json 
new/DateTime-Calendar-Julian-0.107/META.json
--- old/DateTime-Calendar-Julian-0.106/META.json        2021-09-25 
14:56:56.000000000 +0200
+++ new/DateTime-Calendar-Julian-0.107/META.json        2022-01-30 
15:16:17.000000000 +0100
@@ -5,7 +5,7 @@
       "Thomas R. Wyant, III <wyant at cpan dot org>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "perl_5"
    ],
@@ -34,8 +34,8 @@
       },
       "runtime" : {
          "requires" : {
-            "DateTime" : "0.08",
-            "perl" : "5.006002",
+            "DateTime" : "1.48",
+            "perl" : "5.008004",
             "strict" : "0",
             "vars" : "0",
             "warnings" : "0"
@@ -45,7 +45,7 @@
    "provides" : {
       "DateTime::Calendar::Julian" : {
          "file" : "lib/DateTime/Calendar/Julian.pm",
-         "version" : "0.106"
+         "version" : "0.107"
       }
    },
    "release_status" : "stable",
@@ -63,6 +63,6 @@
          "web" : "https://github.com/trwyant/perl-DateTime-Calendar-Julian";
       }
    },
-   "version" : "0.106",
-   "x_serialization_backend" : "JSON::PP version 4.06"
+   "version" : "0.107",
+   "x_serialization_backend" : "JSON::PP version 4.07"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Calendar-Julian-0.106/META.yml 
new/DateTime-Calendar-Julian-0.107/META.yml
--- old/DateTime-Calendar-Julian-0.106/META.yml 2021-09-25 14:56:55.000000000 
+0200
+++ new/DateTime-Calendar-Julian-0.107/META.yml 2022-01-30 15:16:16.000000000 
+0100
@@ -8,7 +8,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 
2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -22,10 +22,10 @@
 provides:
   DateTime::Calendar::Julian:
     file: lib/DateTime/Calendar/Julian.pm
-    version: '0.106'
+    version: '0.107'
 requires:
-  DateTime: '0.08'
-  perl: '5.006002'
+  DateTime: '1.48'
+  perl: '5.008004'
   strict: '0'
   vars: '0'
   warnings: '0'
@@ -33,5 +33,5 @@
   bugtracker: 
https://rt.cpan.org/Public/Dist/Display.html?Name=DateTime-Calendar-Julian
   license: http://dev.perl.org/licenses/
   repository: git://github.com/trwyant/perl-DateTime-Calendar-Julian.git
-version: '0.106'
+version: '0.107'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Calendar-Julian-0.106/Makefile.PL 
new/DateTime-Calendar-Julian-0.107/Makefile.PL
--- old/DateTime-Calendar-Julian-0.106/Makefile.PL      2021-09-13 
01:33:45.000000000 +0200
+++ new/DateTime-Calendar-Julian-0.107/Makefile.PL      2022-01-21 
15:44:08.000000000 +0100
@@ -12,7 +12,7 @@
     NAME               => 'DateTime::Calendar::Julian',
     VERSION_FROM       => 'lib/DateTime/Calendar/Julian.pm',
     PREREQ_PM          => {
-       DateTime        => 0.08,
+       DateTime        => 1.48,        # For is_last_day_of_{quarter,year}
        strict          => 0,
        vars            => 0,
        warnings        => 0,
@@ -58,7 +58,7 @@
 }
 
 $mmv >= 6.4701
-    and $args{MIN_PERL_VERSION} = 5.006002;
+    and $args{MIN_PERL_VERSION} = 5.008004;
 
 $mmv >= 6.5702
     or $args{AUTHOR} = join ', ', @{ $args{AUTHOR} };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DateTime-Calendar-Julian-0.106/lib/DateTime/Calendar/Julian.pm 
new/DateTime-Calendar-Julian-0.107/lib/DateTime/Calendar/Julian.pm
--- old/DateTime-Calendar-Julian-0.106/lib/DateTime/Calendar/Julian.pm  
2021-09-25 14:56:27.000000000 +0200
+++ new/DateTime-Calendar-Julian-0.107/lib/DateTime/Calendar/Julian.pm  
2022-01-30 15:15:58.000000000 +0100
@@ -5,7 +5,7 @@
 
 use vars qw($VERSION @ISA);
 
-$VERSION = '0.106';
+$VERSION = '0.107';
 
 use DateTime 0.08;
 @ISA = 'DateTime';
@@ -44,27 +44,44 @@
     return $rd;
 }
 
-sub _rd2ymd {  ## no critic (ProhibitUnusedPrivateSubroutines)
-    my ($self, $rd, $extra) = @_;
-
-    my $z = $rd + 308;
-    my $y = _floor(($z*100-25)/36525);
-    my $c = $z - _floor(365.25*$y);
-    my $m = int((5*$c + 456)/153);
-    my $d = $c - $start_of_month[$m-3];
-    if ($m > 12) {
-        $m -= 12;
-        $y++;
+{
+    my @QuarterStart = my @LeapYearQuarterStart = ( 0, 90, 181, 273 );
+    $LeapYearQuarterStart[$_] += 1 for 1 .. 3;
+
+    sub _rd2ymd {      ## no critic (ProhibitUnusedPrivateSubroutines)
+       my ($class, $rd, $extra) = @_;
+
+       my $z = $rd + 308;
+       my $y = _floor(($z*100-25)/36525);
+       my $c = $z - _floor(365.25*$y);
+       my $m = int((5*$c + 456)/153);
+       my $d = $c - $start_of_month[$m-3];
+       if ($m > 12) {
+           $m -= 12;
+           $y++;
+       }
+
+       if ($extra) {
+           # day_of_week, day_of_year
+           my $doy = ($c + 31 + 28 - 1)%365 + 1 +
+                         ($class->_is_leap_year($y) && $m > 2);
+           my $dow = (($rd + 6)%7) + 1;
+
+           # quarter -- see DateTime::PP->rd2ymd()
+           my $quarter = int( ( 1 / 3.1 ) * $m ) + 1;
+
+           my $doq = $doy - ( $class->_is_leap_year( $y ) ?
+               $LeapYearQuarterStart[ $quarter - 1 ] :
+               $QuarterStart[ $quarter - 1 ] );
+
+           return $y, $m, $d, $dow, $doy, $quarter, $doq;
+       }
+       return $y, $m, $d;
     }
+}
 
-    if ($extra) {
-        # day_of_week, day_of_year
-        my $doy = ($c + 31 + 28 - 1)%365 + 1 +
-                      ($self->_is_leap_year($y) && $m > 2);
-        my $dow = (($rd + 6)%7) + 1;
-        return $y, $m, $d, $dow, $doy;
-    }
-    return $y, $m, $d;
+sub calendar_name {
+    return 'Julian';
 }
 
 sub epoch {
@@ -139,6 +156,10 @@
 
 =over 4
 
+=item * calendar_name
+
+Returns C<'Julian'>.
+
 =item * gregorian_deviation
 
 Returns the difference in days between the Gregorian and the Julian
@@ -165,6 +186,9 @@
 
 =back
 
+B<Note> that as of version C<0.106_01>, methods related to quarters
+should work.
+
 =head1 BACKGROUND
 
 The Julian calendar was introduced by Julius Caesar in 46BC.  It
@@ -206,7 +230,7 @@
 
 Copyright (c) 2003 Eugene van der Pijll.  All rights reserved.
 
-Copyright (C) 2018-2021 Thomas R. Wyant, III
+Copyright (C) 2018-2022 Thomas R. Wyant, III
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Calendar-Julian-0.106/t/1.t 
new/DateTime-Calendar-Julian-0.107/t/1.t
--- old/DateTime-Calendar-Julian-0.106/t/1.t    2019-10-31 18:20:53.000000000 
+0100
+++ new/DateTime-Calendar-Julian-0.107/t/1.t    2022-01-23 04:04:49.000000000 
+0100
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 42;
+use Test::More tests => 43;
 BEGIN { use_ok('DateTime::Calendar::Julian') };
 
 #########################
@@ -75,3 +75,5 @@
 $d = DateTime::Calendar::Julian->new( year => 1900, month => 10, day => 1, 
time_zone => 'floating');
 $d->add( years => 1 );
 is($d->ymd, '1901-10-01', 'adding a year');
+
+is( $d->calendar_name, 'Julian', 'Calendar name' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Calendar-Julian-0.106/t/6quarter.t 
new/DateTime-Calendar-Julian-0.107/t/6quarter.t
--- old/DateTime-Calendar-Julian-0.106/t/6quarter.t     1970-01-01 
01:00:00.000000000 +0100
+++ new/DateTime-Calendar-Julian-0.107/t/6quarter.t     2022-01-21 
15:43:50.000000000 +0100
@@ -0,0 +1,209 @@
+package main;
+
+use 5.008004;
+
+use strict;
+use warnings;
+
+use DateTime::Calendar::Julian;
+use Test::More 0.88;   # Because of done_testing();
+
+note <<'EOD';
+
+The following from DateTime t/03components.t
+
+EOD
+
+{
+    my $d = DateTime::Calendar::Julian->new(
+        year      => 2001,
+        month     => 7,
+        day       => 5,
+        hour      => 2,
+        minute    => 12,
+        second    => 50,
+        time_zone => 'UTC',
+    );
+
+    is( $d->quarter,        3,      '->quarter' );
+    is( $d->day_of_quarter,   5,          '->day_of_quarter' );
+    is( $d->day_of_quarter_0, 4,          '->day_of_quarter_0' );
+    ok( !$d->is_last_day_of_quarter, '->is_last_day_of_quarter' );
+    is( $d->quarter_length, 92,  '->quarter_length' );
+
+    is( $d->quarter_abbr, 'Q3',          '->quarter_abbr' );
+    is( $d->quarter_name, '3rd quarter', '->quarter_name' );
+}
+
+{
+    my @tests = (
+        { year => 2017, month => 8,  day => 19, expect => 0 },
+        { year => 2017, month => 3,  day => 31, expect => 1 },
+        { year => 2017, month => 6,  day => 30, expect => 1 },
+        { year => 2017, month => 9,  day => 30, expect => 1 },
+        { year => 2017, month => 12, day => 31, expect => 1 },
+    );
+
+    for my $t (@tests) {
+        my $expect = delete $t->{expect};
+
+        my $dt = DateTime::Calendar::Julian->new($t);
+
+        my $is = $dt->is_last_day_of_quarter;
+        ok( ( $expect ? $is : !$is ), '->is_last_day_of_quarter' );
+    }
+}
+
+{
+    my $dt = DateTime::Calendar::Julian->new( year => 1995, month => 2, day => 
1 );
+
+    is( $dt->quarter,        1,  '->quarter is 1' );
+    is( $dt->day_of_quarter, 32, '->day_of_quarter' );
+    is( $dt->quarter_length, 90, '->quarter_length' );
+}
+
+{
+    my $dt = DateTime::Calendar::Julian->new( year => 1995, month => 2, day => 
1 );
+
+    is( $dt->quarter,        1,  '->quarter is 1' );
+    is( $dt->day_of_quarter, 32, '->day_of_quarter' );
+    is( $dt->quarter_length, 90, '->quarter_length' );
+}
+
+{
+    my $dt = DateTime::Calendar::Julian->new( year => 1995, month => 5, day => 
1 );
+
+    is( $dt->quarter,        2,  '->quarter is 2' );
+    is( $dt->day_of_quarter, 31, '->day_of_quarter' );
+    is( $dt->quarter_length, 91, '->quarter_length' );
+}
+
+{
+    my $dt = DateTime::Calendar::Julian->new( year => 1995, month => 8, day => 
1 );
+
+    is( $dt->quarter,        3,  '->quarter is 3' );
+    is( $dt->day_of_quarter, 32, '->day_of_quarter' );
+    is( $dt->quarter_length, 92, '->quarter_length' );
+}
+
+{
+    my $dt = DateTime::Calendar::Julian->new( year => 1995, month => 11, day 
=> 1 );
+
+    is( $dt->quarter,        4,  '->quarter is 4' );
+    is( $dt->day_of_quarter, 32, '->day_of_quarter' );
+    is( $dt->quarter_length, 92, '->quarter_length' );
+}
+
+{
+    my $dt = DateTime::Calendar::Julian->new( year => 1996, month => 2, day => 
1 );
+
+    is( $dt->quarter,        1,  '->quarter is 1' );
+    is( $dt->day_of_quarter, 32, '->day_of_quarter' );
+    is( $dt->quarter_length, 91, '->quarter_length' );
+}
+
+{
+    my $dt = DateTime::Calendar::Julian->new( year => 1996, month => 5, day => 
1 );
+
+    is( $dt->quarter,        2,  '->quarter is 2' );
+    is( $dt->day_of_quarter, 31, '->day_of_quarter' );
+    is( $dt->quarter_length, 91, '->quarter_length' );
+}
+
+{
+    my $dt = DateTime::Calendar::Julian->new( year => 1996, month => 8, day => 
1 );
+
+    is( $dt->quarter,        3,  '->quarter is 3' );
+    is( $dt->day_of_quarter, 32, '->day_of_quarter' );
+    is( $dt->quarter_length, 92, '->quarter_length' );
+}
+
+{
+    my $dt = DateTime::Calendar::Julian->new( year => 1996, month => 11, day 
=> 1 );
+
+    is( $dt->quarter,        4,  '->quarter is 4' );
+    is( $dt->day_of_quarter, 32, '->day_of_quarter' );
+    is( $dt->quarter_length, 92, '->quarter_length' );
+}
+
+note <<'EOD';
+
+The following are Julian-specific
+
+EOD
+
+foreach my $info (
+    {
+       year    => 1500,        # A leap year Julian, but not Gregorian
+       month   => 1,
+       day     => 22,
+       quarter => 1,
+       day_of_quarter  => 22,
+       quarter_length  => 91,
+    },
+    {
+       year    => 1500,        # A leap year Julian, but not Gregorian
+       month   => 3,
+       day     => 1,
+       quarter => 1,
+       day_of_quarter  => 61,
+       quarter_length  => 91,
+    },
+    {
+       year    => 1500,        # A leap year Julian, but not Gregorian
+       month   => 4,
+       day     => 1,
+       quarter => 2,
+       day_of_quarter  => 1,
+       quarter_length  => 91,
+    },
+    {
+       year    => 1501,        # Not a leap year
+       month   => 1,
+       day     => 22,
+       quarter => 1,
+       day_of_quarter  => 22,
+       quarter_length  => 90,
+    },
+    {
+       year    => 1501,        # Not a leap year
+       month   => 3,
+       day     => 1,
+       quarter => 1,
+       day_of_quarter  => 60,
+       quarter_length  => 90,
+    },
+    {
+       year    => 1501,        # Not a leap year
+       month   => 4,
+       day     => 1,
+       quarter => 2,
+       day_of_quarter  => 1,
+       quarter_length  => 91,
+    },
+) {
+
+    my $dt = DateTime::Calendar::Julian->new(
+       year    => $info->{year},
+       month   => $info->{month} || 1,
+       day     => $info->{day} || 1,
+    );
+
+    cmp_ok $dt->quarter, '==', $info->{quarter},
+       sprintf '%s (Julian) quarter is %d', $dt->ymd, $info->{quarter};
+
+    cmp_ok $dt->day_of_quarter, '==', $info->{day_of_quarter},
+       sprintf '%s (Julian) day_of_quarter is %d', $dt->ymd,
+           $info->{day_of_quarter};
+
+    cmp_ok $dt->quarter_length, '==', $info->{quarter_length},
+       sprintf '%s (Julian) quarter_length is %d', $dt->ymd,
+           $info->{quarter_length};
+
+}
+
+done_testing;
+
+1;
+
+# ex: set textwidth=72 :

Reply via email to