Email-Abstract-3.009/000755 000765 000024 00000000000 14063725423 014426 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/LICENSE000644 000765 000024 00000043655 14063725423 015450 0ustar00rjbsstaff000000 000000 This software is copyright (c) 2004 by Simon Cozens. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2004 by Simon Cozens. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2004 by Simon Cozens. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Email-Abstract-3.009/Changes000644 000765 000024 00000007055 14063725423 015730 0ustar00rjbsstaff000000 000000 Revision history for Email-Abstract. 3.009 2021-06-20 16:54:40-04:00 America/New_York - MIME::Entity 5.508 is required for operation - update author information - add a perl support section to docs 3.008 2014-12-27 18:36:19-05:00 America/New_York - make results of get_body be the same on Email::{Simple,MIME} - ...but this method is a mess, so maybe avoid using Abstract for body work 3.007 2013-12-31 10:39:14 America/New_York fix skip count when MIME::Entity is not present 3.006 2013-09-01 08:41:48 America/New_York require Email::Simple 1.998 to allow ->new(\$string) 3.005 2013-07-30 09:57:36 America/New_York repackage, update bug tracker, etc. provide raw body on multipart Email::MIME messages (thanks, bailey@upenn) [rt.cpan.org #77624] 3.004 2011-02-18 If present, MIME::Entity must be v5.501; v5.500 had a regression (or a bug fix, depending how you look at it) that broke header-reading. While technically older versions that are not 5.500 would work, it is much simpler to just require the newest version, rather than to support a version range with a hole in it. 3.003 2010-11-08 replace Class::ISA with mro (MRO::Compat) 3.002 2010-06-11 avoid a warning in MailInternet with zero headers found 3.001 2008-12-11 declare our prereq on Scalar::Util 3.000 2008-12-09 accept scalar references for more efficient msg-from-string 2.134 2007-11-16 (no code changes from previous dev release) 2.133_05 2007-11-11 [BUG FIXES] added is_available method to MIMEEntity plugin 2.133_04 2007-09-24 [ENHANCEMENTS] created Email::Abstract::Plugin base class; please use it! added is_available method to plugins [BUG FIXES] is_available in the Mail::Internet adapter should solve header folding issues (by preventing you from using it when it can't work) 2.133_03 2007-08-?? diagnostics in output to indicate what version of a module we used 2.133_02 2007-07-?? fix test planning 2.133_01 2007-07-?? add test to ensure that "can't handle" exception is thrown ASAP remove unexplained requirement for perl 5.6 fix Mail::Internet header fetching to unfold headers fix Mail::Message body setter, which hosed newlines fix body handling for Mail::Internet improved consistency of method used to find adapter class improved tests and test coverage 2.132 2007-03-22 packaging improvements 2.131 2006-08-22 pod tests 2.13 2006-07-24 test for and permit passing Email::Abstract objects to Email::Abstract class methods 2.12 2006-07-24 don't use MIME::Entity in test if it's not available 2.11 2006-07-22 better test planning 2.10 2006-07-21 add a new method to create wrapper objects handle subclasses /properly/ (correct ISA order) improved tests and test coverage miscellaneous refactoring update PEP URL update documentation 2.01 2004-11-04 Minor Documentation Fix Author Change PEP Contact Added 2.0 2004-08-25 12:12:37 BST Handle subclasses 0.01 2004-05-26 16:47 20 original version; created by h2xs 1.22 with options -AX -b 5.6.0 -n Email::Abstract Email-Abstract-3.009/MANIFEST000644 000765 000024 00000001075 14063725423 015562 0ustar00rjbsstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.020. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Email/Abstract.pm lib/Email/Abstract/EmailMIME.pm lib/Email/Abstract/EmailSimple.pm lib/Email/Abstract/MIMEEntity.pm lib/Email/Abstract/MailInternet.pm lib/Email/Abstract/MailMessage.pm lib/Email/Abstract/Plugin.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/abstractions.t t/example.msg t/lib/Test/EmailAbstract.pm t/multipart.msg t/subclass.t t/unknown.t xt/author/pod-syntax.t xt/release/changes_has_content.t Email-Abstract-3.009/t/000755 000765 000024 00000000000 14063725423 014671 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/xt/000755 000765 000024 00000000000 14063725423 015061 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/README000644 000765 000024 00000000571 14063725423 015311 0ustar00rjbsstaff000000 000000 This archive contains the distribution Email-Abstract, version 3.009: unified interface to mail representations This software is copyright (c) 2004 by Simon Cozens. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.020. Email-Abstract-3.009/META.yml000644 000765 000024 00000030553 14063725423 015705 0ustar00rjbsstaff000000 000000 --- abstract: 'unified interface to mail representations' author: - 'Ricardo SIGNES ' - 'Simon Cozens ' - 'Casey West ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' Test::More: '0.96' lib: '0' configure_requires: ExtUtils::MakeMaker: '6.78' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.020, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Email-Abstract requires: Carp: '0' Email::Simple: '1.998' MRO::Compat: '0' Module::Pluggable: '1.5' Scalar::Util: '0' perl: '5.006' strict: '0' warnings: '0' resources: bugtracker: https://github.com/rjbs/Email-Abstract/issues homepage: https://github.com/rjbs/Email-Abstract repository: https://github.com/rjbs/Email-Abstract.git version: '3.009' x_Dist_Zilla: perl: version: '5.035001' plugins: - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@RJBS/Git::GatherDir' version: '2.047' - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RJBS/CheckPrereqsIndexed' version: '0.021' - class: Dist::Zilla::Plugin::CheckExtraTests name: '@RJBS/CheckExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::RJBS phase: build run_under_travis: 0 skip: [] name: '@RJBS/RJBS-Outdated' version: '0.057' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 0 modules: [] phase: release run_under_travis: 0 skip: - Dist::Zilla::Plugin::RJBSMisc name: '@RJBS/CPAN-Outdated' version: '0.057' - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Filter/PruneCruft' version: '6.020' - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Filter/ManifestSkip' version: '6.020' - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Filter/MetaYAML' version: '6.020' - class: Dist::Zilla::Plugin::License name: '@RJBS/@Filter/License' version: '6.020' - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Filter/Readme' version: '6.020' - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Filter/ExecDir' version: '6.020' - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Filter/ShareDir' version: '6.020' - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Filter/Manifest' version: '6.020' - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Filter/TestRelease' version: '6.020' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Filter/ConfirmRelease' version: '6.020' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Filter/UploadToCPAN' version: '6.020' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@RJBS/MakeMaker' version: '6.020' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' version: '6.020' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.001' version_by_branch: 1 version_regexp: (?^:^([0-9]+\.[0-9]+)$) Dist::Zilla::Role::Git::Repo: git_version: '2.30.1 (Apple Git-130)' repo_root: . name: '@RJBS/Git::NextVersion' version: '2.047' - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' version: '6.020' - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' version: '6.020' - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' version: '6.020' - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' version: '6.020' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@RJBS/Test::ChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' version: '6.020' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@RJBS/Test::ReportPrereqs' version: '0.028' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@RJBS/TestMoreWithSubtests' version: '6.020' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@RJBS' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.018' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.018' - class: Pod::Weaver::Plugin::SingleEncoding name: '@RJBS/SingleEncoding' version: '4.018' - class: Pod::Weaver::Section::Name name: '@RJBS/Name' version: '4.018' - class: Pod::Weaver::Section::Version name: '@RJBS/Version' version: '4.018' - class: Pod::Weaver::Section::Region name: '@RJBS/Prelude' version: '4.018' - class: Pod::Weaver::Section::Generic name: '@RJBS/Synopsis' version: '4.018' - class: Pod::Weaver::Section::Generic name: '@RJBS/Description' version: '4.018' - class: Pod::Weaver::Section::Generic name: '@RJBS/Overview' version: '4.018' - class: Pod::Weaver::Section::Generic name: '@RJBS/Stability' version: '4.018' - class: Pod::Weaver::Section::GenerateSection name: '@RJBS/PerlSupport' version: '4.018' - class: Pod::Weaver::Section::Collect name: Attributes version: '4.018' - class: Pod::Weaver::Section::Collect name: Methods version: '4.018' - class: Pod::Weaver::Section::Collect name: Functions version: '4.018' - class: Pod::Weaver::Section::Leftovers name: '@RJBS/Leftovers' version: '4.018' - class: Pod::Weaver::Section::Region name: '@RJBS/postlude' version: '4.018' - class: Pod::Weaver::Section::Authors name: '@RJBS/Authors' version: '4.018' - class: Pod::Weaver::Section::Contributors name: '@RJBS/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@RJBS/Legal' version: '4.018' - class: Pod::Weaver::Plugin::Transformer name: '@RJBS/List' version: '4.018' name: '@RJBS/PodWeaver' version: '4.009' - class: Dist::Zilla::Plugin::RJBSMisc name: '@RJBS/RJBSMisc' version: '5.018' - class: Dist::Zilla::Plugin::GithubMeta name: '@RJBS/GithubMeta' version: '0.58' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: '2.30.1 (Apple Git-130)' repo_root: . name: '@RJBS/@Git/Check' version: '2.047' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%V%n%n%c signoff: '0' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: '2.30.1 (Apple Git-130)' repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RJBS/@Git/Commit' version: '2.047' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: '3.009' tag_format: '%v' tag_message: v%V Dist::Zilla::Role::Git::Repo: git_version: '2.30.1 (Apple Git-130)' repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RJBS/@Git/Tag' version: '2.047' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - 'github :' remotes_must_exist: 0 Dist::Zilla::Role::Git::Repo: git_version: '2.30.1 (Apple Git-130)' repo_root: . name: '@RJBS/@Git/Push' version: '2.047' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: '2.30.1 (Apple Git-130)' include_authors: 0 include_releaser: 1 order_by: name paths: [] name: '@RJBS/Git::Contributors' version: '0.036' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: '6.020' - class: Dist::Zilla::Plugin::RemovePrereqs config: Dist::Zilla::Plugin::RemovePrereqs: modules_to_remove: - Courriel - Email::MIME - MIME::Entity - MIME::Parser - Mail::Internet - Mail::Message name: RemovePrereqs version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.020' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.020' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.020' x_contributors: - 'Dave Rolsky ' - 'Ricardo Signes ' - 'William Yardley ' x_generated_by_perl: v5.35.1 x_rjbs_perl_support: long-term x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' Email-Abstract-3.009/lib/000755 000765 000024 00000000000 14063725423 015174 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/Makefile.PL000644 000765 000024 00000003031 14063725423 016375 0ustar00rjbsstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.020. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker 6.78; my %WriteMakefileArgs = ( "ABSTRACT" => "unified interface to mail representations", "AUTHOR" => "Ricardo SIGNES , Simon Cozens , Casey West ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.78" }, "DISTNAME" => "Email-Abstract", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", "NAME" => "Email::Abstract", "PREREQ_PM" => { "Carp" => 0, "Email::Simple" => "1.998", "MRO::Compat" => 0, "Module::Pluggable" => "1.5", "Scalar::Util" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Test::More" => "0.96", "lib" => 0 }, "VERSION" => "3.009", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Email::Simple" => "1.998", "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "MRO::Compat" => 0, "Module::Pluggable" => "1.5", "Scalar::Util" => 0, "Test::More" => "0.96", "lib" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Email-Abstract-3.009/META.json000644 000765 000024 00000046446 14063725423 016065 0ustar00rjbsstaff000000 000000 { "abstract" : "unified interface to mail representations", "author" : [ "Ricardo SIGNES ", "Simon Cozens ", "Casey West " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.020, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Email-Abstract", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.78" } }, "develop" : { "requires" : { "Encode" : "0", "Test::More" : "0", "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "Carp" : "0", "Email::Simple" : "1.998", "MRO::Compat" : "0", "Module::Pluggable" : "1.5", "Scalar::Util" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Test::More" : "0.96", "lib" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/rjbs/Email-Abstract/issues" }, "homepage" : "https://github.com/rjbs/Email-Abstract", "repository" : { "type" : "git", "url" : "https://github.com/rjbs/Email-Abstract.git", "web" : "https://github.com/rjbs/Email-Abstract" } }, "version" : "3.009", "x_Dist_Zilla" : { "perl" : { "version" : "5.035001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@RJBS/Git::GatherDir", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RJBS/CheckPrereqsIndexed", "version" : "0.021" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@RJBS/CheckExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::RJBS" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@RJBS/RJBS-Outdated", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 0, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [ "Dist::Zilla::Plugin::RJBSMisc" ] } }, "name" : "@RJBS/CPAN-Outdated", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Filter/PruneCruft", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Filter/ManifestSkip", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Filter/MetaYAML", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Filter/License", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Filter/Readme", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Filter/ExecDir", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Filter/ShareDir", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Filter/Manifest", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Filter/TestRelease", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Filter/ConfirmRelease", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Filter/UploadToCPAN", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@RJBS/MakeMaker", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.001", "version_by_branch" : 1, "version_regexp" : "(?^:^([0-9]+\\.[0-9]+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.1 (Apple Git-130)", "repo_root" : "." } }, "name" : "@RJBS/Git::NextVersion", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@RJBS/Test::ChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@RJBS/Test::ReportPrereqs", "version" : "0.028" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@RJBS/TestMoreWithSubtests", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@RJBS" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@RJBS/SingleEncoding", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@RJBS/Name", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@RJBS/Version", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/Prelude", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Synopsis", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Description", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Overview", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Stability", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::GenerateSection", "name" : "@RJBS/PerlSupport", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Attributes", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Methods", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Functions", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@RJBS/Leftovers", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/postlude", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@RJBS/Authors", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@RJBS/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@RJBS/Legal", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@RJBS/List", "version" : "4.018" } ] } }, "name" : "@RJBS/PodWeaver", "version" : "4.009" }, { "class" : "Dist::Zilla::Plugin::RJBSMisc", "name" : "@RJBS/RJBSMisc", "version" : "5.018" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@RJBS/GithubMeta", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.1 (Apple Git-130)", "repo_root" : "." } }, "name" : "@RJBS/@Git/Check", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%V%n%n%c", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.1 (Apple Git-130)", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RJBS/@Git/Commit", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "3.009", "tag_format" : "%v", "tag_message" : "v%V" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.1 (Apple Git-130)", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RJBS/@Git/Tag", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "github :" ], "remotes_must_exist" : 0 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.1 (Apple Git-130)", "repo_root" : "." } }, "name" : "@RJBS/@Git/Push", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.30.1 (Apple Git-130)", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", "paths" : [] } }, "name" : "@RJBS/Git::Contributors", "version" : "0.036" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::RemovePrereqs", "config" : { "Dist::Zilla::Plugin::RemovePrereqs" : { "modules_to_remove" : [ "Courriel", "Email::MIME", "MIME::Entity", "MIME::Parser", "Mail::Internet", "Mail::Message" ] } }, "name" : "RemovePrereqs", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.020" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.020" } }, "x_contributors" : [ "Dave Rolsky ", "Ricardo Signes ", "William Yardley " ], "x_generated_by_perl" : "v5.35.1", "x_rjbs_perl_support" : "long-term", "x_serialization_backend" : "Cpanel::JSON::XS version 4.26", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } Email-Abstract-3.009/dist.ini000644 000765 000024 00000000724 14063725423 016075 0ustar00rjbsstaff000000 000000 name = Email-Abstract author = Ricardo SIGNES author = Simon Cozens author = Casey West license = Perl_5 copyright_holder = Simon Cozens copyright_year = 2004 [@RJBS] perl-support = long-term package-name-version = 0 [Prereqs] Email::Simple = 1.998 [RemovePrereqs] remove = Courriel remove = Email::MIME remove = MIME::Entity remove = MIME::Parser remove = Mail::Internet remove = Mail::Message Email-Abstract-3.009/lib/Email/000755 000765 000024 00000000000 14063725423 016223 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/lib/Email/Abstract/000755 000765 000024 00000000000 14063725423 017766 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/lib/Email/Abstract.pm000644 000765 000024 00000027720 14063725423 020334 0ustar00rjbsstaff000000 000000 use 5.006; use warnings; use strict; package Email::Abstract; # ABSTRACT: unified interface to mail representations $Email::Abstract::VERSION = '3.009'; use Carp; use Email::Simple; use MRO::Compat; use Module::Pluggable 1.5 search_path => [__PACKAGE__], except => 'Email::Abstract::Plugin', require => 1; use Scalar::Util (); my @plugins = __PACKAGE__->plugins(); # Requires them. my %adapter_for = map { $_->target => $_ } grep { my $avail = eval { $_->is_available }; $@ ? ($@ =~ /Can't locate object method "is_available"/) : $avail; } @plugins; sub object { my ($self) = @_; return unless ref $self; return $self->[0]; } sub new { my ($class, $foreign) = @_; return $foreign if eval { $foreign->isa($class) }; $foreign = Email::Simple->new($foreign) unless Scalar::Util::blessed($foreign); my $adapter = $class->__class_for($foreign); # dies if none available return bless [ $foreign, $adapter ] => $class; } sub __class_for { my ($self, $foreign, $method, $skip_super) = @_; $method ||= 'handle'; my $f_class = ref $foreign; $f_class = $foreign unless $f_class; return $f_class if ref $foreign and $f_class->isa($self); return $adapter_for{$f_class} if $adapter_for{$f_class}; if (not $skip_super) { my @bases = @{ mro::get_linear_isa($f_class) }; shift @bases; for my $base (@bases) { return $adapter_for{$base} if $adapter_for{$base}; } } Carp::croak "Don't know how to $method $f_class"; } sub _adapter_obj_and_args { my $self = shift; if (my $thing = $self->object) { return ($self->[1], $thing, @_); } else { my $thing = shift; my $adapter = $self->__class_for( Scalar::Util::blessed($thing) ? $thing : 'Email::Simple' ); return ($adapter, $thing, @_); } } for my $func (qw(get_header get_body set_header set_body as_string)) { no strict 'refs'; *$func = sub { my $self = shift; my ($adapter, $thing, @args) = $self->_adapter_obj_and_args(@_); # In the event of Email::Abstract->get_body($email_abstract), convert # it into an object method call. $thing = $thing->object if eval { $thing->isa($self) }; # I suppose we could work around this by leaving @_ intact and assigning to # it. That seems ... not good. -- rjbs, 2007-07-18 unless (Scalar::Util::blessed($thing)) { Carp::croak "can't alter string in place" if substr($func, 0, 3) eq 'set'; $thing = Email::Simple->new( ref $thing ? \do{my$str=$$thing} : $thing ); } return $adapter->$func($thing, @args); }; } sub cast { my $self = shift; my ($from_adapter, $from, $to) = $self->_adapter_obj_and_args(@_); my $adapter = $self->__class_for($to, 'construct', 1); my $from_string = ref($from) ? $from_adapter->as_string($from) : $from; return $adapter->construct($from_string); } 1; =pod =encoding UTF-8 =head1 NAME Email::Abstract - unified interface to mail representations =head1 VERSION version 3.009 =head1 SYNOPSIS my $message = Mail::Message->read($rfc822) || Email::Simple->new($rfc822) || Mail::Internet->new([split /\n/, $rfc822]) || ... || $rfc822; my $email = Email::Abstract->new($message); my $subject = $email->get_header("Subject"); $email->set_header(Subject => "My new subject"); my $body = $email->get_body; $rfc822 = $email->as_string; my $mail_message = $email->cast("Mail::Message"); =head1 DESCRIPTION C provides module writers with the ability to write simple, representation-independent mail handling code. For instance, in the cases of C or C, a key part of the code involves reading the headers from a mail object. Where previously one would either have to specify the mail class required, or to build a new object from scratch, C can be used to perform certain simple operations on an object regardless of its underlying representation. C currently supports C, C, C, C, C, and C. Other representations are encouraged to create their own C class by copying C. All modules installed under the C hierarchy will be automatically picked up and used. =head1 PERL VERSION SUPPORT This module has a long-term perl support period. That means it will not require a version of perl released fewer than five years ago. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 METHODS All of these methods may be called either as object methods or as class methods. When called as class methods, the email object (of any class supported by Email::Abstract) must be prepended to the list of arguments, like so: my $return = Email::Abstract->method($message, @args); This is provided primarily for backwards compatibility. =head2 new my $email = Email::Abstract->new($message); Given a message, either as a string or as an object for which an adapter is installed, this method will return a Email::Abstract object wrapping the message. If the message is given as a string, it will be used to construct an object, which will then be wrapped. =head2 get_header my $header = $email->get_header($header_name); my @headers = $email->get_header($header_name); This returns the values for the given header. In scalar context, it returns the first value. =head2 set_header $email->set_header($header => @values); This sets the C<$header> header to the given one or more values. =head2 get_body my $body = $email->get_body; This returns the body as a string. =head2 set_body $email->set_body($string); This changes the body of the email to the given string. B You probably don't want to call this method, despite what you may think. Email message bodies are complicated, and rely on things like content type, encoding, and various MIME requirements. If you call C on a message more complicated than a single-part seven-bit plain-text message, you are likely to break something. If you need to do this sort of thing, you should probably use a specific message class from end to end. This method is left in place for backwards compatibility. =head2 as_string my $string = $email->as_string; This returns the whole email as a decoded string. =head2 cast my $mime_entity = $email->cast('MIME::Entity'); This method will convert a message from one message class to another. It will throw an exception if no adapter for the target class is known, or if the adapter does not provide a C method. =head2 object my $message = $email->object; This method returns the message object wrapped by Email::Abstract. If called as a class method, it returns false. Note that, because strings are converted to message objects before wrapping, this method will return an object when the Email::Abstract was constructed from a string. =head1 AUTHORS =over 4 =item * Ricardo SIGNES =item * Simon Cozens =item * Casey West =back =head1 CONTRIBUTORS =for stopwords Dave Rolsky Ricardo Signes William Yardley =over 4 =item * Dave Rolsky =item * Ricardo Signes =item * William Yardley =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2004 by Simon Cozens. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __END__ #pod =head1 SYNOPSIS #pod #pod my $message = Mail::Message->read($rfc822) #pod || Email::Simple->new($rfc822) #pod || Mail::Internet->new([split /\n/, $rfc822]) #pod || ... #pod || $rfc822; #pod #pod my $email = Email::Abstract->new($message); #pod #pod my $subject = $email->get_header("Subject"); #pod $email->set_header(Subject => "My new subject"); #pod #pod my $body = $email->get_body; #pod #pod $rfc822 = $email->as_string; #pod #pod my $mail_message = $email->cast("Mail::Message"); #pod #pod =head1 DESCRIPTION #pod #pod C provides module writers with the ability to write #pod simple, representation-independent mail handling code. For instance, in the #pod cases of C or C, a key part of the code #pod involves reading the headers from a mail object. Where previously one would #pod either have to specify the mail class required, or to build a new object from #pod scratch, C can be used to perform certain simple operations on #pod an object regardless of its underlying representation. #pod #pod C currently supports C, C, #pod C, C, C, and C. Other #pod representations are encouraged to create their own C class #pod by copying C. All modules installed under the #pod C hierarchy will be automatically picked up and used. #pod #pod =head1 METHODS #pod #pod All of these methods may be called either as object methods or as class #pod methods. When called as class methods, the email object (of any class #pod supported by Email::Abstract) must be prepended to the list of arguments, like #pod so: #pod #pod my $return = Email::Abstract->method($message, @args); #pod #pod This is provided primarily for backwards compatibility. #pod #pod =head2 new #pod #pod my $email = Email::Abstract->new($message); #pod #pod Given a message, either as a string or as an object for which an adapter is #pod installed, this method will return a Email::Abstract object wrapping the #pod message. #pod #pod If the message is given as a string, it will be used to construct an object, #pod which will then be wrapped. #pod #pod =head2 get_header #pod #pod my $header = $email->get_header($header_name); #pod #pod my @headers = $email->get_header($header_name); #pod #pod This returns the values for the given header. In scalar context, it returns #pod the first value. #pod #pod =head2 set_header #pod #pod $email->set_header($header => @values); #pod #pod This sets the C<$header> header to the given one or more values. #pod #pod =head2 get_body #pod #pod my $body = $email->get_body; #pod #pod This returns the body as a string. #pod #pod =head2 set_body #pod #pod $email->set_body($string); #pod #pod This changes the body of the email to the given string. #pod #pod B You probably don't want to call this method, despite what you may #pod think. Email message bodies are complicated, and rely on things like content #pod type, encoding, and various MIME requirements. If you call C on a #pod message more complicated than a single-part seven-bit plain-text message, you #pod are likely to break something. If you need to do this sort of thing, you #pod should probably use a specific message class from end to end. #pod #pod This method is left in place for backwards compatibility. #pod #pod =head2 as_string #pod #pod my $string = $email->as_string; #pod #pod This returns the whole email as a decoded string. #pod #pod =head2 cast #pod #pod my $mime_entity = $email->cast('MIME::Entity'); #pod #pod This method will convert a message from one message class to another. It will #pod throw an exception if no adapter for the target class is known, or if the #pod adapter does not provide a C method. #pod #pod =head2 object #pod #pod my $message = $email->object; #pod #pod This method returns the message object wrapped by Email::Abstract. If called #pod as a class method, it returns false. #pod #pod Note that, because strings are converted to message objects before wrapping, #pod this method will return an object when the Email::Abstract was constructed from #pod a string. #pod #pod =cut Email-Abstract-3.009/lib/Email/Abstract/EmailSimple.pm000644 000765 000024 00000004272 14063725423 022532 0ustar00rjbsstaff000000 000000 use strict; use warnings; package Email::Abstract::EmailSimple; # ABSTRACT: Email::Abstract wrapper for Email::Simple $Email::Abstract::EmailSimple::VERSION = '3.009'; use Email::Abstract::Plugin; BEGIN { @Email::Abstract::EmailSimple::ISA = 'Email::Abstract::Plugin' }; sub target { "Email::Simple" } sub construct { require Email::Simple; my ($class, $rfc822) = @_; Email::Simple->new($rfc822); } sub get_header { my ($class, $obj, $header) = @_; $obj->header($header); } sub get_body { my ($class, $obj) = @_; $obj->body(); } sub set_header { my ($class, $obj, $header, @data) = @_; $obj->header_set($header, @data); } sub set_body { my ($class, $obj, $body) = @_; $obj->body_set($body); } sub as_string { my ($class, $obj) = @_; $obj->as_string(); } 1; #pod =head1 DESCRIPTION #pod #pod This module wraps the Email::Simple mail handling library with an #pod abstract interface, to be used with L #pod #pod =head1 SEE ALSO #pod #pod L, L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Email::Abstract::EmailSimple - Email::Abstract wrapper for Email::Simple =head1 VERSION version 3.009 =head1 DESCRIPTION This module wraps the Email::Simple mail handling library with an abstract interface, to be used with L =head1 PERL VERSION SUPPORT This module has a long-term perl support period. That means it will not require a version of perl released fewer than five years ago. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 SEE ALSO L, L. =head1 AUTHORS =over 4 =item * Ricardo SIGNES =item * Simon Cozens =item * Casey West =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2004 by Simon Cozens. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Email-Abstract-3.009/lib/Email/Abstract/MailMessage.pm000644 000765 000024 00000004367 14063725423 022525 0ustar00rjbsstaff000000 000000 use strict; package Email::Abstract::MailMessage; # ABSTRACT: Email::Abstract wrapper for Mail::Message $Email::Abstract::MailMessage::VERSION = '3.009'; use Email::Abstract::Plugin; BEGIN { @Email::Abstract::MailMessage::ISA = 'Email::Abstract::Plugin' }; sub target { "Mail::Message" } sub construct { require Mail::Message; my ($class, $rfc822) = @_; Mail::Message->read($rfc822); } sub get_header { my ($class, $obj, $header) = @_; $obj->head->get($header); } sub get_body { my ($class, $obj) = @_; $obj->decoded->string; } sub set_header { my ($class, $obj, $header, @data) = @_; $obj->head->delete($header); $obj->head->add($header, $_) for @data; } sub set_body { my ($class, $obj, $body) = @_; $obj->body(Mail::Message::Body->new(data => $body)); } sub as_string { my ($class, $obj) = @_; $obj->string; } 1; #pod =head1 DESCRIPTION #pod #pod This module wraps the Mail::Message mail handling library with an #pod abstract interface, to be used with L #pod #pod =head1 SEE ALSO #pod #pod L, L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Email::Abstract::MailMessage - Email::Abstract wrapper for Mail::Message =head1 VERSION version 3.009 =head1 DESCRIPTION This module wraps the Mail::Message mail handling library with an abstract interface, to be used with L =head1 PERL VERSION SUPPORT This module has a long-term perl support period. That means it will not require a version of perl released fewer than five years ago. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 SEE ALSO L, L. =head1 AUTHORS =over 4 =item * Ricardo SIGNES =item * Simon Cozens =item * Casey West =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2004 by Simon Cozens. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Email-Abstract-3.009/lib/Email/Abstract/EmailMIME.pm000644 000765 000024 00000003702 14063725423 022025 0ustar00rjbsstaff000000 000000 use strict; use warnings; package Email::Abstract::EmailMIME; # ABSTRACT: Email::Abstract wrapper for Email::MIME $Email::Abstract::EmailMIME::VERSION = '3.009'; use Email::Abstract::EmailSimple; BEGIN { @Email::Abstract::EmailMIME::ISA = 'Email::Abstract::EmailSimple' }; sub target { "Email::MIME" } sub construct { require Email::MIME; my ($class, $rfc822) = @_; Email::MIME->new($rfc822); } sub get_body { my ($class, $obj) = @_; # Return the same thing you'd get from Email::Simple. # # Ugh. -- rjbs, 2014-12-27 return $obj->body_raw; } 1; #pod =head1 DESCRIPTION #pod #pod This module wraps the Email::MIME mail handling library with an #pod abstract interface, to be used with L #pod #pod =head1 SEE ALSO #pod #pod L, L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Email::Abstract::EmailMIME - Email::Abstract wrapper for Email::MIME =head1 VERSION version 3.009 =head1 DESCRIPTION This module wraps the Email::MIME mail handling library with an abstract interface, to be used with L =head1 PERL VERSION SUPPORT This module has a long-term perl support period. That means it will not require a version of perl released fewer than five years ago. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 SEE ALSO L, L. =head1 AUTHORS =over 4 =item * Ricardo SIGNES =item * Simon Cozens =item * Casey West =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2004 by Simon Cozens. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Email-Abstract-3.009/lib/Email/Abstract/MIMEEntity.pm000644 000765 000024 00000004527 14063725423 022260 0ustar00rjbsstaff000000 000000 use strict; package Email::Abstract::MIMEEntity; # ABSTRACT: Email::Abstract wrapper for MIME::Entity $Email::Abstract::MIMEEntity::VERSION = '3.009'; use Email::Abstract::Plugin; BEGIN { @Email::Abstract::MIMEEntity::ISA = 'Email::Abstract::MailInternet' }; my $is_avail; sub is_available { return $is_avail if defined $is_avail; eval { require MIME::Entity; MIME::Entity->VERSION(5.508); 1 }; return $is_avail = $@ ? 0 : 1; } sub target { "MIME::Entity" } sub construct { require MIME::Parser; my $parser = MIME::Parser->new; $parser->output_to_core(1); my ($class, $rfc822) = @_; $parser->parse_data($rfc822); } sub get_body { my ($self, $obj) = @_; my $handle = $obj->bodyhandle; return $handle ? $handle->as_string : join('', @{ $obj->body }); } sub set_body { my ($class, $obj, $body) = @_; my @lines = split /\n/, $body; my $io = $obj->bodyhandle->open("w"); foreach (@lines) { $io->print($_."\n") } $io->close; } 1; #pod =head1 DESCRIPTION #pod #pod This module wraps the MIME::Entity mail handling library with an #pod abstract interface, to be used with L #pod #pod =head1 SEE ALSO #pod #pod L, L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Email::Abstract::MIMEEntity - Email::Abstract wrapper for MIME::Entity =head1 VERSION version 3.009 =head1 DESCRIPTION This module wraps the MIME::Entity mail handling library with an abstract interface, to be used with L =head1 PERL VERSION SUPPORT This module has a long-term perl support period. That means it will not require a version of perl released fewer than five years ago. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 SEE ALSO L, L. =head1 AUTHORS =over 4 =item * Ricardo SIGNES =item * Simon Cozens =item * Casey West =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2004 by Simon Cozens. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Email-Abstract-3.009/lib/Email/Abstract/MailInternet.pm000644 000765 000024 00000005456 14063725423 022731 0ustar00rjbsstaff000000 000000 use strict; package Email::Abstract::MailInternet; # ABSTRACT: Email::Abstract wrapper for Mail::Internet $Email::Abstract::MailInternet::VERSION = '3.009'; use Email::Abstract::Plugin; BEGIN { @Email::Abstract::MailInternet::ISA = 'Email::Abstract::Plugin' }; sub target { "Mail::Internet" } # We need 1.77 because otherwise headers unfold badly. my $is_avail; sub is_available { return $is_avail if defined $is_avail; require Mail::Internet; eval { Mail::Internet->VERSION(1.77) }; return $is_avail = $@ ? 0 : 1; } sub construct { require Mail::Internet; my ($class, $rfc822) = @_; Mail::Internet->new([ map { "$_\x0d\x0a" } split /\x0d\x0a/, $rfc822]); } sub get_header { my ($class, $obj, $header) = @_; my @values = $obj->head->get($header); return unless @values; # No reason to s/// lots of values if we're just going to return one. $#values = 0 if not wantarray; chomp @values; s/(?:\x0d\x0a|\x0a\x0d|\x0a|\x0d)\s+/ /g for @values; return wantarray ? @values : $values[0]; } sub get_body { my ($class, $obj) = @_; join "", @{$obj->body()}; } sub set_header { my ($class, $obj, $header, @data) = @_; my $count = 0; $obj->head->replace($header, shift @data, ++$count) while @data; } sub set_body { my ($class, $obj, $body) = @_; $obj->body( map { "$_\n" } split /\n/, $body ); } sub as_string { my ($class, $obj) = @_; $obj->as_string(); } 1; #pod =head1 DESCRIPTION #pod #pod This module wraps the Mail::Internet mail handling library with an #pod abstract interface, to be used with L #pod #pod =head1 SEE ALSO #pod #pod L, L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Email::Abstract::MailInternet - Email::Abstract wrapper for Mail::Internet =head1 VERSION version 3.009 =head1 DESCRIPTION This module wraps the Mail::Internet mail handling library with an abstract interface, to be used with L =head1 PERL VERSION SUPPORT This module has a long-term perl support period. That means it will not require a version of perl released fewer than five years ago. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 SEE ALSO L, L. =head1 AUTHORS =over 4 =item * Ricardo SIGNES =item * Simon Cozens =item * Casey West =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2004 by Simon Cozens. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Email-Abstract-3.009/lib/Email/Abstract/Plugin.pm000644 000765 000024 00000003123 14063725423 021561 0ustar00rjbsstaff000000 000000 use strict; use warnings; package Email::Abstract::Plugin; # ABSTRACT: a base class for Email::Abstract plugins $Email::Abstract::Plugin::VERSION = '3.009'; #pod =method is_available #pod #pod This method returns true if the plugin should be considered available for #pod registration. Plugins that return false from this method will not be #pod registered when Email::Abstract is loaded. #pod #pod =cut sub is_available { 1 } 1; __END__ =pod =encoding UTF-8 =head1 NAME Email::Abstract::Plugin - a base class for Email::Abstract plugins =head1 VERSION version 3.009 =head1 PERL VERSION SUPPORT This module has a long-term perl support period. That means it will not require a version of perl released fewer than five years ago. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 METHODS =head2 is_available This method returns true if the plugin should be considered available for registration. Plugins that return false from this method will not be registered when Email::Abstract is loaded. =head1 AUTHORS =over 4 =item * Ricardo SIGNES =item * Simon Cozens =item * Casey West =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2004 by Simon Cozens. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Email-Abstract-3.009/xt/author/000755 000765 000024 00000000000 14063725423 016363 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/xt/release/000755 000765 000024 00000000000 14063725423 016501 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/xt/release/changes_has_content.t000644 000765 000024 00000002101 14063725423 022655 0ustar00rjbsstaff000000 000000 use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '3.009'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); if ($encoding) { require Encode; $changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK()); } close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } Email-Abstract-3.009/xt/author/pod-syntax.t000644 000765 000024 00000000252 14063725423 020655 0ustar00rjbsstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Email-Abstract-3.009/t/unknown.t000644 000765 000024 00000001551 14063725423 016557 0ustar00rjbsstaff000000 000000 #!perl -T use strict; use Test::More; plan tests => 4; use_ok("Email::Abstract"); BEGIN { package Totally::Unknown::ToAll; @Totally::Unknown::ToAll::ISA = ('Totally::Unknown'); } for my $class ('Totally::Unknown', 'Totally::Unknown::ToAll') { my $object = bless [] => $class; my $abs = eval { Email::Abstract->new($object); }; like($@, qr/handle/, "exception on unknown object type"); } open FILE, '; }; close FILE; # Let's be generous and start with real CRLF, no matter what stupid thing the # VCS or archive tools have done to the message. $message =~ s/\x0a\x0d|\x0d\x0a|\x0d|\x0a/\x0d\x0a/g; require Email::Simple; my $simple = Email::Simple->new($message); eval { Email::Abstract->cast($simple, 'Totally::Unknown::ToAll') }; like($@, qr/don't know/i, "can't cast an object to an unknown class"); Email-Abstract-3.009/t/abstractions.t000644 000765 000024 00000007054 14063725423 017560 0ustar00rjbsstaff000000 000000 #!perl use strict; use Test::More; use lib 't/lib'; use Test::EmailAbstract; my @classes = qw(Email::MIME Email::Simple MIME::Entity Mail::Internet Mail::Message); plan tests => 2 + (@classes * 2 + 2) * Test::EmailAbstract->tests_per_object + (@classes + 4) * Test::EmailAbstract->tests_per_class + 4; use_ok("Email::Abstract"); open my $fh, '<', 't/example.msg' or die "can't open t/example.msg: $!"; my $message = do { local $/; <$fh>; }; close $fh or die "error closing t/example.msg after read: $!"; # Let's be generous and start with real CRLF, no matter what stupid thing the # VCS or archive tools have done to the message. $message =~ s/\x0a\x0d|\x0d\x0a|\x0d|\x0a/\x0d\x0a/g; my $tester = Test::EmailAbstract->new($message); is( substr($message, -2, 2), "\x0d\x0a", "the message ends in a CRLF", ); for my $class (@classes) { SKIP: { $tester->load($class); { my $obj = Email::Abstract->cast($message, $class); my $email_abs = Email::Abstract->new($obj); $tester->object_ok($class, $email_abs, 0); } { my $simple = Email::Simple->new($message); my $obj = Email::Abstract->cast($simple, $class); my $email_abs = Email::Abstract->new($obj); $tester->object_ok($class, $email_abs, 0); } { my $obj = Email::Abstract->cast($message, $class); $tester->class_ok($class, $obj, 0); } } } for my $ref (0..1) { my $get_msg = $ref ? sub { my $copy = $message; \$copy } : sub { $message }; my $desc = 'plaintext' . ($ref ? ' (ref)' : ''); { my $email_abs = Email::Abstract->new($get_msg->()); $tester->object_ok($desc, $email_abs, 0); $tester->class_ok("$desc (class)", $get_msg->(), 1); } { my $email_abs = Email::Abstract->new($get_msg->()); $tester->class_ok('Email::Abstract', $email_abs, 0); } { # Ensure that we can use Email::Abstract->header($abstract, 'foo') my $email_abs = Email::Abstract->new($get_msg->()); my $email_abs_new = Email::Abstract->new($email_abs); ok( $email_abs == $email_abs_new, "trying to wrap a wrapper returns the wrapper; it doesn't re-wrap", ); } } { SKIP: { $tester->load('MIME::Entity', { SKIP => 1 }); open my $fh, '<', 't/multipart.msg' or die "can't open t/multipart.msg: $!"; my $message = do { local $/; <$fh>; }; close $fh or die "error closing t/multipart.msg after read: $!"; # Let's be generous and start with real CRLF, no matter what stupid thing the # VCS or archive tools have done to the message. $message =~ s/\x0a\x0d|\x0d\x0a|\x0d|\x0a/\x0d\x0a/g; my $parser = MIME::Parser->new; $parser->output_to_core(1); my $entity = $parser->parse_data($message); my $abstract = Email::Abstract->new($entity); like( $abstract->get_body, qr/us-ascii/, "minimal body test on MIME::Entity", ); } } { SKIP: { $tester->load('Email::MIME', { SKIP => 1 }); open my $fh, '<', 't/multipart.msg' or die "can't open t/multipart.msg: $!"; my $message = do { local $/; <$fh>; }; close $fh or die "error closing t/multipart.msg after read: $!"; # Let's be generous and start with real CRLF, no matter what stupid thing the # VCS or archive tools have done to the message. $message =~ s/\x0a\x0d|\x0d\x0a|\x0d|\x0a/\x0d\x0a/g; my $email = Email::MIME->new(\$message); my $abstract = Email::Abstract->new($email); like( $abstract->get_body, qr/us-ascii/, "minimal body test on MIME::Entity", ); } } Email-Abstract-3.009/t/multipart.msg000644 000765 000024 00000011133 14063725423 017421 0ustar00rjbsstaff000000 000000 Return-Path: X-Original-To: rjbs@[70.87.222.20] Delivered-To: rjbs@[70.87.222.20] Received: from gold.pobox.com (gold.pobox.com [208.72.237.26]) by cancer.codesimply.com (Postfix) with ESMTP id 51C1742273E for ; Tue, 30 Jul 2013 08:55:58 -0400 (EDT) Received: from localhost.localdomain (localhost [127.0.0.1]) by gold.pobox.com (Postfix) with ESMTP id 869DF40B516; Tue, 30 Jul 2013 08:55:56 -0400 (EDT) X-Pobox-Filter-Version: 3 Delivered-To: cpan@rjbs.manxome.org X-Pobox-Orig-Sender: X-Pobox-Delivery-ID: 5ECC6E8A-F917-11E2-BC38-91E4A95B95DF-07314517!gold.pobox.com x-pobox-client-address: 207.171.7.70 x-pobox-client-name: x1.develooper.com Received: from x1.develooper.com (x1.develooper.com [207.171.7.70]) by gold.pobox.com (Postfix) with SMTP id 900E240A7BB for ; Tue, 30 Jul 2013 08:55:53 -0400 (EDT) Received: (qmail 7015 invoked by uid 225); 30 Jul 2013 12:55:52 -0000 Delivered-To: rjbs@cpan.org Received: (qmail 7011 invoked by uid 103); 30 Jul 2013 12:55:51 -0000 Received: from xx1.dev (10.0.100.115) by x1.dev with QMQP; 30 Jul 2013 12:55:51 -0000 Received: from localhost (HELO xx1.develooper.com) (127.0.0.1) by xx1.develooper.com (qpsmtpd/0.84/v0.84-36-g0b0e4e9) with ESMTP; Tue, 30 Jul 2013 05:55:51 -0700 Received: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id B2D9D11FB91 for ; Tue, 30 Jul 2013 05:55:51 -0700 (PDT) Received: from smtp.pobox.com (b-pb-sasl-quonix.pobox.com [208.72.237.35]) by xx1.develooper.com (Postfix) with ESMTP id 5248F11FB89 for ; Tue, 30 Jul 2013 05:55:51 -0700 (PDT) Received: from smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 5656333B7B for ; Tue, 30 Jul 2013 12:55:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from :content-type:subject:message-id:date:to:mime-version; s=sasl; bh=8y5A5fJ5PreQxsLHjgB27fxj+Og=; b=hOKuPVvtMKC87qv6ziDC3DNULjHh RP0aLBHXUYxJ2YNksTe11d6pJmj/dB1XRR60c/8C48siLnQrBMwX+BjH+aFSi6bE ZYkZtWxqPZBcSdfVlArkR5UMgh3ERSnlWx/YpeWtMsmqJ3r1rO1hoC44n9rM/VHx +cW2KqR+tgB3ouk= Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 4B79A33B7A for ; Tue, 30 Jul 2013 12:55:50 +0000 (UTC) Received: from [172.16.1.202] (unknown [64.121.172.235]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id DABAE33B78 for ; Tue, 30 Jul 2013 12:55:49 +0000 (UTC) From: Ricardo Signes Content-Type: multipart/alternative; boundary="Apple-Mail=_FAFF19B4-3BF3-4D29-930E-9D87CEC03F01" Subject: test of mutipart Message-Id: <8A1869F4-2A06-4155-8E9C-1B9CEB13D297@cpan.org> Date: Tue, 30 Jul 2013 08:55:49 -0400 To: rjbs@cpan.org Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) X-Mailer: Apple Mail (2.1508) X-Pobox-Relay-ID: 5C183962-F917-11E2-917A-E84251E3A03C-07314517!b-pb-sasl-quonix.pobox.com X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.7.30.124527 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' HTML_70_90 0.1, HTML_NO_HTTP 0.1, FROM_SAME_AS_TO 0.05, MIME_LOWER_CASE 0.05, BODYTEXTH_SIZE_10000_LESS 0, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_600_699 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, DKIM_SIGNATURE 0, NO_URI_FOUND 0, SMALL_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_ALT 0, __FROM_SAME_AS_TO2 0, __HAS_FROM 0, __HAS_HTML 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_HTML 0, __MIME_VERSION 0, __MSGID_APPLEMAIL 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_START 0, __TAG_EXISTS_HTML 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __USER_AGENT_APPLEMAIL 0, __X_MAILER_APPLEMAIL 0, __zen.spamhaus.org_ERROR ' X-Pobox-Pass: rjbs@cpan.org is whitelisted Lines: 19 --Apple-Mail=_FAFF19B4-3BF3-4D29-930E-9D87CEC03F01 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii This is a multipart test. -- rjbs --Apple-Mail=_FAFF19B4-3BF3-4D29-930E-9D87CEC03F01 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
This is a multipart test.

-- 
rjbs
--Apple-Mail=_FAFF19B4-3BF3-4D29-930E-9D87CEC03F01-- Email-Abstract-3.009/t/00-report-prereqs.t000644 000765 000024 00000013452 14063725423 020272 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.028 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: Email-Abstract-3.009/t/lib/000755 000765 000024 00000000000 14063725423 015437 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/t/example.msg000644 000765 000024 00000003531 14063725423 017036 0ustar00rjbsstaff000000 000000 Received: from mailman.opengroup.org ([192.153.166.9]) by deep-dark-truthful-mirror.pad with smtp (Exim 3.36 #1 (Debian)) id 18Buh5-0006Zr-00 for ; Wed, 13 Nov 2002 10:24:23 +0000 Received: (qmail 1679 invoked by uid 503); 13 Nov 2002 10:10:49 -0000 Resent-Date: 13 Nov 2002 10:10:49 -0000 Date: Wed, 13 Nov 2002 10:06:51 GMT From: Andrew Josey Message-Id: <1021113100650.ZM12997@skye.rdg.opengroup.org> In-Reply-To: Joanna Farley's message as of Nov 13, 9:56am. References: <200211120937.JAA28130@xoneweb.opengroup.org> <1021112125524.ZM7503@skye.rdg.opengroup.org> <3DD221BB.13116D47@sun.com> X-Mailer: Z-Mail (5.0.0 30July97) To: austin-group-l@opengroup.org Subject: Re: Defect in XBD lround MIME-Version: 1.0 Resent-Message-ID: Resent-To: austin-group-l@opengroup.org Resent-From: austin-group-l@opengroup.org X-Mailing-List: austin-group-l:archive/latest/4823 X-Loop: austin-group-l@opengroup.org Precedence: list X-Spam-Status: No, hits=-1.6 required=5.0 Resent-Sender: austin-group-l-request@opengroup.org Content-Type: text/plain; charset=us-ascii Joanna, All Thanks. I got the following response from Fred Tydeman. On Nov 13, 9:56am in "Re: Defect in XBD lr", Joanna Farley wrote: > Sun's expert in this area after some discussions with a colleague > outside of Sun concluded that for lround, to align with both C99 and SUS > changes of the following form were necessary: > this line of text is really long and no one need worry about it but why was such a long text chosen to begin with i mean really?? ----- Andrew Josey The Open Group Austin Group Chair Apex Plaza,Forbury Road, Email: a.josey@opengroup.org Reading,Berks.RG1 1AX,England Tel: +44 118 9508311 ext 2250 Fax: +44 118 9500110 Email-Abstract-3.009/t/subclass.t000644 000765 000024 00000012736 14063725423 016706 0ustar00rjbsstaff000000 000000 { package MyMail; use Email::Simple; BEGIN { @MyMail::ISA = 'Email::Simple'; } } package main; use Test::More tests => 4; use Email::Abstract; my $message = do { local $/; ; }; my $x = MyMail->new($message); like(Email::Abstract->as_string($x), qr/Farley's/, "Round trip with subclass"); my $y = Email::Abstract->new($x); isa_ok($y, 'Email::Abstract'); like($y->as_string, qr/Farley's/, "Round trip subclass via object wrapped"); SKIP: { skip "this test requires MIME::Entity", 1 unless eval { require Email::Abstract::MIMEEntity; Email::Abstract::MIMEEntity->is_available; }; { # should always adapt as if it's MIME::Entity, the nearest class package MultiHopMail; require MIME::Entity; @MultiHopMail::ISA = qw(MIME::Entity); } # We're digging deep into the guts, here. Wear gloves. # In previous versions, this could return Email::Abstract::MailInternet, # because inheritance order was not respected. is( Email::Abstract->__class_for('MultiHopMail'), 'Email::Abstract::MIMEEntity', "we get the nearest path in inheritance order", ); } __DATA__ Received: from mailman.opengroup.org ([192.153.166.9]) by deep-dark-truthful-mirror.pad with smtp (Exim 3.36 #1 (Debian)) id 18Buh5-0006Zr-00 for ; Wed, 13 Nov 2002 10:24:23 +0000 Received: (qmail 1679 invoked by uid 503); 13 Nov 2002 10:10:49 -0000 Resent-Date: 13 Nov 2002 10:10:49 -0000 Date: Wed, 13 Nov 2002 10:06:51 GMT From: Andrew Josey Message-Id: <1021113100650.ZM12997@skye.rdg.opengroup.org> In-Reply-To: Joanna Farley's message as of Nov 13, 9:56am. References: <200211120937.JAA28130@xoneweb.opengroup.org> <1021112125524.ZM7503@skye.rdg.opengroup.org> <3DD221BB.13116D47@sun.com> X-Mailer: Z-Mail (5.0.0 30July97) To: austin-group-l@opengroup.org Subject: Re: Defect in XBD lround MIME-Version: 1.0 Resent-Message-ID: Resent-To: austin-group-l@opengroup.org Resent-From: austin-group-l@opengroup.org X-Mailing-List: austin-group-l:archive/latest/4823 X-Loop: austin-group-l@opengroup.org Precedence: list X-Spam-Status: No, hits=-1.6 required=5.0 Resent-Sender: austin-group-l-request@opengroup.org Content-Type: text/plain; charset=us-ascii Joanna, All Thanks. I got the following response from Fred Tydeman. C99 Defect Report (DR) 240 covers this. The main body of C99 (7.12.9.7) says range error, while Annex F (F.9.6.7 and F.9.6.5) says "invalid" (domain error). The result was to change 7.12.9.7 to allow for either range or domain error. The preferred error is domain error (so as match Annex F). So, no need to change XBD. regards Andrew On Nov 13, 9:56am in "Re: Defect in XBD lr", Joanna Farley wrote: > Sun's expert in this area after some discussions with a colleague > outside of Sun concluded that for lround, to align with both C99 and SUS > changes of the following form were necessary: > > + If x is +/-Inf/NaN, a domain error occurs, and > + errno is set to EDOM in MATH_ERRNO mode; > + the invalid exception is raised in MATH_ERREXCEPT mode. > [to align with C99 Annex F.4] > > + If x is too large to be represented as a long, a *range* error > may occur, and > + errno *may be* set to ERANGE in MATH_ERRNO mode; > [to align with C99 7.12.9.7] > + the invalid exception *is* raised in MATH_ERREXCEPT mode. > [to align with C99 Annex F.4] > > They believe it is a bit awkward to have errno set to ERANGE in > MATH_ERRNO mode yet the invalid exception raised in MAH_ERREXCEPT mode, > but that just reflects an imperfect mapping of the C notion of errno to > the IEEE 754 notion of data conversion. > > I'll work with our expert to draft text refecting the above to suggest > replacement text for lines 23678-23684 on lround page 721 of XSH6. > > Thanks > > Joanna > > > Andrew Josey wrote: > > > > The text referred to is MX shaded and part of the ISO 60559 floating > > point option. I do not think changing the Domain Error to a Range Error > > is the fix or at least not the fix for the NaN and +-Inf cases. ISO C > > 99 describes the range error case if the magnitude of x is too large as a > > may fail. I'll ask Fred T for his thoughts on this one... > > regards > > Andrew > > > > On Nov 12, 9:37am in "Defect in XBD lround", Erwin.Unruh@fujitsu-siemens.com wrote: > > > Defect report from : Erwin Unruh , Fujitsu Siemens Computers > > > > > > (Please direct followup comments direct to austin-group-l@opengroup.org) > > > > > > @ page 0 line 0 section lround objection {0} > > > > > > Problem: > > > > > > Defect code : 1. Error > > > > > > The function lround is described in http://www.opengroup.org/onlinepubs/007904975/functions/lround.html > > > On Error it is specified that errno has to be set to EDOM. However, the C99 standard ISO/IEC 9899:1999 (E) specifies this as a range error, which would result in a value of ERANGE. So an implementation could not be conformant to both these standards. > > > > > > Action: > > > > > > Change the value of errno to ERANGE, if the result is not represantable. More specific: In the description of the function, replace all occurences of "domain error" with "range error" and replace "EDOM" with "ERANGE" > > >-- End of excerpt from Erwin.Unruh@fujitsu-siemens.com > > ----- Andrew Josey The Open Group Austin Group Chair Apex Plaza,Forbury Road, Email: a.josey@opengroup.org Reading,Berks.RG1 1AX,England Tel: +44 118 9508311 ext 2250 Fax: +44 118 9500110 Email-Abstract-3.009/t/00-report-prereqs.dd000644 000765 000024 00000003077 14063725423 020420 0ustar00rjbsstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '6.78' } }, 'develop' => { 'requires' => { 'Encode' => '0', 'Test::More' => '0', 'Test::Pod' => '1.41' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Email::Simple' => '1.998', 'MRO::Compat' => '0', 'Module::Pluggable' => '1.5', 'Scalar::Util' => '0', 'perl' => '5.006', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Test::More' => '0.96', 'lib' => '0' } } }; $x; }Email-Abstract-3.009/t/lib/Test/000755 000765 000024 00000000000 14063725423 016356 5ustar00rjbsstaff000000 000000 Email-Abstract-3.009/t/lib/Test/EmailAbstract.pm000644 000765 000024 00000005625 14063725423 021437 0ustar00rjbsstaff000000 000000 use strict; package Test::EmailAbstract; use Test::More; sub new { my ($class, $message) = @_; my $simple = Email::Simple->new($message); bless { simple => $simple } => $class; } sub simple { $_[0]->{simple} } sub _call { my ($wrapped, $object, $method, @args) = @_; if ($wrapped) { return $object->$method(@args); } else { return Email::Abstract->$method($object, @args); } } sub tests_per_class { 7 } sub tests_per_object { 8 } sub tests_per_module { + 1 + 2 * $_[0]->tests_per_class + 1 * $_[0]->tests_per_object } sub _do_tests { my ($self, $is_wrapped, $class, $obj, $readonly) = @_; if ($is_wrapped) { isa_ok($obj, 'Email::Abstract', "wrapped $class object"); } is( _call($is_wrapped, $obj, 'get_header', 'Subject'), 'Re: Defect in XBD lround', "Subject OK with $class" ); eval { _call($is_wrapped, $obj, set_header => "Subject", "New Subject"); }; if ($readonly) { like($@, qr/can't alter string/, "can't alter an unwrapped string"); } else { is($@, '', "no exception on altering object via Email::Abstract"); } my @receiveds = ( q{from mailman.opengroup.org ([192.153.166.9]) by deep-dark-truthful-mirror.pad with smtp (Exim 3.36 #1 (Debian)) id 18Buh5-0006Zr-00 for ; Wed, 13 Nov 2002 10:24:23 +0000}, q{(qmail 1679 invoked by uid 503); 13 Nov 2002 10:10:49 -0000}, ); my @got = _call($is_wrapped, $obj, get_header => 'Received'); s/\t/ /g for @got; is_deeply( \@got, \@receiveds, "$class: received headers match up list context get_header", ); my $got_body = _call($is_wrapped, $obj, 'get_body'); my $simple_body = $self->simple->body; # I very much do not like doing this. Why is it needed? $got_body =~ s/\x0d?\x0a?\z//; $simple_body =~ s/\x0d?\x0a?\z//; is( $got_body, $simple_body, "correct stringification of $class; same as reference object", ); is( length $got_body, length $simple_body, "correct body length for $class", ); eval { _call($is_wrapped, $obj, set_body => "A completely new body"); }; if ($readonly) { like($@, qr/can't alter string/, "can't alter an unwrapped string"); } else { is($@, '', "no exception on altering object via Email::Abstract"); } if ($readonly) { pass("(no test; can't check altering unalterable alteration)"); } else { like( _call($is_wrapped, $obj, 'as_string'), qr/Subject: New Subject.*completely new body$/ms, "set subject and body, restringified ok with $class" ); } } sub class_ok { shift->_do_tests(0, @_); } sub object_ok { shift->_do_tests(1, @_); } sub load { my ($self, $class, $arg) = @_; if (eval "require $class; Email::Abstract->__class_for('$class')") { diag "testing $class with " . $class->VERSION; } else { my $skip = $arg && $arg->{SKIP} ? $arg->{SKIP} : $self->tests_per_module; skip "$class: unavailable", $skip; } } 1;