Codebase list libdatetime-format-builder-perl / f378c0a
[svn-upgrade] Integrating new upstream version, libdatetime-format-builder-perl (0.7901) Damyan Ivanov 16 years ago
8 changed file(s) with 312 addition(s) and 213 deletion(s). Raw diff Collapse all Expand all
55 ( module_name => 'DateTime::Format::Builder',
66 author => 'Dave Rolsky <autarch@urth.org>',
77 license => 'perl',
8 requires => { 'DateTime' => 0.12,
8 requires => { 'Class::Factory::Util' => 1.6,
9 'DateTime' => 0.12,
910 'DateTime::Format::Strptime' => 1.04,
1011 'Params::Validate' => 0.72,
11 'Class::Factory::Util' => 1.6,
12 'Task::Weaken' => 0,
1213 },
1314 build_requires => { 'Module::Build' => 0 },
1415 sign => 1,
+229
-191
Changes less more
0 # Change log for DateTime::Format::Builder
1
2
3 version: 0.7807
4 date: 05 29 2006
5 changes:
6 - Fix a test failure in on_fail_regex.t on Win32 (bug in the test code). Reported by Ben Thul.
7
8 version: 0.7806
9 date: 09 09 2004
10 changes:
11 - When DateTime::Format::Builder::Parser loaded worker classes, it ignored modules located under relative paths. This was fixed by using Class::Factory::Util for this functionality instead.
12
13 ---
14 version: 0.7805
15 date: 11 08 2004
16 changes:
17 - DateTime::Format::Build::Parser caused an exception when run in taint mode. Reported by Curtis Hawthorne.
18
19 ---
20 version: 0.7805
21 date: 11 08 2004
22 changes:
23 - DateTime::Format::Build::Parser caused an exception when run in taint mode. Reported by Curtis Hawthorne.
24
25 ---
26 version: 0.7804
27 date: 07 Jul 2004
28 changes:
29 - No code or doc changes, just change the code in examples to ensure that PAUSE does not index it.
30
31 ---
32 version: 0.7803
33 date: 13 Feb 2004
34 changes:
35 - Localize $_ before calling File::Find, otherwise it will be written over for caller. Patch from Leon Brocard.
36
37 ---
38 version: 0.7802
39 date: 13 Feb 2004
40 changes:
41 - Add dependency on DateTime::Format::Strptime.
42
43 ---
44 version: 0.7801
45 date: 26 Jan 2004
46 changes:
47 - New maintainer - Dave Rolsky
48 - Switched to a different build/install sysstem (Module::Build instead of Module::Install)
49
50 ---
51 version: 0.78
52 date: 1 Dec 2003
53 changes:
54 - Fix multigroup bug in Dispatch
55 - Add Tivoli example.
56
57 ---
58 version: 0.77
59 date: 14 Aug 2003
60 changes:
61 - Correct package name for Quick.
62 - Augment license conditions.
63 - Fixed timezones in fall.t and quick.t tests.
64
65 ---
66 version: 0.76
67 date: 10 Aug 2003
68 changes:
69 - Fallthrough example and test added.
70 - Quick parser added to simplify fallthrough stuff.
71 - Rejigged internals to allow for on_fail argument to multi-parsers.
72
73 ---
74 version: 0.75
75 date: 29 Jun 2003
76 changes:
77 - Silly MANIFEST.SKIP entry caused dispatch stuff to be skipped.
78
79 ---
80 version: 0.74
81 date: 28 Jun 2003
82 changes:
83 - >
84 Dispatch Parser class added, which allows us to make
85 groups of parsers and hop quickly to them.
86 - >
87 length parameter can now be an arrayref, hence we can
88 have a parser belong to more than one length group.
89 - Version numbers are all identical now.
90 - Regex Parser can call custom constructors.
91 - Wrapped method only regards undef as a failure.
92
93 ---
94 version: 0.73
95 date: 24 Jun 2003
96 changes:
97 - Exit parser more quickly if able.
98 - Multiple same length parsers accepted.
99 - Fixed some perl 5.005 testing problems.
100
101 ---
102 version: 0.72
103 date: 28 May 2003
104 changes:
105 - Minor tweaks for the 'private' tag in META.yml
106
107 ---
108 version: 0.71
109 date: 23 May 2003
110 changes:
111 - Massive doc (re)writing.
112 - Examples tidied up.
113 - Tutorial refactored.
114 - Users of generic.pm get to subclass now rather than coderef.
115
116 ---
117 version: 0.69
118 date: 28 Apr 2003
119 changes:
120 - DateTime::Format::Strptime is now supported.
121 - To support the previous item, massive refactoring.
122 - Minor API changes that shouldn't affect anyone.
123
124 ---
125 version: 0.64
126 date: 27 Apr 2003
127 changes:
128 - Callbacks are given 'args' and 'self' keys.
129 - Callbacks can be arrays of callbacks.
130
131 ---
132 version: 0.62
133 date: 20 Apr 2003
134 changes:
135 - Fixed erroneous call to on_fail()
136 - Added 'verbose' debugging capability.
137 - Added 'constructor' option to create_class/import.
138 - Avoid overwriting developers' own new() functions.
139 - Complain if asked to overwrite methods.
140
141 ---
142 version: 0.60
143 date: 12 Apr 2003
144 changes:
145 - Fixed missing '\' from a few '\d' in the docs.
146 - Added ICal.pm example.
147 - Added import() feature, to save lots of typing.
148 - Completely revised documentation.
149 - croak is same length is given twice.
150 - Assorted refactoring, retouching.
151
152 ---
153 version: 0.25
154 date: 29 Mar 2003
155 changes:
156 - Minor code cleanups.
157 - Bug fix; 'extra' params were being ignored.
158 - Doc fix; 'extra' params with 0 are not recommended.
159
160 ---
161 version: 0.24
162 date: 25 Mar 2003
163 changes:
164 - First release!
165 - Split POD into separate file.
166 - Preprocess option for method building works.
167 - Postprocess option per parser works.
168 - Specification lists can now have coderefs in there.
169
170 ---
171 version: 0.23
172 date: 25 Mar 2003
173 changes:
174 - Improved ancillary files.
175 - Added basic use case test for new classes.
176 - Assorted API changes.
177 - create_class infers package name.
178 - also creates specified methods rather than assumed ones.
179 - Assorted POD updates. Still not complete.
180 - Rejigged to only have an array of hashrefs. Simpler.
181 - No inference of length/key stuff.
182 - zero is now extra and is thus semantically different.
183 - Preliminary pre/post processing per parser provided.
184
185 ---
186 version: 0.22
187 date: 21 Mar 2003
188 changes:
189 - Initial (pre-actual release) version.
190
0 0.7901 2007-09-01
1
2 - The memory-cycle.t test will fail if you have PadWalker and the
3 current Devel::Cycle (1.07) installed. I forgot I had patched my
4 local Devel::Cycle to fix this bug.
5
6
7 0.79 2007-08-30
8
9 - Fix several circular references in
10 DateTime::Format::Builder::Parser. This would be triggered by any
11 standard usage of DT::F::Builder. Reported by Carl Franks. RT
12 #29034.
13
14
15 0.7807 2006-05-29
16
17 - Fix a test failure in on_fail_regex.t on Win32 (bug in the test code).
18 Reported by Ben Thul.
19
20
21 0.7806 2004-09-09
22
23 - When DateTime::Format::Builder::Parser loaded worker classes, it
24 ignored modules located under relative paths. This was fixed by using
25 Class::Factory::Util for this functionality instead.
26
27
28 0.7805 2004-11-08
29
30 - DateTime::Format::Build::Parser caused an exception when run in taint
31 mode. Reported by Curtis Hawthorne.
32
33
34 0.7805 2004-11-08
35
36 - DateTime::Format::Build::Parser caused an exception when run in taint
37 mode. Reported by Curtis Hawthorne.
38
39
40 0.7804 2004-07-07
41
42 - No code or doc changes, just change the code in examples to ensure
43 that PAUSE does not index it.
44
45
46 0.7803 2004-02-13
47
48 - Localize $_ before calling File::Find, otherwise it will be written
49 over for caller. Patch from Leon Brocard.
50
51
52 0.7802 2004-02-13
53
54 - Add dependency on DateTime::Format::Strptime.
55
56
57 0.7801 2004-01-26
58
59 - New maintainer - Dave Rolsky
60
61 - Switched to a different build/install sysstem (Module::Build instead
62 of Module::Install)
63
64
65 0.78 2003-12-01
66
67 - Fix multigroup bug in Dispatch
68
69 - Add Tivoli example.
70
71
72 0.77 2003-08-14
73
74 - Correct package name for Quick.
75
76 - Augment license conditions.
77
78 - Fixed timezones in fall.t and quick.t tests.
79
80
81 0.76 2003-08-10
82
83 - Fallthrough example and test added.
84
85 - Quick parser added to simplify fallthrough stuff.
86
87 - Rejigged internals to allow for on_fail argument to multi-parsers.
88
89
90 0.75 2003-06-29
91
92 - Silly MANIFEST.SKIP entry caused dispatch stuff to be skipped.
93
94
95 0.74 2003-06-28
96
97 - Dispatch Parser class added, which allows us to make groups of parsers
98 and hop quickly to them.
99
100 - length parameter can now be an arrayref, hence we can have a parser
101 belong to more than one length group.
102
103 - Version numbers are all identical now.
104
105 - Regex Parser can call custom constructors.
106
107 - Wrapped method only regards undef as a failure.
108
109
110 0.73 2003-06-24
111
112 - Exit parser more quickly if able.
113
114 - Multiple same length parsers accepted.
115
116 - Fixed some perl 5.005 testing problems.
117
118
119 0.72 2003-05-28
120
121 - Minor tweaks for the 'private' tag in META.yml
122
123
124 0.71 2003-05-23
125
126 - Massive doc (re)writing.
127
128 - Examples tidied up.
129
130 - Tutorial refactored.
131
132 - Users of generic.pm get to subclass now rather than coderef.
133
134
135 0.69 2003-04-28
136
137 - DateTime::Format::Strptime is now supported.
138
139 - To support the previous item, massive refactoring.
140
141 - Minor API changes that shouldn't affect anyone.
142
143
144 0.64 2003-04-27
145
146 - Callbacks are given 'args' and 'self' keys.
147
148 - Callbacks can be arrays of callbacks.
149
150
151 0.62 2003-04-20
152
153 - Fixed erroneous call to on_fail()
154
155 - Added 'verbose' debugging capability.
156
157 - Added 'constructor' option to create_class/import.
158
159 - Avoid overwriting developers' own new() functions.
160
161 - Complain if asked to overwrite methods.
162
163
164 0.60 2003-04-12
165
166 - Fixed missing '\' from a few '\d' in the docs.
167
168 - Added ICal.pm example.
169
170 - Added import() feature, to save lots of typing.
171
172 - Completely revised documentation.
173
174 - croak is same length is given twice.
175
176 - Assorted refactoring, retouching.
177
178
179 0.25 2003-03-29
180
181 - Minor code cleanups.
182
183 - Bug fix; 'extra' params were being ignored.
184
185 - Doc fix; 'extra' params with 0 are not recommended.
186
187
188 0.24 2003-03-25
189
190 - First release!
191
192 - Split POD into separate file.
193
194 - Preprocess option for method building works.
195
196 - Postprocess option per parser works.
197
198 - Specification lists can now have coderefs in there.
199
200
201 0.23 2003-03-25
202
203 - Improved ancillary files.
204
205 - Added basic use case test for new classes.
206
207 - Assorted API changes.
208
209 - create_class infers package name.
210
211 - also creates specified methods rather than assumed ones.
212
213 - Assorted POD updates. Still not complete.
214
215 - Rejigged to only have an array of hashrefs. Simpler.
216
217 - No inference of length/key stuff.
218
219 - zero is now extra and is thus semantically different.
220
221 - Preliminary pre/post processing per parser provided.
222
223
224 0.22 2003-03-21
225
226 - Initial (pre-actual release) version.
227
228
3737 t/fall.t
3838 t/import.t
3939 t/lengths.t
40 t/memory-cycle.t
4041 t/mergecb.t
4142 t/newclass.t
4243 t/nocon.t
00 ---
11 name: DateTime-Format-Builder
2 version: 0.7807
2 version: 0.7901
33 author:
44 - |-
55 Originally written by Iain Truskett <spoon@cpan.org>, who died on
1414 DateTime: 0.12
1515 DateTime::Format::Strptime: 1.04
1616 Params::Validate: 0.72
17 Task::Weaken: 0
1718 build_requires:
1819 Module::Build: 0
1920 provides:
2021 DateTime::Format::Builder:
2122 file: lib/DateTime/Format/Builder.pm
22 version: 0.7807
23 version: 0.7901
2324 DateTime::Format::Builder::Parser:
2425 file: lib/DateTime/Format/Builder/Parser.pm
2526 version: 0.77
3839 DateTime::Format::Builder::Parser::generic:
3940 file: lib/DateTime/Format/Builder/Parser/generic.pm
4041 version: 0.77
41 generated_by: Module::Build version 0.2801
42 generated_by: Module::Build version 0.2808
4243 meta-spec:
4344 url: http://module-build.sourceforge.net/META-spec-v1.2.html
4445 version: 1.2
00 This file contains message digests of all files listed in MANIFEST,
1 signed via the Module::Signature module, version 0.54.
1 signed via the Module::Signature module, version 0.55.
22
33 To verify the content in this distribution, first make sure you have
44 Module::Signature installed, then type:
1515
1616 SHA1 8d50878004d8d5103e1f44dc3df2899419d3a59d AUTHORS
1717 SHA1 7a95fc8778fbce1f60d222e0d0d1dbb6c649461f Artistic
18 SHA1 ec7b318157905373ababaf78de09a2070704cb79 Build.PL
18 SHA1 58303707b051600b6c0820b2d7777f6391ae652e Build.PL
1919 SHA1 531e6b5c470d4726483fd68833391653eace0a92 COPYING
2020 SHA1 00b8084495b5b9cdc4bcbb7dd90b912b052453ee CREDITS
21 SHA1 df5e2a71a296c3e8e4ad9ffabd1f7450c1b8aa88 Changes
21 SHA1 271b8d5133450916bf41c038027741e6fcdd943f Changes
2222 SHA1 7a273ac56274461c440f658bdab758a94b31ac23 INSTALL
2323 SHA1 a4f818254f51015b8d7606b73db0ad92f8641463 LICENCE
24 SHA1 ed129fa78f1289f0a42ad1e8357def6d4935796c MANIFEST
24 SHA1 70635bebe1a8231f6558105c94c8990ea00ededa MANIFEST
2525 SHA1 d31c065d32a5b2b79340912c172c3069d29f32bc MANIFEST.SKIP
26 SHA1 78c2821c7bdc943846f85548fe5adfd847cc5600 META.yml
26 SHA1 108b5bb7e850196df8ef1023704e024b24d19f47 META.yml
2727 SHA1 cd14ada78fb37a0d926edd86eddcdf7f939de582 Makefile.PL
2828 SHA1 6b2a574958154f535e7ea7d1a7946ebb3a34e93c README
2929 SHA1 f35ac145f4a1379286bf4cebb9f2b268d55e10a4 examples/Apache.pm
3333 SHA1 d882c0f4639ed4721524afbd1ac4a5bedb471d9c examples/Simple.pm
3434 SHA1 bdadcfd2bdbac90edbda48322fea700204dbeb05 examples/Tivoli.pm
3535 SHA1 319195d800e24f7db0fcb73765c5ffd8abf020cf examples/W3CDTF.pm
36 SHA1 a482c6574692becfedaaadb8f4fbd70750b64f2a lib/DateTime/Format/Builder.pm
36 SHA1 30cad078a9272a715d516f397235f406a85dfe72 lib/DateTime/Format/Builder.pm
3737 SHA1 6b9d88d681693cb8ae7fa40a3750980770f34901 lib/DateTime/Format/Builder.pod
38 SHA1 afd8b9f3e6a427a4584042be45194fd014da12ca lib/DateTime/Format/Builder/Parser.pm
38 SHA1 fa481193752c51ca72e1d14bcc6d9b0a98b5dfea lib/DateTime/Format/Builder/Parser.pm
3939 SHA1 d5c9f085e6f4915f7b1147cad0dbe60c9f634d44 lib/DateTime/Format/Builder/Parser/Dispatch.pm
4040 SHA1 cb0bf72d2c17d66d22f97d9d0468a6164f12c12a lib/DateTime/Format/Builder/Parser/Quick.pm
4141 SHA1 d58def0d461fe63867b5510d5d73f67fc47850d1 lib/DateTime/Format/Builder/Parser/Regex.pm
5353 SHA1 62cc29af5fae11eb3df1a0fbc3932f5238356621 t/fall.t
5454 SHA1 3762c8dff93c42a864e9be17e545f95a7446f2e8 t/import.t
5555 SHA1 54fa6e9f4f2390f680b2cdf82b2c28c769b4a0b2 t/lengths.t
56 SHA1 430b341a1e1a925c286ef5af0c8fba5c1b3b2a01 t/memory-cycle.t
5657 SHA1 cb106dcdbf3693444dac4c1c2bd02dd8c97b58f9 t/mergecb.t
5758 SHA1 6d8ad84c0317984a927a72952da0f10d60388fc0 t/newclass.t
5859 SHA1 ca26f16c40ebd1f956c214e9f7969c24407f7b9a t/nocon.t
6869 SHA1 3d6ba3abe89d1799e3d2739237ab1f29affc4192 t/verbose.t
6970 SHA1 52f251e04fbd2772bff6c6fa62731804895305fc t/wholeclass.t
7071 -----BEGIN PGP SIGNATURE-----
71 Version: GnuPG v1.4.2.2 (GNU/Linux)
72 Version: GnuPG v1.4.6 (GNU/Linux)
7273
73 iD8DBQFEezev3Or3ZzQuifMRAjLGAJ0cKBQNEET1gjmi8gylwcgaIWFqygCg8sMZ
74 4mwmaRZPwZVWxS+YtH+/DM8=
75 =5xY3
74 iD8DBQFG2dJS3Or3ZzQuifMRArM/AJ9JCgEioSc/t8tAav5HZn08hznlBACdEkDJ
75 RuEpCtzNgEq/qQnPdrMy4H4=
76 =Z71l
7677 -----END PGP SIGNATURE-----
44 use Params::Validate qw(
55 validate SCALAR CODEREF UNDEF ARRAYREF
66 );
7 use Scalar::Util qw( weaken );
78
89 =head1 NAME
910
5859 }
5960
6061 sub maker { $_[0]->{maker} }
61 sub set_maker { $_[0]->{maker} = $_[1]; $_[0] }
62
63 sub set_maker
64 {
65 my $self = shift;
66 my $maker = shift;
67
68 $self->{maker} = $maker;
69 weaken $self->{maker}
70 if ref $self->{maker};
71
72 return $self;
73 }
6274
6375 sub fail
6476 {
394406 # Who's our maker?
395407 $obj->set_maker( $options->{maker} ) if exists $options->{maker};
396408
409 # We don't want to save the whole options hash as a closure, since
410 # that can cause a circular reference when $options->{maker} is
411 # set.
412 my $preprocess = $options->{preprocess};
413
397414 # These are the innards of a multi-parser.
398415 my $parser = sub {
399416 my ($self, $date, @args) = @_;
407424
408425 my %p;
409426 # Preprocess and potentially fill %p
410 if ($options->{preprocess})
411 {
412 $date = $options->{preprocess}->(
427 if ($preprocess)
428 {
429 $date = $preprocess->(
413430 input => $date, parsed => \%p, %param
414431 );
415432 }
00 package DateTime::Format::Builder;
1 # $Id: Builder.pm 3429 2006-05-29 18:03:05Z autarch $
1 # $Id: Builder.pm 3748 2007-09-01 20:56:42Z autarch $
22
33 =begin comments
44
1616 use vars qw( $VERSION %dispatch_data );
1717
1818 my $parser = 'DateTime::Format::Builder::Parser';
19 $VERSION = '0.7807';
19 $VERSION = '0.7901';
2020
2121 # Developer oriented methods
2222
0 use strict;
1 use warnings;
2
3 use lib 't/lib';
4
5 use DateTime::Format::Builder;
6 use Test::More;
7
8 unless ( eval "use Test::Memory::Cycle; Devel::Cycle->can('_find_cycle_SCALAR'); " )
9 {
10 plan skip_all => 'These tests require Test::Memory::Cycle and a working Devel::Cycle (> 1.07).';
11 exit;
12 }
13
14 plan tests => 4;
15
16 {
17 my $builder = DateTime::Format::Builder->new();
18 my $parser = $builder->parser( { strptime => '%Y-%m-%d' } );
19
20 memory_cycle_ok( $parser,
21 'Make sure parser object does not have circular refs' );
22
23 memory_cycle_ok( $builder,
24 'Make sure builder object does not have circular refs after making a single parser' );
25 }
26
27 {
28 my $builder = DateTime::Format::Builder->new();
29 my $parser = $builder->parser( { strptime => '%Y-%m-%d',
30 strptime => '%d-%m-%Y',
31 } );
32
33 memory_cycle_ok( $parser,
34 'Make sure parser object does not have circular refs' );
35
36 memory_cycle_ok( $builder,
37 'Make sure builder object does not have circular refs after making a multi parser' );
38 }
39