DateTime-Calendar-Discordian-1.0000755001750001750 011765707566 17053 5ustar00jaldharjaldhar000000000000DateTime-Calendar-Discordian-1.0/README000444001750001750 550011765707551 20062 0ustar00jaldharjaldhar000000000000DateTime-Calendar-Discordian ============================ This is a module that implements the Discordian calendar made popular in the "Illuminatus!" trilogy by Robert Shea and Robert Anton Wilson and by the Church of the SubGenius. It follows the DateTime API. INSTALLATION If you have the Module::Signature module installed, you can verify the integrity of this distribution by typing: cpansign -v Module::Signature requires GnuPG which you can get from: http://www.gnupg.org/download/ A binary version for Windows is available from that page. Then to install this module, run the following commands: perl Build.pl ./Build ./Build test ./Build install On Windows you don't need to type the preliminary ./ Alternatively, you can do: perl Makefile.PL make make test make install If you are using ActiveState perl on Windows and you don't have a make utility, you can download nmake from: http://download.microsoft.com/download/vc15/patch/1.52/w95/en-us/nmake15.exe (Replace make with nmake in the instructions above if you are using it.) If you are using Strawberry perl on Windows, it comes with a make utility called dmake. (Replace make with dmake in the instructions above if you are using it.) DEPENDENCIES This module is pure perl and should work with any version of perl, 5.010 or greater. The signature can be tested by installing the following module: Module::Signature and setting the environment variable TEST_SIGNATURE to 1. This module requires these other modules available from CPAN: DateTime DateTime::Locale Params::Validate SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc DateTime::Calendar::Discordian Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. Please submit bugs to the CPAN RT system at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=datetime-Calendar-Discordian or via email at bug-datetime-calendar-discordian@rt.cpan.org. You can also look for information at: Search CPAN http://search.cpan.org/dist/DateTime-Calendar-Discordian AnnoCPAN, annotated CPAN documentation: http://annocpan.org/dist/DateTime-Calendar-Discordian CPAN Ratings: http://cpanratings.perl.org/d/DateTime-Calendar-Discordian COPYRIGHT AND LICENCE By Jaldhar H. Vyas Copyright (C) 2012 Consolidated Braincells Inc. This distribution is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or b) the Artistic License version 2.0. The full text of the license can be found in the LICENSE file included with this distribution. DateTime-Calendar-Discordian-1.0/Build.PL000444001750001750 164011765707551 20477 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl -w use strict; use warnings; use Module::Build; my $builder = Module::Build->new( module_name => 'DateTime::Calendar::Discordian', license => 'perl', dist_version_from => 'lib/DateTime/Calendar/Discordian.pm', dist_author => 'Jaldhar H. Vyas ', requires => { 'perl' => 5.010, 'DateTime' => 0, 'DateTime::Locale' => 0, 'Params::Validate' => 0, }, create_makefile_pl => 'traditional', sign => 1, meta_merge => { resources => { repository => 'http://github.com/jaldhar/DateTime-Calendar-Discordian', homepage => 'http://jaldhar.github.com/DateTime-Calendar-Discordian', }, }, ); $builder->create_build_script(); DateTime-Calendar-Discordian-1.0/LICENSE000444001750001750 5032611765707551 20235 0ustar00jaldharjaldhar000000000000Copyright (c) 2008 Consolidated Braincells Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Terms of Perl 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 General Public License (GPL) Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU 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. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), 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 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 show them these terms so they know 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. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. 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 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 derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 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 License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. 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. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary 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 License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 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 Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing 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 for copying, distributing or modifying the Program or works based on it. 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. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. 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 this 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 this License, you may choose any version ever published by the Free Software Foundation. 10. 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 11. 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. 12. 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 --------------------------------------------------------------------------- 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. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. 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 DateTime-Calendar-Discordian-1.0/SIGNATURE000644001750001750 434611765707566 20505 0ustar00jaldharjaldhar000000000000This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.68. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 dd854fe9b04883154885be5cd1066c918f2353c6 Build.PL SHA1 939d6f9fc56e1f3de09e591d6baf1b05206e33bd Changes SHA1 f7353eef543c00881d10bee200ac0120954f77e7 LICENSE SHA1 e05e070eea1c79aebcd3dcad0b0951f446206ead MANIFEST SHA1 4429c8ccea605354796ae97b6c6c34b12cfc44de MANIFEST.SKIP SHA1 2c012ebb812fee2c114259deeb3aa3cd0e257438 META.json SHA1 5f390a841d55aaf0863fcf253420379bb9041831 META.yml SHA1 754dfd5d89d7a04a4051c3dbddcb27aca3b3a8de Makefile.PL SHA1 c4c9bf97d33edc527d54284c1a397038504951ce README SHA1 50108b9f937325cea1fd3c5d7fd23a5469f58f3b lib/DateTime/Calendar/Discordian.pm SHA1 19f00534f20fc9ec1274396e4018326741d2566d t/00-signature.t SHA1 663c8a0cdef7e02166fb5c7b56a4bf4b36fdd3d3 t/01-load.t SHA1 05418222c3cb3ee63ba95a2f36e98ab655811d4d t/cardinals.t SHA1 edb17c43c476c1a7f02140d70d6ce4aa02ab8d01 t/clone.t SHA1 b880325c69563fcf6d4b7fa3767bf36dfd4473ef t/day_abbr.t SHA1 1855007a8ecfeb603ebf5d15b54c1be761796b1c t/day_name.t SHA1 38622ece7ef90f77efea1477c5f1f34ae61941df t/days_till_x.t SHA1 6730048bba31e48bac20f6d6b2e157d8e1c7e4ac t/from_object.t SHA1 33756b6bbd89d55784880a32c26bc37c02b5d270 t/holydays.t SHA1 ad38a16d4697f245d99a8e0345964fc165ce202f t/locale.t SHA1 30fe0508cf4e70e292ec21559037edcff66899e5 t/randexcl.t SHA1 ab2d5dafa9d8f764ced86c0f7f2fc3430faed83f t/season_boundaries.t SHA1 20421fbd7eb769b250c2e946c6c4646865a6a91e t/st_tibs.t SHA1 60476a709c14a7e2582e0a7db913b9fc1e4f4332 t/strftime.t SHA1 bbaa335d8906aa4c0e4003bf6e70bb99a19c9660 t/utc_rd_values.t SHA1 2032eb8f71c0d303ab1e0b762dbc5b6894114ff9 t/validation.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk/Xj2kACgkQIN9eM6kfjrpD+QCg2H8kDk45jg0ARUy+wkeD7TBw bMgAnjhkzXD+G/xeOiglE0nIZmrxotks =16R6 -----END PGP SIGNATURE----- DateTime-Calendar-Discordian-1.0/Changes000444001750001750 322111765707551 20473 0ustar00jaldharjaldhar000000000000Revision history for Perl extension DateTime::Calendar::Discordian. 1.0 Tue Jun 12 14:40:37 EDT 2012 - Fixed improper conversion from object on December 31. (RT #77696) - second and nanosecond parameters in constructor instead of rd_secs, rd_nanosecs for better DateTime compatability. - Updated tests for current best practices. 100% test coverage. 0.9.7 Fri Aug 6 14:00:49 EDT 2010 - Miscapitalization of days_till_x fixed in one place. 0.9.6 Thu Mar 6 07:39:24 2008 - Fixed t/4-perl-critic.t so it deals properly with the absence of Test::Perl::Critic. Thanks to haoess and thospell on Perl Monks for the solution. 0.9.5 Mon Mar 3 23:20:20 2008 - Ran the module through Perl::Critic - Sign the package with a valid public key 0.9.4 Sat Sep 02 04:46:23 2006 - Fixed Debian bug# 381793 where the module was giving 0 as the day number around season boundaries and added tests. 0.9.3 Fri Jan 27 16:09:45 2006 - Patch from Philippe Bruhat to fix rt.cpan.org bug #17233: %{ and %} do not work as the documentation says they should. 0.9.2 Wed Oct 6 16:02:28 2004 - Corrected an off by one error in the conversion of St. Tib's day to an RD date. Found by Adrian Irving-Beer. 0.9.1 Sat Jun 12 13:55:00 2004 - Uploaded to Debian and CPAN. 0.9.0 Fri Jun 11 16:19:00 2004 - At Dave Rolskys suggestion, days_till_x renamed to days_until_x - Constructor doesn't take rd_secs, rd_nanosecs, or locale parameters. - README file tidied up. 0.8 Thu Jun 10 05:17:12 2004 - original version; created by h2xs 1.23 with options -AX -n DateTime::Calendar::Discordian DateTime-Calendar-Discordian-1.0/Makefile.PL000444001750001750 72711765707551 21142 0ustar00jaldharjaldhar000000000000# Note: this file was auto-generated by Module::Build::Compat version 0.3800 require 5.010; use ExtUtils::MakeMaker; WriteMakefile ( 'NAME' => 'DateTime::Calendar::Discordian', 'VERSION_FROM' => 'lib/DateTime/Calendar/Discordian.pm', 'PREREQ_PM' => { 'DateTime' => 0, 'DateTime::Locale' => 0, 'Params::Validate' => 0 }, 'INSTALLDIRS' => 'site', 'EXE_FILES' => [], 'PL_FILES' => {} ) ; DateTime-Calendar-Discordian-1.0/MANIFEST.SKIP000444001750001750 17711765707551 21065 0ustar00jaldharjaldhar000000000000#defaults ^Makefile$ ^blib/ ^pm_to_blib ^blibdirs ^Build$ ^Build.bat$ ^_build/ .svn .git .tmp ^MYMETA.yml$ ^xt/ ^MYMETA\.json$ DateTime-Calendar-Discordian-1.0/META.yml000444001750001750 144311765707551 20455 0ustar00jaldharjaldhar000000000000--- abstract: 'Perl extension for the Discordian Calendar' author: - 'Jaldhar H. Vyas ' build_requires: {} configure_requires: Module::Build: 0.38 dynamic_config: 1 generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.110440' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: DateTime-Calendar-Discordian provides: DateTime::Calendar::Discordian: file: lib/DateTime/Calendar/Discordian.pm version: 1.0 requires: DateTime: 0 DateTime::Locale: 0 Params::Validate: 0 perl: 5.01 resources: homepage: http://jaldhar.github.com/DateTime-Calendar-Discordian license: http://dev.perl.org/licenses/ repository: http://github.com/jaldhar/DateTime-Calendar-Discordian version: 1.0 DateTime-Calendar-Discordian-1.0/META.json000444001750001750 234411765707551 20626 0ustar00jaldharjaldhar000000000000{ "abstract" : "Perl extension for the Discordian Calendar", "author" : [ "Jaldhar H. Vyas " ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.110440", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "DateTime-Calendar-Discordian", "prereqs" : { "configure" : { "requires" : { "Module::Build" : "0.38" } }, "runtime" : { "requires" : { "DateTime" : 0, "DateTime::Locale" : 0, "Params::Validate" : 0, "perl" : "5.01" } } }, "provides" : { "DateTime::Calendar::Discordian" : { "file" : "lib/DateTime/Calendar/Discordian.pm", "version" : "1.0" } }, "release_status" : "stable", "resources" : { "homepage" : "http://jaldhar.github.com/DateTime-Calendar-Discordian", "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "url" : "http://github.com/jaldhar/DateTime-Calendar-Discordian" } }, "version" : "1.0" } DateTime-Calendar-Discordian-1.0/MANIFEST000444001750001750 60711765707551 20316 0ustar00jaldharjaldhar000000000000Build.PL Changes Makefile.PL lib/DateTime/Calendar/Discordian.pm LICENSE MANIFEST MANIFEST.SKIP META.yml README t/00-signature.t t/01-load.t t/cardinals.t t/clone.t t/day_name.t t/day_abbr.t t/days_till_x.t t/holydays.t t/from_object.t t/locale.t t/randexcl.t t/season_boundaries.t t/st_tibs.t t/strftime.t t/utc_rd_values.t t/validation.t META.json SIGNATURE Added here by Module::Build DateTime-Calendar-Discordian-1.0/lib000755001750001750 011765707551 17613 5ustar00jaldharjaldhar000000000000DateTime-Calendar-Discordian-1.0/lib/DateTime000755001750001750 011765707551 21307 5ustar00jaldharjaldhar000000000000DateTime-Calendar-Discordian-1.0/lib/DateTime/Calendar000755001750001750 011765707551 23020 5ustar00jaldharjaldhar000000000000DateTime-Calendar-Discordian-1.0/lib/DateTime/Calendar/Discordian.pm000444001750001750 4071311765707551 25617 0ustar00jaldharjaldhar000000000000 =head1 NAME DateTime::Calendar::Discordian - Perl extension for the Discordian Calendar =head1 SYNOPSIS use DateTime::Calendar::Discordian; =head1 ABSTRACT A module that implements the Discordian calendar made popular(?) in the "Illuminatus!" trilogy by Robert Shea and Robert Anton Wilson and by the Church of the SubGenius. =cut package DateTime::Calendar::Discordian; use strict; use warnings; use 5.010; use Carp; use DateTime::Locale; use Params::Validate qw( validate SCALAR OBJECT UNDEF); =head1 VERSION This document describes DateTime::Calendar::Discordian version 1.0 =cut our $VERSION = '1.0'; =head1 DESCRIPTION =head2 The Discordian Calendar =head3 Seasons Name Patron apostle ---- -------------- Chaos Hung Mung Discord Dr. Van Van Mojo Confusion Sri Syadasti Bureaucracy Zarathud The Aftermath The Elder Malaclypse Each season contains 73 consecutively numbered days. =head3 Holydays Apostle Holydays Season Holydays ---------------- --------------- 1) Mungday 1) Chaoflux 2) Mojoday 2) Discoflux 3) Syaday 3) Confuflux 4) Zaraday 4) Bureflux 5) Maladay 5) Afflux Apostle Holydays occur on the 5th day of the season. Season Holydays occur on the 50th day of the deason. St. Tib's Day occurs once every 4 years (1+4=5) and is inserted between the 59th and 60th days of the Season of Chaos. The era of the Discordian Calendar is called Year Of Lady Discord (YOLD.) Its' epoch (Confusion 1 of year 0) is equivalent to January 1, -1167 B.C. X Day is when the Church of the SubGenius believes the alien X-ists will destroy the world. The revised date is equivalent to Confusion 40, 9827 YOLD. =cut my %seasons = ( 'Chaos' => { abbrev => 'Chs', offset => 0, apostle_holyday => 'Mungday', season_holyday => 'Chaoflux', }, 'Discord' => { abbrev => 'Dsc', offset => 73, apostle_holyday => 'Mojoday', season_holyday => 'Discoflux', }, 'Confusion' => { abbrev => 'Cfn', offset => 146, apostle_holyday => 'Syaday', season_holyday => 'Confuflux', }, 'Bureaucracy' => { abbrev => 'Bcy', offset => 219, apostle_holyday => 'Zaraday', season_holyday => 'Bureflux', }, 'The Aftermath' => { abbrev => 'Afm', offset => 292, apostle_holyday => 'Maladay', season_holyday => 'Afflux', }, ); my $tibsday = qr/s(?:ain)?t[.]?\s*tib'?s?\s*(?:day)?/imsx; =head3 Days Of The Week 1. Sweetmorn 2. Boomtime 3. Pungenday 4. Prickle-Prickle 5. Setting Orange The days of the week are named from the five Basic Elements: sweet, boom, pungent, prickle and orange. =cut my @days = ( { name => 'Sweetmorn', abbrev => 'SM', }, { name => 'Boomtime', abbrev => 'BT', }, { name => 'Pungenday', abbrev => 'PD', }, { name => 'Prickle-Prickle', abbrev => 'PP', }, { name => 'Setting Orange', abbrev => 'SO', }, ); my @excl = ( 'Hail Eris!', 'All Hail Discordia!', 'Kallisti!', 'Fnord.', 'Or not.', 'Wibble.', 'Pzat!', q{P'tang!}, 'Frink!', 'Slack!', 'Praise "Bob"!', 'Or kill me.', 'Grudnuk demand sustenance!', 'Keep the Lasagna flying!', 'Umlaut Zebra über alles!', 'You are what you see.', 'Or is it?', 'This statement is false.', 'Hail Eris, Hack Perl!', ); =head1 METHODS =head2 new Constructs a new I object. This class method requires the parameters I, I, and I. If I is given as "St. Tib's Day" (or reasonable facsimile thereof,) then I is omitted. This function will C if invalid parameters are given. For example: my $dtcd = DateTime::Calendar::Discordian->new( day => 8, season => 'Discord', year => 3137, ); The I, I, and I parameters are also accepted for compatability with L but nothing is done with them. =cut sub new { my ( $class, @arguments ) = @_; my %args = validate( @arguments, { day => { callbacks => { q{between 1 and 73 or St. Tib's Day} => sub { my ( $day, $opts ) = @_; if ( $day =~ $tibsday ) { if ( !defined $opts->{season} ) { return 1; } } elsif ( $day > 0 && $day < 74 ) { return 1; } return; }, }, }, season => { default => undef, callbacks => { 'valid season name' => sub { my ( $season, $opts ) = @_; if ( defined $season ) { return scalar grep { /((?-x)$season)/imsx } keys %seasons; } return 1; }, }, }, year => { type => SCALAR, }, second => { default => 0, }, nanosecond => { default => 0, }, locale => { type => SCALAR | OBJECT | UNDEF, optional => 1, }, } ); if ( defined $args{season} ) { $args{season} = join q{ }, map { ucfirst lc $_ } split q{ }, $args{season}; } else { if ( $args{day} !~ $tibsday ) { confess 'missing season'; } } if ( $args{day} =~ $tibsday ) { $args{day} = q{St. Tib's Day}; } croak q{Not a leap year} if $args{day} eq q{St. Tib's Day} && !_is_leap_year( $args{year} - 1166 ); my $self = bless \%args, $class; $self->{epoch} = -426_237; $self->{fnord} = 5; if ( defined $self->{locale} ) { if ( !ref $self->{locale} ) { $self->{locale} = DateTime::Locale->load( $args{locale} ); } } $self->{rd} = $self->_discordian2rd; return bless $self, $class; } =head2 clone Returns a copy of the object. =cut sub clone { my ($object) = @_; return bless { %{$object} }, ref $object; } =head2 day Returns the day of the season as a number between 1 and 73 or the string "St. Tib's Day". =cut sub day { my ($self) = @_; return $self->{day}; } =head2 day_abbr Returns the name of the day of the week in abbreviated form or false if it is "St. Tib's Day". =cut sub day_abbr { my ($self) = @_; if ( $self->{day} eq q{St. Tib's Day} ) { return; } my $day_of_year = $seasons{ $self->{season} }->{offset} + $self->{day}; return $days[ ( $day_of_year - 1 ) % 5 ]->{abbrev}; } =head2 day_name Returns the full name of the day of the week or "St. Tib's Day" if it is that day. =cut sub day_name { my ($self) = @_; return $self->{day} if ( $self->{day} eq q{St. Tib's Day} ); my $day_of_year = $seasons{ $self->{season} }->{offset} + $self->{day}; return $days[ ( $day_of_year - 1 ) % 5 ]->{name}; } =head2 days_till_x Returns the number of days until X Day. =cut sub days_till_x { my ($self) = @_; return 3_163_186 - $self->{rd}; } =head2 from_object Builds a I object from another I object. This function takes an I parameter and optionally I. For example: my $dtcd = DateTime::Calendar::Discordian->from_object( object => DateTime->new(day => 22, month => 3, year => 1971,)); =cut sub from_object { my ( $class, @arguments ) = @_; my %args = validate( @arguments, { object => { type => OBJECT, can => 'utc_rd_values', }, locale => { type => SCALAR | OBJECT | UNDEF, default => undef, }, }, ); if ( $args{object}->can('set_time_zone') ) { $args{object} = $args{object}->clone->set_time_zone('floating'); } my ( $rd_days, $rd_secs, $rd_nanosecs ) = $args{object}->utc_rd_values; my ( $day, $season, $year ) = $class->_rd2discordian($rd_days); my $newobj = $class->new( day => $day, season => $season, year => $year, second => $rd_secs, nanosecond => $rd_nanosecs, locale => $args{locale}, ); return $newobj; } =head2 holyday If the current day is a holy day, returns the name of that day otherwise returns an empty string. =cut sub holyday { my ($self) = @_; return $seasons{ $self->{season} }->{apostle_holyday} if ( $self->{day} == 5 ); return $seasons{ $self->{season} }->{season_holyday} if ( $self->{day} == 50 ); return q{}; } =head2 season_abbr Returns the abbreviated name of the current season. =cut sub season_abbr { my ($self) = @_; return $seasons{ $self->{season} }->{abbrev}; } =head2 season_name Returns the full name of the current season. =cut sub season_name { my ($self) = @_; return $self->{season}; } =head2 strftime This function takes one or more parameters consisting of strings containing special specifiers. For each such string it will return a string formatted according to the specifiers, er, specified. See the L section for a list of the available format specifiers. They have been chosen to be compatible with the L program not necessarily the L C function. If you give a format specifier that doesn't exist, then it is simply treated as text. =head3 strftime Specifiers The following specifiers are allowed in the format string given to the B method: =over 4 =item * %a Abbreviated name of the day of the week (i.e., SM.) Internally uses the I function. =item * %A Full name of the day of the week (i.e., Sweetmorn.) Internally uses the I function. =item * %b Abbreviated name of the season (i.e., Chs.) Internally uses the I function. =item * %B Full name of the season (i.e., Chaos.) Internally uses the I function. =item * %d Ordinal number of day in season (i.e., 23.) Internally uses the I function. =item * %e Cardinal number of day in season (i.e., 23rd.) =item * %H Name of current Holyday, if any. Internally uses the I function. =item * %n A newline character. =item * %N Magic code to prevent rest of format from being printed unless today is a Holyday. =item * %t A tab character. =item * %X Number of days remaining until X-Day. Internally uses the I function. =item * %Y Number of Year Of Lady Discord (YOLD.) Internally uses the I function. =item * %{ =item * %} Used to enclose the part of the string which is to be replaced with the words "St. Tib's Day" if the current day is St. Tib's Day. =item * %% A literal `%' character. =item * %. Try it and see. =back =cut my %formats = ( 'a' => sub { $_[0]->day_abbr }, 'A' => sub { $_[0]->day_name }, 'b' => sub { $_[0]->season_abbr }, 'B' => sub { $_[0]->season_name }, 'd' => sub { $_[0]->day }, 'e' => sub { _cardinal( $_[0]->{day} ) }, 'H' => sub { $_[0]->holyday }, 'n' => sub { "\n" }, 't' => sub { "\t" }, 'X' => sub { $_[0]->days_till_x }, 'Y' => sub { $_[0]->year }, q{%} => sub { q{%} }, q{.} => sub { $_[0]->_randexcl }, ); sub strftime { my ( $self, @r ) = @_; foreach (@r) { ( $self->{day} eq q{St. Tib's Day} || ( $self->{day} != 5 && $self->{day} != 50 ) ) ? s/%N.+$//msx : s/%N//gmsx; ( $self->{day} eq q{St. Tib's Day} ) ? s/%[{].+?%[}]/%d/gmsx : s/%[{}]//gmsx; s/%([%*[:alpha:]])/ $formats{$1} ? $formats{$1}->($self) : $1 /egmsx; if ( !wantarray ) { return $_; } } return @r; } =head2 utc_rd_values Returns a three-element array containing the current UTC RD days, seconds, and nanoseconds. See L for more details. =cut sub utc_rd_values { my ($self) = @_; return ( $self->{rd}, $self->{rd_secs}, $self->{rd_nanosecs} ); } =head2 year Returns the current year according to the YOLD (Year Of Lady Discord) era. =cut sub year { my ($self) = @_; return $self->{year}; } sub _cardinal { my ($day) = @_; my $cardinal = $day; return $cardinal . 'st' if ( $day % 10 == 1 && $day != 11 ); return $cardinal . 'nd' if ( $day % 10 == 2 && $day != 12 ); return $cardinal . 'rd' if ( $day % 10 == 3 && $day != 13 ); return $cardinal . 'th'; } # # calculate RD (Rata Dia) date # sub _discordian2rd { my ($self) = @_; # Convert Discordian year to Gregorian - 1 my $yr = $self->{year} - 1167; # Start with the epoch + number of elapsed days in intervening years. # Add number of intervening leap days. my $rd = 0 # + 365 * ($yr) # + _floor( $yr / 4 ) # - _floor( $yr / 100 ) + _floor( $yr / 400 ); # add number of days elapsed this year. my $day_of_year = $self->{day} eq q{St. Tib's Day} ? 60 : $seasons{ $self->{season} }->{offset} + $self->{day}; $rd += $day_of_year; # add 1 if this is a leap year and it is past St. Tibs' Day. $rd += $day_of_year <= 60 ? 0 : _is_leap_year( $yr + 1 ) ? 1 : 0; return $rd; } sub _floor { my ($x) = @_; my $ix = int $x; return ( $ix <= $x ) ? $ix : $ix - 1; } sub _is_leap_year { my ($yr) = @_; my $c = ($yr) % 400; return ( $yr % 4 == 0 ) && $c != 100 && $c != 200 && $c != 300; } sub _randexcl { my ($self) = @_; return $excl[ int rand $#excl ]; } sub _rd2discordian { my ( $self, $rd ) = @_; my $n400 = _floor( $rd / 146_097 ); my $d1 = $rd % 146_097; my $n100 = _floor( $d1 / 36_524 ); my $d2 = $d1 % 36_524; my $n4 = _floor( $d2 / 1461 ); my $d3 = $d2 % 1461; my $n1 = _floor( $d3 / 365 ); my $d4 = $d3 % 365; # $d4 == 0 is the last day of the year so has to be special cased. my $year = ( 400 * $n400 ) + ( 100 * $n100 ) + ( 4 * $n4 ) + $n1 + 1166 + ( ( $d4 == 0 ) ? 0 : 1 ); my ( $season, $day ); if ( $d4 == 60 && _is_leap_year( $year - 1166 ) ) { $season = undef; $day = q{St. Tib's Day}; } else { my @seas = ( 'Chaos', 'Discord', 'Confusion', 'Bureaucracy', 'The Aftermath', ); $season = ( $d4 == 0 ) ? $seas[4] : $seas[ _floor( $d4 / 73 ) ]; $day = ( $d4 == 0 ) ? 73 : $d4 - $seasons{$season}->{offset}; if ( $d4 > 60 && _is_leap_year( $year - 1166 ) ) { $day--; } if ( $day < 1 ) { $day += 73; } } return ( $day, $season, $year ); } 1; __END__ =head1 SUPPORT After installing, you can find documentation for this module with the perldoc command. perldoc DateTime::Calendar::Discordian Support for this module is provided via the datetime@perl.org email list. See L for more details. Please submit bugs to the L or via email at bug-datetime-calendar-discordian@rt.cpan.org. You can also look for information at: =over 4 =item * L =item * L =item * L =back =head1 AUTHOR Jaldhar H. Vyas, Ejaldhar@braincells.comE =head1 COPYRIGHT AND LICENSE Copyright (C) 2012, Consolidated Braincells Inc. This distribution is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or b) the Artistic License version 2.0. The full text of the license can be found in the LICENSE file included with this distribution. =head1 SEE ALSO =over 4 =item * L =item * L =item * L =back =cut DateTime-Calendar-Discordian-1.0/t000755001750001750 011765707551 17310 5ustar00jaldharjaldhar000000000000DateTime-Calendar-Discordian-1.0/t/holydays.t000444001750001750 102611765707551 21465 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime::Calendar::Discordian; my @dates = ( {season => 'Chaos', day => 1, year => 3178, name => q{}}, {season => 'Chaos', day => 5, year => 3178, name => 'Mungday'}, {season => 'Discord', day => 50, year => 3178, name => 'Discoflux'}, ); my $i = 1; foreach my $d (@dates) { is(DateTime::Calendar::Discordian->new (season => $d->{season}, day => $d->{day}, year => $d->{year})->holyday, $d->{name}, "date $i"); $i++; } done_testing(); DateTime-Calendar-Discordian-1.0/t/day_abbr.t000444001750001750 506611765707551 21404 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime::Calendar::Discordian; my @dates = ( {season => 'Confusion', day => 59, year => 580, abbr => 'SO'}, {season => 'The Aftermath', day => 47, year => 998, abbr => 'PP'}, {season => 'Bureaucracy', day => 48, year => 1236, abbr => 'BT'}, {season => 'Bureaucracy', day => 56, year => 1301, abbr => 'SO'}, {season => 'Chaos', day => 8, year => 1636, abbr => 'PD'}, {season => 'Discord', day => 67, year => 1742, abbr => 'SO'}, {season => 'The Aftermath', day => 22, year => 1860, abbr => 'PP'}, {season => 'Discord', day => 42, year => 2179, abbr => 'SO'}, {season => 'Discord', day => 71, year => 2262, abbr => 'PP'}, {season => 'Discord', day => 9, year => 2356, abbr => 'BT'}, {season => 'Chaos', day => 69, year => 2406, abbr => 'PP'}, {season => 'Discord', day => 19, year => 2454, abbr => 'BT'}, {season => 'Discord', day => 44, year => 2464, abbr => 'BT'}, {season => 'Confusion', day => 17, year => 2557, abbr => 'PD'}, {season => 'Chaos', day => 34, year => 2602, abbr => 'PP'}, {season => 'Discord', day => 26, year => 2658, abbr => 'PP'}, {season => 'Bureaucracy', day => 43, year => 2719, abbr => 'BT'}, {season => 'Chaos', day => 64, year => 2726, abbr => 'PP'}, {season => 'Confusion', day => 15, year => 2814, abbr => 'SM'}, {season => 'Confusion', day => 35, year => 2846, abbr => 'SM'}, {season => 'Confusion', day => 59, year => 2882, abbr => 'SO'}, {season => 'Confusion', day => 24, year => 2934, abbr => 'SO'}, {season => 'Confusion', day => 68, year => 2985, abbr => 'PP'}, {season => 'Discord', day => 13, year => 3005, abbr => 'SM'}, {season => 'Discord', day => 36, year => 3069, abbr => 'PP'}, {season => 'Bureaucracy', day => 18, year => 3095, abbr => 'BT'}, {season => 'Bureaucracy', day => 53, year => 3107, abbr => 'BT'}, {season => 'Discord', day => 36, year => 3109, abbr => 'PP'}, {season => 'Bureaucracy', day => 61, year => 3109, abbr => 'SO'}, {season => 'Discord', day => 3, year => 3158, abbr => 'SM'}, {season => 'Chaos', day => 56, year => 3162, abbr => 'SM'}, {season => 'The Aftermath', day => 22, year => 3204, abbr => 'PP'}, {season => 'Confusion', day => 53, year => 3260, abbr => 'PP'}, {day => q{St. Tib's Day}, year => 3178, abbr => undef }, ); my $i = 1; foreach my $d (@dates) { is(DateTime::Calendar::Discordian->new (season => $d->{season}, day => $d->{day}, year => $d->{year})->day_abbr, $d->{abbr}, "date $i"); $i++; } done_testing(); DateTime-Calendar-Discordian-1.0/t/strftime.t000444001750001750 253711765707551 21476 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime; use DateTime::Calendar::Discordian; is(DateTime::Calendar::Discordian->from_object( object => DateTime->new(day => 28, month => 2, year =>, 2000,) )->strftime('%A %B %d %Y%t'), "Prickle-Prickle Chaos 59 3166\t", 'date 1'); is(DateTime::Calendar::Discordian->from_object( object => DateTime->new(day => 28, month => 2, year =>, 2000,) )->strftime('%a %b %e %%%n'), "PP Chs 59th %\n", 'date 2'); is(DateTime::Calendar::Discordian->from_object( object => DateTime->new(day => 29, month => 2, year =>, 2000,) )->strftime('%{%A, the %e day of %B%} in the YOLD %Y'), "St. Tib's Day in the YOLD 3166", 'date 3'); is(DateTime::Calendar::Discordian->from_object( object => DateTime->new(day => 28, month => 2, year =>, 2000,) )->strftime('%{%A, the %e day of %B%} in the YOLD %Y'), 'Prickle-Prickle, the 59th day of Chaos in the YOLD 3166', 'date 4'); is(DateTime::Calendar::Discordian->new(day => 50, season => 'Discord', year => 3170,)->strftime('%NHappy %H'), 'Happy Discoflux', 'date 5'); is(DateTime::Calendar::Discordian->new(day => 51, season => 'Discord', year => 3170,)->strftime('%NHappy %H'), q{}, 'date 6'); is_deeply([ DateTime::Calendar::Discordian->new(day => 51, season => 'Discord', year => 3170,)->strftime('%%', '%Z') ], ['%', 'Z'], 'date 7'); done_testing(); DateTime-Calendar-Discordian-1.0/t/validation.t000444001750001750 146211765707551 21767 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use English qw( -no_match_vars ); use DateTime; use DateTime::Calendar::Discordian; eval{ DateTime::Calendar::Discordian->new (day => q{St. Tib's day}, season => 'Chaos', year => 3166); }; ok($EVAL_ERROR, 'St. Tibs and season'); eval{ DateTime::Calendar::Discordian->new (day => 0, season => 'Chaos', year => 3166); }; ok($EVAL_ERROR, 'day < 1'); eval{ DateTime::Calendar::Discordian->new (day => 74, season => 'Chaos', year => 3166); }; ok($EVAL_ERROR, 'day > 73'); eval{ DateTime::Calendar::Discordian->new (day => 1, season => 'Order', year => 3166); }; ok($EVAL_ERROR, 'invalid season'); eval{ DateTime::Calendar::Discordian->new(day => 1, year => 3166); }; ok($EVAL_ERROR, 'missing season'); done_testing(); DateTime-Calendar-Discordian-1.0/t/season_boundaries.t000444001750001750 154411765707551 23341 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More tests => 30; use DateTime; use DateTime::Calendar::Discordian; my $dt; my $dtcd; my @testdates = ( [3, 13], [3, 14], [3, 15], [5, 25], [5, 26], [5, 27], [8, 6], [8, 7], [8, 8], [10, 18], [10, 19], [10, 20], [12, 30], [12, 31], [1, 1], ); foreach my $year (2004, 2006) { foreach my $date (@testdates) { $dt = DateTime->new( year => $year, month => $date->[0], day => $date->[1], ); eval { $dtcd = DateTime::Calendar::Discordian->from_object(object => $dt); }; ok($@ eq "", 'Discordian Calendar Object created') or diag(($dt->utc_rd_values)[0] . ' ' . join('/', $year, $date->[0], $date->[1]) . ": $@"); } } DateTime-Calendar-Discordian-1.0/t/01-load.t000444001750001750 43011765707551 20744 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl # Test to see if the module loads correctly. use warnings; use strict; use Test::More tests => 1; BEGIN { use_ok('DateTime::Calendar::Discordian') }; diag( "Testing DateTime::Calendar::Discordian $DateTime::Calendar::Discordian::VERSION, Perl $], $^X\n", ); DateTime-Calendar-Discordian-1.0/t/day_name.t000444001750001750 561411765707551 21415 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime::Calendar::Discordian; my @dates = ( {season => 'Confusion', day => 59, year => 580, name => 'Setting Orange'}, {season => 'The Aftermath', day => 47, year => 998, name => 'Prickle-Prickle'}, {season => 'Bureaucracy', day => 48, year => 1236, name => 'Boomtime'}, {season => 'Bureaucracy', day => 56, year => 1301, name => 'Setting Orange'}, {season => 'Chaos', day => 8, year => 1636, name => 'Pungenday'}, {season => 'Discord', day => 67, year => 1742, name => 'Setting Orange'}, {season => 'The Aftermath', day => 22, year => 1860, name => 'Prickle-Prickle'}, {season => 'Discord', day => 42, year => 2179, name => 'Setting Orange'}, {season => 'Discord', day => 71, year => 2262, name => 'Prickle-Prickle'}, {season => 'Discord', day => 9, year => 2356, name => 'Boomtime'}, {season => 'Chaos', day => 69, year => 2406, name => 'Prickle-Prickle'}, {season => 'Discord', day => 19, year => 2454, name => 'Boomtime'}, {season => 'Discord', day => 44, year => 2464, name => 'Boomtime'}, {season => 'Confusion', day => 17, year => 2557, name => 'Pungenday'}, {season => 'Chaos', day => 34, year => 2602, name => 'Prickle-Prickle'}, {season => 'Discord', day => 26, year => 2658, name => 'Prickle-Prickle'}, {season => 'Bureaucracy', day => 43, year => 2719, name => 'Boomtime'}, {season => 'Chaos', day => 64, year => 2726, name => 'Prickle-Prickle'}, {season => 'Confusion', day => 15, year => 2814, name => 'Sweetmorn'}, {season => 'Confusion', day => 35, year => 2846, name => 'Sweetmorn'}, {season => 'Confusion', day => 59, year => 2882, name => 'Setting Orange'}, {season => 'Confusion', day => 24, year => 2934, name => 'Setting Orange'}, {season => 'Confusion', day => 68, year => 2985, name => 'Prickle-Prickle'}, {season => 'Discord', day => 13, year => 3005, name => 'Sweetmorn'}, {season => 'Discord', day => 36, year => 3069, name => 'Prickle-Prickle'}, {season => 'Bureaucracy', day => 18, year => 3095, name => 'Boomtime'}, {season => 'Bureaucracy', day => 53, year => 3107, name => 'Boomtime'}, {season => 'Discord', day => 36, year => 3109, name => 'Prickle-Prickle'}, {season => 'Bureaucracy', day => 61, year => 3109, name => 'Setting Orange'}, {season => 'Discord', day => 3, year => 3158, name => 'Sweetmorn'}, {season => 'Chaos', day => 56, year => 3162, name => 'Sweetmorn'}, {season => 'The Aftermath', day => 22, year => 3204, name => 'Prickle-Prickle'}, {season => 'Confusion', day => 53, year => 3260, name => 'Prickle-Prickle'}, {day => q{St. Tib's Day}, year => 3178, name => q{St. Tib's Day} }, ); my $i = 1; foreach my $d (@dates) { is(DateTime::Calendar::Discordian->new (season => $d->{season}, day => $d->{day}, year => $d->{year})->day_name, $d->{name}, "date $i"); $i++; } done_testing(); DateTime-Calendar-Discordian-1.0/t/clone.t000444001750001750 53711765707551 20717 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime; use DateTime::Calendar::Discordian; my $locale = DateTime::Locale->load('en_US'); my $dtcd1 = DateTime::Calendar::Discordian->new (day => 1, season => 'Chaos', year => 3000, locale => $locale); my $dtcd2 = $dtcd1->clone; is_deeply($dtcd1, $dtcd2, 'clone'); done_testing(); DateTime-Calendar-Discordian-1.0/t/randexcl.t000444001750001750 125411765707551 21434 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime::Calendar::Discordian; my @excl = ( 'Hail Eris!', 'All Hail Discordia!', 'Kallisti!', 'Fnord.', 'Or not.', 'Wibble.', 'Pzat!', q{P'tang!}, 'Frink!', 'Slack!', 'Praise "Bob"!', 'Or kill me.', 'Grudnuk demand sustenance!', 'Keep the Lasagna flying!', 'Umlaut Zebra über alles!', 'You are what you see.', 'Or is it?', 'This statement is false.', 'Hail Eris, Hack Perl!', ); ok(scalar grep { DateTime::Calendar::Discordian->new( season => 'Confusion', day => 1, year => 0)->_randexcl } @excl, 'randexcl' ); done_testing(); DateTime-Calendar-Discordian-1.0/t/st_tibs.t000444001750001750 173611765707551 21310 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime; use DateTime::Calendar::Discordian; is(eval{DateTime::Calendar::Discordian->new (day => q{St. Tib's day}, year => 3066)->day}, undef, 'date 1'); is(eval{DateTime::Calendar::Discordian->new (day => q{St. Tib's day}, year => 3165)->day}, undef, 'date 2'); is(eval{DateTime::Calendar::Discordian->new (day => q{St. Tib's day}, year => 3166)->day}, q{St. Tib's Day}, 'date 3'); is(DateTime::Calendar::Discordian->from_object( object => DateTime->new(day => 29, month => 2, year =>, 2000,) )->strftime("%d"), q{St. Tib's Day}, 'date 4'); is(DateTime::Calendar::Discordian->from_object( object => DateTime->new(day => 29, month => 2, year =>, 1996,) )->strftime("%d"), q{St. Tib's Day}, 'date 5'); is((DateTime::Calendar::Discordian->new (day => q{St. Tib's day}, year => 3166)->utc_rd_values)[0], (DateTime->new(day => 29, month => 2, year => 2000)->utc_rd_values)[0], 'date 6'); done_testing(); DateTime-Calendar-Discordian-1.0/t/cardinals.t000444001750001750 76011765707551 21555 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use 5.010; use Test::More; use DateTime::Calendar::Discordian; for my $i (1 .. 73) { my $cardinal = $i; given ($i) { when ($i % 10 == 1 && $i != 11) { $cardinal .= 'st' } when ($i % 10 == 2 && $i != 12) { $cardinal .= 'nd' } when ($i % 10 == 3 && $i != 13) { $cardinal .= 'rd' } default { $cardinal .= 'th' } }; is(DateTime::Calendar::Discordian::_cardinal($i), $cardinal, "date $i"); } done_testing(); DateTime-Calendar-Discordian-1.0/t/from_object.t000444001750001750 561411765707551 22131 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime; use DateTime::Calendar::Discordian; my @dates = ( {day => 24, month => 7, year =>, -586, date => 'Confusion 59 580'}, {day => 5, month => 12, year =>, -168, date => 'The Aftermath 47 998'}, {day => 24, month => 9, year => 70, date => 'Bureaucracy 48 1236'}, {day => 2, month => 10, year => 135, date => 'Bureaucracy 56 1301'}, {day => 8, month => 1 , year => 470, date => 'Chaos 8 1636'}, {day => 20, month => 5, year => 576, date => 'Discord 67 1742'}, {day => 10, month => 11, year => 694, date => 'The Aftermath 22 1860'}, {day => 25, month => 4, year => 1013, date => 'Discord 42 2179'}, {day => 24, month => 5, year => 1096, date => 'Discord 71 2262'}, {day => 23, month => 3, year => 1190, date => 'Discord 9 2356'}, {day => 10, month => 3, year => 1240, date => 'Chaos 69 2406'}, {day => 2, month => 4, year => 1288, date => 'Discord 19 2454'}, {day => 27, month => 4, year => 1298, date => 'Discord 44 2464'}, {day => 12, month => 6, year => 1391, date => 'Confusion 17 2557'}, {day => 3, month => 2, year => 1436, date => 'Chaos 34 2602'}, {day => 9, month => 4, year => 1492, date => 'Discord 26 2658'}, {day => 19, month => 9, year => 1553, date => 'Bureaucracy 43 2719'}, {day => 5, month => 3, year => 1560, date => 'Chaos 64 2726'}, {day => 10, month => 6, year => 1648, date => 'Confusion 15 2814'}, {day => 30, month => 6, year => 1680, date => 'Confusion 35 2846'}, {day => 24, month => 7, year => 1716, date => 'Confusion 59 2882'}, {day => 19, month => 6, year => 1768, date => 'Confusion 24 2934'}, {day => 2, month => 8, year => 1819, date => 'Confusion 68 2985'}, {day => 27, month => 3, year => 1839, date => 'Discord 13 3005'}, {day => 19, month => 4, year => 1903, date => 'Discord 36 3069'}, {day => 25, month => 8, year => 1929, date => 'Bureaucracy 18 3095'}, {day => 29, month => 9, year => 1941, date => 'Bureaucracy 53 3107'}, {day => 19, month => 4, year => 1943, date => 'Discord 36 3109'}, {day => 7, month => 10, year => 1943, date => 'Bureaucracy 61 3109'}, {day => 17, month => 3, year => 1992, date => 'Discord 3 3158'}, {day => 25, month => 2, year => 1996, date => 'Chaos 56 3162'}, {day => 10, month => 11, year => 2038, date => 'The Aftermath 22 3204'}, {day => 18, month => 7, year => 2094, date => 'Confusion 53 3260'}, {day => 31, month => 12, year => 2011, date => 'The Aftermath 73 3177'}, {day => 31, month => 12, year => 2012, date => 'The Aftermath 73 3178'}, {day => 1, month => 3, year => 2011, date => 'Chaos 60 3177'}, ); my $i = 1; foreach my $d (@dates) { is(DateTime::Calendar::Discordian->from_object( object => DateTime->new(day => $d->{day}, month => $d->{month}, year => $d->{year})) ->strftime("%B %d %Y"), $d->{date}, "date $i"); $i++; } done_testing(); DateTime-Calendar-Discordian-1.0/t/locale.t000444001750001750 71411765707551 21053 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime; use DateTime::Locale; use DateTime::Calendar::Discordian; my $locale = DateTime::Locale->load('en_US'); my $dtcd1 = DateTime::Calendar::Discordian->new (day => 1, season => 'Chaos', year => 3000, locale => $locale); my $dtcd2 = DateTime::Calendar::Discordian->new (day => 1, season => 'Chaos', year => 3000, locale => 'en_US'); is_deeply($dtcd1, $dtcd2, 'locale'); done_testing(); DateTime-Calendar-Discordian-1.0/t/utc_rd_values.t000444001750001750 617611765707551 22503 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime; use DateTime::TimeZone; use DateTime::Calendar::Discordian; my @dates = ( {season => 'Confusion', day => 59, year => 580, rd => -214193}, {season => 'The Aftermath', day => 47, year => 998, rd => -61387}, {season => 'Bureaucracy', day => 48, year => 1236, rd => 25469}, {season => 'Bureaucracy', day => 56, year => 1301, rd => 49217}, {season => 'Chaos', day => 8, year => 1636, rd => 171307}, {season => 'Discord', day => 67, year => 1742, rd => 210155}, {season => 'The Aftermath', day => 22, year => 1860, rd => 253427}, {season => 'Discord', day => 42, year => 2179, rd => 369740}, {season => 'Discord', day => 71, year => 2262, rd => 400085}, {season => 'Discord', day => 9, year => 2356, rd => 434355}, {season => 'Chaos', day => 69, year => 2406, rd => 452605}, {season => 'Discord', day => 19, year => 2454, rd => 470160}, {season => 'Discord', day => 44, year => 2464, rd => 473837}, {season => 'Confusion', day => 17, year => 2557, rd => 507850}, {season => 'Chaos', day => 34, year => 2602, rd => 524156}, {season => 'Discord', day => 26, year => 2658, rd => 544676}, {season => 'Bureaucracy', day => 43, year => 2719, rd => 567118}, {season => 'Chaos', day => 64, year => 2726, rd => 569477}, {season => 'Confusion', day => 15, year => 2814, rd => 601716}, {season => 'Confusion', day => 35, year => 2846, rd => 613424}, {season => 'Confusion', day => 59, year => 2882, rd => 626596}, {season => 'Confusion', day => 24, year => 2934, rd => 645554}, {season => 'Confusion', day => 68, year => 2985, rd => 664224}, {season => 'Discord', day => 13, year => 3005, rd => 671401}, {season => 'Discord', day => 36, year => 3069, rd => 694799}, {season => 'Bureaucracy', day => 18, year => 3095, rd => 704424}, {season => 'Bureaucracy', day => 53, year => 3107, rd => 708842}, {season => 'Discord', day => 36, year => 3109, rd => 709409}, {season => 'Bureaucracy', day => 61, year => 3109, rd => 709580}, {season => 'Discord', day => 3, year => 3158, rd => 727274}, {season => 'Chaos', day => 56, year => 3162, rd => 728714}, {season => 'The Aftermath', day => 22, year => 3204, rd => 744313}, {season => 'Confusion', day => 53, year => 3260, rd => 764652}, {season => 'The Aftermath', day => 73, year => 3177, rd => 734502}, {season => 'The Aftermath', day => 73, year => 3178, rd => 734868}, ); my $i = 1; foreach my $d (@dates) { is((DateTime::Calendar::Discordian->new (season => $d->{season}, day => $d->{day}, year => $d->{year}) ->utc_rd_values)[0], $d->{rd}, "date $i"); $i++; } my $dt = DateTime->new(day => 1, month => 1, year => 2012, time_zone => 'UTC', hour => 12, minute => 30, second => 0, nanosecond => 0); my $dtcd1 = DateTime::Calendar::Discordian->from_object( object => $dt ); is($dtcd1->strftime("%B %d %Y"), 'Chaos 1 3178', 'utc_rd_values'); my $dtcd2 = DateTime::Calendar::Discordian->from_object( object => $dtcd1 ); is($dtcd2->strftime("%B %d %Y"), 'Chaos 1 3178', 'floating timezone'); done_testing(); DateTime-Calendar-Discordian-1.0/t/days_till_x.t000444001750001750 73011765707551 22125 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; use DateTime::Calendar::Discordian; my @dates = ( {season => 'Confusion', day => 1, year => 0, tillx => 3_589_277}, {season => 'Confusion', day => 40, year => 9827, tillx => 0}, ); my $i = 1; foreach my $d (@dates) { is(DateTime::Calendar::Discordian->new (season => $d->{season}, day => $d->{day}, year => $d->{year})->days_till_x, $d->{tillx}, "date $i"); $i++; } done_testing(); DateTime-Calendar-Discordian-1.0/t/00-signature.t000444001750001750 176211765707551 22056 0ustar00jaldharjaldhar000000000000#!/usr/bin/perl # Test if the modules signature is valid. use warnings; use strict; use Test::More; if ( !$ENV{TEST_SIGNATURE} ) { plan skip_all => 'Set the environment variable TEST_SIGNATURE to enable this test.'; } elsif ( !eval { require Module::Signature; 1 } ) { plan skip_all => 'Next time around, consider install Module::Signature, ' . 'so you can verify the integrity of this distribution.'; } elsif ( !-e 'SIGNATURE' ) { plan skip_all => 'SIGNATURE not found'; } elsif ( -s 'SIGNATURE' == 0 ) { plan skip_all => 'SIGNATURE file empty'; } elsif ( !eval { require Socket; Socket::inet_aton('pool.sks-keyservers.net') } ) { plan skip_all => 'Cannot connect to the keyserver to check module signature'; } else { plan tests => 1; } my $ret = Module::Signature::verify(); SKIP: { skip 'Module::Signature cannot verify', 1 if $ret eq Module::Signature::CANNOT_VERIFY(); cmp_ok $ret, '==', Module::Signature::SIGNATURE_OK(), 'Valid signature'; }