Import upstream version 1.0301+git20210528.1.05aa9c2
Debian Janitor
2 years ago
0 | Revision history for Perl extension Exception::Class::DBI. | |
0 | Revision history for Exception-Class-DBI | |
1 | ||
2 | 1.04 2021-06-05 14:07:07 +0000 | |
1 | 3 | |
2 | 4 | 1.04 2019-05-27 14:41:02 -0400 |
3 | 5 | - Production release identical to 1.03_01 |
0 | This is the Perl distribution Exception-Class-DBI. | |
1 | ||
2 | Installing Exception-Class-DBI is straightforward. | |
3 | ||
4 | ## Installation with cpanm | |
5 | ||
6 | If you have cpanm, you only need one line: | |
7 | ||
8 | % cpanm Exception::Class::DBI | |
9 | ||
10 | If it does not have permission to install modules to the current perl, cpanm | |
11 | will automatically set up and install to a local::lib in your home directory. | |
12 | See the local::lib documentation (https://metacpan.org/pod/local::lib) for | |
13 | details on enabling it in your environment. | |
14 | ||
15 | ## Installing with the CPAN shell | |
16 | ||
17 | Alternatively, if your CPAN shell is set up, you should just be able to do: | |
18 | ||
19 | % cpan Exception::Class::DBI | |
20 | ||
21 | ## Manual installation | |
22 | ||
23 | As a last resort, you can manually install it. If you have not already | |
24 | downloaded the release tarball, you can find the download link on the module's | |
25 | MetaCPAN page: https://metacpan.org/pod/Exception::Class::DBI | |
26 | ||
27 | Untar the tarball, install configure prerequisites (see below), then build it: | |
28 | ||
29 | % perl Makefile.PL | |
30 | % make && make test | |
31 | ||
32 | Then install it: | |
33 | ||
34 | % make install | |
35 | ||
36 | On Windows platforms, you should use `dmake` or `nmake`, instead of `make`. | |
37 | ||
38 | If your perl is system-managed, you can create a local::lib in your home | |
39 | directory to install modules to. For details, see the local::lib documentation: | |
40 | https://metacpan.org/pod/local::lib | |
41 | ||
42 | The prerequisites of this distribution will also have to be installed manually. The | |
43 | prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated | |
44 | by running the manual build process described above. | |
45 | ||
46 | ## Configure Prerequisites | |
47 | ||
48 | This distribution requires other modules to be installed before this | |
49 | distribution's installer can be run. They can be found under the | |
50 | "configure_requires" key of META.yml or the | |
51 | "{prereqs}{configure}{requires}" key of META.json. | |
52 | ||
53 | ## Other Prerequisites | |
54 | ||
55 | This distribution may require additional modules to be installed after running | |
56 | Makefile.PL. | |
57 | Look for prerequisites in the following phases: | |
58 | ||
59 | * to run make, PHASE = build | |
60 | * to use the module code itself, PHASE = runtime | |
61 | * to run tests, PHASE = test | |
62 | ||
63 | They can all be found in the "PHASE_requires" key of MYMETA.yml or the | |
64 | "{prereqs}{PHASE}{requires}" key of MYMETA.json. | |
65 | ||
66 | ## Documentation | |
67 | ||
68 | Exception-Class-DBI documentation is available as POD. | |
69 | You can run `perldoc` from a shell to read the documentation: | |
70 | ||
71 | % perldoc Exception::Class::DBI | |
72 | ||
73 | For more information on installing Perl modules via CPAN, please see: | |
74 | https://www.cpan.org/modules/INSTALL.html |
0 | This software is copyright (c) 2002-2021 by David E. Wheeler. | |
1 | ||
2 | This is free software; you can redistribute it and/or modify it under | |
3 | the same terms as the Perl 5 programming language system itself. | |
4 | ||
5 | Terms of the Perl programming language system itself | |
6 | ||
7 | a) the GNU General Public License as published by the Free | |
8 | Software Foundation; either version 1, or (at your option) any | |
9 | later version, or | |
10 | b) the "Artistic License" | |
11 | ||
12 | --- The GNU General Public License, Version 1, February 1989 --- | |
13 | ||
14 | This software is Copyright (c) 2002-2021 by David E. Wheeler. | |
15 | ||
16 | This is free software, licensed under: | |
17 | ||
18 | The GNU General Public License, Version 1, February 1989 | |
19 | ||
20 | GNU GENERAL PUBLIC LICENSE | |
21 | Version 1, February 1989 | |
22 | ||
23 | Copyright (C) 1989 Free Software Foundation, Inc. | |
24 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
25 | ||
26 | Everyone is permitted to copy and distribute verbatim copies | |
27 | of this license document, but changing it is not allowed. | |
28 | ||
29 | Preamble | |
30 | ||
31 | The license agreements of most software companies try to keep users | |
32 | at the mercy of those companies. By contrast, our General Public | |
33 | License is intended to guarantee your freedom to share and change free | |
34 | software--to make sure the software is free for all its users. The | |
35 | General Public License applies to the Free Software Foundation's | |
36 | software and to any other program whose authors commit to using it. | |
37 | You can use it for your programs, too. | |
38 | ||
39 | When we speak of free software, we are referring to freedom, not | |
40 | price. Specifically, the General Public License is designed to make | |
41 | sure that you have the freedom to give away or sell copies of free | |
42 | software, that you receive source code or can get it if you want it, | |
43 | that you can change the software or use pieces of it in new free | |
44 | programs; and that you know you can do these things. | |
45 | ||
46 | To protect your rights, we need to make restrictions that forbid | |
47 | anyone to deny you these rights or to ask you to surrender the rights. | |
48 | These restrictions translate to certain responsibilities for you if you | |
49 | distribute copies of the software, or if you modify it. | |
50 | ||
51 | For example, if you distribute copies of a such a program, whether | |
52 | gratis or for a fee, you must give the recipients all the rights that | |
53 | you have. You must make sure that they, too, receive or can get the | |
54 | source code. And you must tell them their rights. | |
55 | ||
56 | We protect your rights with two steps: (1) copyright the software, and | |
57 | (2) offer you this license which gives you legal permission to copy, | |
58 | distribute and/or modify the software. | |
59 | ||
60 | Also, for each author's protection and ours, we want to make certain | |
61 | that everyone understands that there is no warranty for this free | |
62 | software. If the software is modified by someone else and passed on, we | |
63 | want its recipients to know that what they have is not the original, so | |
64 | that any problems introduced by others will not reflect on the original | |
65 | authors' reputations. | |
66 | ||
67 | The precise terms and conditions for copying, distribution and | |
68 | modification follow. | |
69 | ||
70 | GNU GENERAL PUBLIC LICENSE | |
71 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
72 | ||
73 | 0. This License Agreement applies to any program or other work which | |
74 | contains a notice placed by the copyright holder saying it may be | |
75 | distributed under the terms of this General Public License. The | |
76 | "Program", below, refers to any such program or work, and a "work based | |
77 | on the Program" means either the Program or any work containing the | |
78 | Program or a portion of it, either verbatim or with modifications. Each | |
79 | licensee is addressed as "you". | |
80 | ||
81 | 1. You may copy and distribute verbatim copies of the Program's source | |
82 | code as you receive it, in any medium, provided that you conspicuously and | |
83 | appropriately publish on each copy an appropriate copyright notice and | |
84 | disclaimer of warranty; keep intact all the notices that refer to this | |
85 | General Public License and to the absence of any warranty; and give any | |
86 | other recipients of the Program a copy of this General Public License | |
87 | along with the Program. You may charge a fee for the physical act of | |
88 | transferring a copy. | |
89 | ||
90 | 2. You may modify your copy or copies of the Program or any portion of | |
91 | it, and copy and distribute such modifications under the terms of Paragraph | |
92 | 1 above, provided that you also do the following: | |
93 | ||
94 | a) cause the modified files to carry prominent notices stating that | |
95 | you changed the files and the date of any change; and | |
96 | ||
97 | b) cause the whole of any work that you distribute or publish, that | |
98 | in whole or in part contains the Program or any part thereof, either | |
99 | with or without modifications, to be licensed at no charge to all | |
100 | third parties under the terms of this General Public License (except | |
101 | that you may choose to grant warranty protection to some or all | |
102 | third parties, at your option). | |
103 | ||
104 | c) If the modified program normally reads commands interactively when | |
105 | run, you must cause it, when started running for such interactive use | |
106 | in the simplest and most usual way, to print or display an | |
107 | announcement including an appropriate copyright notice and a notice | |
108 | that there is no warranty (or else, saying that you provide a | |
109 | warranty) and that users may redistribute the program under these | |
110 | conditions, and telling the user how to view a copy of this General | |
111 | Public License. | |
112 | ||
113 | d) You may charge a fee for the physical act of transferring a | |
114 | copy, and you may at your option offer warranty protection in | |
115 | exchange for a fee. | |
116 | ||
117 | Mere aggregation of another independent work with the Program (or its | |
118 | derivative) on a volume of a storage or distribution medium does not bring | |
119 | the other work under the scope of these terms. | |
120 | ||
121 | 3. You may copy and distribute the Program (or a portion or derivative of | |
122 | it, under Paragraph 2) in object code or executable form under the terms of | |
123 | Paragraphs 1 and 2 above provided that you also do one of the following: | |
124 | ||
125 | a) accompany it with the complete corresponding machine-readable | |
126 | source code, which must be distributed under the terms of | |
127 | Paragraphs 1 and 2 above; or, | |
128 | ||
129 | b) accompany it with a written offer, valid for at least three | |
130 | years, to give any third party free (except for a nominal charge | |
131 | for the cost of distribution) a complete machine-readable copy of the | |
132 | corresponding source code, to be distributed under the terms of | |
133 | Paragraphs 1 and 2 above; or, | |
134 | ||
135 | c) accompany it with the information you received as to where the | |
136 | corresponding source code may be obtained. (This alternative is | |
137 | allowed only for noncommercial distribution and only if you | |
138 | received the program in object code or executable form alone.) | |
139 | ||
140 | Source code for a work means the preferred form of the work for making | |
141 | modifications to it. For an executable file, complete source code means | |
142 | all the source code for all modules it contains; but, as a special | |
143 | exception, it need not include source code for modules which are standard | |
144 | libraries that accompany the operating system on which the executable | |
145 | file runs, or for standard header files or definitions files that | |
146 | accompany that operating system. | |
147 | ||
148 | 4. You may not copy, modify, sublicense, distribute or transfer the | |
149 | Program except as expressly provided under this General Public License. | |
150 | Any attempt otherwise to copy, modify, sublicense, distribute or transfer | |
151 | the Program is void, and will automatically terminate your rights to use | |
152 | the Program under this License. However, parties who have received | |
153 | copies, or rights to use copies, from you under this General Public | |
154 | License will not have their licenses terminated so long as such parties | |
155 | remain in full compliance. | |
156 | ||
157 | 5. By copying, distributing or modifying the Program (or any work based | |
158 | on the Program) you indicate your acceptance of this license to do so, | |
159 | and all its terms and conditions. | |
160 | ||
161 | 6. Each time you redistribute the Program (or any work based on the | |
162 | Program), the recipient automatically receives a license from the original | |
163 | licensor to copy, distribute or modify the Program subject to these | |
164 | terms and conditions. You may not impose any further restrictions on the | |
165 | recipients' exercise of the rights granted herein. | |
166 | ||
167 | 7. The Free Software Foundation may publish revised and/or new versions | |
168 | of the General Public License from time to time. Such new versions will | |
169 | be similar in spirit to the present version, but may differ in detail to | |
170 | address new problems or concerns. | |
171 | ||
172 | Each version is given a distinguishing version number. If the Program | |
173 | specifies a version number of the license which applies to it and "any | |
174 | later version", you have the option of following the terms and conditions | |
175 | either of that version or of any later version published by the Free | |
176 | Software Foundation. If the Program does not specify a version number of | |
177 | the license, you may choose any version ever published by the Free Software | |
178 | Foundation. | |
179 | ||
180 | 8. If you wish to incorporate parts of the Program into other free | |
181 | programs whose distribution conditions are different, write to the author | |
182 | to ask for permission. For software which is copyrighted by the Free | |
183 | Software Foundation, write to the Free Software Foundation; we sometimes | |
184 | make exceptions for this. Our decision will be guided by the two goals | |
185 | of preserving the free status of all derivatives of our free software and | |
186 | of promoting the sharing and reuse of software generally. | |
187 | ||
188 | NO WARRANTY | |
189 | ||
190 | 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
191 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
192 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
193 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
194 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
195 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
196 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
197 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
198 | REPAIR OR CORRECTION. | |
199 | ||
200 | 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
201 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
202 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
203 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
204 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
205 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
206 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
207 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
208 | POSSIBILITY OF SUCH DAMAGES. | |
209 | ||
210 | END OF TERMS AND CONDITIONS | |
211 | ||
212 | Appendix: How to Apply These Terms to Your New Programs | |
213 | ||
214 | If you develop a new program, and you want it to be of the greatest | |
215 | possible use to humanity, the best way to achieve this is to make it | |
216 | free software which everyone can redistribute and change under these | |
217 | terms. | |
218 | ||
219 | To do so, attach the following notices to the program. It is safest to | |
220 | attach them to the start of each source file to most effectively convey | |
221 | the exclusion of warranty; and each file should have at least the | |
222 | "copyright" line and a pointer to where the full notice is found. | |
223 | ||
224 | <one line to give the program's name and a brief idea of what it does.> | |
225 | Copyright (C) 19yy <name of author> | |
226 | ||
227 | This program is free software; you can redistribute it and/or modify | |
228 | it under the terms of the GNU General Public License as published by | |
229 | the Free Software Foundation; either version 1, or (at your option) | |
230 | any later version. | |
231 | ||
232 | This program is distributed in the hope that it will be useful, | |
233 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
234 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
235 | GNU General Public License for more details. | |
236 | ||
237 | You should have received a copy of the GNU General Public License | |
238 | along with this program; if not, write to the Free Software | |
239 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA | |
240 | ||
241 | ||
242 | Also add information on how to contact you by electronic and paper mail. | |
243 | ||
244 | If the program is interactive, make it output a short notice like this | |
245 | when it starts in an interactive mode: | |
246 | ||
247 | Gnomovision version 69, Copyright (C) 19xx name of author | |
248 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
249 | This is free software, and you are welcome to redistribute it | |
250 | under certain conditions; type `show c' for details. | |
251 | ||
252 | The hypothetical commands `show w' and `show c' should show the | |
253 | appropriate parts of the General Public License. Of course, the | |
254 | commands you use may be called something other than `show w' and `show | |
255 | c'; they could even be mouse-clicks or menu items--whatever suits your | |
256 | program. | |
257 | ||
258 | You should also get your employer (if you work as a programmer) or your | |
259 | school, if any, to sign a "copyright disclaimer" for the program, if | |
260 | necessary. Here a sample; alter the names: | |
261 | ||
262 | Yoyodyne, Inc., hereby disclaims all copyright interest in the | |
263 | program `Gnomovision' (a program to direct compilers to make passes | |
264 | at assemblers) written by James Hacker. | |
265 | ||
266 | <signature of Ty Coon>, 1 April 1989 | |
267 | Ty Coon, President of Vice | |
268 | ||
269 | That's all there is to it! | |
270 | ||
271 | ||
272 | --- The Artistic License 1.0 --- | |
273 | ||
274 | This software is Copyright (c) 2002-2021 by David E. Wheeler. | |
275 | ||
276 | This is free software, licensed under: | |
277 | ||
278 | The Artistic License 1.0 | |
279 | ||
280 | The Artistic License | |
281 | ||
282 | Preamble | |
283 | ||
284 | The intent of this document is to state the conditions under which a Package | |
285 | may be copied, such that the Copyright Holder maintains some semblance of | |
286 | artistic control over the development of the package, while giving the users of | |
287 | the package the right to use and distribute the Package in a more-or-less | |
288 | customary fashion, plus the right to make reasonable modifications. | |
289 | ||
290 | Definitions: | |
291 | ||
292 | - "Package" refers to the collection of files distributed by the Copyright | |
293 | Holder, and derivatives of that collection of files created through | |
294 | textual modification. | |
295 | - "Standard Version" refers to such a Package if it has not been modified, | |
296 | or has been modified in accordance with the wishes of the Copyright | |
297 | Holder. | |
298 | - "Copyright Holder" is whoever is named in the copyright or copyrights for | |
299 | the package. | |
300 | - "You" is you, if you're thinking about copying or distributing this Package. | |
301 | - "Reasonable copying fee" is whatever you can justify on the basis of media | |
302 | cost, duplication charges, time of people involved, and so on. (You will | |
303 | not be required to justify it to the Copyright Holder, but only to the | |
304 | computing community at large as a market that must bear the fee.) | |
305 | - "Freely Available" means that no fee is charged for the item itself, though | |
306 | there may be fees involved in handling the item. It also means that | |
307 | recipients of the item may redistribute it under the same conditions they | |
308 | received it. | |
309 | ||
310 | 1. You may make and give away verbatim copies of the source form of the | |
311 | Standard Version of this Package without restriction, provided that you | |
312 | duplicate all of the original copyright notices and associated disclaimers. | |
313 | ||
314 | 2. You may apply bug fixes, portability fixes and other modifications derived | |
315 | from the Public Domain or from the Copyright Holder. A Package modified in such | |
316 | a way shall still be considered the Standard Version. | |
317 | ||
318 | 3. You may otherwise modify your copy of this Package in any way, provided that | |
319 | you insert a prominent notice in each changed file stating how and when you | |
320 | changed that file, and provided that you do at least ONE of the following: | |
321 | ||
322 | a) place your modifications in the Public Domain or otherwise make them | |
323 | Freely Available, such as by posting said modifications to Usenet or an | |
324 | equivalent medium, or placing the modifications on a major archive site | |
325 | such as ftp.uu.net, or by allowing the Copyright Holder to include your | |
326 | modifications in the Standard Version of the Package. | |
327 | ||
328 | b) use the modified Package only within your corporation or organization. | |
329 | ||
330 | c) rename any non-standard executables so the names do not conflict with | |
331 | standard executables, which must also be provided, and provide a separate | |
332 | manual page for each non-standard executable that clearly documents how it | |
333 | differs from the Standard Version. | |
334 | ||
335 | d) make other distribution arrangements with the Copyright Holder. | |
336 | ||
337 | 4. You may distribute the programs of this Package in object code or executable | |
338 | form, provided that you do at least ONE of the following: | |
339 | ||
340 | a) distribute a Standard Version of the executables and library files, | |
341 | together with instructions (in the manual page or equivalent) on where to | |
342 | get the Standard Version. | |
343 | ||
344 | b) accompany the distribution with the machine-readable source of the Package | |
345 | with your modifications. | |
346 | ||
347 | c) accompany any non-standard executables with their corresponding Standard | |
348 | Version executables, giving the non-standard executables non-standard | |
349 | names, and clearly documenting the differences in manual pages (or | |
350 | equivalent), together with instructions on where to get the Standard | |
351 | Version. | |
352 | ||
353 | d) make other distribution arrangements with the Copyright Holder. | |
354 | ||
355 | 5. You may charge a reasonable copying fee for any distribution of this | |
356 | Package. You may charge any fee you choose for support of this Package. You | |
357 | may not charge a fee for this Package itself. However, you may distribute this | |
358 | Package in aggregate with other (possibly commercial) programs as part of a | |
359 | larger (possibly commercial) software distribution provided that you do not | |
360 | advertise this Package as a product of your own. | |
361 | ||
362 | 6. The scripts and library files supplied as input to or produced as output | |
363 | from the programs of this Package do not automatically fall under the copyright | |
364 | of this Package, but belong to whomever generated them, and may be sold | |
365 | commercially, and may be aggregated with this Package. | |
366 | ||
367 | 7. C or perl subroutines supplied by you and linked into this Package shall not | |
368 | be considered part of this Package. | |
369 | ||
370 | 8. The name of the Copyright Holder may not be used to endorse or promote | |
371 | products derived from this software without specific prior written permission. | |
372 | ||
373 | 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED | |
374 | WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | |
375 | MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
376 | ||
377 | The End | |
378 |
0 | # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.017. | |
0 | 1 | Changes |
2 | INSTALL | |
3 | LICENSE | |
4 | MANIFEST | |
5 | META.json | |
6 | META.yml | |
7 | Makefile.PL | |
8 | README | |
9 | author.yml | |
10 | dist.ini | |
1 | 11 | lib/Exception/Class/DBI.pm |
2 | maint/releaseprep | |
3 | Makefile.PL | |
4 | MANIFEST This list of files | |
5 | README.md | |
12 | t/00_diag.t | |
6 | 13 | t/dbh.t |
7 | 14 | t/dbi.t |
8 | 15 | t/drh.t |
9 | 16 | t/sth.t |
10 | 17 | t/subclass.t |
11 | 18 | t/z_pod.t |
12 | META.yml Module YAML meta-data (added by MakeMaker) | |
13 | META.json Module JSON meta-data (added by MakeMaker) | |
19 | xt/author/eol.t | |
20 | xt/author/no_tabs.t | |
21 | xt/author/pod.t | |
22 | xt/author/pod_coverage.t | |
23 | xt/author/pod_spelling_common.t | |
24 | xt/author/pod_spelling_system.t | |
25 | xt/author/strict.t | |
26 | xt/author/version.t | |
27 | xt/release/changes.t | |
28 | xt/release/fixme.t |
0 | 0 | { |
1 | 1 | "abstract" : "DBI Exception objects", |
2 | 2 | "author" : [ |
3 | "unknown" | |
3 | "David E. Wheeler <david@justatheory.com>", | |
4 | "Graham Ollis <plicease@cpan.org>" | |
4 | 5 | ], |
5 | "dynamic_config" : 1, | |
6 | "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", | |
6 | "dynamic_config" : 0, | |
7 | "generated_by" : "Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010", | |
7 | 8 | "license" : [ |
8 | 9 | "perl_5" |
9 | 10 | ], |
12 | 13 | "version" : 2 |
13 | 14 | }, |
14 | 15 | "name" : "Exception-Class-DBI", |
15 | "no_index" : { | |
16 | "directory" : [ | |
17 | "t", | |
18 | "inc" | |
19 | ] | |
20 | }, | |
21 | 16 | "prereqs" : { |
22 | "build" : { | |
17 | "configure" : { | |
23 | 18 | "requires" : { |
24 | "ExtUtils::MakeMaker" : "6.64" | |
19 | "ExtUtils::MakeMaker" : "0", | |
20 | "perl" : "5.006" | |
25 | 21 | } |
26 | 22 | }, |
27 | "configure" : { | |
23 | "develop" : { | |
28 | 24 | "requires" : { |
29 | "ExtUtils::MakeMaker" : "6.64" | |
25 | "File::Spec" : "0", | |
26 | "FindBin" : "0", | |
27 | "Test::CPAN::Changes" : "0", | |
28 | "Test::EOL" : "0", | |
29 | "Test::Fixme" : "0.07", | |
30 | "Test::More" : "0.98", | |
31 | "Test::NoTabs" : "0", | |
32 | "Test::Pod" : "0", | |
33 | "Test::Pod::Coverage" : "0", | |
34 | "Test::Pod::Spelling::CommonMistakes" : "0", | |
35 | "Test::Spelling" : "0", | |
36 | "Test::Strict" : "0", | |
37 | "YAML" : "0" | |
30 | 38 | } |
31 | 39 | }, |
32 | 40 | "runtime" : { |
33 | 41 | "requires" : { |
34 | 42 | "DBI" : "1.28", |
35 | 43 | "Exception::Class" : "1.02", |
36 | "perl" : "5.006000" | |
44 | "perl" : "5.006" | |
37 | 45 | } |
38 | 46 | }, |
39 | 47 | "test" : { |
40 | 48 | "requires" : { |
49 | "DBD::ExampleP" : "0", | |
50 | "DBI" : "1.28", | |
41 | 51 | "Test::Harness" : "2.03", |
42 | "Test::More" : "0.17" | |
52 | "Test::More" : "0.98", | |
53 | "base" : "0", | |
54 | "perl" : "5.006" | |
43 | 55 | } |
44 | 56 | } |
45 | 57 | }, |
46 | 58 | "release_status" : "stable", |
47 | 59 | "resources" : { |
48 | 60 | "bugtracker" : { |
49 | "web" : "https://github.com/plicease/Exception-Class-DBI/issues" | |
61 | "web" : "https://github.com/uperl/libexception-class-dbi-perl/issues" | |
50 | 62 | }, |
51 | "homepage" : "https://metacpan.org/pod/Exception-Class-DBI", | |
63 | "homepage" : "https://metacpan.org/pod/libexception::class::dbi::perl", | |
52 | 64 | "repository" : { |
53 | 65 | "type" : "git", |
54 | "url" : "https://github.com/plicease/Exception-Class-DBI.git", | |
55 | "web" : "https://github.com/plicease/Exception-Class-DBI" | |
66 | "url" : "git://github.com/uperl/libexception-class-dbi-perl.git", | |
67 | "web" : "https://github.com/uperl/libexception-class-dbi-perl" | |
56 | 68 | } |
57 | 69 | }, |
58 | 70 | "version" : "1.04", |
59 | "x_serialization_backend" : "JSON::PP version 4.02" | |
71 | "x_generated_by_perl" : "v5.32.1", | |
72 | "x_serialization_backend" : "Cpanel::JSON::XS version 4.25", | |
73 | "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", | |
74 | "x_use_unsafe_inc" : 0 | |
60 | 75 | } |
76 |
0 | 0 | --- |
1 | 1 | abstract: 'DBI Exception objects' |
2 | 2 | author: |
3 | - unknown | |
3 | - 'David E. Wheeler <david@justatheory.com>' | |
4 | - 'Graham Ollis <plicease@cpan.org>' | |
4 | 5 | build_requires: |
5 | ExtUtils::MakeMaker: '6.64' | |
6 | DBD::ExampleP: '0' | |
7 | DBI: '1.28' | |
6 | 8 | Test::Harness: '2.03' |
7 | Test::More: '0.17' | |
9 | Test::More: '0.98' | |
10 | base: '0' | |
11 | perl: '5.006' | |
8 | 12 | configure_requires: |
9 | ExtUtils::MakeMaker: '6.64' | |
10 | dynamic_config: 1 | |
11 | generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' | |
13 | ExtUtils::MakeMaker: '0' | |
14 | perl: '5.006' | |
15 | dynamic_config: 0 | |
16 | generated_by: 'Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010' | |
12 | 17 | license: perl |
13 | 18 | meta-spec: |
14 | 19 | url: http://module-build.sourceforge.net/META-spec-v1.4.html |
15 | 20 | version: '1.4' |
16 | 21 | name: Exception-Class-DBI |
17 | no_index: | |
18 | directory: | |
19 | - t | |
20 | - inc | |
21 | 22 | requires: |
22 | 23 | DBI: '1.28' |
23 | 24 | Exception::Class: '1.02' |
24 | perl: '5.006000' | |
25 | perl: '5.006' | |
25 | 26 | resources: |
26 | bugtracker: https://github.com/plicease/Exception-Class-DBI/issues | |
27 | homepage: https://metacpan.org/pod/Exception-Class-DBI | |
28 | repository: https://github.com/plicease/Exception-Class-DBI.git | |
27 | bugtracker: https://github.com/uperl/libexception-class-dbi-perl/issues | |
28 | homepage: https://metacpan.org/pod/libexception::class::dbi::perl | |
29 | repository: git://github.com/uperl/libexception-class-dbi-perl.git | |
29 | 30 | version: '1.04' |
30 | x_serialization_backend: 'CPAN::Meta::YAML version 0.018' | |
31 | x_generated_by_perl: v5.32.1 | |
32 | x_serialization_backend: 'YAML::Tiny version 1.73' | |
33 | x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' | |
34 | x_use_unsafe_inc: 0 |
0 | BEGIN { | |
1 | use strict; use warnings; | |
2 | unless(eval q{ use 5.006; 1}) { | |
3 | print "Perl 5.006 or better required\n"; | |
4 | exit; | |
5 | } | |
6 | } | |
7 | # This file was automatically generated by Dist::Zilla::Plugin::Author::Plicease::MakeMaker v2.64. | |
0 | 8 | use strict; |
1 | 9 | use warnings; |
2 | 10 | use 5.006; |
3 | use ExtUtils::MakeMaker 6.64; | |
11 | use ExtUtils::MakeMaker; | |
4 | 12 | |
5 | WriteMakefile( | |
6 | NAME => 'Exception::Class::DBI', | |
7 | LICENSE => 'perl', | |
8 | VERSION_FROM => 'lib/Exception/Class/DBI.pm', | |
9 | ABSTRACT_FROM => 'lib/Exception/Class/DBI.pm', | |
10 | MIN_PERL_VERSION => '5.006000', | |
13 | my %WriteMakefileArgs = ( | |
14 | "ABSTRACT" => "DBI Exception objects", | |
15 | "AUTHOR" => "David E. Wheeler <david\@justatheory.com>, Graham Ollis <plicease\@cpan.org>", | |
16 | "CONFIGURE_REQUIRES" => { | |
17 | "ExtUtils::MakeMaker" => 0 | |
18 | }, | |
19 | "DISTNAME" => "Exception-Class-DBI", | |
20 | "LICENSE" => "perl", | |
21 | "MIN_PERL_VERSION" => "5.006", | |
22 | "NAME" => "Exception::Class::DBI", | |
23 | "PM" => { | |
24 | "lib/Exception/Class/DBI.pm" => "\$(INST_LIB)/Exception/Class/DBI.pm" | |
25 | }, | |
26 | "PREREQ_PM" => { | |
27 | "DBI" => "1.28", | |
28 | "Exception::Class" => "1.02" | |
29 | }, | |
30 | "TEST_REQUIRES" => { | |
31 | "DBD::ExampleP" => 0, | |
32 | "DBI" => "1.28", | |
33 | "Test::Harness" => "2.03", | |
34 | "Test::More" => "0.98", | |
35 | "base" => 0 | |
36 | }, | |
37 | "VERSION" => "1.04", | |
38 | "test" => { | |
39 | "TESTS" => "t/*.t" | |
40 | } | |
41 | ); | |
11 | 42 | |
12 | CONFIGURE_REQUIRES => { | |
13 | 'ExtUtils::MakeMaker' => '6.64', | |
14 | }, | |
43 | my %FallbackPrereqs = ( | |
44 | "DBD::ExampleP" => 0, | |
45 | "DBI" => "1.28", | |
46 | "Exception::Class" => "1.02", | |
47 | "Test::Harness" => "2.03", | |
48 | "Test::More" => "0.98", | |
49 | "base" => 0 | |
50 | ); | |
15 | 51 | |
16 | BUILD_REQUIRES => { | |
17 | 'ExtUtils::MakeMaker' => '6.64', | |
18 | }, | |
52 | unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { | |
53 | delete $WriteMakefileArgs{TEST_REQUIRES}; | |
54 | delete $WriteMakefileArgs{BUILD_REQUIRES}; | |
55 | $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; | |
56 | } | |
19 | 57 | |
20 | TEST_REQUIRES => { | |
21 | 'Test::More' => '0.17', | |
22 | 'Test::Harness' => '2.03', | |
23 | }, | |
58 | delete $WriteMakefileArgs{CONFIGURE_REQUIRES} | |
59 | unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; | |
24 | 60 | |
25 | PREREQ_PM => { | |
26 | 'DBI' => '1.28', | |
27 | 'Exception::Class' => '1.02', | |
28 | }, | |
29 | ||
30 | META_MERGE => { | |
31 | 'meta-spec' => { version => 2 }, | |
32 | resources => { | |
33 | bugtracker => { | |
34 | web => 'https://github.com/plicease/Exception-Class-DBI/issues', | |
35 | }, | |
36 | homepage => 'https://metacpan.org/pod/Exception-Class-DBI', | |
37 | repository => { | |
38 | type => 'git', | |
39 | url => 'https://github.com/plicease/Exception-Class-DBI.git', | |
40 | web => 'https://github.com/plicease/Exception-Class-DBI', | |
41 | }, | |
42 | } | |
43 | }, | |
44 | ); | |
61 | WriteMakefile(%WriteMakefileArgs);⏎ |
0 | NAME | |
1 | ||
2 | Exception::Class::DBI - DBI Exception objects | |
3 | ||
4 | VERSION | |
5 | ||
6 | version 1.04 | |
7 | ||
8 | Name | |
9 | ||
10 | Exception::Class::DBI - DBI Exception objects | |
11 | ||
12 | Synopsis | |
13 | ||
14 | use DBI; | |
15 | use Exception::Class::DBI; | |
16 | ||
17 | my $dbh = DBI->connect($dsn, $user, $pass, { | |
18 | PrintError => 0, | |
19 | RaiseError => 0, | |
20 | HandleError => Exception::Class::DBI->handler, | |
21 | }); | |
22 | ||
23 | eval { $dbh->do($sql) }; | |
24 | ||
25 | if (my $ex = $@) { | |
26 | print STDERR "DBI Exception:\n"; | |
27 | print STDERR " Exception Type: ", ref $ex, "\n"; | |
28 | print STDERR " Error: ", $ex->error, "\n"; | |
29 | print STDERR " Err: ", $ex->err, "\n"; | |
30 | print STDERR " Errstr: ", $ex->errstr, "\n"; | |
31 | print STDERR " State: ", $ex->state, "\n"; | |
32 | print STDERR " Return Value: ", ($ex->retval || 'undef'), "\n"; | |
33 | } | |
34 | ||
35 | Description | |
36 | ||
37 | This module offers a set of DBI-specific exception classes. They | |
38 | inherit from Exception::Class, the base class for all exception objects | |
39 | created by the Exception::Class module from the CPAN. | |
40 | Exception::Class::DBI itself offers a single class method, handler(), | |
41 | that returns a code reference appropriate for passing to the DBI | |
42 | HandleError attribute. | |
43 | ||
44 | The exception classes created by Exception::Class::DBI are designed to | |
45 | be thrown in certain DBI contexts; the code reference returned by | |
46 | handler() and passed to the DBI HandleError attribute determines the | |
47 | context and throws the appropriate exception. | |
48 | ||
49 | Each of the Exception::Class::DBI classes offers a set of object | |
50 | accessor methods in addition to those provided by Exception::Class. | |
51 | These can be used to output detailed diagnostic information in the | |
52 | event of an exception. | |
53 | ||
54 | Interface | |
55 | ||
56 | Exception::Class::DBI inherits from Exception::Class, and thus its | |
57 | entire interface. Refer to the Exception::Class documentation for | |
58 | details. | |
59 | ||
60 | Class Method | |
61 | ||
62 | handler | |
63 | ||
64 | my $dbh = DBI->connect($data_source, $username, $auth, { | |
65 | PrintError => 0, | |
66 | RaiseError => 0, | |
67 | HandleError => Exception::Class::DBI->handler | |
68 | }); | |
69 | ||
70 | This method returns a code reference appropriate for passing to the | |
71 | DBI HandleError attribute. When DBI encounters an error, it checks | |
72 | its PrintError, RaiseError, and HandleError attributes to decide what | |
73 | to do about it. When HandleError has been set to a code reference, | |
74 | DBI executes it, passing it the error string that would be printed | |
75 | for PrintError, the DBI handle object that was executing the method | |
76 | call that triggered the error, and the return value of that method | |
77 | call (usually undef). Using these arguments, the code reference | |
78 | provided by handler() determines what type of exception to throw. | |
79 | Exception::Class::DBI contains the subclasses detailed below, each | |
80 | relevant to the DBI handle that triggered the error. | |
81 | ||
82 | Classes | |
83 | ||
84 | Exception::Class::DBI creates a number of exception classes, each one | |
85 | specific to a particular DBI error context. Most of the object methods | |
86 | described below correspond to like-named attributes in the DBI itself. | |
87 | Thus the documentation below summarizes the DBI attribute | |
88 | documentation, so you should refer to DBI itself for more in-depth | |
89 | information. | |
90 | ||
91 | Exception::Class::DBI | |
92 | ||
93 | All of the Exception::Class::DBI classes documented below inherit from | |
94 | Exception::Class::DBI. It offers the several object methods in addition | |
95 | to those it inherits from its parent, Exception::Class. These methods | |
96 | correspond to the DBI dynamic attributes, as well as to the values | |
97 | passed to the handler() exception handler via the DBI HandleError | |
98 | attribute. Exceptions of this base class are only thrown when there is | |
99 | no DBI handle object executing, e.g. in the DBI connect() method. Note: | |
100 | This functionality is not yet implemented in DBI -- see the discussion | |
101 | that starts here: | |
102 | http://archive.develooper.com/dbi-dev@perl.org/msg01438.html. | |
103 | ||
104 | error | |
105 | ||
106 | my $error = $ex->error; | |
107 | ||
108 | Exception::Class::DBI actually inherits this method from | |
109 | Exception::Class. It contains the error string that DBI prints when | |
110 | its PrintError attribute is enabled, or dies with when its | |
111 | <RaiseError> attribute is enabled. | |
112 | ||
113 | err | |
114 | ||
115 | my $err = $ex->err; | |
116 | ||
117 | Corresponds to the $DBI::err dynamic attribute. Returns the native | |
118 | database engine error code from the last driver method called. | |
119 | ||
120 | errstr | |
121 | ||
122 | my $errstr = $ex->errstr; | |
123 | ||
124 | Corresponds to the $DBI::errstr dynamic attribute. Returns the native | |
125 | database engine error message from the last driver method called. | |
126 | ||
127 | state | |
128 | ||
129 | my $state = $ex->state; | |
130 | ||
131 | Corresponds to the $DBI::state dynamic attribute. Returns an error | |
132 | code in the standard SQLSTATE five character format. | |
133 | ||
134 | retval | |
135 | ||
136 | my $retval = $ex->retval; | |
137 | ||
138 | The first value being returned by the DBI method that failed | |
139 | (typically undef). | |
140 | ||
141 | handle | |
142 | ||
143 | my $db_handle = $ex->handle; | |
144 | ||
145 | The DBI handle appropriate to the exception class. For | |
146 | Exception::Class::DBI::DRH, it will be a driver handle. For | |
147 | Exception::Class::DBI::DBH it will be a database handle. And for | |
148 | Exception::Class::DBI::STH it will be a statement handle. If there is | |
149 | no handle thrown in the exception (because, say, the exception was | |
150 | thrown before a driver handle could be created), the handle will be | |
151 | undef. | |
152 | ||
153 | Exception::Class::DBI::H | |
154 | ||
155 | This class inherits from Exception::Class::DBI, and is the base class | |
156 | for all DBI handle exceptions (see below). It will not be thrown | |
157 | directly. Its methods correspond to the DBI attributes common to all | |
158 | handles. | |
159 | ||
160 | warn | |
161 | ||
162 | my $warn = $ex->warn; | |
163 | ||
164 | Boolean value indicating whether DBI warnings have been enabled. | |
165 | Corresponds to the DBI Warn attribute. | |
166 | ||
167 | active | |
168 | ||
169 | my $active = $ex->active; | |
170 | ||
171 | Boolean value indicating whether the DBI handle that encountered the | |
172 | error is active. Corresponds to the DBI Active attribute. | |
173 | ||
174 | kids | |
175 | ||
176 | my $kids = $ex->kids; | |
177 | ||
178 | For a driver handle, Kids is the number of currently existing | |
179 | database handles that were created from that driver handle. For a | |
180 | database handle, Kids is the number of currently existing statement | |
181 | handles that were created from that database handle. Corresponds to | |
182 | the DBI Kids attribute. | |
183 | ||
184 | active_kids | |
185 | ||
186 | my $active_kids = $ex->active_kids; | |
187 | ||
188 | Like kids, but only counting those that are active (as above). | |
189 | Corresponds to the DBI ActiveKids attribute. | |
190 | ||
191 | compat_mode | |
192 | ||
193 | my $compat_mode = $ex->compat_mode; | |
194 | ||
195 | Boolean value indicating whether an emulation layer (such as Oraperl) | |
196 | enables compatible behavior in the underlying driver (e.g., | |
197 | DBD::Oracle) for this handle. Corresponds to the DBI CompatMode | |
198 | attribute. | |
199 | ||
200 | inactive_destroy | |
201 | ||
202 | my $inactive_destroy = $ex->inactive_destroy; | |
203 | ||
204 | Boolean value indicating whether the DBI has disabled the database | |
205 | engine related effect of DESTROYing a handle. Corresponds to the DBI | |
206 | InactiveDestroy attribute. | |
207 | ||
208 | trace_level | |
209 | ||
210 | my $trace_level = $ex->trace_level; | |
211 | ||
212 | Returns the DBI trace level set on the handle that encountered the | |
213 | error. Corresponds to the DBI TraceLevel attribute. | |
214 | ||
215 | fetch_hash_key_name | |
216 | ||
217 | my $fetch_hash_key_name = $ex->fetch_hash_key_name; | |
218 | ||
219 | Returns the attribute name the DBI fetchrow_hashref() method should | |
220 | use to get the field names for the hash keys. Corresponds to the DBI | |
221 | FetchHashKeyName attribute. | |
222 | ||
223 | chop_blanks | |
224 | ||
225 | my $chop_blanks = $ex->chop_blanks; | |
226 | ||
227 | Boolean value indicating whether DBI trims trailing space characters | |
228 | from fixed width character (CHAR) fields. Corresponds to the DBI | |
229 | ChopBlanks attribute. | |
230 | ||
231 | long_read_len | |
232 | ||
233 | my $long_read_len = $ex->long_read_len; | |
234 | ||
235 | Returns the maximum length of long fields ("blob", "memo", etc.) | |
236 | which the DBI driver will read from the database automatically when | |
237 | it fetches each row of data. Corresponds to the DBI LongReadLen | |
238 | attribute. | |
239 | ||
240 | long_trunc_ok | |
241 | ||
242 | my $long_trunc_ok = $ex->long_trunc_ok; | |
243 | ||
244 | Boolean value indicating whether the DBI will truncate values it | |
245 | retrieves from long fields that are longer than the value returned by | |
246 | long_read_len(). Corresponds to the DBI LongTruncOk attribute. | |
247 | ||
248 | taint | |
249 | ||
250 | my $taint = $ex->taint; | |
251 | ||
252 | Boolean value indicating whether data fetched from the database is | |
253 | considered tainted. Corresponds to the DBI Taint attribute. | |
254 | ||
255 | Exception::Class::DBI::DRH | |
256 | ||
257 | DBI driver handle exceptions objects. This class inherits from | |
258 | Exception::Class::DBI::H, and offers no extra methods of its own. | |
259 | ||
260 | Exception::Class::DBI::DBH | |
261 | ||
262 | DBI database handle exceptions objects. This class inherits from | |
263 | Exception::Class::DBI::H Its methods correspond to the DBI database | |
264 | handle attributes. | |
265 | ||
266 | auto_commit | |
267 | ||
268 | my $auto_commit = $ex->auto_commit; | |
269 | ||
270 | Returns true if the database handle AutoCommit attribute is enabled. | |
271 | meaning that database changes cannot be rolled back. Corresponds to | |
272 | the DBI database handle AutoCommit attribute. | |
273 | ||
274 | db_name | |
275 | ||
276 | my $db_name = $ex->db_name; | |
277 | ||
278 | Returns the "name" of the database. Corresponds to the DBI database | |
279 | handle Name attribute. | |
280 | ||
281 | statement | |
282 | ||
283 | my $statement = $ex->statement; | |
284 | ||
285 | Returns the statement string passed to the most recent call to the | |
286 | DBI prepare() method in this database handle. If it was the prepare() | |
287 | method that encountered the error and triggered the exception, the | |
288 | statement string will be the statement passed to prepare(). | |
289 | Corresponds to the DBI database handle Statement attribute. | |
290 | ||
291 | row_cache_size | |
292 | ||
293 | my $row_cache_size = $ex->row_cache_size; | |
294 | ||
295 | Returns the hint to the database driver indicating the size of the | |
296 | local row cache that the application would like the driver to use for | |
297 | future SELECT statements. Corresponds to the DBI database handle | |
298 | RowCacheSize attribute. | |
299 | ||
300 | Exception::Class::DBI::STH | |
301 | ||
302 | DBI statement handle exceptions objects. This class inherits from | |
303 | Exception::Class::DBI::H Its methods correspond to the DBI statement | |
304 | handle attributes. | |
305 | ||
306 | num_of_fields | |
307 | ||
308 | my $num_of_fields = $ex->num_of_fields; | |
309 | ||
310 | Returns the number of fields (columns) the prepared statement will | |
311 | return. Corresponds to the DBI statement handle NUM_OF_FIELDS | |
312 | attribute. | |
313 | ||
314 | num_of_params | |
315 | ||
316 | my $num_of_params = $ex->num_of_params; | |
317 | ||
318 | Returns the number of parameters (placeholders) in the prepared | |
319 | statement. Corresponds to the DBI statement handle NUM_OF_PARAMS | |
320 | attribute. | |
321 | ||
322 | field_names | |
323 | ||
324 | my $field_names = $ex->field_names; | |
325 | ||
326 | Returns a reference to an array of field names for each column. | |
327 | Corresponds to the DBI statement handle NAME attribute. | |
328 | ||
329 | type | |
330 | ||
331 | my $type = $ex->type; | |
332 | ||
333 | Returns a reference to an array of integer values for each column. | |
334 | The value indicates the data type of the corresponding column. | |
335 | Corresponds to the DBI statement handle TYPE attribute. | |
336 | ||
337 | precision | |
338 | ||
339 | my $precision = $ex->precision; | |
340 | ||
341 | Returns a reference to an array of integer values for each column. | |
342 | For non-numeric columns, the value generally refers to either the | |
343 | maximum length or the defined length of the column. For numeric | |
344 | columns, the value refers to the maximum number of significant digits | |
345 | used by the data type (without considering a sign character or | |
346 | decimal point). Corresponds to the DBI statement handle PRECISION | |
347 | attribute. | |
348 | ||
349 | scale | |
350 | ||
351 | my $scale = $ex->scale; | |
352 | ||
353 | Returns a reference to an array of integer values for each column. | |
354 | Corresponds to the DBI statement handle SCALE attribute. | |
355 | ||
356 | nullable | |
357 | ||
358 | my $nullable = $ex->nullable; | |
359 | ||
360 | Returns a reference to an array indicating the possibility of each | |
361 | column returning a null. Possible values are 0 (or an empty string) = | |
362 | no, 1 = yes, 2 = unknown. Corresponds to the DBI statement handle | |
363 | NULLABLE attribute. | |
364 | ||
365 | cursor_name | |
366 | ||
367 | my $cursor_name = $ex->cursor_name; | |
368 | ||
369 | Returns the name of the cursor associated with the statement handle, | |
370 | if available. Corresponds to the DBI statement handle CursorName | |
371 | attribute. | |
372 | ||
373 | param_values | |
374 | ||
375 | my $param_values = $ex->param_values; | |
376 | ||
377 | Returns a reference to a hash containing the values currently bound | |
378 | to placeholders. Corresponds to the DBI statement handle ParamValues | |
379 | attribute. | |
380 | ||
381 | statement | |
382 | ||
383 | my $statement = $ex->statement; | |
384 | ||
385 | Returns the statement string passed to the DBI prepare() method. | |
386 | Corresponds to the DBI statement handle Statement attribute. | |
387 | ||
388 | rows_in_cache | |
389 | ||
390 | my $rows_in_cache = $ex->rows_in_cache; | |
391 | ||
392 | the number of unfetched rows in the cache if the driver supports a | |
393 | local row cache for SELECT statements. Corresponds to the DBI | |
394 | statement handle RowsInCache attribute. | |
395 | ||
396 | Exception::Class::DBI::Unknown | |
397 | ||
398 | Exceptions of this class are thrown when the context for a DBI error | |
399 | cannot be determined. Inherits from Exception::Class::DBI, but | |
400 | implements no methods of its own. | |
401 | ||
402 | Note | |
403 | ||
404 | Note: Not all of the attributes offered by the DBI are exploited by | |
405 | these exception classes. For example, the PrintError and RaiseError | |
406 | attributes seemed redundant. But if folks think it makes sense to | |
407 | include the missing attributes for the sake of completeness, let me | |
408 | know. Enough interest will motivate me to get them in. | |
409 | ||
410 | Subclassing | |
411 | ||
412 | It is possible to subclass Exception::Class::DBI. The trick is to | |
413 | subclass its subclasses, too. Similar to subclassing DBI itself, this | |
414 | means that the handle subclasses should exist as subnamespaces of your | |
415 | base subclass. | |
416 | ||
417 | It's easier to explain with an example. Say that you wanted to add a | |
418 | new method to all DBI exceptions that outputs a nicely formatted error | |
419 | message. You might do it like this: | |
420 | ||
421 | package MyApp::Ex::DBI; | |
422 | use base 'Exception::Class::DBI'; | |
423 | ||
424 | sub full_message { | |
425 | my $self = shift; | |
426 | return $self->SUPER::full_message unless $self->can('statement'); | |
427 | return $self->SUPER::full_message | |
428 | . ' [for Statement "' | |
429 | . $self->statement . '"]'; | |
430 | } | |
431 | ||
432 | You can then use this subclass just like Exception::Class::DBI itself: | |
433 | ||
434 | my $dbh = DBI->connect($dsn, $user, $pass, { | |
435 | PrintError => 0, | |
436 | RaiseError => 0, | |
437 | HandleError => MyApp::Ex::DBI->handler, | |
438 | }); | |
439 | ||
440 | And that's all well and good, except that none of | |
441 | Exception::Class::DBI's own subclasses inherit from your class, so most | |
442 | exceptions won't be able to use your spiffy new method. | |
443 | ||
444 | The solution is to create subclasses of both the Exception::Class::DBI | |
445 | subclasses and your own base subclass, as long as they each use the | |
446 | same package name as your subclass, plus "H", "DRH", "DBH", "STH", and | |
447 | "Unknown". Here's what it looks like: | |
448 | ||
449 | package MyApp::Ex::DBI::H; | |
450 | use base 'MyApp::Ex::DBI', 'Exception::Class::DBI::H'; | |
451 | ||
452 | package MyApp::Ex::DBI::DRH; | |
453 | use base 'MyApp::Ex::DBI', 'Exception::Class::DBI::DRH'; | |
454 | ||
455 | package MyApp::Ex::DBI::DBH; | |
456 | use base 'MyApp::Ex::DBI', 'Exception::Class::DBI::DBH'; | |
457 | ||
458 | package MyApp::Ex::DBI::STH; | |
459 | use base 'MyApp::Ex::DBI', 'Exception::Class::DBI::STH'; | |
460 | ||
461 | package MyApp::Ex::DBI::Unknown; | |
462 | use base 'MyApp::Ex::DBI', 'Exception::Class::DBI::Unknown'; | |
463 | ||
464 | And then things should work just spiffy! Of course, you probably don't | |
465 | need the H subclass unless you want to add other methods for the DRH, | |
466 | DBH, and STH classes to inherit from. | |
467 | ||
468 | To Do | |
469 | ||
470 | * I need to figure out a non-database specific way of testing STH | |
471 | exceptions. DBD::ExampleP works well for DRH and DBH exceptions, but | |
472 | not so well for STH exceptions. | |
473 | ||
474 | Support | |
475 | ||
476 | This module is stored in an open GitHub repository | |
477 | <http://github.com/uperl/Exception-Class-DBI/>. Feel free to fork and | |
478 | contribute! | |
479 | ||
480 | Please file bug reports via GitHub Issues | |
481 | <http://github.com/uperl/Exception-Class-DBI/issues/>. | |
482 | ||
483 | Author | |
484 | ||
485 | Original Author is David E. Wheeler <david@justatheory.com> | |
486 | ||
487 | Current maintainer is Graham Ollis <plicease@cpan.org> | |
488 | ||
489 | See Also | |
490 | ||
491 | You should really only be using this module in conjunction with Tim | |
492 | Bunce's DBI, so it pays to be familiar with its documentation. | |
493 | ||
494 | See the documentation for Dave Rolsky's Exception::Class module for | |
495 | details on the methods this module's classes inherit from it. There's | |
496 | lots more information in these exception objects, so use them! | |
497 | ||
498 | AUTHORS | |
499 | ||
500 | * David E. Wheeler <david@justatheory.com> | |
501 | ||
502 | * Graham Ollis <plicease@cpan.org> | |
503 | ||
504 | COPYRIGHT AND LICENSE | |
505 | ||
506 | This software is copyright (c) 2002-2021 by David E. Wheeler. | |
507 | ||
508 | This is free software; you can redistribute it and/or modify it under | |
509 | the same terms as the Perl 5 programming language system itself. | |
510 |
0 | Exception/Class/DBI version 1.02 | |
1 | ================================ | |
2 | ||
3 | This module offers a set of DBI-specific exception classes. They inherit from | |
4 | Exception::Class::Base, the base class for all exception objects created by | |
5 | the [Exception::Class](http://search.cpan.org/perldoc?Exception::Class) module | |
6 | from the CPAN. Exception::Class::DBI itself offers a single class method, | |
7 | `handler()`, that returns a code reference appropriate for passing the | |
8 | [DBI](http://search.cpan.org/perldoc?DBI) `HandleError` attribute. | |
9 | ||
10 | The exception classes created by Exception::Class::DBI are designed to be | |
11 | thrown in certain DBI contexts; the code reference returned by `handler()` and | |
12 | passed to the DBI `HandleError attribute determines the context, assembles the | |
13 | necessary metadata, and throws the apopropriate exception. | |
14 | ||
15 | Each of the Exception::Class::DBI classes offers a set of object accessor | |
16 | methods in addition to those provided by Exception::Class::Base. These can be | |
17 | used to output detailed output in the event of an exception. | |
18 | ||
19 | Installation | |
20 | ------------ | |
21 | ||
22 | To install this module, type the following: | |
23 | ||
24 | perl Build.PL | |
25 | ./Build | |
26 | ./Build test | |
27 | ./Build install | |
28 | ||
29 | Or, if you don't have Module::Build installed, type the following: | |
30 | ||
31 | perl Makefile.PL | |
32 | make | |
33 | make test | |
34 | make install | |
35 | ||
36 | Dependencies | |
37 | ------------ | |
38 | ||
39 | This module requires these other modules and libraries: | |
40 | ||
41 | * Perl 5.6 or later | |
42 | * DBI 1.28 or later (1.30 or later strongly recommended). | |
43 | * Exception::Class 1.02 or later (1.05 or later strongly recommended). | |
44 | * Test::Simple 0.40 (for testing). | |
45 | ||
46 | Copyright and Licence | |
47 | --------------------- | |
48 | ||
49 | Copyright (c) 2002-2011, David E. Wheeler. Some Rights Reserved. | |
50 | ||
51 | This module is free software; you can redistribute it and/or modify it under | |
52 | the same terms as Perl itself. | |
53 |
0 | --- | |
1 | pod_spelling_system: | |
2 | skip: 0 | |
3 | # list of words that are spelled correctly | |
4 | # (regardless of what spell check thinks) | |
5 | stopwords: | |
6 | - DBH | |
7 | - DRH | |
8 | - oraperl | |
9 | - Rolsky | |
10 | - SQLSTATE | |
11 | - STH | |
12 | - subnamespaces | |
13 | - unfetched | |
14 | ||
15 | pod_coverage: | |
16 | skip: 0 | |
17 | # format is "Class#method" or "Class", regex allowed | |
18 | # for either Class or method. | |
19 | private: | |
20 | - Exception::Class::DBI#Fields | |
21 | - Exception::Class::DBI#description |
0 | name = Exception-Class-DBI | |
1 | author = David E. Wheeler <david@justatheory.com> | |
2 | author = Graham Ollis <plicease@cpan.org> | |
3 | license = Perl_5 | |
4 | copyright_holder = David E. Wheeler | |
5 | copyright_year = 2002-2021 | |
6 | version = 1.04 | |
7 | ||
8 | [@Author::Plicease] | |
9 | :version = 2.63 | |
10 | release_tests = 1 | |
11 | github_user = uperl | |
12 | ||
13 | workflow = linux | |
14 | workflow = macos | |
15 | workflow = windows | |
16 | workflow = cygwin | |
17 | workflow = msys2-mingw | |
18 | ||
19 | [Prereqs] | |
20 | DBI = 1.28 | |
21 | ||
22 | [Prereqs / TestPrereqs] | |
23 | -phase = test | |
24 | Test::Harness = 2.03 | |
25 | ||
26 | [RemovePrereqs] | |
27 | remove = strict | |
28 | remove = warnings | |
29 | ||
30 | remove = Exception::Class::DBI::DRH | |
31 | remove = Exception::Class::DBI::Unknown | |
32 | ||
33 | [Author::Plicease::Upload] | |
34 | cpan = 1 |
2 | 2 | use 5.006; |
3 | 3 | use strict; |
4 | 4 | use warnings; |
5 | use Exception::Class; | |
6 | ||
7 | our $VERSION = '1.04'; | |
5 | use Exception::Class 1.02; | |
6 | ||
7 | # ABSTRACT: DBI Exception objects | |
8 | our $VERSION = '1.04'; # VERSION | |
8 | 9 | |
9 | 10 | use Exception::Class ( |
10 | 11 | 'Exception::Class::DBI' => { |
122 | 123 | sub rows_in_cache { shift->handle->{RowsInCache} } |
123 | 124 | |
124 | 125 | 1; |
126 | ||
125 | 127 | __END__ |
128 | ||
129 | =pod | |
130 | ||
131 | =encoding UTF-8 | |
132 | ||
133 | =head1 NAME | |
134 | ||
135 | Exception::Class::DBI - DBI Exception objects | |
136 | ||
137 | =head1 VERSION | |
138 | ||
139 | version 1.04 | |
126 | 140 | |
127 | 141 | =head1 Name |
128 | 142 | |
218 | 232 | C<HandleError> attribute. Exceptions of this base class are only thrown when |
219 | 233 | there is no DBI handle object executing, e.g. in the DBI C<connect()> |
220 | 234 | method. B<Note:> This functionality is not yet implemented in DBI -- see the |
221 | discusion that starts here: | |
235 | discussion that starts here: | |
222 | 236 | L<http://archive.develooper.com/dbi-dev@perl.org/msg01438.html>. |
223 | 237 | |
224 | 238 | =over 4 |
605 | 619 | =head1 Support |
606 | 620 | |
607 | 621 | This module is stored in an open L<GitHub |
608 | repository|http://github.com/plicease/Exception-Class-DBI/>. Feel free to fork | |
622 | repository|http://github.com/uperl/Exception-Class-DBI/>. Feel free to fork | |
609 | 623 | and contribute! |
610 | 624 | |
611 | 625 | Please file bug reports via L<GitHub |
612 | Issues|http://github.com/plicease/Exception-Class-DBI/issues/> or by sending | |
613 | mail to | |
614 | L<bug-Exception-Class-DBI@rt.cpan.org|mailto:bug-Exception-Class-DBI@rt.cpan.org>. | |
626 | Issues|http://github.com/uperl/Exception-Class-DBI/issues/>. | |
615 | 627 | |
616 | 628 | =head1 Author |
617 | 629 | |
628 | 640 | module for details on the methods this module's classes inherit from |
629 | 641 | it. There's lots more information in these exception objects, so use them! |
630 | 642 | |
643 | =head1 AUTHORS | |
644 | ||
645 | =over 4 | |
646 | ||
647 | =item * | |
648 | ||
649 | David E. Wheeler <david@justatheory.com> | |
650 | ||
651 | =item * | |
652 | ||
653 | Graham Ollis <plicease@cpan.org> | |
654 | ||
655 | =back | |
656 | ||
631 | 657 | =head1 COPYRIGHT AND LICENSE |
632 | 658 | |
633 | Copyright (c) 2002-2019, David E. Wheeler. Some Rights Reserved. | |
634 | ||
635 | This module is free software; you can redistribute it and/or modify it under | |
636 | the same terms as Perl itself. | |
659 | This software is copyright (c) 2002-2021 by David E. Wheeler. | |
660 | ||
661 | This is free software; you can redistribute it and/or modify it under | |
662 | the same terms as the Perl 5 programming language system itself. | |
637 | 663 | |
638 | 664 | =cut |
0 | #!/usr/bin/env perl | |
1 | ||
2 | use strict; | |
3 | use warnings; | |
4 | use autodie qw( :all ); | |
5 | use App::RewriteVersion; | |
6 | ||
7 | my $version = shift @ARGV; | |
8 | my $time = `date +'%F %T %z'`; | |
9 | chomp $time; | |
10 | ||
11 | if($version) | |
12 | { | |
13 | # update the version number in all modules | |
14 | { | |
15 | my $rewrite = App::RewriteVersion->new; | |
16 | $rewrite->allow_decimal_underscore(1); | |
17 | $rewrite->verbose(1); | |
18 | $rewrite->rewrite_versions($version); | |
19 | } | |
20 | ||
21 | # update the Changes file | |
22 | { | |
23 | my @lines; | |
24 | my $fh; | |
25 | my $first = 1; | |
26 | open $fh, '<', 'Changes'; | |
27 | while(my $line = <$fh>) | |
28 | { | |
29 | if($first && $line =~ /^\s+-/) | |
30 | { | |
31 | push @lines, "$version $time\n"; | |
32 | $first = 0; | |
33 | } | |
34 | push @lines, $line; | |
35 | } | |
36 | close $fh; | |
37 | open $fh, '>', 'Changes'; | |
38 | print $fh $_ for @lines; | |
39 | close $fh; | |
40 | } | |
41 | } | |
42 |
0 | use strict; | |
1 | use warnings; | |
2 | use Config; | |
3 | use Test::More tests => 1; | |
4 | ||
5 | # This .t file is generated. | |
6 | # make changes instead to dist.ini | |
7 | ||
8 | my %modules; | |
9 | my $post_diag; | |
10 | ||
11 | $modules{$_} = $_ for qw( | |
12 | DBD::ExampleP | |
13 | DBI | |
14 | Exception::Class | |
15 | ExtUtils::MakeMaker | |
16 | Test::Harness | |
17 | Test::More | |
18 | ); | |
19 | ||
20 | ||
21 | ||
22 | my @modules = sort keys %modules; | |
23 | ||
24 | sub spacer () | |
25 | { | |
26 | diag ''; | |
27 | diag ''; | |
28 | diag ''; | |
29 | } | |
30 | ||
31 | pass 'okay'; | |
32 | ||
33 | my $max = 1; | |
34 | $max = $_ > $max ? $_ : $max for map { length $_ } @modules; | |
35 | our $format = "%-${max}s %s"; | |
36 | ||
37 | spacer; | |
38 | ||
39 | my @keys = sort grep /(MOJO|PERL|\A(LC|HARNESS)_|\A(SHELL|LANG)\Z)/i, keys %ENV; | |
40 | ||
41 | if(@keys > 0) | |
42 | { | |
43 | diag "$_=$ENV{$_}" for @keys; | |
44 | ||
45 | if($ENV{PERL5LIB}) | |
46 | { | |
47 | spacer; | |
48 | diag "PERL5LIB path"; | |
49 | diag $_ for split $Config{path_sep}, $ENV{PERL5LIB}; | |
50 | ||
51 | } | |
52 | elsif($ENV{PERLLIB}) | |
53 | { | |
54 | spacer; | |
55 | diag "PERLLIB path"; | |
56 | diag $_ for split $Config{path_sep}, $ENV{PERLLIB}; | |
57 | } | |
58 | ||
59 | spacer; | |
60 | } | |
61 | ||
62 | diag sprintf $format, 'perl', "$] $^O $Config{archname}"; | |
63 | ||
64 | foreach my $module (@modules) | |
65 | { | |
66 | my $pm = "$module.pm"; | |
67 | $pm =~ s{::}{/}g; | |
68 | if(eval { require $pm; 1 }) | |
69 | { | |
70 | my $ver = eval { $module->VERSION }; | |
71 | $ver = 'undef' unless defined $ver; | |
72 | diag sprintf $format, $module, $ver; | |
73 | } | |
74 | else | |
75 | { | |
76 | diag sprintf $format, $module, '-'; | |
77 | } | |
78 | } | |
79 | ||
80 | if($post_diag) | |
81 | { | |
82 | spacer; | |
83 | $post_diag->(); | |
84 | } | |
85 | ||
86 | spacer; | |
87 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | BEGIN { | |
4 | plan skip_all => 'test requires Test::EOL' | |
5 | unless eval q{ use Test::EOL; 1 }; | |
6 | }; | |
7 | use Test::EOL; | |
8 | use FindBin; | |
9 | use File::Spec; | |
10 | ||
11 | chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); | |
12 | ||
13 | all_perl_files_ok(grep { -e $_ } qw( bin lib t Makefile.PL )); | |
14 | ||
15 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | BEGIN { | |
4 | plan skip_all => 'test requires Test::NoTabs' | |
5 | unless eval q{ use Test::NoTabs; 1 }; | |
6 | }; | |
7 | use Test::NoTabs; | |
8 | use FindBin; | |
9 | use File::Spec; | |
10 | ||
11 | chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); | |
12 | ||
13 | all_perl_files_ok( grep { -e $_ } qw( bin lib t Makefile.PL )); | |
14 | ||
15 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | BEGIN { | |
4 | plan skip_all => 'test requires Test::Pod' | |
5 | unless eval q{ use Test::Pod; 1 }; | |
6 | }; | |
7 | use Test::Pod; | |
8 | use FindBin; | |
9 | use File::Spec; | |
10 | ||
11 | chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); | |
12 | ||
13 | all_pod_files_ok( grep { -e $_ } qw( bin lib )); | |
14 | ||
15 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | BEGIN { | |
4 | plan skip_all => 'test requires 5.010 or better' | |
5 | unless $] >= 5.010; | |
6 | plan skip_all => 'test requires Test::Pod::Coverage' | |
7 | unless eval q{ use Test::Pod::Coverage; 1 }; | |
8 | plan skip_all => 'test requires YAML' | |
9 | unless eval q{ use YAML; 1; }; | |
10 | plan skip_all => 'test does not always work in cip check' | |
11 | if defined $ENV{CIPSTATIC} && $ENV{CIPSTATIC} eq 'true'; | |
12 | }; | |
13 | use Test::Pod::Coverage; | |
14 | use YAML qw( LoadFile ); | |
15 | use FindBin; | |
16 | use File::Spec; | |
17 | ||
18 | my $config_filename = File::Spec->catfile( | |
19 | $FindBin::Bin, File::Spec->updir, File::Spec->updir, 'author.yml' | |
20 | ); | |
21 | ||
22 | my $config; | |
23 | $config = LoadFile($config_filename) | |
24 | if -r $config_filename; | |
25 | ||
26 | plan skip_all => 'disabled' if $config->{pod_coverage}->{skip}; | |
27 | ||
28 | chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); | |
29 | ||
30 | my @private_classes; | |
31 | my %private_methods; | |
32 | ||
33 | push $config->{pod_coverage}->{private}->@*, | |
34 | 'Alien::.*::Install::Files#Inline'; | |
35 | ||
36 | foreach my $private ($config->{pod_coverage}->{private}->@*) | |
37 | { | |
38 | my($class,$method) = split /#/, $private; | |
39 | if(defined $class && $class ne '') | |
40 | { | |
41 | my $regex = eval 'qr{^' . $class . '$}'; | |
42 | if(defined $method && $method ne '') | |
43 | { | |
44 | push @private_classes, { regex => $regex, method => $method }; | |
45 | } | |
46 | else | |
47 | { | |
48 | push @private_classes, { regex => $regex, all => 1 }; | |
49 | } | |
50 | } | |
51 | elsif(defined $method && $method ne '') | |
52 | { | |
53 | $private_methods{$_} = 1 for split /,/, $method; | |
54 | } | |
55 | } | |
56 | ||
57 | my @classes = all_modules; | |
58 | ||
59 | plan tests => scalar @classes; | |
60 | ||
61 | foreach my $class (@classes) | |
62 | { | |
63 | SKIP: { | |
64 | my($is_private_class) = map { 1 } grep { $class =~ $_->{regex} && $_->{all} } @private_classes; | |
65 | skip "private class: $class", 1 if $is_private_class; | |
66 | ||
67 | my %methods = map {; $_ => 1 } map { split /,/, $_->{method} } grep { $class =~ $_->{regex} } @private_classes; | |
68 | $methods{$_} = 1 for keys %private_methods; | |
69 | ||
70 | my $also_private = eval 'qr{^' . join('|', keys %methods ) . '$}'; | |
71 | ||
72 | pod_coverage_ok $class, { also_private => [$also_private] }; | |
73 | }; | |
74 | } | |
75 | ||
76 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | BEGIN { | |
4 | plan skip_all => 'test requires Test::Pod::Spelling::CommonMistakes' | |
5 | unless eval q{ use Test::Pod::Spelling::CommonMistakes; 1 }; | |
6 | plan skip_all => 'test requires YAML' | |
7 | unless eval q{ use YAML qw( LoadFile ); 1 }; | |
8 | }; | |
9 | use Test::Pod::Spelling::CommonMistakes; | |
10 | use FindBin; | |
11 | use File::Spec; | |
12 | ||
13 | my $config_filename = File::Spec->catfile( | |
14 | $FindBin::Bin, File::Spec->updir, File::Spec->updir, 'author.yml' | |
15 | ); | |
16 | ||
17 | my $config; | |
18 | $config = LoadFile($config_filename) | |
19 | if -r $config_filename; | |
20 | ||
21 | plan skip_all => 'disabled' if $config->{pod_spelling_common}->{skip}; | |
22 | ||
23 | chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); | |
24 | ||
25 | # TODO: test files in bin too. | |
26 | all_pod_files_ok; | |
27 | ||
28 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | BEGIN { | |
4 | plan skip_all => 'test requires Test::Spelling' | |
5 | unless eval q{ use Test::Spelling; 1 }; | |
6 | plan skip_all => 'test requires YAML' | |
7 | unless eval q{ use YAML; 1; }; | |
8 | }; | |
9 | use Test::Spelling; | |
10 | use YAML qw( LoadFile ); | |
11 | use FindBin; | |
12 | use File::Spec; | |
13 | ||
14 | my $config_filename = File::Spec->catfile( | |
15 | $FindBin::Bin, File::Spec->updir, File::Spec->updir, 'author.yml' | |
16 | ); | |
17 | ||
18 | my $config; | |
19 | $config = LoadFile($config_filename) | |
20 | if -r $config_filename; | |
21 | ||
22 | plan skip_all => 'disabled' if $config->{pod_spelling_system}->{skip}; | |
23 | ||
24 | chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); | |
25 | ||
26 | add_stopwords($config->{pod_spelling_system}->{stopwords}->@*); | |
27 | add_stopwords(qw( | |
28 | Plicease | |
29 | stdout | |
30 | stderr | |
31 | stdin | |
32 | subref | |
33 | loopback | |
34 | username | |
35 | os | |
36 | Ollis | |
37 | Mojolicious | |
38 | plicease | |
39 | CPAN | |
40 | reinstall | |
41 | TODO | |
42 | filename | |
43 | filenames | |
44 | login | |
45 | callback | |
46 | callbacks | |
47 | standalone | |
48 | VMS | |
49 | hostname | |
50 | hostnames | |
51 | TCP | |
52 | UDP | |
53 | IP | |
54 | API | |
55 | MSWin32 | |
56 | OpenBSD | |
57 | FreeBSD | |
58 | NetBSD | |
59 | unencrypted | |
60 | WebSocket | |
61 | WebSockets | |
62 | timestamp | |
63 | timestamps | |
64 | poney | |
65 | BackPAN | |
66 | portably | |
67 | RedHat | |
68 | AIX | |
69 | BSD | |
70 | XS | |
71 | FFI | |
72 | perlish | |
73 | optimizations | |
74 | subdirectory | |
75 | RESTful | |
76 | SQLite | |
77 | JavaScript | |
78 | dir | |
79 | plugins | |
80 | munge | |
81 | jQuery | |
82 | namespace | |
83 | ||
84 | PDFs | |
85 | usernames | |
86 | DBI | |
87 | pluggable | |
88 | APIs | |
89 | SSL | |
90 | JSON | |
91 | YAML | |
92 | uncommented | |
93 | Solaris | |
94 | OpenVMS | |
95 | URI | |
96 | URL | |
97 | CGI | |
98 | )); | |
99 | all_pod_files_spelling_ok; | |
100 | ||
101 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | BEGIN { | |
4 | plan skip_all => 'test requires Test::Strict' | |
5 | unless eval q{ use Test::Strict; 1 }; | |
6 | }; | |
7 | use Test::Strict; | |
8 | use FindBin; | |
9 | use File::Spec; | |
10 | ||
11 | chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); | |
12 | ||
13 | unshift @Test::Strict::MODULES_ENABLING_STRICT, | |
14 | 'ozo', | |
15 | 'Test2::Bundle::SIPS', | |
16 | 'Test2::V0', | |
17 | 'Test2::Bundle::Extended'; | |
18 | note "enabling strict = $_" for @Test::Strict::MODULES_ENABLING_STRICT; | |
19 | ||
20 | all_perl_files_ok( grep { -e $_ } qw( bin lib t Makefile.PL )); | |
21 | ||
22 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | use FindBin (); | |
4 | BEGIN { | |
5 | ||
6 | plan skip_all => "test requires Test::Version 2.00" | |
7 | unless eval q{ | |
8 | use Test::Version 2.00 qw( version_all_ok ), { | |
9 | has_version => 1, | |
10 | filename_match => sub { $_[0] !~ m{/(ConfigData|Install/Files)\.pm$} }, | |
11 | }; | |
12 | 1 | |
13 | }; | |
14 | ||
15 | plan skip_all => 'test requires YAML' | |
16 | unless eval q{ use YAML; 1; }; | |
17 | } | |
18 | ||
19 | use YAML qw( LoadFile ); | |
20 | use FindBin; | |
21 | use File::Spec; | |
22 | ||
23 | my $config_filename = File::Spec->catfile( | |
24 | $FindBin::Bin, File::Spec->updir, File::Spec->updir, 'author.yml' | |
25 | ); | |
26 | ||
27 | my $config; | |
28 | $config = LoadFile($config_filename) | |
29 | if -r $config_filename; | |
30 | ||
31 | if($config->{version}->{dir}) | |
32 | { | |
33 | note "using dir " . $config->{version}->{dir} | |
34 | } | |
35 | ||
36 | version_all_ok($config->{version}->{dir} ? ($config->{version}->{dir}) : ()); | |
37 | done_testing; | |
38 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | BEGIN { | |
4 | plan skip_all => 'test requires Test::CPAN::Changes' | |
5 | unless eval q{ use Test::CPAN::Changes; 1 }; | |
6 | }; | |
7 | use Test::CPAN::Changes; | |
8 | use FindBin; | |
9 | use File::Spec; | |
10 | ||
11 | chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); | |
12 | ||
13 | do { | |
14 | my $old = \&Test::Builder::carp; | |
15 | my $new = sub { | |
16 | my($self, @messages) = @_; | |
17 | return if $messages[0] =~ /^Date ".*" is not in the recommend format/; | |
18 | $old->($self, @messages); | |
19 | }; | |
20 | no warnings 'redefine'; | |
21 | *Test::Builder::carp = $new; | |
22 | }; | |
23 | ||
24 | changes_file_ok; | |
25 | ||
26 | done_testing; | |
27 | ||
28 |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More; | |
3 | BEGIN { | |
4 | plan skip_all => 'test requires Test::Fixme' | |
5 | unless eval q{ use Test::Fixme 0.14; 1 }; | |
6 | }; | |
7 | use Test::Fixme 0.07; | |
8 | use FindBin; | |
9 | use File::Spec; | |
10 | ||
11 | chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); | |
12 | ||
13 | run_tests( | |
14 | match => qr/FIXME/, | |
15 | where => [ grep { -e $_ } qw( bin lib t Makefile.PL Build.PL )], | |
16 | warn => 1, | |
17 | ); | |
18 | ||
19 |