Skip to content

Commit 7b9994f

Browse files
committed
Update build metadata and fatpacking artifacts
1 parent 5c337bf commit 7b9994f

File tree

8 files changed

+2387
-5
lines changed

8 files changed

+2387
-5
lines changed

META.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,14 @@
214214
"IO::String" : "0",
215215
"JSON::MaybeXS" : "1.002005",
216216
"Module::Pluggable::Object" : "5.1",
217+
"POSIX" : "0",
217218
"Pod::Perldoc" : "0",
218219
"Scalar::Util" : "0",
219220
"Text::Autoformat" : "0",
220221
"Text::CSV" : "0",
221222
"Tie::Array" : "0",
222-
"Tie::Hash" : "0"
223+
"Tie::Hash" : "0",
224+
"Time::ParseDate" : "2013.1113"
223225
}
224226
},
225227
"test" : {

Makefile.PL

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,14 @@ my %WriteMakefileArgs = (
7373
"IO::String" => 0,
7474
"JSON::MaybeXS" => "1.002005",
7575
"Module::Pluggable::Object" => "5.1",
76+
"POSIX" => 0,
7677
"Pod::Perldoc" => 0,
7778
"Scalar::Util" => 0,
7879
"Text::Autoformat" => 0,
7980
"Text::CSV" => 0,
8081
"Tie::Array" => 0,
81-
"Tie::Hash" => 0
82+
"Tie::Hash" => 0,
83+
"Time::ParseDate" => "2013.1113"
8284
},
8385
"TEST_REQUIRES" => {
8486
"File::Spec::Functions" => 0,
@@ -119,13 +121,15 @@ my %FallbackPrereqs = (
119121
"JSON::MaybeXS" => "1.002005",
120122
"Module::Pluggable::Object" => "5.1",
121123
"Module::Versions::Report" => "1.06",
124+
"POSIX" => 0,
122125
"Pod::Perldoc" => 0,
123126
"Scalar::Util" => 0,
124127
"Test::More" => "0.88",
125128
"Text::Autoformat" => 0,
126129
"Text::CSV" => 0,
127130
"Tie::Array" => 0,
128-
"Tie::Hash" => 0
131+
"Tie::Hash" => 0,
132+
"Time::ParseDate" => "2013.1113"
129133
);
130134

131135
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {

fatlib/Time/CTime.pm

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
package Time::CTime;
2+
3+
4+
require 5.000;
5+
6+
use Time::Timezone;
7+
use Time::CTime;
8+
require Exporter;
9+
@ISA = qw(Exporter);
10+
@EXPORT = qw(ctime asctime strftime);
11+
@EXPORT_OK = qw(asctime_n ctime_n @DoW @MoY @DayOfWeek @MonthOfYear);
12+
13+
use strict;
14+
15+
# constants
16+
use vars qw(@DoW @DayOfWeek @MoY @MonthOfYear %strftime_conversion $VERSION);
17+
use vars qw($template $sec $min $hour $mday $mon $year $wday $yday $isdst);
18+
19+
$VERSION = 2011.0505;
20+
21+
CONFIG: {
22+
@DoW = qw(Sun Mon Tue Wed Thu Fri Sat);
23+
@DayOfWeek = qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday);
24+
@MoY = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
25+
@MonthOfYear = qw(January February March April May June
26+
July August September October November December);
27+
28+
%strftime_conversion = (
29+
'%', sub { '%' },
30+
'a', sub { $DoW[$wday] },
31+
'A', sub { $DayOfWeek[$wday] },
32+
'b', sub { $MoY[$mon] },
33+
'B', sub { $MonthOfYear[$mon] },
34+
'c', sub { asctime_n($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, "") },
35+
'd', sub { sprintf("%02d", $mday); },
36+
'D', sub { sprintf("%02d/%02d/%02d", $mon+1, $mday, $year%100) },
37+
'e', sub { sprintf("%2d", $mday); },
38+
'f', sub { fracprintf ("%3.3f", $sec); },
39+
'F', sub { fracprintf ("%6.6f", $sec); },
40+
'h', sub { $MoY[$mon] },
41+
'H', sub { sprintf("%02d", $hour) },
42+
'I', sub { sprintf("%02d", $hour % 12 || 12) },
43+
'j', sub { sprintf("%03d", $yday + 1) },
44+
'k', sub { sprintf("%2d", $hour); },
45+
'l', sub { sprintf("%2d", $hour % 12 || 12) },
46+
'm', sub { sprintf("%02d", $mon+1); },
47+
'M', sub { sprintf("%02d", $min) },
48+
'n', sub { "\n" },
49+
'o', sub { sprintf("%d%s", $mday, (($mday < 20 && $mday > 3) ? 'th' : ($mday%10 == 1 ? "st" : ($mday%10 == 2 ? "nd" : ($mday%10 == 3 ? "rd" : "th"))))) },
50+
'p', sub { $hour > 11 ? "PM" : "AM" },
51+
'r', sub { sprintf("%02d:%02d:%02d %s", $hour % 12 || 12, $min, $sec, $hour > 11 ? 'PM' : 'AM') },
52+
'R', sub { sprintf("%02d:%02d", $hour, $min) },
53+
'S', sub { sprintf("%02d", $sec) },
54+
't', sub { "\t" },
55+
'T', sub { sprintf("%02d:%02d:%02d", $hour, $min, $sec) },
56+
'U', sub { wkyr(0, $wday, $yday) },
57+
'v', sub { sprintf("%2d-%s-%4d", $mday, $MoY[$mon], $year+1900) },
58+
'w', sub { $wday },
59+
'W', sub { wkyr(1, $wday, $yday) },
60+
'y', sub { sprintf("%02d",$year%100) },
61+
'Y', sub { $year + 1900 },
62+
'x', sub { sprintf("%02d/%02d/%02d", $mon + 1, $mday, $year%100) },
63+
'X', sub { sprintf("%02d:%02d:%02d", $hour, $min, $sec) },
64+
'Z', sub { &tz2zone(undef,undef,$isdst) }
65+
# z sprintf("%+03d%02d", $offset / 3600, ($offset % 3600)/60);
66+
);
67+
68+
69+
}
70+
71+
sub fracprintf {
72+
my($t,$s) = @_;
73+
my($p) = sprintf($t, $s-int($s));
74+
$p=~s/^0+//;
75+
$p;
76+
}
77+
78+
sub asctime_n {
79+
my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, $TZname) = @_;
80+
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, $TZname) = localtime($sec) unless defined $min;
81+
$year += 1900;
82+
$TZname .= ' '
83+
if $TZname;
84+
sprintf("%s %s %2d %2d:%02d:%02d %s%4d",
85+
$DoW[$wday], $MoY[$mon], $mday, $hour, $min, $sec, $TZname, $year);
86+
}
87+
88+
sub asctime
89+
{
90+
return asctime_n(@_)."\n";
91+
}
92+
93+
# is this formula right?
94+
sub wkyr {
95+
my($wstart, $wday, $yday) = @_;
96+
$wday = ($wday + 7 - $wstart) % 7;
97+
return int(($yday - $wday + 13) / 7 - 1);
98+
}
99+
100+
# ctime($time)
101+
102+
sub ctime {
103+
my($time) = @_;
104+
asctime(localtime($time), &tz2zone(undef,$time));
105+
}
106+
107+
sub ctime_n {
108+
my($time) = @_;
109+
asctime_n(localtime($time), &tz2zone(undef,$time));
110+
}
111+
112+
# strftime($template, @time_struct)
113+
#
114+
# Does not support locales
115+
116+
sub strftime {
117+
local ($template, $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = @_;
118+
119+
undef $@;
120+
$template =~ s/%([%aAbBcdDefFhHIjklmMnopQrRStTUvwWxXyYZ])/&{$Time::CTime::strftime_conversion{$1}}()/egs;
121+
die $@ if $@;
122+
return $template;
123+
}
124+
125+
1;
126+
127+
__END__
128+
129+
=head1 NAME
130+
131+
Time::CTime -- format times ala POSIX asctime
132+
133+
=head1 SYNOPSIS
134+
135+
use Time::CTime
136+
print ctime(time);
137+
print asctime(localtime(time));
138+
print strftime(template, localtime(time));
139+
140+
=head2 strftime conversions
141+
142+
%% PERCENT
143+
%a day of the week abbr
144+
%A day of the week
145+
%b month abbr
146+
%B month
147+
%c ctime format: Sat Nov 19 21:05:57 1994
148+
%d DD
149+
%D MM/DD/YY
150+
%e numeric day of the month
151+
%f floating point seconds (milliseconds): .314
152+
%F floating point seconds (microseconds): .314159
153+
%h month abbr
154+
%H hour, 24 hour clock, leading 0's)
155+
%I hour, 12 hour clock, leading 0's)
156+
%j day of the year
157+
%k hour
158+
%l hour, 12 hour clock
159+
%m month number, starting with 1, leading 0's
160+
%M minute, leading 0's
161+
%n NEWLINE
162+
%o ornate day of month -- "1st", "2nd", "25th", etc.
163+
%p AM or PM
164+
%r time format: 09:05:57 PM
165+
%R time format: 21:05
166+
%S seconds, leading 0's
167+
%t TAB
168+
%T time format: 21:05:57
169+
%U week number, Sunday as first day of week
170+
%v DD-Mon-Year
171+
%w day of the week, numerically, Sunday == 0
172+
%W week number, Monday as first day of week
173+
%x date format: 11/19/94
174+
%X time format: 21:05:57
175+
%y year (2 digits)
176+
%Y year (4 digits)
177+
%Z timezone in ascii. eg: PST
178+
179+
=head1 DESCRIPTION
180+
181+
This module provides routines to format dates. They correspond
182+
to the libc routines. &strftime() supports a pretty good set of
183+
conversions -- more than most C libraries.
184+
185+
strftime supports a pretty good set of conversions.
186+
187+
The POSIX module has very similar functionality. You should consider
188+
using it instead if you do not have allergic reactions to system
189+
libraries.
190+
191+
=head1 GENESIS
192+
193+
Written by David Muir Sharnoff <muir@idiom.org>.
194+
195+
The starting point for this package was a posting by
196+
Paul Foley <paul@ascent.com>
197+
198+
=head1 LICENSE
199+
200+
Copyright (C) 1996-2010 David Muir Sharnoff.
201+
Copyright (C) 2011 Google, Inc.
202+
License hereby
203+
granted for anyone to use, modify or redistribute this module at
204+
their own risk. Please feed useful changes back to cpan@dave.sharnoff.org.
205+

fatlib/Time/DaysInMonth.pm

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package Time::DaysInMonth;
2+
3+
use Carp;
4+
5+
require 5.000;
6+
7+
@ISA = qw(Exporter);
8+
@EXPORT = qw(days_in is_leap);
9+
@EXPORT_OK = qw(%mltable);
10+
11+
use strict;
12+
13+
use vars qw($VERSION %mltable);
14+
15+
$VERSION = 99.1117;
16+
17+
CONFIG: {
18+
%mltable = qw(
19+
1 31
20+
3 31
21+
4 30
22+
5 31
23+
6 30
24+
7 31
25+
8 31
26+
9 30
27+
10 31
28+
11 30
29+
12 31);
30+
}
31+
32+
sub days_in
33+
{
34+
# Month is 1..12
35+
my ($year, $month) = @_;
36+
return $mltable{$month+0} unless $month == 2;
37+
return 28 unless &is_leap($year);
38+
return 29;
39+
}
40+
41+
sub is_leap
42+
{
43+
my ($year) = @_;
44+
return 0 unless $year % 4 == 0;
45+
return 1 unless $year % 100 == 0;
46+
return 0 unless $year % 400 == 0;
47+
return 1;
48+
}
49+
50+
1;
51+
52+
__END__
53+
54+
=head1 NAME
55+
56+
Time::DaysInMonth -- simply report the number of days in a month
57+
58+
=head1 SYNOPSIS
59+
60+
use Time::DaysInMonth;
61+
$days = days_in($year, $month_1_to_12);
62+
$leapyear = is_leap($year);
63+
64+
=head1 DESCRIPTION
65+
66+
DaysInMonth is simply a package to report the number of days in
67+
a month. That's all it does. Really!
68+
69+
=head1 AUTHOR
70+
71+
David Muir Sharnoff <muir@idiom.org>
72+
73+
=head1 BUGS
74+
75+
This only deals with the "modern" calendar. Look elsewhere for
76+
historical time and date support.
77+
78+
=head1 LICENSE
79+
80+
Copyright (C) 1996-1999 David Muir Sharnoff. License hereby
81+
granted for anyone to use, modify or redistribute this module at
82+
their own risk. Please feed useful changes back to muir@idiom.org.
83+

0 commit comments

Comments
 (0)