r54656 - in /branches/upstream/libtime-clock-perl/current: Changes META.yml Makefile.PL lib/Time/Clock.pm t/format.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Tue Mar 23 03:21:46 UTC 2010


Author: ansgar-guest
Date: Tue Mar 23 03:21:32 2010
New Revision: 54656

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54656
Log:
[svn-upgrade] Integrating new upstream version, libtime-clock-perl (1.00)

Modified:
    branches/upstream/libtime-clock-perl/current/Changes
    branches/upstream/libtime-clock-perl/current/META.yml
    branches/upstream/libtime-clock-perl/current/Makefile.PL
    branches/upstream/libtime-clock-perl/current/lib/Time/Clock.pm
    branches/upstream/libtime-clock-perl/current/t/format.t

Modified: branches/upstream/libtime-clock-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtime-clock-perl/current/Changes?rev=54656&op=diff
==============================================================================
--- branches/upstream/libtime-clock-perl/current/Changes (original)
+++ branches/upstream/libtime-clock-perl/current/Changes Tue Mar 23 03:21:32 2010
@@ -1,6 +1,12 @@
-0.12 (02.01.2008) - John Siracusa <siracusa at gmail.com>
+1.00 (03.09.2010) - John Siracusa <siracusa at gmail.com>
 
-    * Updated the maintainer's email address.
+    * The %i format now correctly shows 12 for 12 AM.
+    * Removed leading zeros from the %i format.
+    * Bumped version number to reflect API stability.
+
+0.12 (10.16.2009) - John Siracusa <siracusa at gmail.com>
+
+    * Updated eval block to avoid stomping on $@ from an outer scope.
 
 0.11 (08.24.2006) - John Siracusa <siracusa at gmail.com>
 

Modified: branches/upstream/libtime-clock-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtime-clock-perl/current/META.yml?rev=54656&op=diff
==============================================================================
--- branches/upstream/libtime-clock-perl/current/META.yml (original)
+++ branches/upstream/libtime-clock-perl/current/META.yml Tue Mar 23 03:21:32 2010
@@ -1,11 +1,26 @@
 --- #YAML:1.0
-name:                Time-Clock
-version:             0.12
-abstract:            ~
-license:             ~
-generated_by:        ExtUtils::MakeMaker version 6.36
-distribution_type:   module
-requires:     
+name:               Time-Clock
+version:            1.00
+abstract:           Twenty-four hour clock object with nanosecond precision.
+author:
+    - John Siracusa <siracusa at gmail.com>
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
+requires:
+    perl:  5.006000
+resources:
+    bugtracker:  http://rt.cpan.org/NoAuth/Bugs.html?Dist=Time-Clock
+    license:     http://dev.perl.org/licenses/
+    repository:  http://rose.googlecode.com/svn/trunk/modules/Time-Clock
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.56
 meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
-    version: 1.2
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: branches/upstream/libtime-clock-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtime-clock-perl/current/Makefile.PL?rev=54656&op=diff
==============================================================================
--- branches/upstream/libtime-clock-perl/current/Makefile.PL (original)
+++ branches/upstream/libtime-clock-perl/current/Makefile.PL Tue Mar 23 03:21:32 2010
@@ -2,8 +2,28 @@
 
 use ExtUtils::MakeMaker;
 
+my $MM_Version = $ExtUtils::MakeMaker::VERSION;
+
+if($MM_Version =~ /_/) # dev version
+{
+  $MM_Version = eval $MM_Version;
+  die $@  if($@);
+}
+
 WriteMakefile(NAME         => 'Time::Clock',
-              ($^O =~ /darwin/i ?
-               (dist => { DIST_CP => 'cp' }) : ()), # Avoid Mac OS X ._* files
-              PMLIBDIRS    => [ 'lib' ],
-              VERSION_FROM => 'lib/Time/Clock.pm');
+              ABSTRACT_FROM => 'lib/Time/Clock.pm',
+              VERSION_FROM  => 'lib/Time/Clock.pm',
+              ($^O =~ /darwin/i ? (dist => { DIST_CP => 'cp' }) : ()), # Avoid Mac OS X ._* files
+              AUTHOR => 'John Siracusa <siracusa at gmail.com>',
+              ($MM_Version >= 6.48 ? (MIN_PERL_VERSION => '5.6.0') : ()),
+              ($MM_Version >= 6.31 ? (LICENSE => 'perl') : ()),
+              ($MM_Version <= 6.44 ? () : 
+              (META_MERGE => 
+              {
+                resources =>
+                {
+                  license     => 'http://dev.perl.org/licenses/',
+                  bugtracker  => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Time-Clock',
+                  repository  => 'http://rose.googlecode.com/svn/trunk/modules/Time-Clock',
+                },
+              })));

Modified: branches/upstream/libtime-clock-perl/current/lib/Time/Clock.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtime-clock-perl/current/lib/Time/Clock.pm?rev=54656&op=diff
==============================================================================
--- branches/upstream/libtime-clock-perl/current/lib/Time/Clock.pm (original)
+++ branches/upstream/libtime-clock-perl/current/lib/Time/Clock.pm Tue Mar 23 03:21:32 2010
@@ -4,7 +4,7 @@
 
 use Carp;
 
-our $VERSION = '0.12';
+our $VERSION = '1.00';
 
 use overload
 (
@@ -12,8 +12,14 @@
    fallback => 1,
 );
 
-eval { require Time::HiRes };
-our $Have_HiRes_Time = $@ ? 0 : 1;
+our $Have_HiRes_Time;
+
+TRY:
+{
+  local $@;
+  eval { require Time::HiRes };
+  $Have_HiRes_Time = $@ ? 0 : 1;
+}
 
 # Allow an hour value of 24
 our $Allow_Hour_24 = 0;
@@ -192,8 +198,10 @@
   $format ||= ref($self)->default_format;
 
   my $hour  = $self->hour;
-  my $ihour = $hour > 12 ? ($hour - 12) : $hour;
+  my $ihour = $hour > 12 ? ($hour - 12) : $hour == 0 ? 12 : $hour;
   my $ns     = $self->nanosecond;
+
+  $ihour =~ s/^0//;
 
   my %formats =
   (
@@ -754,8 +762,8 @@
 
 John C. Siracusa (siracusa at gmail.com)
 
-=head1 COPYRIGHT
-
-Copyright (c) 2006 by John C. Siracusa.  All rights reserved.  This program is
+=head1 LICENSE
+
+Copyright (c) 2010 by John C. Siracusa.  All rights reserved.  This program is
 free software; you can redistribute it and/or modify it under the same terms
 as Perl itself.

Modified: branches/upstream/libtime-clock-perl/current/t/format.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtime-clock-perl/current/t/format.t?rev=54656&op=diff
==============================================================================
--- branches/upstream/libtime-clock-perl/current/t/format.t (original)
+++ branches/upstream/libtime-clock-perl/current/t/format.t Tue Mar 23 03:21:32 2010
@@ -2,7 +2,7 @@
 
 use strict;
 
-use Test::More tests => 26;
+use Test::More tests => 28;
 
 use Time::Clock;
 
@@ -50,3 +50,11 @@
 
 $t->format('%H%%%M%%%2N');
 is($t->format('%H%%%M%%%2N'), '12%34%12', 'format %H%%%M%%%2N');
+
+$t->parse('12 AM');
+
+is($t->format('%i'), '12', 'format %i 12 AM');
+
+$t->parse('01:00:00');
+
+is($t->format('%i'), '1', 'format %i 01:00:00');




More information about the Pkg-perl-cvs-commits mailing list