ExtUtils-ModuleMaker-0.56/0000755000175000017500000000000013043670323015241 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/scripts/0000755000175000017500000000000013043670323016730 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/scripts/modulemaker0000644000175000017500000002001313043670162021155 0ustar jkeenanjkeenan#!/usr/local/bin/perl #$Id$ # modulemaker: command-line utility implementing ExtUtils::ModuleMaker eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' if 0; # not running under some shell use strict; use warnings; use ExtUtils::ModuleMaker::Interactive; use ExtUtils::ModuleMaker::Opts; use vars qw ( $VERSION ); $VERSION = 0.56; my $opt = ExtUtils::ModuleMaker::Opts->new( q{ExtUtils::ModuleMaker}, q{modulemaker}, ); my $mod = ExtUtils::ModuleMaker::Interactive->new( $opt->get_standard_options() ); $mod->run_interactive() if $mod->{INTERACTIVE}; $mod->complete_build(); $mod->closing_message(); ################### DOCUMENTATION ################### =head1 NAME modulemaker - interactive interface to ExtUtils::ModuleMaker; replaces C =head1 VERSION This document references version 0.56 of modulemaker, released to CPAN on January 30 2017. =head1 USAGE::Simple =head2 Easy At the command-prompt, simply call: % modulemaker ... and answer each question. =head2 Not So Easy, But More Geeky At the command-prompt, call C with as many options as you can type correctly: modulemaker [-CIPVchqs] [-v version] [-n module_name] [-a abstract] [-u author_name] [-p author_CPAN_ID] [-o organization] [-w author_website] [-e author_e-mail] [-l license_name] [-b build_system] =head2 Mix and Match You can specify some of the arguments on the command-line and then -- assuming you don't include the C<-I> option -- F will then switch to interactive mode so that you can finish entering arguments at the prompts. =head1 USAGE::More =head2 Menus After calling C at the command-prompt, you will be presented with a series of menus looking something like this: =head3 Main Menu ------------------------ modulemaker: Main Menu Feature Current Value N - Name of module '' S - Abstract 'Module abstract (<= 44 characters) goes here' A - Author information L - License 'perl' D - Directives B - Build system 'ExtUtils::MakeMaker' G - Generate module H - Generate module; save selections as defaults X - Exit immediately Please choose which feature you would like to edit: In many cases you make your selection by typing a single letter or number and hitting the C key. In the remaining cases, you have to type what you want. Note that in the Main Menu: =over 4 =item * G C generates the directories and files requested, then exits. =item * H C generates the directories and files requested, saves the values you have entered (with the exception of the module's name and abstract) in a personal defaults file, then exits. (See the documentation for ExtUtils::ModuleMaker for a more complete discussion of this feature.) =item * X C exits without generating directories or file. =back =head3 Author Menu ------------------------ modulemaker: Author Menu Feature Current Value N - Author 'A. U. Thor' C - CPAN ID 'MODAUTHOR' O - Organization 'XYZ Corp.' W - Website 'http://a.galaxy.far.far.away/modules' E - Email 'a.u.thor@a.galaxy.far.far.away' R - Return to main menu X - Exit immediately Please choose which feature you would like to edit: The values you enter here to override the Current Values may be good choices for the C 'save selections as defaults' feature in the Main Menu. Note that you cannot generate directories or files from this menu. You must return (C) to the Main Menu first. You can, however, bail out of the program from this menu with C. =head3 License Menu ------------------------ modulemaker: License Menu ModuleMaker provides many licenes to choose from, many of them approved by opensource.org. License Name 1 Apache Software License (1.1) 2 Artistic License 3 Artistic License w/ Aggregation 4 BSD License 5 BSD License(Raw) 6 CVW - MITRE Collaborative Virtual Workspace 7 GPL - General Public License (2) 8 IBM Public License Version (1.0) 9 Intel (BSD+) 10 Jabber (1.0) 11 LGPL - GNU Lesser General Public License (2.1) 12 MIT License 13 Mozilla Public License (1.0) 14 Mozilla Public License (1.1) 15 Nethack General Public License 16 Nokia Open Source License(1.0a) 17 Python License 18 Q Public License (1.0) 19 Ricoh Source Code Public License (1.0) 20*** Same terms as Perl itself 21 Sun Internet Standards Source License 22 The Sleepycat License 23 Vovida Software License (1.0) 24 zlib/libpng License 25 Loose Lips License (1.0) # - Enter the number of the license you want to use C - Display the Copyright L - Display the License R - Return to main menu X - Exit immediately Please choose which license you would like to use: =head3 Directives Menu ------------------------ modulemaker: Directives Menu Feature Current Value C - Compact '0' V - Verbose '0' D - Include POD '1' N - Include new '1' H - History in POD '0' P - Permissions '0755 - 493' R - Return to main menu X - Exit immediately Please choose which feature you would like to edit: As with the Author Menu above, the values you enter here to override the Current Values may be good choices for the C 'save selections as defaults' feature in the Main Menu. =head3 Build System Menu ------------------------ Here is the current build system: ExtUtils::MakeMaker E - ExtUtils::MakeMaker B - Module::Build P - Module::Build and proxy Makefile.PL R - Return to main menu X - Exit immediately Please choose which build system you would like to use: =head2 Features Currently Supported with Command-Line Options =over 4 =item * -a Specify (in quotes) an abstract for this extension =item * -b Specify a build system for this extension =item * -c Flag for compact base directory name =item * -C Omit creating the Changes file, add HISTORY heading to stub POD =item * -d Name of Perl module whose methods will override defaults provided in F and F. =item * -e Specify author's e-mail address =item * -h Display this help message =item * -I Disable INTERACTIVE mode, the command line arguments better be complete =item * -l Specify a license for this extension =item * -n Specify a name to use for the extension (required) =item * -o Specify (in quotes) author's organization =item * -p Specify author's CPAN ID =item * -P Omit the stub POD section =item * -q Do not include a constructor (C) in the F<*.pm> file. =item * -r Set permissions. =item * -s Save the selections entered (either as command-line options or as responses to F's prompts) as your new personal defaults. These will be the values provided by ExtUtils::ModuleMaker or F the next time you invoke either one of them. =item * -u Specify (in quotes) author's name =item * -v Specify a version number for this extension =item * -V Flag for verbose messages during module creation =item * -w Specify author's web site =back The code handling the processing of these options is found in package ExtUtils::ModuleMaker::Opts. =head1 AUTHOR ExtUtils::ModuleMaker was originally written in 2001-02 by R. Geoffrey Avery (modulemaker [at] PlatypiVentures [dot] com). Since version 0.33 (July 2005) it has been maintained by James E. Keenan (jkeenan [at] cpan [dot] org). =head1 COPYRIGHT Copyright (c) 2001-2002 R. Geoffrey Avery. Revisions from v0.33 forward (c) 2005 James E. Keenan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =head1 SEE ALSO F, F, F, F. =cut ExtUtils-ModuleMaker-0.56/META.yml0000664000175000017500000000162213043670323016515 0ustar jkeenanjkeenan--- abstract: 'Better than h2xs for creating modules' author: - 'James E Keenan (jkeenan@cpan.org)' build_requires: ExtUtils::MakeMaker: '0' IO::Capture: '0' Test::More: '0.44' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.24, 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: ExtUtils-ModuleMaker no_index: directory: - t - inc requires: File::Basename: '0' File::Path: '0' File::Save::Home: '0.03' Getopt::Std: '0' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-ModuleMaker homepage: http://thenceforward.net/perl/modules/ExtUtils-ModuleMaker/ repository: https://github.com/jkeenan/extutils-modulemaker.git version: 0.56 x_serialization_backend: 'CPAN::Meta::YAML version 0.018' ExtUtils-ModuleMaker-0.56/MANIFEST.SKIP0000644000175000017500000000045712642322767017157 0ustar jkeenanjkeenan^blib/ ^Makefile$ ^Makefile\.[a-z]+$ ^pm_to_blib$ CVS/.* ,v$ ^tmp/ \.old$ \.bak$ \.tmp$ \.swp$ ~$ ^# \.shar$ \.tar$ \.tgz$ \.tar\.gz$ \.zip$ \.DS_Store$ _uu$ \.svn bug/ cover_db/ coverage/ html/ research/ superseded/ svndiff/ ^Todo ^.cvsignore ^init ^results ^htmlify ^.git/ ^MYMETA.* \.version_info.pl ExtUtils-ModuleMaker-0.56/Changes0000644000175000017500000003452013043670123016536 0ustar jkeenanjkeenanRevision history for Perl extension ExtUtils::ModuleMaker. 0.56 January 30, 2017 Removed all test files using 'scripts/modulemaker' as first step in diagnosing problem reported in https://rt.cpan.org/Ticket/Display.html?id=111637. No changes in functionality. 0.55 January 03, 2016 Prodded by Chris Kirke during the CPAN Pull Request Challenge, standardized $VERSION numbers and release dates across all files. No changes in functionality or tests. 0.54 March 13, 2015 Correct error in TEST_REQUIRES: should have been IO::Capture rather than IO::CaptureOutput. 0.53 March 10, 2015 Add metadata to Makefile.PL. Remove IO::Capture from distribution. Instead, add it to TEST_REQUIRES metadata in Makefile.PL. 0.52 July 4, 2014 Move version control from Subversion to git. Establish development repository at https://github.com/jkeenan/extutils-modulemaker. Adapt code to prevent warnings to be added in Perl 5.22. 0.51 February 8, 2008 ExtUtils::ModuleMaker::Interactive:: Change prompt for Abstract; make it 44-characters long. 0.50 February 8, 2008 'modulemaker' script was failing to initialize certain variables. Diagnosed as problems in ExtUtils::ModuleMaker::Opts. Perl 5.10-related upgrade to Getopts::Std required declaration of $Getopts::Std::STANDARD_HELP_VERSION with assignment of true value. Eliminated croak(Usage()). 0.49 March 27, 2007 Responded to bug report http://rt.cpan.org/Ticket/Display.html?id=25830 that when either INCLUDE_POD_COVERAGE_TEST or INCLUDE_POD_TEST is used on Windows, using File::Spec::catfile to generate filenames for MANIFEST results in Windows-style path separators (\) appearing in MANIFEST. Though most of the time you want to use catfile to generate system-specific paths, in this case you do not because ExtUtils::Manifest uses only Unix-style path separators (/). Fixed. Responded to bug report 0.48 March 26, 2007 Responded to bug report http://rt.cpan.org/Ticket/Display.html?id=25830 of warnings being thrown during 'make test' in a situation where requestor Paul_AV had added a local license to EU::MM::Licenses::Local. It turned out that at line 80 of EU::MM::Interactive I had failed to s/Standard/Local/g. Fixed. 0.47 May 17, 2006 Added two more options: INCLUDE_ID_LINE and INCLUDE_WARNINGS. Both are off by default. Setting either to a true value includes a Subversion-style 'Id' keyword at the top of each Perl module created by ModuleMaker or inserts 'use warnings;' in the same location. 0.46 April 29, 2006 Use of Devel::Cover for coverage analysis indicated that most subroutines in lib/ExtUtils/ModuleMaker/Utility.pm were no longer covered. It turned out that, with one exception, they had all been superseded by calls to File::Save::Home functions. Hence, they could safely be deleted from the file and the distribution. The one exception, _get_dir_and_file(), was moved into lib/ExtUtils/ModuleMaker.pm. 0.45 April 5, 2006 In response to bug report from Gabriel Fortuna, corrected bug in t/01_ini.t. 0.44 December 24, 2005 Corrected one typo in ExtUtils/ModuleMaker.pm: '\' before @ in e-mail address in BUGS section. Corrected typo in POD erroneously crediting David Golden with ExtUtils::ModuleMaker::PBP. It should have been ExtUtils::ModuleMaker::TT. Deleted File::Temp from PM_PREREQ key in Makefile.PL. It's only used in the test suite, and when it appears there it's within SKIP blocks in case user is using Perl older than 5.6y. Per bug report from David Golden, changed remaining references to generate_pm_file() in StandardText.pm and Utility.pm to refer to complete_build(). Rewrote Initializers::validate_values() and set_author_composite() in response to bug reports from David Golden and Terrence Brannon. Added t/miscargs/919.t, 920.t and 921.t to test these revisions. There remained one minor problem with the modulemaker command-line mode, however. If in command-line mode you try to specify an empty string as the argument to -p (CPANID), -o (ORGANIZATION) or -w (WEBSITE) (and perhaps others not yet discovered), those values do *not* appear on the interactive mode's AUTHOR menu. Instead, you get the default values -- either ExtUtils::ModuleMaker::Defaults or ExtUtils::ModuleMaker::Personal Defaults, if the latter is installed. OTOH, if you store a personal defaults file with an empty string as the value for, say, ORGANIZATION, your lib/*.pm file will be created correctly (with no extra linespace for the missing attribute). Furthermore, if on the command-line you specify an empty string for any of those three attributes and you suppress interactive mode with -I option, the lib/*.pm file will use the default value, which is not what you wanted. By tossing in 'defined' at three points in ExtUtils::ModuleMaker::Opts, I solved the problem of supplying an empty string to CPANID, ORGANIZATION and WEBSITE in the modulemaker command-line utility. Modified 4 subs in lib/ExtUtils/ModuleMaker/Auxiliary.pm to use subs from new CPAN module File::Save::Home rather than subs from lib/ExtUtils/ModuleMaker/Utility.pm. Added File::Save::Home to the PREREQ_PM key in Makefile.PL. 0.43 September 29, 2005 - In response to report from CPAN tester imacat, corrected the number of unskipped tests in the SKIP block call in all test files. I had failed to account for the tests found within subroutines such as Auxiliary::_save_pretesting_status() (3) and _restore_pretesting_status (5) in computing the number of unskipped tests. This became evident when I tested without Module::Build on the system. 0.42 September 28, 2005 - Converted all test files (except t/01_ini.t) to have an END block which does the 'reprocessing' of the .modulemaker directory and personal defaults files as needed, notwithstanding any die or croak. In cases where t/*.t files encompassed several test blocks, this entailed extracting each block from such a file and creating a separate test file for it. Thus, this meant the creation of several new directories beneath t/, including failsafe/, mmkr/, miscargs/, license/, makedefaults/. 0.41 September 19, 2005 - Corrected error in lib/ExtUtils/ModuleMaker/Utility.pm _get_home_directory(): double backslashes messed up tests on Windows. 0.40 September 18, 2005 - Extensive refactoring; additional documentation; new default values added, particularly with regard to naming of tests. 0.39 September 5, 2005 - v0.38 was reported by two beta-testers to fail in tests depending on whether the user had or had not previously created a home/.modulemaker directory on user's system. Set v0.38 for deletion from CPAN. 0.38 September 4, 2005 - v0.37 failed to include t/testlib/ExtUtils/ModuleMaker/Alt_no_Todo.pm in MANIFEST, which meant it wasn't bundled in tarball that went up to CPAN. Corrected MANIFEST; set v0.37 for deletion from CPAN. 0.37 September 3, 2005 - Added method make_selections_defaults() to the public interface. User can now override the default values for attributes in the object created by ExtUtils::ModuleMaker::new(). The values which a user enters in a particular invocation of new() can be saved in a file called ExtUtils/ModuleMaker/Personal/Defaults.pm which overrides ExtUtils/ModuleMaker/Defaults.pm. This file is saved in a .modulemaker/ directory which is in turn located beneath the user's home directory or an equivalent thereto. make_selections_defaults() can be activated from the modulemaker command line via the '-s' option or from modulemaker interactive mode's Main Menu, choice 'H'. - Added capability for user to override particular methods called within ExtUtils::ModuleMaker::complete_build. This is done by setting the ALT_BUILD attribute passed to new() or by passing the name of a Perl package to the '-d' option to the modulemaker utility in command-line mode. - To prepare for the two extensions to ExtUtils::ModuleMaker's capabilities described above, most of the quasi-public methods previously found in ExtUtils/ModuleMaker.pm were moved to ExtUtils::ModuleMaker::Initializers.pm (in the case of methods called within new() for the purpose of initializing attributes with default values) or to ExtUtils/ModuleMaker/StandardText.pm (in the case of methods called within complete_build() for the purpose of creating directories, files and writing content to files. These two packages are require-d into the ExtUtils::ModuleMaker object at run-time. - Addition of the new capabilities described above required the creation of many new tests. Some test files were renumbered so that there are no longer gaps in their order. 0.36 July 18, 2005 - Corrected error pointed out by CPAN tester Scott R. Godin: IO::Capture and subclasses were omitted from MANIFEST, causing failure in t/11_miscargs.t. - Added additional command-line option '-q' to suppress sub new() in .pm file created by modulemaker. Added tests to t/09_mmkr.t to test suppression of POD and suppression of sub new() in .pm file created by modulemaker. Along the way, wrote additional testing subroutines and added them to t/testlib/_Auxiliary.pm: exported: check_pm_file make_compact not exported: pod_present constructor_present - Typographic cleanup of what modulemaker prints to STDOUT for Directives menu (mistake caused by my wrap settings in vi). - Commented out SecondStyles.pm so it will no longer be bundled via make dist and no longer be uploaded to CPAN. 0.35 July 17, 2005 - Removed support for Perl 4 style module names (e.g., D'oh). - Added many tests, including tests for the modulemaker utility in non-interactive mode. - Extensive refactoring, including extraction of most variable and subroutine declarations from modulemaker utility and placed them in lib/ExtUtils/ModuleMaker/Interactive.pm. Done to simplify future maintenance and make coverage results more transparent. - Added partial_dump() method to ModuleMaker.pm. This is not yet viewed as publicly available but is used to diagnose the content of the EUMM object during development. - Improvements in documentation; more to come. 0.34 - Intermediate version not released to CPAN. 0.33 July 8, 2005 - Primary maintenance taken over by James E Keenan (jkeenan@cpan.org). - scripts/modulemaker - modulemaker utility revised with objective of making it possible to specify all options on the command-line - Included ABSTRACT in Main Menu and created prompt for new abstract - Allowed for additional command-line options for specification of abstract and author info - Modified Usage message to reflect additional command-line options; placed options in alphabetical order - lib/ExtUtils/ModuleMaker.pm: - Corrected typing errors in several places - Modified ORGANIZATION in POD to parallel wording of CPANID - Changed $defaults{ABSTRACT} to 'Module abstract (<= 44 characters) goes here' - Allowed for ORGANIZATION, where defined, to be included in AUTHOR COMPOSITE and thereby included in Author section of POD - Fixed Block_Begin() and Block_Begin_BareBones() to eliminate blank first line in .pm files - Deletion of superseded/deprecated subroutines and corresponding POD - t/*.t - Corrected names of test files on first lines of each of 02_simple.t, 03_quick.t and 04_compact.t - Created 05_abstract. to test current and new features: -- correct Author and Email in Makefile.PL -- placement of Abstract in POD -- placement of Author info in POD -- placement of History info in POD rather than in Changes - Created t/06_build.t and t/07_proxy.t to test alternative BUILD_SYSTEMs - Created t/08_modulemaker.t to pave the way for testing of the modulemaker utility (much to be done) -------------------------------------------------------------- 0.32 June 16 2003 (YAPC::Boca_Raton) - Removed Fakefile.PL that was for testing but only caused problems. The content has been held over after __END__ in Makefile.PL - Added missing fullname for libpng license which was causing an odd number of parts in a hash - Added support for Module::Build (patch from Dave Rolsky) - Fixed misplaced backslash when generating the new method - Generated Makefile.PL now has a prerequisite of Test::Simple -------------------------------------------------------------- 0.312_29 September 2002 (YAPC::Munich) - Complete rewrite from the ground up for the 0.3xxx line - Created by ExtUtils::ModuleMaker 0.202 - Now object oriented for customizability - Licenses in two new modules: ExtUtils::ModuleMaker::Licenses::Standard ExtUtils::ModuleMaker::Licenses::Local - Customize for local environment by subclassing, example in ExtUtils::ModuleMaker::SecondStyle - Tests now use Test::More - New interactive script 'modulemaker' - Removed old scripts 'newmodule' and 'eumm' - Old functions are deprecated, but still here for now Quick_Module Generate_Module_Files - Fixed missing VERSION_FROM in Makefile.PL - pod and new method can now be optional in extra modules and different in each module -------------------------------------------------------------- 0.204_01 Fri May 31 2002 - joshua@cpan.org - Renamed eumm to the more memorable newmodule - Documented newmodule - More testing. We use Test::More now - Verbose prints to STDOUT not STDERR - Minor internal changes 0.202_02 Wed May 29 2002 - joshua@cpan.org - New feature: create compact base directories - New program: eumm (name TBD) frontend. 0.202_01 Sat May 25 2002 - joshua@cpan.org - Creates .cvsignore - Creates MANIFEST.SKIP 0.202 Fri Dec 28 2001 - Fixed typo on line 134 of Licences.pm 0.201_02 Fri Jul 27 2001 - Coming out party for the module at TPC 5.0 - Change name of module from ModuleMaker to ExtUtils::ModuleMaker - Added Licences.pm including: - LICENSE file added to the manifest - Now support all 21 licenses approved by opensource.org - Added simple tests - Need to add INLINE hooks, XS hooks, and better testing 0.2001+ Wed Jul 18 2001 - Minor housekeeping details 0.2 Sun Jul 08 20:47:34 2001 - original version; created by ModuleMaker 0.2 - Amazingly incestuous isn't it. ExtUtils-ModuleMaker-0.56/META.json0000664000175000017500000000312013043670323016660 0ustar jkeenanjkeenan{ "abstract" : "Better than h2xs for creating modules", "author" : [ "James E Keenan (jkeenan@cpan.org)" ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "ExtUtils-ModuleMaker", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "File::Basename" : "0", "File::Path" : "0", "File::Save::Home" : "0.03", "Getopt::Std" : "0" } }, "test" : { "requires" : { "IO::Capture" : "0", "Test::More" : "0.44" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-ModuleMaker" }, "homepage" : "http://thenceforward.net/perl/modules/ExtUtils-ModuleMaker/", "repository" : { "type" : "git", "url" : "https://github.com/jkeenan/extutils-modulemaker.git", "web" : "https://github.com/jkeenan/extutils-modulemaker" } }, "version" : 0.56, "x_serialization_backend" : "JSON::PP version 2.27300_01" } ExtUtils-ModuleMaker-0.56/LICENSE0000644000175000017500000004737012355615154016267 0ustar jkeenanjkeenanTerms 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. 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 ExtUtils-ModuleMaker-0.56/.gitignore0000644000175000017500000000032412642323240017225 0ustar jkeenanjkeenan/blib/ /.build/ _build/ cover_db/ inc/ Build !Build/ Build.bat .last_cover_stats /Makefile /Makefile.old /MANIFEST.bak /META.yml /META.json /MYMETA.* nytprof.out /pm_to_blib *.o *.bs ExtUtils-ModuleMaker*.tar.gz ExtUtils-ModuleMaker-0.56/MANIFEST0000644000175000017500000000442113043670323016373 0ustar jkeenanjkeenan.gitignore Changes lib/ExtUtils/ModuleMaker.pm lib/ExtUtils/ModuleMaker/Auxiliary.pm lib/ExtUtils/ModuleMaker/Defaults.pm lib/ExtUtils/ModuleMaker/Initializers.pm lib/ExtUtils/ModuleMaker/Interactive.pm lib/ExtUtils/ModuleMaker/Licenses/Local.pm lib/ExtUtils/ModuleMaker/Licenses/Standard.pm lib/ExtUtils/ModuleMaker/Opts.pm lib/ExtUtils/ModuleMaker/StandardText.pm LICENSE Makefile.PL MANIFEST This list of files MANIFEST.SKIP README scripts/modulemaker t/01_ini.t t/03_quick.t t/04_compact.t t/05_abstract.t t/06_build.t t/07_proxy.t t/10_standard_text.t t/13_alt_block_new_method.t t/failsafe/201.t t/failsafe/202.t t/failsafe/203.t t/failsafe/204.t t/failsafe/205.t t/failsafe/206.t t/failsafe/207.t t/failsafe/208.t t/failsafe/209.t t/failsafe/210.t t/failsafe/211.t t/license/apache.t t/license/apache_1_1.t t/license/artistic.t t/license/artistic_agg.t t/license/bsd.t t/license/gpl.t t/license/gpl_2.t t/license/ibm.t t/license/ibm_1_0.t t/license/intel.t t/license/jabber.t t/license/jabber_1_0.t t/license/lgpl.t t/license/lgpl_2_1.t t/license/libpng.t t/license/looselips.t t/license/mit.t t/license/mitre.t t/license/mozilla.t t/license/mozilla_1_0.t t/license/mozilla_1_1.t t/license/mpl.t t/license/mpl_1_0.t t/license/mpl_1_1.t t/license/nethack.t t/license/nokia.t t/license/nokia_1_0a.t t/license/nokos.t t/license/nokos_1_0a.t t/license/perl.t t/license/python.t t/license/q.t t/license/q_1_0.t t/license/r_bsd.t t/license/ricoh.t t/license/ricoh_1_0.t t/license/sissl.t t/license/sleepycat.t t/license/sun.t t/license/vovida.t t/license/vovida_1_0.t t/license/zlib.t t/makedefaults/1201.t t/makedefaults/1202.t t/miscargs/901.t t/miscargs/902.t t/miscargs/903.t t/miscargs/904.t t/miscargs/905.t t/miscargs/906.t t/miscargs/907.t t/miscargs/908.t t/miscargs/909.t t/miscargs/910.t t/miscargs/911.t t/miscargs/912.t t/miscargs/913.t t/miscargs/914.t t/miscargs/915.t t/miscargs/916.t t/miscargs/917.t t/miscargs/918.t t/miscargs/919.t t/miscargs/920.t t/miscargs/921.t t/miscargs/922.t t/miscargs/923.t t/testlib/arbitrary.txt t/testlib/ExtUtils/ModuleMaker/Alt_block_new_method.pm t/testlib/ExtUtils/ModuleMaker/Testing/Defaults.pm META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) ExtUtils-ModuleMaker-0.56/Makefile.PL0000644000175000017500000000274512646313406017227 0ustar jkeenanjkeenanuse ExtUtils::MakeMaker; require 5.006; my $mm_ver = ExtUtils::MakeMaker->VERSION; WriteMakefile( NAME => 'ExtUtils::ModuleMaker', VERSION_FROM => 'lib/ExtUtils/ModuleMaker.pm', AUTHOR => 'James E Keenan (jkeenan@cpan.org)', ABSTRACT => 'Better than h2xs for creating modules', EXE_FILES => [ 'scripts/modulemaker' ], PREREQ_PM => { Getopt::Std => 0, # in the Perl core File::Basename => 0, # in the Perl core File::Path => 0, # in the Perl core ($^O =~ /Win32/ ? (Win32 => 0) : ()), File::Save::Home => 0.03, }, ( $mm_ver < 6.63_03 ? 'BUILD_REQUIRES' : 'TEST_REQUIRES' ) => { 'IO::Capture' => 0, 'Test::More' => 0.44, }, LICENSE => "perl", test => { TESTS => join q{ }, map {glob} qw( t/*.t t/*/*.t ) }, ($mm_ver < 6.46 ? () : (META_MERGE => { 'meta-spec' => { version => 2 }, dynamic_config => 1, resources => { homepage => 'http://thenceforward.net/perl/modules/ExtUtils-ModuleMaker/', repository => { url => 'https://github.com/jkeenan/extutils-modulemaker.git', web => 'https://github.com/jkeenan/extutils-modulemaker', type => 'git', }, bugtracker => { web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-ModuleMaker', }, }, })), ); ExtUtils-ModuleMaker-0.56/README0000644000175000017500000000325313043670123016122 0ustar jkeenanjkeenanExtUtils::ModuleMaker - Better than h2xs for creating modules This document refers to version 0.56 of ExtUtils::ModuleMaker. This version was released January 30 2017. To install this module on your system, place the tarball archive file in a temporary directory and call the following: % gunzip ExtUtils-ModuleMaker-0.52.tar.gz % tar xf ExtUtils-ModuleMaker-0.52.tar % cd ExtUtils-ModuleMaker-0.52 % perl Makefile.PL % make % make test % make install If during installation you wish to view more information on test results, substitute the following for the sixth line in the sequence of commands above: % make test TEST=VERBOSE If you are installing this module over any earlier version, you may substitute the following for the last line in the sequence of commands above: % make install UNINST=1 If you are installing this module on a Win32 system with 'nmake', substitute 'nmake' for 'make' in the sequence of commands above. In sending e-mail to the maintainer, please put "ExtUtils::ModuleMaker", "ExtUtils-ModuleMaker" or "modulemaker" in the subject line. Original author: R. Geoffrey Avery CPAN ID: RGEOFFREY modulemaker@PlatypiVentures.com http://www.PlatypiVentures.com/perl/modules/ModuleMaker.shtml Maintainer since version 0.33: James E. Keenan CPAN ID: JKEENAN jkeenan@cpan.org Development repository: https://github.com/jkeenan/extutils-modulemaker Copyright (c) 2001-2002 R. Geoffrey Avery. Revisions from v0.33 forward (c) 2005-2017 James E. Keenan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. ExtUtils-ModuleMaker-0.56/t/0000755000175000017500000000000013043670323015504 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/t/01_ini.t0000644000175000017500000000134013043664013016745 0ustar jkeenanjkeenan# t/01_ini.t - check module loading use strict; use warnings; use Test::More tests => 5; # qw(no_plan); use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'File::Save::Home', qw| get_home_directory get_subhome_directory_status make_subhome_directory restore_subhome_directory_status | ); my ($realhome); ok( $realhome = get_home_directory(), "HOME or home-equivalent directory found on system"); my $mmkr_dir_ref = get_subhome_directory_status(".modulemaker"); my $mmkr_dir = make_subhome_directory($mmkr_dir_ref); ok( $mmkr_dir, "personal defaults directory found on system"); END { ok( restore_subhome_directory_status($mmkr_dir_ref), "original presence/absence of .modulemaker directory restored"); } ExtUtils-ModuleMaker-0.56/t/04_compact.t0000644000175000017500000000335512646313406017634 0ustar jkeenanjkeenan# t/04_compact.t use strict; use warnings; use Test::More tests => 25; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with Perl 5.6", (25 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); ####################################################################### my $mod; ok($mod = ExtUtils::ModuleMaker->new ( NAME => 'Sample::Module::Foo', COMPACT => 1, LICENSE => 'looselips', ), "call ExtUtils::ModuleMaker->new for Sample-Module-Foo"); ok( $mod->complete_build(), 'call complete_build()' ); ######################################################################## ok(chdir 'Sample-Module-Foo', "cd Sample-Module-Foo"); for (qw/Changes MANIFEST Makefile.PL LICENSE README lib t/) { ok (-e, "$_ exists"); } ######################################################################## my $filetext; { local *FILE; ok(open (FILE, 'LICENSE'), "reading 'LICENSE'"); $filetext = do {local $/; }; close FILE; } ok($filetext =~ m/Loose lips sink ships/, "correct LICENSE generated"); ######################################################################## ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/10_standard_text.t0000644000175000017500000000753212646313406021050 0ustar jkeenanjkeenan# t/10_standard_text.t # tests of importation of standard text from # lib/ExtUtils/Modulemaker/Defaults.pm use strict; use warnings; use Test::More tests => 43; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string read_file_array ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (43 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext, @makefilelines, @pmfilelines, @readmelines); ######################################################################## { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Beta'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); ok(@pmfilelines = read_file_array("lib/Alpha/${testmod}.pm"), 'Able to read module into array'); # test of main pod wrapper is( (grep {/^#{20} main pod documentation (begin|end)/} @pmfilelines), 2, "standard text for POD wrapper found"); # test of block new method is( (grep {/^sub new/} @pmfilelines), 1, "new method found"); # test of block module header description is( (grep {/^sub new/} @pmfilelines), 1, "new method found"); # test of stub documentation is( (grep {/^Stub documentation for this module was created/} @pmfilelines), 1, "stub documentation found"); # test of subroutine header is( (grep {/^#{20} subroutine header (begin|end)/} @pmfilelines), 2, "subroutine header found"); # test of final block is( (grep { /^(1;|# The preceding line will help the module return a true value)$/ } @pmfilelines), 2, "final module block found"); # test of Makefile text ok(@makefilelines = read_file_array('Makefile.PL'), 'Able to read Makefile.PL into array'); is( (grep {/^# See lib\/ExtUtils\/MakeMaker.pm for details of how to influence/} @makefilelines), 1, "Makefile.PL has standard text"); # test of README text ok(@readmelines = read_file_array('README'), 'Able to read README into array'); is( (grep {/^pod2text $mod->{NAME}/} @readmelines), 1, "README has correct pod2text line"); is( (grep {/^If this is still here/} @readmelines), 1, "README has correct top part"); is( (grep {/^(perl Makefile\.PL|make( (test|install))?)/} @readmelines), 4, "README has appropriate build instructions for MakeMaker"); is( (grep {/^If you are on a windows box/} @readmelines), 1, "README has correct bottom part"); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/06_build.t0000644000175000017500000000344412646313406017306 0ustar jkeenanjkeenan# t/06_build.t use strict; use warnings; use Test::More tests => 23; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string six_file_tests ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 and require Module::Build }; skip "tests require File::Temp, core with 5.6, and require Module::Build", (23 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); ######################################################################## my $mod; my $testmod = 'Gamma'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", ABSTRACT => 'Test of the capacities of EU::MM', COMPACT => 1, CHANGES_IN_POD => 1, BUILD_SYSTEM => 'Module::Build', AUTHOR => 'Phineas T. Bluster', CPANID => 'PTBLUSTER', ORGANIZATION => 'Peanut Gallery', WEBSITE => 'http://www.anonymous.com/~phineas', EMAIL => 'phineas@anonymous.com', ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); my ($filetext); ok($filetext = read_file_string('Build.PL'), 'Able to read Build.PL'); six_file_tests(7, $testmod); # first arg is # entries in MANIFEST ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/0000755000175000017500000000000013043670323017126 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/t/license/lgpl_2_1.t0000644000175000017500000000147312646313406020723 0ustar jkeenanjkeenan# t/license/lgpl_2_1.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'lgpl_2_1', qr/The GNU Lesser General Public License \(LGPL\)\s+Version 2\.1, February 1999/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/libpng.t0000644000175000017500000000140312646313406020570 0ustar jkeenanjkeenan# t/license/libpng.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'libpng', qr/The zlib\/libpng License/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/intel.t0000644000175000017500000000151112646313406020430 0ustar jkeenanjkeenan# t/license/intel.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'intel', qr/The Intel Open Source License for CDSA\/CSSM Implementation\s+\(BSD License with Export Notice\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/apache.t0000644000175000017500000000140212646313406020535 0ustar jkeenanjkeenan# t/license/apache.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'apache', qr/Apache Software License/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/sleepycat.t0000644000175000017500000000140612646313406021311 0ustar jkeenanjkeenan# t/license/sleepycat.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'sleepycat', qr/The Sleepycat License/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/gpl_2.t0000644000175000017500000000144212646313406020323 0ustar jkeenanjkeenan# t/license/gpl_2.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'gpl_2', qr/The General Public License \(GPL\)\s+Version 2, June 1991/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/nokia_1_0a.t0000644000175000017500000000145412646313406021224 0ustar jkeenanjkeenan# t/license/nokia_1_0a.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'nokia_1_0a', qr/Nokia Open Source License \(NOKOS License\) Version 1\.0a/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/nokos_1_0a.t0000644000175000017500000000145412646313406021254 0ustar jkeenanjkeenan# t/license/nokos_1_0a.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'nokos_1_0a', qr/Nokia Open Source License \(NOKOS License\) Version 1\.0a/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/sun.t0000644000175000017500000000142412646313406020125 0ustar jkeenanjkeenan# t/license/sun.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'sun', qr/Sun Internet Standards Source License \(SISSL\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/lgpl.t0000644000175000017500000000146312646313406020261 0ustar jkeenanjkeenan# t/license/lgpl.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'lgpl', qr/The GNU Lesser General Public License \(LGPL\)\s+Version 2\.1, February 1999/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/mitre.t0000644000175000017500000000144612646313406020444 0ustar jkeenanjkeenan# t/license/mitre.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'mitre', qr/MITRE Collaborative Virtual Workspace License \(CVW License\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/nethack.t0000644000175000017500000000141312646313406020733 0ustar jkeenanjkeenan# t/license/nethack.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'nethack', qr/Nethack General Public License/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/q_1_0.t0000644000175000017500000000141412646313406020216 0ustar jkeenanjkeenan# t/license/q_1_0.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'q_1_0', qr/The Q Public License\s+Version 1\.0/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/jabber.t0000644000175000017500000000142612646313406020547 0ustar jkeenanjkeenan# t/license/jabber.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'jabber', qr/Jabber Open Source License \(Version 1\.0\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/gpl.t0000644000175000017500000000143612646313406020105 0ustar jkeenanjkeenan# t/license/gpl.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'gpl', qr/The General Public License \(GPL\)\s+Version 2, June 1991/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/mit.t0000644000175000017500000000140012646313406020103 0ustar jkeenanjkeenan# t/license/mit.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'mit', qr/The MIT License\s+Copyright/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/ricoh_1_0.t0000644000175000017500000000144212646313406021063 0ustar jkeenanjkeenan# t/license/ricoh_1_0.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'ricoh_1_0', qr/Ricoh Source Code Public License \(Version 1\.0\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/nokia.t0000644000175000017500000000144212646313406020421 0ustar jkeenanjkeenan# t/license/nokia.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'nokia', qr/Nokia Open Source License \(NOKOS License\) Version 1\.0a/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/sissl.t0000644000175000017500000000143012646313406020452 0ustar jkeenanjkeenan# t/license/sissl.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'sissl', qr/Sun Internet Standards Source License \(SISSL\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/mpl.t0000644000175000017500000000141512646313406020110 0ustar jkeenanjkeenan# t/license/mpl.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'mpl', qr/Mozilla Public License 1\.1 \(MPL 1\.1\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/zlib.t0000644000175000017500000000137712646313406020267 0ustar jkeenanjkeenan# t/license/zlib.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'zlib', qr/The zlib\/libpng License/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/apache_1_1.t0000644000175000017500000000143012646313406021176 0ustar jkeenanjkeenan# t/license/apache_1_1.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'apache_1_1', qr/Apache Software License.*Version 1\.1/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/ibm.t0000644000175000017500000000141012646313406020062 0ustar jkeenanjkeenan# t/license/ibm.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'ibm', qr/IBM Public License Version \(1\.0\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/looselips.t0000644000175000017500000000434212646313406021333 0ustar jkeenanjkeenan# t/license/looselips.t use strict; use warnings; use Test::More tests => 33; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (33 - 11) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext, $license); { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Beta'; ok($mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, LICENSE => 'looselips', COPYRIGHT_YEAR => 1899, AUTHOR => "J E Keenan", ORGANIZATION => "The World Wide Webby", ), "object created for Alpha::$testmod"); ok($mod->complete_build(), "build files for Alpha::$testmod"); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('LICENSE'), 'Able to read LICENSE'); like($filetext, qr/Copyright \(c\) 1899 The World Wide Webby\. All rights reserved\./, "correct copyright year and organization" ); ok($license = $mod->get_license(), "license retrieved"); like($license, qr/^={69}\s+={69}.*?={69}\s+={69}.*?={69}\s+={69}/s, "formatting for license and copyright found as expected" ); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/mozilla_1_0.t0000644000175000017500000000146012646313406021426 0ustar jkeenanjkeenan# t/license/mozilla_1_0.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'mozilla_1_0', qr/Mozilla Public License \(Version 1\.0\)\s+1\. Definitions\./s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/ricoh.t0000644000175000017500000000143212646313406020423 0ustar jkeenanjkeenan# t/license/ricoh.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'ricoh', qr/Ricoh Source Code Public License \(Version 1\.0\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/artistic.t0000644000175000017500000000141512646313406021142 0ustar jkeenanjkeenan# t/license/artistic.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'artistic', qr/The Artistic License.*Preamble/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/jabber_1_0.t0000644000175000017500000000143612646313406021207 0ustar jkeenanjkeenan# t/license/jabber_1_0.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'jabber_1_0', qr/Jabber Open Source License \(Version 1\.0\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/artistic_agg.t0000644000175000017500000000152112646313406021756 0ustar jkeenanjkeenan# t/license/artistic_agg.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'artistic_agg', qr/The Artistic License.*Preamble.*Aggregation of this Package with a commercial distribution/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/mozilla.t0000644000175000017500000000142512646313406020770 0ustar jkeenanjkeenan# t/license/mozilla.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'mozilla', qr/Mozilla Public License 1\.1 \(MPL 1\.1\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/ibm_1_0.t0000644000175000017500000000142012646313406020522 0ustar jkeenanjkeenan# t/license/ibm_1_0.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'ibm_1_0', qr/IBM Public License Version \(1\.0\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/mpl_1_1.t0000644000175000017500000000142512646313406020551 0ustar jkeenanjkeenan# t/license/mpl_1_1.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'mpl_1_1', qr/Mozilla Public License 1\.1 \(MPL 1\.1\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/nokos.t0000644000175000017500000000144212646313406020451 0ustar jkeenanjkeenan# t/license/nokos.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'nokos', qr/Nokia Open Source License \(NOKOS License\) Version 1\.0a/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/bsd.t0000644000175000017500000000140012646313406020062 0ustar jkeenanjkeenan# t/license/bsd.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'bsd', qr/The BSD License\s+Copyright/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/mpl_1_0.t0000644000175000017500000000145012646313406020546 0ustar jkeenanjkeenan# t/license/mpl_1_0.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'mpl_1_0', qr/Mozilla Public License \(Version 1\.0\)\s+1\. Definitions\./s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/mozilla_1_1.t0000644000175000017500000000143512646313406021431 0ustar jkeenanjkeenan# t/license/mozilla_1_1.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'mozilla_1_1', qr/Mozilla Public License 1\.1 \(MPL 1\.1\)/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/vovida_1_0.t0000644000175000017500000000136312646313406021251 0ustar jkeenanjkeenan# t/license/vovida_1_0.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'vovida_1_0', qr//s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/vovida.t0000644000175000017500000000141312646313406020606 0ustar jkeenanjkeenan# t/license/vovida.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'vovida', qr/Vovida Software License v\. 1\.0/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/q.t0000644000175000017500000000140412646313406017556 0ustar jkeenanjkeenan# t/license/q.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'q', qr/The Q Public License\s+Version 1\.0/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/perl.t0000644000175000017500000000145112646313406020262 0ustar jkeenanjkeenan# t/license/perl.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'perl', qr/Terms of Perl itself.*GNU General Public License.*Artistic License/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/r_bsd.t0000644000175000017500000000141012646313406020404 0ustar jkeenanjkeenan# t/license/r_bsd.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'r_bsd', qr/The BSD License\s+The following/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/license/python.t0000644000175000017500000000143612646313406020644 0ustar jkeenanjkeenan# t/license/python.t use strict; use warnings; use Test::More tests => 17; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Licenses::Local' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status licensetest ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (17 - 11) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; licensetest($caller, 'python', qr/Python License\s+CNRI OPEN SOURCE LICENSE AGREEMENT/s ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/0000755000175000017500000000000013043670323017314 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/t/miscargs/918.t0000644000175000017500000000541012646313406020026 0ustar jkeenanjkeenan# t/miscargs/918.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 41; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (41 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my $odir = $statusref->{cwd}; my ($tdir, $mod, $testmod); ##### Set 18: Test of INCLUDE_FILE_IN_PM option ##### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Kappa'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, EXTRA_MODULES => [ { NAME => "Alpha::${testmod}::Gamma" }, { NAME => "Alpha::${testmod}::Delta" }, { NAME => "Alpha::${testmod}::Gamma::Epsilon" }, ], INCLUDE_FILE_IN_PM => "$odir/t/testlib/arbitrary.txt", ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README Todo | ); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", "lib/Alpha/${testmod}", "lib/Alpha/${testmod}/Gamma", ); my @pm_pred = ( "lib/Alpha/${testmod}.pm", "lib/Alpha/${testmod}/Gamma.pm", "lib/Alpha/${testmod}/Delta.pm", "lib/Alpha/${testmod}/Gamma/Epsilon.pm", ); my @t_pred = ( 't/001_load.t', 't/002_load.t', 't/003_load.t', 't/004_load.t', ); ok( -f, "file $_ exists" ) for ( @pm_pred, @t_pred); for my $pm (@pm_pred) { my $line = read_file_string($pm); like($line, qr<=pod.+INCLUDE_FILE_IN_PM.+sub marine \{}>s, "$pm contains pod header, key-value pair, sub"); } } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/921.t0000644000175000017500000000506012646313406020021 0ustar jkeenanjkeenan# t/miscargs/921.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; # use Test::More tests => 32; use Test::More qw(no_plan); use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (32 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); # Set 19: Set WEBSITE to empty string and verify that no blank line is # added to the .pm file author info section. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Lambda'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, AUTHOR => 'Phineas T. Bluster', CPANID => 'PTBLUSTER', ORGANIZATION => 'Peanut Gallery', WEBSITE => q{}, EMAIL => 'phineas@anonymous.com', ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README Todo | ); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", ); my @pm_pred = ( "lib/Alpha/${testmod}.pm", ); my @t_pred = ( 't/001_load.t', ); ok( -f, "file $_ exists" ) for ( @pm_pred, @t_pred); my $line = read_file_string("lib/Alpha/${testmod}.pm"); ok($line =~ m| Phineas\sT\.\sBluster\n \s+CPAN\sID:\s+PTBLUSTER\n \s+Peanut\sGallery\n \s+phineas\@anonymous\.com |xs, 'POD contains correct author info -- no WEBSITE'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/904.t0000644000175000017500000000314112646313406020020 0ustar jkeenanjkeenan# t/miscargs/904.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 16; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (16 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod); ##### Set 4: Tests of dump_keys_except() method. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Rho'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 0, VERBOSE => 1, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); my $dump; ok( $dump = $mod->dump_keys_except(qw| LicenseParts USAGE_MESSAGE |), 'call dump_keys_except()' ); my @dumplines = split(/\n/, $dump); my $excluded_keys_flag = 0; for my $m ( @dumplines ) { $excluded_keys_flag++ if $m =~ /^\s+'(LicenseParts|USAGE_MESSAGE)/; } #' is($excluded_keys_flag, 0, "keys intended to be excluded were excluded"); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/915.t0000644000175000017500000000404312646313406020024 0ustar jkeenanjkeenan# t/miscargs/915.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 31; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (31 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); ##### Set 15: Test of INCLUDE_POD_COVERAGE_TEST ############### ################## and INCLUDE_POD_TEST options ################ { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Phi'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, INCLUDE_POD_COVERAGE_TEST => 1, INCLUDE_POD_TEST => 1, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README Todo | ); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t", "t/pod-coverage.t", "t/pod.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/919.t0000644000175000017500000000513312646313406020031 0ustar jkeenanjkeenan# t/miscargs/919.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; # use Test::More tests => 32; use Test::More qw(no_plan); use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (32 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); # Set 19: Set CPANID to empty string and verify that no blank line is # added to the .pm file author info section. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Lambda'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, AUTHOR => 'Phineas T. Bluster', CPANID => q{},, ORGANIZATION => 'Peanut Gallery', WEBSITE => 'http://www.anonymous.com/~phineas', EMAIL => 'phineas@anonymous.com', ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README Todo | ); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", ); my @pm_pred = ( "lib/Alpha/${testmod}.pm", ); my @t_pred = ( 't/001_load.t', ); ok( -f, "file $_ exists" ) for ( @pm_pred, @t_pred); my $line = read_file_string("lib/Alpha/${testmod}.pm"); ok($line =~ m| Phineas\sT\.\sBluster\n [ \t]+Peanut\sGallery\n \s+phineas\@anonymous\.com\n \s+http:\/\/www\.anonymous\.com\/~phineas |xs, 'POD contains correct author info -- no CPANID'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/920.t0000644000175000017500000000514712646313406020026 0ustar jkeenanjkeenan# t/miscargs/920.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; # use Test::More tests => 32; use Test::More qw(no_plan); use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (32 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); # Set 19: Set ORGANIZATION to empty string and verify that no blank line is # added to the .pm file author info section. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Lambda'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, AUTHOR => 'Phineas T. Bluster', CPANID => 'PTBLUSTER', ORGANIZATION => q{}, WEBSITE => 'http://www.anonymous.com/~phineas', EMAIL => 'phineas@anonymous.com', ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README Todo | ); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", ); my @pm_pred = ( "lib/Alpha/${testmod}.pm", ); my @t_pred = ( 't/001_load.t', ); ok( -f, "file $_ exists" ) for ( @pm_pred, @t_pred); my $line = read_file_string("lib/Alpha/${testmod}.pm"); ok($line =~ m| Phineas\sT\.\sBluster\n \s+CPAN\sID:\s+PTBLUSTER\n [ \t]+phineas\@anonymous\.com\n \s+http:\/\/www\.anonymous\.com\/~phineas |xs, 'POD contains correct author info -- no ORGANIZATION'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/907.t0000644000175000017500000000412212646313406020023 0ustar jkeenanjkeenan# t/miscargs/907.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 31; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string read_file_array ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (31 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext, @filelines); ##### Set 7: Tests of NEED_POD and NEED_NEW_METHOD options ##### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Xi'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, NEED_POD => 0, NEED_NEW_METHOD => 0, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); ok(@filelines = read_file_array("lib/Alpha/${testmod}.pm"), 'Able to read module into array'); is( (grep {/^(sub new|=(head|cut))/} @filelines), 0, "no sub new() or POD correctly detected in module"); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/923.t0000644000175000017500000000450712646313406020030 0ustar jkeenanjkeenan# t/miscargs/923.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 30; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (32 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); # Test insertion of warnings in .pm files. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Lambda'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, AUTHOR => 'Phineas T. Bluster', CPANID => 'PTBLUSTER', ORGANIZATION => 'Peanut Gallery', EMAIL => 'phineas@anonymous.com', INCLUDE_ID_LINE => 1, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README Todo | ); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", ); my @pm_pred = ( "lib/Alpha/${testmod}.pm", ); my @t_pred = ( 't/001_load.t', ); ok( -f, "file $_ exists" ) for ( @pm_pred, @t_pred); my $line = read_file_string("lib/Alpha/${testmod}.pm"); ok($line =~ m| #$Id#\n use\sstrict;\n |xs, q<.pm file contains 'Id' string>); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/914.t0000644000175000017500000000357412646313406020033 0ustar jkeenanjkeenan# t/miscargs/914.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 29; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (29 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); ##### Set 14: Test of (negating) INCLUDE_TODO option ##### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Phi'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, INCLUDE_TODO => 0, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README | ); ok(! -f 'Todo', "Todo correctly not created" ); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/902.t0000644000175000017500000000460012646313406020017 0ustar jkeenanjkeenan# t/miscargs/902.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 33; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (33 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); use lib('t/testlib'); use_ok( 'IO::Capture::Stdout' ); my ($tdir, $mod, $testmod, $filetext); # Set 2: Test VERBOSE => 1 to make sure that logging messages # note each directory and file created. Non-compact top directory. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Gamma'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 0, VERBOSE => 1, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); my ($capture, %count); $capture = IO::Capture::Stdout->new(); $capture->start(); ok( $mod->complete_build(), 'call complete_build()' ); $capture->stop(); for my $l ($capture->read()) { $count{'mkdir'}++ if $l =~ /^mkdir/; $count{'writing'}++ if $l =~ /^writing file/; } is($count{'mkdir'}, 6, "correct no. of directories created announced verbosely"); is($count{'writing'}, 8, "correct no. of files created announced verbosely"); ok( -d qq{Alpha/$testmod}, "non-compact top-level directories exist" ); ok( chdir "Alpha/$testmod", "cd Alpha/$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib lib\/Alpha scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/917.t0000644000175000017500000000365712646313406020040 0ustar jkeenanjkeenan# t/miscargs/917.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 29; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (29 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); ##### Set 17: Test of (negating) INCLUDE_SCRIPTS_DIRECTORY option ##### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Phi'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, INCLUDE_SCRIPTS_DIRECTORY => 0, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib t/); ok(! -d 'scripts', "scripts directory correctly not created"); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README Todo | ); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/908.t0000644000175000017500000000446012646313406020031 0ustar jkeenanjkeenan# t/miscargs/908.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 37; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (37 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod); ######### Set #8: Test of EXTRA_MODULES Option ########## { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Sigma'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, EXTRA_MODULES => [ { NAME => "Alpha::${testmod}::Gamma" }, { NAME => "Alpha::${testmod}::Delta" }, { NAME => "Alpha::${testmod}::Gamma::Epsilon" }, ], ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", "lib/Alpha/${testmod}", "lib/Alpha/${testmod}/Gamma", ); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "lib/Alpha/${testmod}/Gamma.pm", "lib/Alpha/${testmod}/Delta.pm", "lib/Alpha/${testmod}/Gamma/Epsilon.pm", 't/001_load.t', 't/002_load.t', 't/003_load.t', 't/004_load.t', ); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/922.t0000644000175000017500000000452512646313406020027 0ustar jkeenanjkeenan# t/miscargs/922.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 30; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (32 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); # Test insertion of warnings in .pm files. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Lambda'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, AUTHOR => 'Phineas T. Bluster', CPANID => 'PTBLUSTER', ORGANIZATION => 'Peanut Gallery', EMAIL => 'phineas@anonymous.com', INCLUDE_WARNINGS => 1, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README Todo | ); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", ); my @pm_pred = ( "lib/Alpha/${testmod}.pm", ); my @t_pred = ( 't/001_load.t', ); ok( -f, "file $_ exists" ) for ( @pm_pred, @t_pred); my $line = read_file_string("lib/Alpha/${testmod}.pm"); ok($line =~ m| use\sstrict;\n use\swarnings;\n |xs, q<.pm file contains 'use warnings;'>); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/912.t0000644000175000017500000000603512646313406020024 0ustar jkeenanjkeenan# t/miscargs/912.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 39; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (39 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); ######### Set # 12: Test of EXTRA_MODULES Option ########## ########## with all tests in a single file ################# ########## with no number in test name ##################### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Sigma'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, EXTRA_MODULES => [ { NAME => "Alpha::${testmod}::Gamma" }, { NAME => "Alpha::${testmod}::Delta" }, { NAME => "Alpha::${testmod}::Gamma::Epsilon" }, ], EXTRA_MODULES_SINGLE_TEST_FILE => 1, TEST_NUMBER_FORMAT => undef, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", "lib/Alpha/${testmod}", "lib/Alpha/${testmod}/Gamma", ); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "lib/Alpha/${testmod}/Gamma.pm", "lib/Alpha/${testmod}/Delta.pm", "lib/Alpha/${testmod}/Gamma/Epsilon.pm", "t/load.t", ); $filetext = read_file_string("t/load.t"); my $number_line = q{use Test::More tests => 4;}; ok( (index($filetext, $number_line)) > -1, "test file lists predicted number in plan"); my @use = qw( Alpha::Sigma Alpha::Sigma::Gamma Alpha::Sigma::Delta Alpha::Sigma::Gamma::Epsilon ); foreach my $f (@use) { my $newstr = " use_ok( '$f' );"; ok( (index($filetext, $newstr)) > -1, "test file contains use_ok for $f"); } } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/916.t0000644000175000017500000000366712646313406020040 0ustar jkeenanjkeenan# t/miscargs/916.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 29; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (29 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); ##### Set 16: Test of (negation of) INCLUDE_LICENSE option ##### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Xi'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, INCLUDE_LICENSE => 0, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes Makefile.PL MANIFEST README Todo | ); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok(! -f 'LICENSE', "LICENSE correctly not created" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/913.t0000644000175000017500000000353712646313406020031 0ustar jkeenanjkeenan# t/miscargs/913.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 30; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (30 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); ##### Set 13: Test of INCLUDE_MANIFEST_SKIP option ##### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Phi'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, INCLUDE_MANIFEST_SKIP => 1, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw| Changes LICENSE Makefile.PL MANIFEST README Todo MANIFEST.SKIP | ); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/901.t0000644000175000017500000000455612646313406020030 0ustar jkeenanjkeenan# t/miscargs/901.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 32; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (32 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); use lib('t/testlib'); use_ok( 'IO::Capture::Stdout' ); my ($tdir, $mod, $testmod, $filetext); # Set 1: Test VERBOSE => 1 to make sure that logging messages # note each directory and file created; Compact top directory. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Beta'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, VERBOSE => 1, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); my ($capture, %count); $capture = IO::Capture::Stdout->new(); $capture->start(); ok( $mod->complete_build(), 'call complete_build()' ); $capture->stop(); for my $l ($capture->read()) { $count{'mkdir'}++ if $l =~ /^mkdir/; $count{'writing'}++ if $l =~ /^writing file/; } is($count{'mkdir'}, 5, "correct no. of directories created announced verbosely"); is($count{'writing'}, 8, "correct no. of files created announced verbosely"); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/910.t0000644000175000017500000000567512646313406020033 0ustar jkeenanjkeenan# t/miscargs/910.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 39; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (39 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); ######### Set # 10: Test of EXTRA_MODULES Option ########## ########## with all tests in a single file ################# { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Sigma'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, EXTRA_MODULES => [ { NAME => "Alpha::${testmod}::Gamma" }, { NAME => "Alpha::${testmod}::Delta" }, { NAME => "Alpha::${testmod}::Gamma::Epsilon" }, ], EXTRA_MODULES_SINGLE_TEST_FILE => 1, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", "lib/Alpha/${testmod}", "lib/Alpha/${testmod}/Gamma", ); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "lib/Alpha/${testmod}/Gamma.pm", "lib/Alpha/${testmod}/Delta.pm", "lib/Alpha/${testmod}/Gamma/Epsilon.pm", 't/001_load.t', ); $filetext = read_file_string("t/001_load.t"); my $number_line = q{use Test::More tests => 4;}; ok( (index($filetext, $number_line)) > -1, "test file lists predicted number in plan"); my @use = qw( Alpha::Sigma Alpha::Sigma::Gamma Alpha::Sigma::Delta Alpha::Sigma::Gamma::Epsilon ); foreach my $f (@use) { my $newstr = " use_ok( '$f' );"; ok( (index($filetext, $newstr)) > -1, "test file contains use_ok for $f"); } } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/905.t0000644000175000017500000000377612646313406020037 0ustar jkeenanjkeenan# t/miscargs/905.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 31; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string read_file_array ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (31 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext, @filelines); ##### Set 5: Test of NEED_POD option ##### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Phi'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, NEED_POD => 0, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); ok(@filelines = read_file_array("lib/Alpha/${testmod}.pm"), 'Able to read module into array'); is( (grep {/^=(head|cut)/} @filelines), 0, "no POD correctly detected in module"); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/911.t0000644000175000017500000000501412646313406020017 0ustar jkeenanjkeenan# t/miscargs/911.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 37; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (37 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod); ######### Set # 11: Test of EXTRA_MODULES Option ########## ########## with test names derived from module names ####### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Sigma'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, EXTRA_MODULES => [ { NAME => "Alpha::${testmod}::Gamma" }, { NAME => "Alpha::${testmod}::Delta" }, { NAME => "Alpha::${testmod}::Gamma::Epsilon" }, ], TEST_NAME_DERIVED_FROM_MODULE_NAME => 1, TEST_NUMBER_FORMAT => undef, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -d, "directory $_ exists" ) for ( "lib/Alpha", "lib/Alpha/${testmod}", "lib/Alpha/${testmod}/Gamma", ); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "lib/Alpha/${testmod}/Gamma.pm", "lib/Alpha/${testmod}/Delta.pm", "lib/Alpha/${testmod}/Gamma/Epsilon.pm", "t/Alpha_${testmod}.t", "t/Alpha_${testmod}_Gamma.t", "t/Alpha_${testmod}_Delta.t", "t/Alpha_${testmod}_Gamma_Epsilon.t", ); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/906.t0000644000175000017500000000401212646313406020020 0ustar jkeenanjkeenan# t/miscargs/906.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 31; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string read_file_array ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (31 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext, @filelines); ##### Set 6: Tests of NEED_NEW_METHOD option ##### { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Chi'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, NEED_NEW_METHOD => 0, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); ok(@filelines = read_file_array("lib/Alpha/${testmod}.pm"), 'Able to read module into array'); is( (grep {/^sub new/} @filelines), 0, "no sub new() correctly detected in module"); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/909.t0000644000175000017500000000370212646313406020030 0ustar jkeenanjkeenan# t/miscargs/909.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 30; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (30 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod, $filetext); # Set 9: Test VERSION for value other than 0.01; make sure it is quoted # in .pm file. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Beta'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, VERSION => q{0.3}, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); ok($filetext = read_file_string("lib/Alpha/$testmod.pm"), "Able to read lib/Alpha/$testmod.pm"); like($filetext, qr/\$VERSION\s+=\s+'0\.3'/, "VERSION number is correct and properly quoted"); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/miscargs/903.t0000644000175000017500000000314012646313406020016 0ustar jkeenanjkeenan# t/miscargs/903.t # tests of miscellaneous arguments passed to constructor use strict; use warnings; use Test::More tests => 16; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (16 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my ($tdir, $mod, $testmod); ##### Set 3: Tests of dump_keys() method. { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); $testmod = 'Tau'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 0, VERBOSE => 1, ABSTRACT => "Tau's the time for Perl", ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); my $dump; ok( $dump = $mod->dump_keys(qw| NAME ABSTRACT |), 'call dump_keys()' ); my @dumplines = split(/\n/, $dump); my $keys_shown_flag = 0; for my $m ( @dumplines ) { $keys_shown_flag++ if $m =~ /^\s+'(NAME|ABSTRACT)/; } #' is($keys_shown_flag, 2, "keys intended to be shown were shown"); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/05_abstract.t0000644000175000017500000000443012646313406020005 0ustar jkeenanjkeenan# t/05_abstract.t use strict; use warnings; use Test::More tests => 35; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string six_file_tests ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with Perl 5.6", (35 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); ######################################################################## my $mod; my $testmod = 'Beta'; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", ABSTRACT => 'Test of the capacities of EU::MM', COMPACT => 1, CHANGES_IN_POD => 1, AUTHOR => 'Phineas T. Bluster', CPANID => 'PTBLUSTER', ORGANIZATION => 'Peanut Gallery', WEBSITE => 'http://www.anonymous.com/~phineas', EMAIL => 'phineas@anonymous.com', ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); for ( qw/LICENSE Makefile.PL MANIFEST README Todo/) { ok( -f, "file $_ exists" ); } ok(! -f 'Changes', 'Changes file correctly not created'); for ( qw/lib scripts t/) { ok( -d, "directory $_ exists" ); } my ($filetext); ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); ok($filetext =~ m|AUTHOR\s+=>\s+.Phineas\sT.\sBluster|, 'Makefile.PL contains correct author'); ok($filetext =~ m|AUTHOR.*\(phineas\@anonymous\.com\)|, 'Makefile.PL contains correct e-mail'); ok($filetext =~ m|ABSTRACT\s+=>\s+'Test\sof\sthe\scapacities\sof\sEU::MM'|, 'Makefile.PL contains correct abstract'); six_file_tests(7, $testmod); # first arg is # entries in MANIFEST ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/03_quick.t0000644000175000017500000000610613043664013017311 0ustar jkeenanjkeenan# t/03_quick.t use strict; use warnings; use Test::More tests => 36; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with Perl 5.6", (36 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); ########################################################################### my $mod; ok($mod = ExtUtils::ModuleMaker->new ( NAME => 'Sample::Module'), "call ExtUtils::ModuleMaker->new for Sample-Module"); ok( $mod->complete_build(), 'call complete_build()' ); ######################################################################## ok(chdir "Sample/Module", "cd Sample/Module"); for (qw/Changes MANIFEST Makefile.PL LICENSE README lib t/) { ok (-e, "$_ exists"); } ######################################################################## my $filetext; { local *FILE; ok(open (FILE, 'LICENSE'), "reading 'LICENSE'"); $filetext = do {local $/; }; close FILE; } ok($filetext =~ m/Terms of Perl itself/, "correct LICENSE generated"); ######################################################################## # tests of inheritability of constructor # note: attributes must not be thought of as inherited because # constructor freshly repopulates data structure with default values my ($modparent, $modchild, $modgrandchild); ok($modparent = ExtUtils::ModuleMaker->new( NAME => 'Sample::Module', ABSTRACT => 'The quick brown fox' ), "call ExtUtils::ModuleMaker->new for Sample-Module"); isa_ok($modparent, "ExtUtils::ModuleMaker", "object is an EU::MM object"); is($modparent->{NAME}, 'Sample::Module', "NAME is correct"); is($modparent->{ABSTRACT}, 'The quick brown fox', "ABSTRACT is correct"); $modchild = $modparent->new( 'NAME' => 'Alpha::Beta', ABSTRACT => 'The quick brown fox' ); isa_ok($modchild, "ExtUtils::ModuleMaker", "constructor is inheritable"); is($modchild->{NAME}, 'Alpha::Beta', "new NAME is correct"); is($modchild->{ABSTRACT}, 'The quick brown fox', "ABSTRACT was correctly inherited"); ok($modgrandchild = $modchild->new( NAME => 'Gamma::Delta', ABSTRACT => 'The quick brown vixen' ), "call ExtUtils::ModuleMaker->new for Sample-Module"); isa_ok($modgrandchild, "ExtUtils::ModuleMaker", "object is an EU::MM object"); is($modgrandchild->{NAME}, 'Gamma::Delta', "NAME is correct"); is($modgrandchild->{ABSTRACT}, 'The quick brown vixen', "explicitly coded ABSTRACT is correct"); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/makedefaults/0000755000175000017500000000000013043670323020151 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/t/makedefaults/1201.t0000644000175000017500000000735112646313406020733 0ustar jkeenanjkeenan# t/makedefaults/1201.t # tests of options to make modulemaker selections default personal values use strict; use warnings; use Test::More tests => 38; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status check_MakefilePL ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (38 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my $cwd = $statusref->{cwd}; my ($tdir, $topdir, @pred); =pod TestingModality: Suppress any Personal::Defaults currently installed on system. Create a new EU::MM object. To be certain of values, require Testing::Defaults and explicitly call the default_values() method from that package. Build files and verify structure and content with tests previously developed. Then, call make_selections_defaults(). That installs a Personal::Defaults on system. Now create a second EU::MM object with new values for several keys. Build files from that object. Use tests previously developed to analyze the content of the Makefile.PL, the directory/file structure, etc. Then do cleanup: restore any Personal::Defaults which was originally on system. Verify that was done. =cut { $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); push @INC, "$cwd/t/testlib"; require ExtUtils::ModuleMaker::Testing::Defaults; my $testing_defaults_ref = ExtUtils::ModuleMaker::Testing::Defaults->default_values(); my $obj1 = ExtUtils::ModuleMaker->new( %{$testing_defaults_ref} ); isa_ok( $obj1, 'ExtUtils::ModuleMaker' ); ok( $obj1->complete_build(), 'call complete_build()' ); $topdir = "EU/MM/Testing/Defaults"; ok(-d $topdir, "by default, non-compact top directory created"); ok(-f "$topdir/$_", "$_ file created") for qw| Changes LICENSE MANIFEST Makefile.PL README Todo |; ok(-d "$topdir/$_", "$_ directory created") for qw| lib t |; @pred = ( q{EU::MM::Testing::Defaults}, qq{lib\/EU\/MM\/Testing\/Defaults\.pm}, qq{Hilton\\sStallone}, qq{hiltons\@parliamentarypictures\.com}, qq{Module\\sabstract\\s\\(<=\\s44\\scharacters\\)\\sgoes\\shere}, ); check_MakefilePL($topdir, \@pred); $obj1->make_selections_defaults(); ok(-f "$statusref->{mmkr_dir}/$statusref->{pers_file}", "new Personal::Defaults installed"); my $obj2 = ExtUtils::ModuleMaker->new( NAME => q{Ackus::Frackus}, AUTHOR => q{Marilyn Shmarilyn}, EMAIL => q{marilyns@nineteenthcenturyfox.com}, COMPACT => 1, ); isa_ok( $obj2, 'ExtUtils::ModuleMaker' ); ok( $obj2->complete_build(), 'call complete_build()' ); $topdir = "Ackus-Frackus"; ok(-d $topdir, "by choice, compact top directory created"); ok(-f "$topdir/$_", "$_ file created") for qw| Changes LICENSE MANIFEST Makefile.PL README Todo |; ok(-d "$topdir/$_", "$_ directory created") for qw| lib t |; @pred = ( q{Ackus::Frackus}, qq{lib\/Ackus\/Frackus\.pm}, qq{Marilyn\\sShmarilyn}, qq{marilyns\@nineteenthcenturyfox\.com}, qq{Module\\sabstract\\s\\(<=\\s44\\scharacters\\)\\sgoes\\shere}, ); check_MakefilePL($topdir, \@pred); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/makedefaults/1202.t0000644000175000017500000000615112646313406020731 0ustar jkeenanjkeenan# t/makedefaults/1202.t # tests of options to make modulemaker selections default personal values use strict; use warnings; use Test::More tests => 38; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status check_MakefilePL ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (38 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my $cwd = $statusref->{cwd}; my ($tdir, $topdir, @pred); { # same test as above, only passing SAVE_AS_DEFAULTS to constructor $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); push @INC, "$cwd/t/testlib"; require ExtUtils::ModuleMaker::Testing::Defaults; my $testing_defaults_ref = ExtUtils::ModuleMaker::Testing::Defaults->default_values(); my $obj1 = ExtUtils::ModuleMaker->new( %{$testing_defaults_ref}, SAVE_AS_DEFAULTS => 1, ); isa_ok( $obj1, 'ExtUtils::ModuleMaker' ); ok( $obj1->complete_build(), 'call complete_build()' ); $topdir = "EU/MM/Testing/Defaults"; ok(-d $topdir, "by default, non-compact top directory created"); ok(-f "$topdir/$_", "$_ file created") for qw| Changes LICENSE MANIFEST Makefile.PL README Todo |; ok(-d "$topdir/$_", "$_ directory created") for qw| lib t |; @pred = ( q{EU::MM::Testing::Defaults}, qq{lib\/EU\/MM\/Testing\/Defaults\.pm}, qq{Hilton\\sStallone}, qq{hiltons\@parliamentarypictures\.com}, qq{Module\\sabstract\\s\\(<=\\s44\\scharacters\\)\\sgoes\\shere}, ); check_MakefilePL($topdir, \@pred); ok(-f "$statusref->{mmkr_dir}/$statusref->{pers_file}", "new Personal::Defaults installed"); my $obj2 = ExtUtils::ModuleMaker->new( NAME => q{Ackus::Frackus}, AUTHOR => q{Marilyn Shmarilyn}, EMAIL => q{marilyns@nineteenthcenturyfox.com}, COMPACT => 1, ); isa_ok( $obj2, 'ExtUtils::ModuleMaker' ); ok( $obj2->complete_build(), 'call complete_build()' ); $topdir = "Ackus-Frackus"; ok(-d $topdir, "by choice, compact top directory created"); ok(-f "$topdir/$_", "$_ file created") for qw| Changes LICENSE MANIFEST Makefile.PL README Todo |; ok(-d "$topdir/$_", "$_ directory created") for qw| lib t |; @pred = ( q{Ackus::Frackus}, qq{lib\/Ackus\/Frackus\.pm}, qq{Marilyn\\sShmarilyn}, qq{marilyns\@nineteenthcenturyfox\.com}, qq{Module\\sabstract\\s\\(<=\\s44\\scharacters\\)\\sgoes\\shere}, ); check_MakefilePL($topdir, \@pred); } ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/0000755000175000017500000000000013043670323017256 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/t/failsafe/204.t0000644000175000017500000000146312646313406017760 0ustar jkeenanjkeenan# t/failsafe/204.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' => 'My::B!ad::Module', ], "^Module NAME contains illegal characters", "Constructor correctly failed due to illegal characters in module name" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/211.t0000644000175000017500000000156312646313406017757 0ustar jkeenanjkeenan# t/failsafe/211.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' => 'ABC::XYZ', 'LICENSE' => 'dka;fkkj3o9jflvbkja0 lkasd;ldfkJKD38kdd;llk45', ], "^LICENSE is not recognized", "Constructor correctly failed due to unrecognized LICENSE" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/208.t0000644000175000017500000000156712646313406017771 0ustar jkeenanjkeenan# t/failsafe/208.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' => 'ABC::XYZ', 'AUTHOR' => 'James E Keenan', 'CPANID' => 'AB', ], "^CPAN IDs are 3-9 characters", "Constructor correctly failed due to CPANID < 3 characters" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/203.t0000644000175000017500000000147212646313406017757 0ustar jkeenanjkeenan# t/failsafe/203.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'ABSTRACT' => 'The quick brown fox jumps over the lazy dog', ], "^NAME is required", "Constructor correctly failed due to lack of NAME for module" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/206.t0000644000175000017500000000161512646313406017761 0ustar jkeenanjkeenan# t/failsafe/206.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' => 'ABC::XYZ', 'ABSTRACT' => '123456789012345678901234567890123456789012345', ], "^ABSTRACTs are limited to 44 characters", "Constructor correctly failed due to ABSTRACT > 44 characters" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/201.t0000644000175000017500000000143312646313406017752 0ustar jkeenanjkeenan# t/failsafe/201.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' ], "^Must be hash or balanced list of key-value pairs:", "Constructor correctly failed due to odd number of arguments" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/202.t0000644000175000017500000000146112646313406017754 0ustar jkeenanjkeenan# t/failsafe/202.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' => 'Jim', 'ABSTRACT' ], "^Must be hash or balanced list of key-value pairs:", "Constructor correctly failed due to odd number of arguments" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/205.t0000644000175000017500000000144712646313406017763 0ustar jkeenanjkeenan# t/failsafe/205.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' => "My'BadModule", ], "^Module NAME contains illegal characters", "Perl 4-style single-quote path separators no longer supported" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/209.t0000644000175000017500000000161712646313406017766 0ustar jkeenanjkeenan# t/failsafe/209.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' => 'ABC::XYZ', 'AUTHOR' => 'James E Keenan', 'EMAIL' => 'jkeenancpan.org', ], "^EMAIL addresses need to have an at sign", "Constructor correctly failed; e-mail must have '\@' sign" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/207.t0000644000175000017500000000157712646313406017771 0ustar jkeenanjkeenan# t/failsafe/207.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' => 'ABC::DEF', 'AUTHOR' => 'James E Keenan', 'CPANID' => 'ABCDEFGHIJ', ], "^CPAN IDs are 3-9 characters", "Constructor correctly failed due to CPANID > 9 characters" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/failsafe/210.t0000644000175000017500000000164712646313406017761 0ustar jkeenanjkeenan# t/failsafe/210.t use strict; use warnings; use Test::More tests => 13; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( failsafe _save_pretesting_status _restore_pretesting_status ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 }; skip "failsafe requires File::Temp, core with Perl 5.6", (13 - 10) if $@; use warnings; my $caller = 'ExtUtils::ModuleMaker'; failsafe($caller, [ 'NAME' => 'ABC::XYZ', 'AUTHOR' => 'James E Keenan', 'WEBSITE' => 'ftp://ftp.perl.org', ], "^WEBSITEs should start with an \"http:\" or \"https:\"", "Constructor correctly failed; websites start 'http' or 'https'" ); ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/07_proxy.t0000644000175000017500000000730712646313406017373 0ustar jkeenanjkeenan# t/07_proxy.t use strict; use warnings; use Test::More tests => 57; use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( _save_pretesting_status _restore_pretesting_status read_file_string six_file_tests ) ); my $statusref = _save_pretesting_status(); SKIP: { eval { require 5.006_001 and require Module::Build }; skip "tests require File::Temp, core with 5.6, and require Module::Build", (57 - 10) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); my $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); ######################################################################## my ($mod, $filetext); my $testmod = 'Delta'; ########## Variant: 'Module::Build and proxy Makefile.PL' ########## ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", ABSTRACT => 'Test of the capacities of EU::MM', COMPACT => 1, CHANGES_IN_POD => 1, BUILD_SYSTEM => 'Module::Build and proxy Makefile.PL', AUTHOR => 'Phineas T. Bluster', CPANID => 'PTBLUSTER', ORGANIZATION => 'Peanut Gallery', WEBSITE => 'http://www.anonymous.com/~phineas', EMAIL => 'phineas@anonymous.com', ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); for ( qw/Build.PL LICENSE Makefile.PL MANIFEST README Todo/) { ok( -f, "file $_ exists" ); } ok(! -f 'Changes', 'Changes file correctly not created'); for ( qw/lib scripts t/) { ok( -d, "directory $_ exists" ); } ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); ok($filetext =~ m|Module::Build::Compat|, 'Makefile.PL will call Module::Build or install it'); ok($filetext = read_file_string('Build.PL'), 'Able to read Build.PL'); six_file_tests(8, $testmod); # first arg is # entries in MANIFEST ########## Variant: 'Module::Build and Proxy' ########## ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", ABSTRACT => 'Test of the capacities of EU::MM', COMPACT => 1, CHANGES_IN_POD => 1, BUILD_SYSTEM => 'Module::Build and Proxy', AUTHOR => 'Phineas T. Bluster', CPANID => 'PTBLUSTER', ORGANIZATION => 'Peanut Gallery', WEBSITE => 'http://www.anonymous.com/~phineas', EMAIL => 'phineas@anonymous.com', ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); for ( qw/Build.PL LICENSE Makefile.PL MANIFEST README Todo/) { ok( -f, "file $_ exists" ); } ok(! -f 'Changes', 'Changes file correctly not created'); for ( qw/lib scripts t/) { ok( -d, "directory $_ exists" ); } ok($filetext = read_file_string('Makefile.PL'), 'Able to read Makefile.PL'); ok($filetext =~ m|Module::Build::Compat|, 'Makefile.PL will call Module::Build or install it'); ok($filetext = read_file_string('Build.PL'), 'Able to read Build.PL'); six_file_tests(8, $testmod); # first arg is # entries in MANIFEST ok(chdir $statusref->{cwd}, "changed back to original directory"); } # end SKIP block END { _restore_pretesting_status($statusref); } ExtUtils-ModuleMaker-0.56/t/13_alt_block_new_method.t0000644000175000017500000000573012646313406022350 0ustar jkeenanjkeenan# t/13_alt_block_new_method.t # test whether methods overriding those provided by EU::MM::StandardText # create files as intended use strict; use warnings; use Test::More tests => 40; # qw(no_plan); use_ok( 'ExtUtils::ModuleMaker' ); use_ok( 'Cwd'); use_ok( 'ExtUtils::ModuleMaker::Auxiliary', qw( read_file_string _subclass_preparatory_tests _subclass_cleanup_tests ) ); use_ok( 'File::Copy' ); use Carp; my $odir = cwd(); my $prepref = _subclass_preparatory_tests($odir); my $persref = $prepref->{persref}; my $pers_def_ref = $prepref->{pers_def_ref}; my %els1 = %{ $prepref->{initial_els_ref} }; my $eumm_dir = $prepref->{eumm_dir}; my $mmkr_dir_ref = $prepref->{mmkr_dir_ref}; SKIP: { eval { require 5.006_001 }; skip "tests require File::Temp, core with 5.6", (40 - 20) if $@; use warnings; use_ok( 'File::Temp', qw| tempdir |); ######################################################################## { # Set: Alt_block_new_method # real tests go here my $alt = 'Alt_block_new_method.pm'; copy( "$prepref->{sourcedir}/$alt", "$eumm_dir/$alt") or die "Unable to copy $alt for testing: $!"; ok(-f "$eumm_dir/$alt", "file copied for testing"); my $testmod = 'Beta'; my $mod; ok( $mod = ExtUtils::ModuleMaker->new( NAME => "Alpha::$testmod", COMPACT => 1, ALT_BUILD => q{ExtUtils::ModuleMaker::Alt_block_new_method}, ), "call ExtUtils::ModuleMaker->new for Alpha-$testmod" ); ok( $mod->complete_build(), 'call complete_build()' ); ok( -d qq{Alpha-$testmod}, "compact top-level directory exists" ); ok( chdir "Alpha-$testmod", "cd Alpha-$testmod" ); ok( -d, "directory $_ exists" ) for ( qw/lib scripts t/); ok( -f, "file $_ exists" ) for ( qw/Changes LICENSE Makefile.PL MANIFEST README Todo/); ok( -f, "file $_ exists" ) for ( "lib/Alpha/${testmod}.pm", "t/001_load.t" ); my $filetext = read_file_string("lib/Alpha/${testmod}.pm"); my $newstr = <<'ENDNEW'; sub new { my $class = shift; my $self = bless ({}, $class); return $self; } ENDNEW ok( (index($filetext, $newstr)) > -1, "string present in file as predicted"); unlink( "$eumm_dir/$alt" ) or croak "Unable to unlink $alt for testing: $!"; ok(! -f "$eumm_dir/$alt", "file $alt deleted after testing"); # end of real tests } # end of Set ok(chdir $odir, "changed back to original directory"); } # end SKIP block END { _subclass_cleanup_tests( { persref => $persref, pers_def_ref => $pers_def_ref, eumm_dir => $eumm_dir, initial_els_ref => \%els1, odir => $odir, mmkr_dir_ref => $mmkr_dir_ref, } ); } ExtUtils-ModuleMaker-0.56/t/testlib/0000755000175000017500000000000013043670323017152 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/t/testlib/ExtUtils/0000755000175000017500000000000013043670323020733 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/t/testlib/ExtUtils/ModuleMaker/0000755000175000017500000000000013043670323023140 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/t/testlib/ExtUtils/ModuleMaker/Alt_block_new_method.pm0000644000175000017500000000153612355615154027614 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker::Alt_block_new_method; use strict; local $^W = 1; use File::Path; use Carp; =head3 C Usage : $self->block_new_method() within text_pm_file() Purpose : Build 'new()' method as part of a pm file Returns : String holding sub new. Argument : $module: pointer to the module being built (as there can be more than one module built by EU::MM); for the primary module it is a pointer to $self Throws : n/a Comment : This method is a likely candidate for alteration in a subclass, e.g., pass a single hash-ref to new() instead of a list of parameters. =cut sub block_new_method { my $self = shift; return <<'EOFBLOCK'; sub new { my $class = shift; my $self = bless ({}, $class); return $self; } EOFBLOCK } 1; ExtUtils-ModuleMaker-0.56/t/testlib/ExtUtils/ModuleMaker/Testing/0000755000175000017500000000000013043670323024555 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/t/testlib/ExtUtils/ModuleMaker/Testing/Defaults.pm0000644000175000017500000000347012355615154026674 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker::Testing::Defaults; # as of 08/24/2005 use strict; local $^W = 1; my $usage = < q{EU::MM::Testing::Defaults}, LICENSE => q{perl}, VERSION => 0.01, ABSTRACT => q{Module abstract (<= 44 characters) goes here}, AUTHOR => q{Hilton Stallone}, CPANID => q{RAMBO}, ORGANIZATION => q{Parliamentary Pictures}, WEBSITE => q{http://parliamentarypictures.com}, EMAIL => q{hiltons@parliamentarypictures.com}, BUILD_SYSTEM => q{ExtUtils::MakeMaker}, COMPACT => 0, VERBOSE => 0, INTERACTIVE => 0, NEED_POD => 1, NEED_NEW_METHOD => 1, CHANGES_IN_POD => 0, PERMISSIONS => 0755, SAVE_AS_DEFAULTS => 0, USAGE_MESSAGE => $usage, FIRST_TEST_NUMBER => 1, TEST_NUMBER_FORMAT => "%03d", TEST_NAME => 'load', EXTRA_MODULES_SINGLE_TEST_FILE => 0, TEST_NAME_DERIVED_FROM_MODULE_NAME => 0, TEST_NAME_SEPARATOR => q{_}, INCLUDE_MANIFEST_SKIP => 0, INCLUDE_TODO => 1, INCLUDE_POD_COVERAGE_TEST => 0, INCLUDE_POD_TEST => 0, INCLUDE_LICENSE => 1, INCLUDE_SCRIPTS_DIRECTORY => 1, INCLUDE_FILE_IN_PM => 0, ); sub default_values { my $self = shift; return { %default_values }; } 1; ExtUtils-ModuleMaker-0.56/t/testlib/arbitrary.txt0000644000175000017500000000121312355615154021715 0ustar jkeenanjkeenan=pod This is an illustration of arbitrary text to be inserted into each of the lib/*.pm files created by a particular run of ExtUtils::ModuleMaker. By default, this code is placed after any constructor and before the main POD block. If you want to put it elsewhere, you should subclass ExtUtils::ModuleMaker::StandardText::compose_pm_file(). You may include both POD and code, as illustrated here. To include this code in the lib/*.pm files in your distribution, pass a key-value pair like the following to ExtUtils::ModuleMaker::new(): INCLUDE_FILE_IN_PM => qq{/path/to/some/arbitrary.txt}; =cut sub declare {} sub init {} sub marine {} ExtUtils-ModuleMaker-0.56/lib/0000755000175000017500000000000013043670323016007 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/lib/ExtUtils/0000755000175000017500000000000013043670323017570 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker/0000755000175000017500000000000013043670323021775 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker/Initializers.pm0000644000175000017500000001540313043670123025002 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker::Initializers; use strict; use warnings; use vars qw( $VERSION ); $VERSION = 0.56; use ExtUtils::ModuleMaker::Licenses::Standard qw( Get_Standard_License Verify_Standard_License ); use ExtUtils::ModuleMaker::Licenses::Local qw( Get_Local_License Verify_Local_License ); =head1 NAME ExtUtils::ModuleMaker::Initializers - Methods used within C and C =head1 DESCRIPTION The methods described below are 'quasi-private' methods which are called by certain publicly available methods of ExtUtils::ModuleMaker and ExtUtils::ModuleMaker::Interactive. They are 'quasi-private' in the sense that they are not intended to be called by the everyday user of ExtUtils::ModuleMaker. Nothing prevents a user from calling these methods, but they are documented here primarily so that users writing plug-ins for ExtUtils::ModuleMaker will know what methods need to be subclassed. I The methods below are called in C but not in that same package's C. For methods called in C, please see ExtUtils::ModuleMaker::StandardText. Some of the methods below are also called within methods in ExtUtils::ModuleMaker::Interactive. Subclassers: At ExtUtils::ModuleMaker's current state of development, it is recommended that you I subclass these methods but instead focus your efforts on subclassing the methods in ExtUtils::ModuleMaker::StandardText. The latter package's methods focus more closely on the structure and content of the files built by ExtUtils::ModuleMaker. Happy subclassing! =head1 METHODS =head2 Methods Called within C =head3 C Usage : $self->set_author_composite() within new() and Interactive::Main_Menu() Purpose : Sets $self key COMPOSITE by composing it from $self keys AUTHOR, CPANID, ORGANIZATION, EMAIL and WEBSITE Returns : n/a Argument : n/a Comment : =cut sub set_author_composite { my $self = shift; my ($cpan_message, $org, $web, $composite); $cpan_message = "CPAN ID: $self->{CPANID}" if $self->{CPANID}; $org = $self->{ORGANIZATION} if $self->{ORGANIZATION}; $web = $self->{WEBSITE} if $self->{WEBSITE}; my @data = ( $self->{AUTHOR}, $cpan_message, $org, $self->{EMAIL}, $web, ); $composite = " $data[0]"; for my $el (@data[1..$#data]) { $composite .= "\n $el" if defined $el; } $self->{COMPOSITE} = $composite; } =head3 C Usage : $self->set_file_composite() within new() Purpose : Sets $self key COMPOSITE by composing it from $self key NAME Returns : n/a Argument : n/a Comment : =cut sub set_file_composite { my $self = shift; my @layers = split( /::/, $self->{NAME} ); my $file = pop(@layers); $file .= '.pm'; my $dir = join( '/', 'lib', @layers ); $self->{FILE} = join( '/', $dir, $file ); } =head3 C Usage : $self->set_dates() within new() Purpose : Sets 3 keys in $self: year, timestamp and COPYRIGHT_YEAR Returns : n/a Argument : n/a Comment : =cut sub set_dates { my $self = shift; $self->{year} = (localtime)[5] + 1900; $self->{timestamp} = scalar localtime; $self->{COPYRIGHT_YEAR} ||= $self->{year}; } =head3 C Usage : $self->validate_values() within complete_build() and Interactive::Main_Menu() Purpose : Verify module values are valid and complete. Returns : Error message if there is a problem Argument : n/a Throws : Will die with a death_message if errors and not interactive. Comment : References many $self keys =cut sub validate_values { my $self = shift; # Key: short-hand name for error condition # Value: anonymous array holding: # [0]: error message # [1]: condition which will generate error message if evals true my %error_msg = ( NAME_REQ => [ q{NAME is required}, eval { ! $self->{NAME}; }, ], NAME_ILLEGAL => [ q{Module NAME contains illegal characters}, eval { $self->{NAME} and $self->{NAME} !~ m/^[\w:]+$/; }, ], ABSTRACT => [ q{ABSTRACTs are limited to 44 characters}, eval { length( $self->{ABSTRACT} ) > 44; }, ], CPANID => [ q{CPAN IDs are 3-9 characters}, eval { $self->{CPANID} and $self->{CPANID} !~ m/^\w{3,9}$/; }, ], EMAIL => [ q{EMAIL addresses need to have an at sign}, eval { $self->{EMAIL} !~ m/.*\@.*/; }, ], WEBSITE => [ q{WEBSITEs should start with an "http:" or "https:"}, eval { $self->{WEBSITE} and $self->{WEBSITE} !~ m{https?://.*}; }, ], LICENSE => [ q{LICENSE is not recognized}, eval { ! ( Verify_Local_License($self->{LICENSE}) || Verify_Standard_License($self->{LICENSE}) ); }, ], ); # Errors should be checked in the following order my @msgs_ordered = qw( NAME_REQ NAME_ILLEGAL ABSTRACT CPANID EMAIL WEBSITE LICENSE ); my @errors; foreach my $attr ( @msgs_ordered ) { push @errors, $error_msg{$attr}[0] if $error_msg{$attr}[1]; } return 1 unless @errors; $self->death_message(\@errors); } =head3 C Usage : $self->initialize_license() within new() and Interactive::License_Menu Purpose : Gets appropriate license and, where necessary, fills in 'blanks' with information such as COPYRIGHT_YEAR, AUTHOR and ORGANIZATION; sets $self keys LICENSE and LicenseParts Returns : n/a Argument : n/a Comment : =cut sub initialize_license { my $self = shift; $self->{LICENSE} = lc( $self->{LICENSE} ); my $license_function = Get_Local_License( $self->{LICENSE} ) || Get_Standard_License( $self->{LICENSE} ); if ( ref($license_function) eq 'CODE' ) { $self->{LicenseParts} = $license_function->(); $self->{LicenseParts}{LICENSETEXT} =~ s/###year###/$self->{COPYRIGHT_YEAR}/ig; $self->{LicenseParts}{LICENSETEXT} =~ s/###owner###/$self->{AUTHOR}/ig; $self->{LicenseParts}{LICENSETEXT} =~ s/###organization###/$self->{ORGANIZATION}/ig; } } =head1 SEE ALSO F. =cut 1; ExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker/StandardText.pm0000644000175000017500000007137113043670123024747 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker::StandardText; #$Id$ use strict; use warnings; use vars qw ( $VERSION ); $VERSION = 0.56; use ExtUtils::ModuleMaker::Licenses::Standard qw( Get_Standard_License Verify_Standard_License ); use ExtUtils::ModuleMaker::Licenses::Local qw( Get_Local_License Verify_Local_License ); use File::Path; use File::Spec; use Carp; =head1 NAME ExtUtils::ModuleMaker::StandardText - Methods used within ExtUtils::ModuleMaker =head1 DESCRIPTION The methods described below are 'quasi-private' methods which are called by the publicly available methods of ExtUtils::ModuleMaker and ExtUtils::ModuleMaker::Interactive. They are 'quasi-private' in the sense that they are not intended to be called by the everyday user of ExtUtils::ModuleMaker. Nothing prevents a user from calling these methods, but they are documented here primarily so that users writing plug-ins for ExtUtils::ModuleMaker's standard text will know what methods need to be subclassed. The methods below are called in C but not in that same package's C. For methods called in C, please see ExtUtils::ModuleMaker::Initializers. The descriptions below are presented in hierarchical order rather than alphabetically. The order is that of ''how close to the surface can a particular method called?'', where 'surface' means being called within C. So methods called within C are described before methods which are only called within other quasi-private methods. Some of the methods described are also called within ExtUtils::ModuleMaker::Interactive methods. And some quasi-private methods are called within both public and other quasi-private methods. Within each heading, methods are presented more or less as they are first called within the public or higher-order quasi-private methods. Happy subclassing! =head1 METHODS =head2 Methods Called within C =head3 C Usage : $self->create_base_directory within complete_build() Purpose : Create the directory where all the files will be created. Returns : $DIR = directory name where the files will live Argument : n/a Comment : $self keys Base_Dir, COMPACT, NAME. Calls method create_directory. =cut sub create_base_directory { my $self = shift; $self->{Base_Dir} = File::Spec->rel2abs( join( ( $self->{COMPACT} ) ? q{-} : q{/}, split( /::/, $self->{NAME} ) ) ); $self->create_directory( $self->{Base_Dir} ); } =head3 C Usage : create_directory( [ I ] ) in complete_build; create_base_directory; create_pm_basics Purpose : Creates directory(ies) requested. Returns : n/a Argument : Reference to an array holding list of directories to be created. Comment : Essentially a wrapper around File::Path::mkpath. Will use values in $self keys VERBOSE and PERMISSIONS to provide 2nd and 3rd arguments to mkpath if requested. Comment : Adds to death message in event of failure. =cut sub create_directory { my $self = shift; return mkpath( \@_, $self->{VERBOSE}, $self->{PERMISSIONS} ); $self->death_message( [ "Can't create a directory: $!" ] ); } =head3 C Usage : $self->print_file($filename, $filetext) within complete_build() Purpose : Adds the file being created to MANIFEST, then prints text to new file. Logs file creation under verbose. Adds info for death_message in event of failure. Returns : n/a Argument : 2 arguments: filename and text to be printed Comment : =cut sub print_file { my ( $self, $filename, $filetext ) = @_; push( @{ $self->{MANIFEST} }, $filename ) unless ( $filename eq 'MANIFEST' ); $self->log_message( qq{writing file '$filename'}); my $file = File::Spec->catfile( $self->{Base_Dir}, $filename ); local *FILE; open( FILE, ">$file" ) or $self->death_message( [ qq{Could not write '$filename', $!} ] ); print FILE $filetext; close FILE; } =head2 Methods Called within C as an Argument to C =head3 C Usage : $self->text_README() within complete_build() Purpose : Build README Returns : String holding text of README Argument : n/a Throws : n/a Comment : This method is a likely candidate for alteration in a subclass =cut sub text_README { my $self = shift; my %README_text = ( eumm_instructions => <<'END_OF_MAKE', perl Makefile.PL make make test make install END_OF_MAKE mb_instructions => <<'END_OF_BUILD', perl Build.PL ./Build ./Build test ./Build install END_OF_BUILD readme_top => <<'END_OF_TOP', If this is still here it means the programmer was too lazy to create the readme file. You can create it now by using the command shown above from this directory. At the very least you should be able to use this set of instructions to install the module... END_OF_TOP readme_bottom => <<'END_OF_BOTTOM', If you are on a windows box you should use 'nmake' rather than 'make'. END_OF_BOTTOM ); my $pod2textline = "pod2text $self->{NAME}.pm > README\n"; my $build_instructions = ( $self->{BUILD_SYSTEM} eq 'ExtUtils::MakeMaker' ) ? $README_text{eumm_instructions} : $README_text{mb_instructions}; return $pod2textline . $README_text{readme_top} . $build_instructions . $README_text{readme_bottom}; } =head3 C Usage : $self->text_Todo() within complete_build() Purpose : Composes text for Todo file Returns : String with text of Todo file Argument : n/a Throws : n/a Comment : This method is a likely candidate for alteration in a subclass Comment : References $self key NAME =cut sub text_Todo { my $self = shift; my $text = <{NAME} - Nothing yet EOF return $text; } =head3 C Usage : $self->text_Changes($only_in_pod) within complete_build; block_pod() Purpose : Composes text for Changes file Returns : String holding text for Changes file Argument : $only_in_pod: True value to get only a HISTORY section for POD False value to get whole Changes file Throws : n/a Comment : This method is a likely candidate for alteration in a subclass Comment : Accesses $self keys NAME, VERSION, timestamp, eumm_version =cut sub text_Changes { my ( $self, $only_in_pod ) = @_; my $text_of_Changes; unless ($only_in_pod) { $text_of_Changes = <{NAME} $self->{VERSION} $self->{timestamp} - original version; created by ExtUtils::ModuleMaker $self->{eumm_version} EOF } else { $text_of_Changes = <{VERSION} $self->{timestamp} - original version; created by ExtUtils::ModuleMaker $self->{eumm_version} EOF } return $text_of_Changes; } =head3 C Usage : $self->text_test within complete_build($testnum, $module) Purpose : Composes text for a test for each pm file being requested in call to EU::MM Returns : String holding complete text for a test file. Argument : Two arguments: $testnum and $module Throws : n/a Comment : This method is a likely candidate for alteration in a subclass Will make a test with or without a checking for method new. =cut sub text_test { my ( $self, $testfilename, $module ) = @_; my $name = $self->process_attribute( $module, 'NAME' ); my $neednew = $self->process_attribute( $module, 'NEED_NEW_METHOD' ); my %test_file_texts; $test_file_texts{neednew} = < 2; BEGIN { use_ok( '$module->{NAME}' ); } my \$object = ${name}->new (); isa_ok (\$object, '$module->{NAME}'); MFNN $test_file_texts{zeronew} = < 1; BEGIN { use_ok( '$module->{NAME}' ); } MFZN return $neednew ? $test_file_texts{neednew} : $test_file_texts{zeronew}; } sub text_test_multi { my ( $self, $testfilename, $pmfilesref ) = @_; my @pmfiles = @{$pmfilesref}; my $top = < } . scalar(@pmfiles) . q{;}; my $begin_block = "BEGIN {\n"; foreach my $f (@pmfiles) { $begin_block .= " use_ok( '$f->{NAME}' );\n"; } $begin_block .= "}\n"; my $text_of_test_file = join("\n", ( $top, $number_line, $begin_block, ) ); return $text_of_test_file; } =head3 C Usage : $self->text_Makefile() within complete_build() Purpose : Build Makefile Returns : String holding text of Makefile Argument : n/a Throws : n/a Comment : This method is a likely candidate for alteration in a subclass =cut sub text_Makefile { my $self = shift; my $Makefile_format = q~ use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => '%s', VERSION_FROM => '%s', # finds \$VERSION AUTHOR => '%s (%s)', ABSTRACT => '%s', PREREQ_PM => { 'Test::Simple' => 0.44, }, ); ~; my $text_of_Makefile = sprintf $Makefile_format, map { my $s = $_; $s =~ s{'}{\\'}g; $s; } $self->{NAME}, $self->{FILE}, $self->{AUTHOR}, $self->{EMAIL}, $self->{ABSTRACT}; return $text_of_Makefile; } =head3 C Usage : $self->text_Buildfile() within complete_build() Purpose : Composes text for a Buildfile for Module::Build Returns : String holding text for Buildfile Argument : n/a Throws : n/a Comment : This method is a likely candidate for alteration in a subclass, e.g., respond to improvements in Module::Build Comment : References $self keys NAME and LICENSE =cut sub text_Buildfile { my $self = shift; # As of 0.15, Module::Build only allows a few licenses my $license_line = 1 if $self->{LICENSE} =~ /^(?:perl|gpl|artistic)$/; my $text_of_Buildfile = <new ( module_name => '$self->{NAME}', EOF if ($license_line) { $text_of_Buildfile .= < '$self->{LICENSE}', EOF } $text_of_Buildfile .= <create_build_script; EOF return $text_of_Buildfile; } =head3 C Usage : $self->text_proxy_makefile() within complete_build() Purpose : Composes text for proxy makefile Returns : String holding text for proxy makefile Argument : n/a Throws : n/a Comment : This method is a likely candidate for alteration in a subclass =cut sub text_proxy_makefile { my $self = shift; # This comes directly from the docs for Module::Build::Compat my $text_of_proxy = <<'EOF'; unless (eval "use Module::Build::Compat 0.02; 1" ) { print "This module requires Module::Build to install itself.\n"; require ExtUtils::MakeMaker; my $yn = ExtUtils::MakeMaker::prompt (' Install Module::Build from CPAN?', 'y'); if ($yn =~ /^y/i) { require Cwd; require File::Spec; require CPAN; # Save this 'cause CPAN will chdir all over the place. my $cwd = Cwd::cwd(); my $makefile = File::Spec->rel2abs($0); CPAN::Shell->install('Module::Build::Compat'); chdir $cwd or die "Cannot chdir() back to $cwd: $!"; exec $^X, $makefile, @ARGV; # Redo now that we have Module::Build } else { warn " *** Cannot install without Module::Build. Exiting ...\n"; exit 1; } } Module::Build::Compat->run_build_pl(args => \@ARGV); Module::Build::Compat->write_makefile(); EOF return $text_of_proxy; } =head3 C Usage : $self->text_MANIFEST_SKIP() within complete_build() Purpose : Composes text for MANIFEST.SKIP file Returns : String with text of MANIFEST.SKIP file Argument : n/a Throws : n/a Comment : References $self key NAME Comment : Adapted from David Golden's ExtUtils::ModuleMaker::TT =cut sub text_MANIFEST_SKIP { my $self = shift; my $text_of_SKIP = <<'END_OF_SKIP'; # Version control files and dirs. \bRCS\b \bCVS\b ,v$ .svn/ # ExtUtils::MakeMaker generated files and dirs. ^MANIFEST\.(?!SKIP) ^Makefile$ ^blib/ ^blibdirs$ ^PM_to_blib$ ^MakeMaker-\d # Module::Build ^Build$ ^_build # Temp, old, vi and emacs files. ~$ \.old$ ^#.*#$ ^\.# \.swp$ \.bak$ END_OF_SKIP return $text_of_SKIP; } =head3 C Usage : $self->text_pod_coverage_test() within complete_build() Purpose : Composes text for t/pod-coverage.t Returns : String with text of t/pod-coverage.t Argument : n/a Throws : n/a Comment : Adapted from Andy Lester's Module::Starter Comment : I don't think of much of this metric, but Andy and Damian do, so if you want it you set INCLUDE_POD_COVERAGE_TEST => 1 =cut sub text_pod_coverage_test { my $self = shift; my $text_of_pod_coverage_test = <<'END_OF_POD_COVERAGE_TEST'; #!perl -T use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; all_pod_coverage_ok(); END_OF_POD_COVERAGE_TEST return $text_of_pod_coverage_test; } =head3 C Usage : $self->text_pod_test() within complete_build() Purpose : Composes text for t/pod.t Returns : String with text of t/pod.t Argument : n/a Throws : n/a Comment : Adapted from Andy Lester's Module::Starter Comment : I don't think of much of this metric, but Andy and Damian do, so if you want it you set INCLUDE_POD_TEST => 1 =cut sub text_pod_test { my $self = shift; my $text_of_pod_test = <<'END_OF_POD_TEST'; #!perl -T use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok(); END_OF_POD_TEST return $text_of_pod_test; } =head3 C Usage : $self->text_pm_file($module) within complete_build() Purpose : Composes a string holding all elements for a pm file Returns : String holding text for a pm file Argument : $module: pointer to the module being built (as there can be more than one module built by EU::MM); for the primary module it is a pointer to $self =cut sub text_pm_file { my $self = shift; my $module = shift; my $text_of_pm_file = $self->block_begin($module); $text_of_pm_file .= ( ( ( ( $self->process_attribute( $module, 'NEED_POD' ) ) && ( $self->process_attribute( $module, 'NEED_NEW_METHOD' ) ) ) ? $self->block_subroutine_header($module) : q{} ) ); $text_of_pm_file .= ( ( $self->process_attribute( $module, 'NEED_NEW_METHOD' ) ) ? $self->block_new_method() : q{} ); $text_of_pm_file .= ( ( $self->process_attribute( $module, 'INCLUDE_FILE_IN_PM' ) ) ? $self->block_include_file_in_pm() : q{} ); $text_of_pm_file .= ( ( $self->process_attribute( $module, 'NEED_POD' ) ) ? $self->block_pod($module) : q{} ); $text_of_pm_file .= $self->block_final(); return ($module, $text_of_pm_file); } =head2 Methods Called within C =head3 C Usage : $self->block_begin($module) within text_pm_file() Purpose : Composes the standard code for top of a Perl pm file Returns : String holding code for top of pm file Argument : $module: pointer to the module being built (as there can be more than one module built by EU::MM); for the primary module it is a pointer to $self Throws : n/a Comment : This method is a likely candidate for alteration in a subclass, e.g., you don't need Exporter-related code if you're building an OO-module. Comment : References $self keys NAME and (indirectly) VERSION =cut sub block_begin { my ( $self, $module ) = @_; my $version = $self->process_attribute( $module, 'VERSION' ); my $package_line = "package $module->{NAME};\n"; my $Id_line = q{#$Id#} . "\n"; my $strict_line = "use strict;\n"; my $warnings_line = "use warnings;\n"; # not included in standard version my $begin_block = <<"END_OF_BEGIN"; BEGIN { use Exporter (); use vars qw(\$VERSION \@ISA \@EXPORT \@EXPORT_OK \%EXPORT_TAGS); \$VERSION = '$version'; \@ISA = qw(Exporter); #Give a hoot don't pollute, do not export more than needed by default \@EXPORT = qw(); \@EXPORT_OK = qw(); \%EXPORT_TAGS = (); } END_OF_BEGIN # my $text = # $package_line . # $strict_line . # # $warnings_line . # $begin_block; my $text = $package_line; $text .= $Id_line if $self->{INCLUDE_ID_LINE}; $text .= $strict_line; $text .= $warnings_line if $self->{INCLUDE_WARNINGS}; $text .= $begin_block; return $text; } =head3 C Usage : $self->process_attribute($module, @keys) within block_begin(), text_test(), text_pm_file(), block_pod(), complete_build() Purpose : For the particular .pm file now being processed (value of the NAME key of the first argument: $module), see if there exists a key whose name is the second argument. If so, return it. Otherwise, return the value of the key by that name in the EU::MM object. If we have a two-level hash (currently only in License_Parts, process down to that level. Arguments : First argument is a reference to an anonymous hash which has at least one element with key NAME and value of the module being processed. Second is an array of key names, although in all but one case it's a single-element (NAME) array. Comment : [The method's name is very opaque and not self-documenting. Function of the code is not easily evident. Rename? Refactor?] =cut sub process_attribute { my ( $self, $module, @keys ) = @_; if ( scalar(@keys) == 1 ) { return ( $module->{ $keys[0] } ) if ( exists( ( $module->{ $keys[0] } ) ) ); return ( $self->{ $keys[0] } ); } else { # only alternative currently possible is @keys == 2 return ( $module->{ $keys[0] }{ $keys[1] } ) if ( exists( ( $module->{ $keys[0] }{ $keys[1] } ) ) ); return ( $self->{ $keys[0] }{ $keys[1] } ); } } =head3 C Usage : $self->block_subroutine_header($module) within text_pm_file() Purpose : Composes an inline comment for pm file (much like this inline comment) which documents purpose of a subroutine Returns : String containing text for inline comment Argument : $module: pointer to the module being built (as there can be more than one module built by EU::MM); for the primary module it is a pointer to $self Throws : n/a Comment : This method is a likely candidate for alteration in a subclass E.g., some may prefer this info to appear in POD rather than inline comments. =cut sub block_subroutine_header { my ( $self, $module ) = @_; my $text_of_subroutine_pod = < Usage : $self->block_new_method() within text_pm_file() Purpose : Build 'new()' method as part of a pm file Returns : String holding sub new. Argument : $module: pointer to the module being built (as there can be more than one module built by EU::MM); for the primary module it is a pointer to $self Throws : n/a Comment : This method is a likely candidate for alteration in a subclass, e.g., pass a single hash-ref to new() instead of a list of parameters. =cut sub block_new_method { my $self = shift; return <<'EOFBLOCK'; sub new { my ($class, %parameters) = @_; my $self = bless ({}, ref ($class) || $class); return $self; } EOFBLOCK } =head3 C Usage : $self->block_include_file_in_pm() within text_pm_file() Purpose : Include text from an arbitrary file on disk in .pm file, e.g., subroutine stubs you want in each of several extra modules. Returns : String holding text of arbitrary file. Argument : $module: pointer to the module being built (as there can be more than one module built by EU::MM); for the primary module it is a pointer to $self Throws : n/a Comment : References $self->{INCLUDE_FILE_IN_PM}, whose value must be a path to a single, readable file =cut sub block_include_file_in_pm { my ( $self, $module ) = @_; my $arb = $self->{INCLUDE_FILE_IN_PM}; local *ARB; open ARB, $arb or croak "Could not open $arb for inclusion: $!"; my $text_included = do { local $/; }; close ARB or croak "Could not close $arb after reading: $!"; return $text_included; } =head3 C Usage : $self->block_pod($module) inside text_pm_file() Purpose : Compose the main POD section within a pm file Returns : String holding main POD section Argument : $module: pointer to the module being built (as there can be more than one module built by EU::MM); for the primary module it is a pointer to $self Throws : n/a Comment : This method is a likely candidate for alteration in a subclass Comment : In StandardText formulation, contains the following components: warning about stub documentation needing editing pod wrapper top NAME - ABSTRACT SYNOPSIS DESCRIPTION USAGE BUGS SUPPORT HISTORY (as requested) AUTHOR COPYRIGHT SEE ALSO pod wrapper bottom =cut sub block_pod { my ( $self, $module ) = @_; my $name = $self->process_attribute( $module, 'NAME' ); my $abstract = $self->process_attribute( $module, 'ABSTRACT' ); my $synopsis = qq{ use $name;\n blah blah blah\n}; my $description = <process_attribute( $module, 'COMPOSITE' ); my $copyright = $self->process_attribute( $module, 'LicenseParts', 'COPYRIGHT'); my $see_also = q{perl(1).}; my $text_of_pod = join( q{}, $self->pod_section( NAME => $name . ( (defined $abstract) ? qq{ - $abstract} : q{} ) ), $self->pod_section( SYNOPSIS => $synopsis ), $self->pod_section( DESCRIPTION => $description ), $self->pod_section( USAGE => q{} ), $self->pod_section( BUGS => q{} ), $self->pod_section( SUPPORT => q{} ), ( ( $self->{CHANGES_IN_POD} ) ? $self->pod_section( HISTORY => $self->text_Changes('only pod') ) : q{} ), $self->pod_section( AUTHOR => $author_composite), $self->pod_section( COPYRIGHT => $copyright), $self->pod_section( 'SEE ALSO' => $see_also), ); return $self->pod_wrapper($text_of_pod); } =head3 C Usage : $self->block_final() within text_pm_file() Purpose : Compose code and comment that conclude a pm file and guarantee that the module returns a true value Returns : String containing code and comment concluding a pm file Argument : $module: pointer to the module being built (as there can be more than one module built by EU::MM); for the primary module it is a pointer to $self Throws : n/a Comment : This method is a likely candidate for alteration in a subclass, e.g., some may not want the comment line included. =cut sub block_final { my $self = shift; return < Usage : $self->death_message( [ I ] ) in validate_values; create_directory; print_file Purpose : Croaks with error message composed from elements in the list passed by reference as argument Returns : [ To come. ] Argument : Reference to an array holding list of error messages accumulated Comment : Different functioning in modulemaker interactive mode =cut sub death_message { my $self = shift; my $errorref = shift; my @errors = @{$errorref}; croak( join "\n", @errors, q{}, $self->{USAGE_MESSAGE} ) unless $self->{INTERACTIVE}; my %err = map {$_, 1} @errors; delete $err{'NAME is required'} if $err{'NAME is required'}; @errors = keys %err; if (@errors) { print( join "\n", 'Oops, there are the following errors:', @errors, q{} ); return 1; } else { return; } } =head3 C Usage : $self->log_message( $message ) in print_file; Purpose : Prints log_message (currently, to STDOUT) if $self->{VERBOSE} Returns : n/a Argument : Scalar holding message to be logged Comment : =cut sub log_message { my ( $self, $message ) = @_; print "$message\n" if $self->{VERBOSE}; } =head3 C Usage : $self->pod_section($heading, $content) within block_pod() Purpose : When writing POD sections, you have to 'escape' the POD markers to prevent the compiler from treating them as real POD. This method 'unescapes' them and puts header and closer around individual POD headings within pm file. Arguments : Variables holding POD section name and text of POD section. =cut sub pod_section { my ( $self, $heading, $content ) = @_; my $text_of_pod_section = < Usage : $self->pod_wrapper($string) within block_pod() Purpose : When writing POD sections, you have to 'escape' the POD markers to prevent the compiler from treating them as real POD. This method 'unescapes' them and puts header and closer around main POD block in pm file, along with warning about stub documentation. Argument : String holding text of POD which has been built up within block_pod(). Comment : $head and $tail inside pod_wrapper() are optional and, in a subclass, could be redefined as empty strings; but $cutline is mandatory as it supplies the last =cut =cut sub pod_wrapper { my ( $self, $podtext ) = @_; my $head = <<'END_OF_HEAD'; #################### main pod documentation begin ################### ## Below is the stub of documentation for your module. ## You better edit it! END_OF_HEAD my $cutline = <<'END_OF_CUT'; ====cut END_OF_CUT my $tail = <<'END_OF_TAIL'; #################### main pod documentation end ################### END_OF_TAIL $cutline =~ s/\n ====/\n=/g; return join( q{}, $head, # optional $podtext, # required $cutline, # required $tail # optional ); } =head1 SEE ALSO F, F. =cut 1; ExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker/Auxiliary.pm0000644000175000017500000003665513043670123024317 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker::Auxiliary; use strict; # Contains test subroutines for distribution with ExtUtils::ModuleMaker use warnings; use vars qw( $VERSION @ISA @EXPORT_OK ); $VERSION = 0.56; require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw( read_file_string read_file_array six_file_tests check_MakefilePL check_pm_file make_compact failsafe licensetest _process_personal_defaults_file _reprocess_personal_defaults_file _get_els _subclass_preparatory_tests _subclass_cleanup_tests _save_pretesting_status _restore_pretesting_status ); use Carp; use Cwd; use File::Copy; use File::Path; use File::Spec; use File::Temp qw| tempdir |; *ok = *Test::More::ok; *is = *Test::More::is; *like = *Test::More::like; *copy = *File::Copy::copy; *move = *File::Copy::move; use File::Save::Home qw( get_subhome_directory_status make_subhome_directory restore_subhome_directory_status ); =head1 NAME ExtUtils::ModuleMaker::Auxiliary - Subroutines for testing ExtUtils::ModuleMaker =head1 DESCRIPTION This package contains subroutines used in one or more F files in ExtUtils::ModuleMaker's test suite. They may prove useful in writing test suites for distributions which subclass ExtUtils::ModuleMaker. =head1 SUBROUTINES =head2 C Function: Read the contents of a file into a string. Argument: String holding name of a file created by complete_build(). Returns: String holding text of the file read. Used: To see whether text of files such as README, Makefile.PL, etc. was created correctly by returning a string against which a pattern can be matched. =cut sub read_file_string { my $file = shift; open my $fh, $file or die "Unable to open filehandle: $!"; my $filetext = do { local $/; <$fh> }; close $fh or die "Unable to close filehandle: $!"; return $filetext; } =head2 C Function: Read a file line-by-line into an array. Argument: String holding name of a file created by complete_build(). Returns: Array holding the lines of the file read. Used: To see whether text of files such as README, Makefile.PL, etc. was created correctly by returning an array against whose elements patterns can be matched. =cut sub read_file_array { my $file = shift; open my $fh, $file or die "Unable to open filehandle: $!"; my @filetext = <$fh>; close $fh or die "Unable to close filehandle: $!"; return @filetext; } =head2 C Function: Verify that content of MANIFEST and lib/*.pm were created correctly. Argument: Two arguments: 1. A number predicting the number of entries in the MANIFEST. 2. The stem of the lib/*.pm file, i.e., what immediately precedes the .pm. Returns: n/a. Used: To see whether MANIFEST and lib/*.pm have correct text. Runs 6 Test::More tests: 1. Number of entries in MANIFEST. 2. Change to directory under lib. 3. Applies read_file_string to the stem.pm file. 4. Determine whether stem.pm's POD contains module name and abstract. 5. Determine whether POD contains a HISTORY head. 6. Determine whether POD contains correct author information. =cut sub six_file_tests { my ($manifest_entries, $testmod) = @_; my @filetext = read_file_array('MANIFEST'); is(scalar(@filetext), $manifest_entries, 'Correct number of entries in MANIFEST'); my $str; ok(chdir 'lib/Alpha', 'Directory is now lib/Alpha'); ok($str = read_file_string("$testmod.pm"), "Able to read $testmod.pm"); ok($str =~ m|Alpha::$testmod\s-\sTest\sof\sthe\scapacities\sof\sEU::MM|, 'POD contains module name and abstract'); ok($str =~ m|=head1\sHISTORY|, 'POD contains history head'); ok($str =~ m| Phineas\sT\.\sBluster\n \s+CPAN\sID:\s+PTBLUSTER\n \s+Peanut\sGallery\n \s+phineas\@anonymous\.com\n \s+http:\/\/www\.anonymous\.com\/~phineas |xs, 'POD contains correct author info'); } =head2 C Function: Verify that content of Makefile.PL was created correctly. Argument: Two arguments: 1. A string holding the directory in which the Makefile.PL should have been created. 2. A reference to an array holding strings each of which is a prediction as to content of particular lines in Makefile.PL. Returns: n/a. Used: To see whether Makefile.PL created by complete_build() has correct entries. Runs 1 Test::More test which checks NAME, VERSION_FROM, AUTHOR and ABSTRACT. =cut sub check_MakefilePL { my ($topdir, $predictref) = @_; my @pred = @$predictref; my $mkfl = File::Spec->catfile( $topdir, q{Makefile.PL} ); local *MAK; open MAK, $mkfl or die "Unable to open Makefile.PL: $!"; my $bigstr = read_file_string($mkfl); like($bigstr, qr/ NAME.+($pred[0]).+ VERSION_FROM.+($pred[1]).+ AUTHOR.+($pred[2]).+ ($pred[3]).+ ABSTRACT.+($pred[4]).+ /sx, "Makefile.PL has predicted values"); } sub check_pm_file { my ($pmfile, $predictref) = @_; my %pred = %$predictref; my @pmlines; @pmlines = read_file_array($pmfile); ok( scalar(@pmlines), ".pm file has content"); if (defined $pred{'pod_present'}) { pod_present(\@pmlines, \%pred); } if (defined $pred{'constructor_present'}) { constructor_present(\@pmlines, \%pred); } } sub make_compact { my $module_name = shift; my ($topdir, $path, $pmfile); $topdir = $path = $module_name; $topdir =~ s{::}{-}g; $path =~ s{::}{/}g; $path .= q{.pm}; $pmfile = File::Spec->catfile( $topdir, q{lib}, $path ); return ($topdir, $pmfile); } sub pod_present { my $linesref = shift; my $predictref = shift; my $podcount = grep {/^=(head|cut)/} @{$linesref}; if (${$predictref}{'pod_present'} == 0) { is( $podcount, 0, "no POD correctly detected in module"); } else { isnt( $podcount, 0, "POD detected in module"); } } sub constructor_present { my $linesref = shift; my $predictref = shift; my $constructorcount = grep {/^=sub new/} @{$linesref}; if (${$predictref}{'constructor_present'} == 0) { is( $constructorcount, 0, "constructor correctly absent from module"); } else { isnt( $constructorcount, 0, "constructor correctly present in module"); } } sub failsafe { my ($caller, $argslistref, $pattern, $message) = @_; my ($tdir, $obj); $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); local $@ = undef; eval { $obj = $caller->new (@$argslistref); }; like($@, qr/$pattern/, $message); } sub licensetest { my ($caller, $license, $pattern) = @_; my ($tdir, $mod); $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, "changed to temp directory for testing $license"); ok($mod = $caller->new( NAME => "Alpha::$license", LICENSE => $license, COMPACT => 1, ), "object for module Alpha::$license created"); ok( $mod->complete_build(), 'call complete_build()' ); ok(chdir "Alpha-$license", "changed to Alpha-$license directory"); my $licensetext = read_file_string('LICENSE'); like($licensetext, $pattern, "$license license has predicted content"); } sub _process_personal_defaults_file { my ($mmkr_dir, $pers_file) = @_; my $pers_file_hidden = $pers_file . '.hidden'; my %pers; $pers{full} = File::Spec->catfile( $mmkr_dir, $pers_file ); $pers{hidden} = File::Spec->catfile( $mmkr_dir, $pers_file_hidden ); if (-f $pers{full}) { $pers{atime} = (stat($pers{full}))[8]; $pers{modtime} = (stat($pers{full}))[9]; rename $pers{full}, $pers{hidden} or croak "Unable to rename $pers{full}: $!"; ok(! -f $pers{full}, "personal defaults file temporarily suppressed"); ok(-f $pers{hidden}, "personal defaults file now hidden"); } else { ok(! -f $pers{full}, "personal defaults file not found"); ok(1, "personal defaults file not found"); } return { %pers }; } sub _reprocess_personal_defaults_file { my $pers_def_ref = shift;; if(-f $pers_def_ref->{hidden} ) { rename $pers_def_ref->{hidden}, $pers_def_ref->{full}, or croak "Unable to rename $pers_def_ref->{hidden}: $!"; ok(-f $pers_def_ref->{full}, "personal defaults file re-established"); ok(! -f $pers_def_ref->{hidden}, "hidden personal defaults now gone"); ok( (utime $pers_def_ref->{atime}, $pers_def_ref->{modtime}, ($pers_def_ref->{full}) ), "atime and modtime of personal defaults file restored"); } else { ok(1, "test not relevant"); ok(1, "test not relevant"); ok(1, "test not relevant"); } } sub _get_els { my $persref = shift; my %pers = %$persref; my %pm = %{$pers{pm}}; my %hidden = %{$pers{hidden}}; return ( pm => scalar(keys %pm), hidden => scalar(keys %hidden) ); } sub _subclass_preparatory_tests { my $odir = shift; my $tdir = tempdir( CLEANUP => 1); ok(chdir $tdir, 'changed to temp directory for testing'); my $mmkr_dir_ref = get_subhome_directory_status(".modulemaker"); my $mmkr_dir = make_subhome_directory($mmkr_dir_ref); ok($mmkr_dir, "home/.modulemaker directory now present on system"); my $eumm = File::Spec->catfile( qw| ExtUtils ModuleMaker | ); my $eumm_dir = File::Spec->catfile( $mmkr_dir, $eumm ); unless (-d $eumm_dir) { mkpath($eumm_dir) or croak "Unable to make path: $!"; } ok(-d $eumm_dir, "eumm directory now exists"); my $pers_file = "ExtUtils/ModuleMaker/Personal/Defaults.pm"; my $pers_def_ref = _process_personal_defaults_file( $mmkr_dir, $pers_file ); my $persref; $persref = _identify_pm_files_under_mmkr_dir($eumm_dir); my %els1 = _get_els($persref); _hide_pm_files_under_mmkr_dir($persref); $persref = _identify_pm_files_under_mmkr_dir($eumm_dir); my %els2 = _get_els($persref); if (! $els1{pm}) { is($els1{pm}, $els2{pm}, "no .pm files originally, so no .pm files now"); is($els1{pm}, $els2{hidden}, "no .pm files originally, so no .pm.hidden files now"); } elsif ($els1{pm}) { is($els2{pm}, 0, "original .pm files are now hidden"); is($els1{pm}, $els2{hidden}, ".pm.hidden files exist"); } my $sourcedir = File::Spec->catdir( $odir, q{t}, q{testlib}, $eumm ); ok( -d $sourcedir, "source directory exists"); ok( -d $eumm_dir, "destination directory exists"); return { mmkr_dir_ref => $mmkr_dir_ref, persref => $persref, pers_def_ref => $pers_def_ref, initial_els_ref => \%els1, sourcedir => $sourcedir, eumm_dir => $eumm_dir, } } sub _subclass_cleanup_tests { my $cleanup_ref = shift; my $persref = $cleanup_ref->{persref}; my $pers_def_ref = $cleanup_ref->{pers_def_ref}; my $eumm_dir = $cleanup_ref->{eumm_dir}; my %els1 = %{ $cleanup_ref->{initial_els_ref} }; my $odir = $cleanup_ref->{odir}; my $mmkr_dir_ref = $cleanup_ref->{mmkr_dir_ref}; _reveal_pm_files_under_mmkr_dir($persref); $persref = _identify_pm_files_under_mmkr_dir($eumm_dir); my %els3 = _get_els($persref); if (! $els1{pm}) { is($els1{pm}, $els3{pm}, "no .pm files originally, so no .pm files now"); is($els1{pm}, $els3{hidden}, "no .pm files originally, so no .pm.hidden files now"); } elsif ($els1{pm}) { is($els1{pm}, $els3{pm}, "same number of .pm files as originally"); is($els3{hidden}, 0, "no more .pm.hidden files"); } _reprocess_personal_defaults_file($pers_def_ref); ok(chdir $odir, 'changed back to original directory after testing'); ok( restore_subhome_directory_status($mmkr_dir_ref), "original presence/absence of .modulemaker directory restored"); } sub _identify_pm_files_under_mmkr_dir { my $eumm_dir = shift; my (@pm_files, @pm_files_hidden); opendir my $dirh, $eumm_dir or croak "Unable to open $eumm_dir for reading: $!"; while (my $f = readdir($dirh)) { if ($f =~ /\.pm$/) { push @pm_files, File::Spec->catfile( $eumm_dir, $f ); } elsif ($f =~ /\.pm\.hidden$/) { push @pm_files_hidden, File::Spec->catfile( $eumm_dir, $f ); } else { next; } } closedir $dirh or croak "Unable to close $eumm_dir after reading: $!"; # sanity check: # If there are .pm files, there should be no .pm.hidden files # and vice versa. if ( scalar(@pm_files) and scalar(@pm_files_hidden) ) { croak "Both .pm and .pm.hidden files found in $eumm_dir: $!"; } my %pers; my %pm; foreach my $f (@pm_files) { $pm{$f}{atime} = (stat($f))[8]; $pm{$f}{modtime} = (stat($f))[9]; } my %hidden; foreach my $f (@pm_files_hidden) { $hidden{$f}{atime} = (stat($f))[8]; $hidden{$f}{modtime} = (stat($f))[9]; } $pers{dir} = $eumm_dir;; $pers{pm} = \%pm; $pers{hidden} = \%hidden; return \%pers; } sub _hide_pm_files_under_mmkr_dir { my $per_dir_ref = shift; my %pers = %{$per_dir_ref}; my %pm = %{$pers{pm}}; foreach my $f (keys %pm) { my $new = "$f.hidden"; rename $f, $new or croak "Unable to rename $f: $!"; utime $pm{$f}{atime}, $pm{$f}{modtime}, $new; } } sub _reveal_pm_files_under_mmkr_dir { my $per_dir_ref = shift; my %pers = %{$per_dir_ref}; my %hidden = %{$pers{hidden}}; foreach my $f (keys %hidden) { $f =~ m{(.*)\.hidden$}; my $new = $1; rename $f, $new or croak "Unable to rename $f: $!"; utime $hidden{$f}{atime}, $hidden{$f}{modtime}, $new; } } sub _save_pretesting_status { my $mmkr_dir_ref = get_subhome_directory_status(".modulemaker"); my $mmkr_dir = make_subhome_directory($mmkr_dir_ref); ok( $mmkr_dir, "personal defaults directory now present on system"); my $pers_file = "ExtUtils/ModuleMaker/Personal/Defaults.pm"; my $pers_def_ref = _process_personal_defaults_file( $mmkr_dir, $pers_file, ); return { cwd => cwd(), mmkr_dir_ref => $mmkr_dir_ref, pers_def_ref => $pers_def_ref, mmkr_dir => $mmkr_dir, # needed in make_selections_defaults pers_file => $pers_file, # needed in make_selections_defaults } } sub _restore_pretesting_status { my $statusref = shift; _reprocess_personal_defaults_file($statusref->{pers_def_ref}); ok(chdir $statusref->{cwd}, "changed back to original directory after testing"); ok( restore_subhome_directory_status($statusref->{mmkr_dir_ref}), "original presence/absence of .modulemaker directory restored"); } =head1 SEE ALSO F. =cut 1; ExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker/Interactive.pm0000644000175000017500000004224213043670123024612 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker::Interactive; #$Id$ use strict; use warnings; BEGIN { use base qw( ExtUtils::ModuleMaker ); use vars qw ( $VERSION ); $VERSION = 0.56; } use Carp; use Data::Dumper; ########## CONSTRUCTOR ########## # # Inherited from EU::MM # ########## BEGIN DECLARATIONS ########## ###### Index of Variables (08/18/2005): # %Build_Menu # %destinations # %Directives_Menu # %Flagged # $License_Standard # $License_Local # @lic # %messages my %Build_Menu = ( E => 'ExtUtils::MakeMaker', B => 'Module::Build', P => 'Module::Build and proxy Makefile.PL', ); my %destinations = ( 'Main Menu' => { A => 'Author Menu', L => 'License Menu', D => 'Directives_Menu', B => 'Build Menu', X => 'exit', }, 'Author Menu' => { R => 'Main Menu', X => 'exit', }, Directives_Menu => { R => 'Main Menu', X => 'exit', }, 'License Menu' => { C => 'Copyright_Display', L => 'License_Display', P => 'License Menu', R => 'Main Menu', X => 'exit', }, 'Build Menu' => { R => 'Main Menu', X => 'exit', }, ); my %Flagged = ( ( map { $_ => 0 } qw (0 N F) ), ( map { $_ => 1 } qw (1 Y T) ), ); my $License_Standard = ExtUtils::ModuleMaker::Licenses::Standard->interact(); my $License_Local = ExtUtils::ModuleMaker::Licenses::Local->interact(); my @lic = ( ( map { [ $_, $License_Standard->{$_} ] } sort { $License_Standard->{$a} cmp $License_Standard->{$b} } keys( %{$License_Standard} ) ), ( map { [ $_, $License_Local->{$_} ] } sort { $License_Local->{$a} cmp $License_Local->{$b} } keys( %{$License_Local} ) ), ); my %messages = ( #--------------------------------------------------------------------- 'Main Menu' => < < < < < < <default_values(); my %author_defaults = ( AUTHOR => { default => $defaults_ref->{AUTHOR}, string => 'Author ', opt => 'u', select => 'N', }, CPANID => { default => $defaults_ref->{CPANID}, string => 'CPAN ID ', opt => 'p', select => 'C', }, ORGANIZATION => { default => $defaults_ref->{ORGANIZATION}, string => 'Organization', opt => 'o', select => 'O', }, WEBSITE => { default => $defaults_ref->{WEBSITE}, string => 'Website ', opt => 'w', select => 'W', }, EMAIL => { default => $defaults_ref->{EMAIL}, string => 'Email ', opt => 'e', select => 'E', }, ); return { %author_defaults }; } sub _prepare_directives_defaults { my $self = shift; my $defaults_ref = $self->default_values(); my %directives_defaults = ( COMPACT => { default => $defaults_ref->{COMPACT}, string => 'Compact ', opt => 'c', select => 'C', }, VERBOSE => { default => $defaults_ref->{VERBOSE}, string => 'Verbose ', opt => 'V', select => 'V', }, NEED_POD => { default => $defaults_ref->{NEED_POD}, string => 'Include POD ', opt => 'P', select => 'D', }, NEED_NEW_METHOD => { default => $defaults_ref->{NEED_NEW_METHOD}, string => 'Include new ', opt => 'q', select => 'N', }, CHANGES_IN_POD => { default => $defaults_ref->{CHANGES_IN_POD}, string => 'History in POD ', opt => 'C', select => 'H', }, PERMISSIONS => { default => $defaults_ref->{PERMISSIONS}, string => 'Permissions ', opt => 'r', select => 'P', }, ); return { %directives_defaults }; } sub Main_Menu { my $MOD = shift; MAIN_LOOP: { my $string = $messages{'Main Menu'}; defined $MOD->{NAME} ? $string =~ s|##name##|$MOD->{NAME}| : $string =~ s|##name##||; $string =~ s|##abstract##|$MOD->{ABSTRACT}|; $string =~ s|##license##|$MOD->{LICENSE}|; $string =~ s|##build##|$MOD->{BUILD_SYSTEM}|; my $response = Question_User( $string, 'menu' ); return ( $destinations{'Main Menu'}{$response} ) if ( exists $destinations{'Main Menu'}{$response} ); if ( $response eq 'N' ) { my $value = Question_User( "Please enter a new value for Primary Module Name", 'data' ); $MOD->{NAME} = $value; } elsif ( $response eq 'S' ) { my $value = Question_User( "Please enter Abstract (suggest: 44-char max)", 'data' ); $MOD->{ABSTRACT} = $value; } elsif ( $response eq 'G' or $response eq 'H' ) { $MOD->set_author_composite(); if (! $MOD->{NAME}) { print "ERROR: Must enter module name!\n"; next MAIN_LOOP; } elsif ($MOD->validate_values()) { $MOD->set_file_composite(); if ( $response eq 'G' ) { print "Module files are being generated.\n"; } else { $MOD->make_selections_defaults(); print "Module files are being generated;\n"; print " selections are being saved as defaults.\n"; } return ('done'); } else { next MAIN_LOOP; } } } # END MAIN_LOOP return ('Main Menu'); } sub Author_Menu { my $MOD = shift; my $author_defaults_ref = $MOD->_prepare_author_defaults(); my %author_defaults = %{$author_defaults_ref}; my %Author_Menu = map { $author_defaults{$_}{select} => [ $author_defaults{$_}{string}, $_ ] } keys %author_defaults; my $string = $messages{'Author Menu'}; my $stuff = join( "\n", map { qq{$_ - $Author_Menu{$_}[0] '} #' . $MOD->{ $Author_Menu{$_}[1] } . q{'} } qw (N C O W E) ); $string =~ s|##Data Here##|$stuff|; my $response = Question_User( $string, 'menu' ); return ( $destinations{'Author Menu'}{$response} ) if ( exists $destinations{'Author Menu'}{$response} ); return ('Author Menu') unless ( exists( $Author_Menu{$response} ) ); my $value = Question_User( "Please enter a new value for $Author_Menu{$response}[0]", 'data' ); $MOD->{ $Author_Menu{$response}[1] } = $value; return ('Author Menu'); } sub Directives_Menu { my $MOD = shift; # warn "at start of Directives_Menu: $MOD->{COMPACT}\n"; my $directives_defaults_ref = $MOD->_prepare_directives_defaults(); my %directives_defaults = %{$directives_defaults_ref}; my %Directives_Menu = map { $directives_defaults{$_}{select} => [ $directives_defaults{$_}{string}, $_ ] } keys %directives_defaults; my $string = $messages{Directives_Menu}; my $stuff = join( "\n", ( map { qq{$_ - $Directives_Menu{$_}[0] '} #' . $MOD->{ $Directives_Menu{$_}[1] } . q{'} # . $Directives_Menu{$_}[1] . q{'} } qw (C V D N H) ), qq{P - $Directives_Menu{P}[0] '} . sprintf( "%04o - %d", $MOD->{ $Directives_Menu{P}[1] }, $MOD->{ $Directives_Menu{P}[1] } ) . q{'}, ); $string =~ s|##Data Here##|$stuff|; my $response = Question_User( $string, 'menu' ); return ( $destinations{Directives_Menu}{$response} ) if ( exists $destinations{Directives_Menu}{$response} ); return ('Directives_Menu') unless ( exists( $Directives_Menu{$response} ) ); if ( $response eq 'P' ) { my $value = Question_User( "Please enter a new value for $Directives_Menu{$response}[0]", 'data' ); $value = oct($value) if ( $value =~ /^0/ ); $MOD->{ $Directives_Menu{$response}[1] } = $value if ( $value <= 0777 ); } else { my $value = Question_User( "Please enter a new value for $Directives_Menu{$response}[0]," . " (0,No,False || 1,Yes,True)", 'menu' ); $value = $Flagged{$value}; $MOD->{ $Directives_Menu{$response}[1] } = $Flagged{$value} if ( exists $Flagged{$value} ); } return ('Directives_Menu'); } sub License_Menu { my $MOD = shift; my $string = $messages{'License Menu'}; my $ct = 1; my $licenses = join( "\n", map { $ct++ . ( ( $MOD->{LICENSE} eq $_->[0] ) ? '***' : '' ) . "\t" . $_->[1] } @lic ); $string =~ s|##Licenses Here##|$licenses|; my $response = Question_User( $string, 'license', scalar(@lic) ); return ( $destinations{'License Menu'}{$response} ) if ( exists $destinations{'License Menu'}{$response} ); if ( $lic[ $response - 1 ] ) { $MOD->{LICENSE} = $lic[ $response - 1 ][0]; } $MOD->initialize_license(); return ('License Menu'); } sub License_Display { my $MOD = shift; my $string = $messages{License_Display}; $string =~ s|##License Here##|$MOD->{LicenseParts}{LICENSETEXT}|; my $response = Question_User( $string, 'menu' ); return ( $destinations{'License Menu'}{$response} ) if ( exists $destinations{'License Menu'}{$response} ); return ('License Menu'); } sub Build_Menu { my $MOD = shift; my $string = $messages{Build_Menu}; $string =~ s|##Build Here##|$MOD->{BUILD_SYSTEM}|; my $response = Question_User( $string, 'menu' ); return ( $destinations{'Build Menu'}{$response} ) if ( exists $destinations{'Build Menu'}{$response} ); $MOD->{BUILD_SYSTEM} = $Build_Menu{$response} if exists $Build_Menu{$response}; return ('Build Menu'); } sub Copyright_Display { my $MOD = shift; my $string = $messages{Copyright_Display}; $string =~ s|##Copyright Here##|$MOD->{LicenseParts}{COPYRIGHT}|; my $response = Question_User( $string, 'menu' ); return ( $destinations{'License Menu'}{$response} ) if ( exists $destinations{'License Menu'}{$response} ); return ('License Menu'); } sub Question_User { my ( $question, $flavor, $feature ) = @_; print "\n------------------------\n\n", $question, "\n"; my $answer = <>; if ( $flavor eq 'menu' ) { $answer =~ m/^(.)/; $answer = uc($1); } elsif ( $flavor eq 'data' ) { chomp($answer); } elsif ( $flavor eq 'license' ) { chomp($answer); unless ( $answer =~ m/^\d+/ ) { $answer =~ m/^(.)/; $answer = uc($1); } elsif ( ( $answer < 1 ) || ( $feature < $answer ) ) { $answer = 'P'; } } print "You entered '$answer'\n"; return ($answer); } ########## END PRIVATE METHODS ########## 1; ################### DOCUMENTATION ################### =head1 NAME ExtUtils::ModuleMaker::Interactive - Hold methods used in F =head1 SYNOPSIS use ExtUtils::ModuleMaker::Interactive; $mod = ExtUtils::ModuleMaker::Interactive->new(%standard_options); $mod->run_interactive() if $mod->{INTERACTIVE}; ... # ExtUtils::ModuleMaker::complete_build() called here $mod->closing_message(); =head1 DESCRIPTION This package exists solely to hold declarations of variables and methods used in F, the command-line utility which is the easiest way of accessing the functionality of Perl extension ExtUtils::ModuleMaker. =head1 METHODS =head2 C This method drives the menus which make up F's interactive mode. Once it has been run, F calls C to build the directories and files requested. =head2 C Prints a closing message after C is run. Can be commented out without problem. Could be subclassed, and -- in a future version -- probably will be with an optional printout of files created. =head1 AUTHOR James E Keenan. CPANID: JKEENAN. =head1 COPYRIGHT Copyright (c) 2005, 2017 James E. Keenan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =head1 SEE ALSO F, F. =cut ExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker/Defaults.pm0000644000175000017500000000517613043670162024114 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker::Defaults; use strict; use vars qw( $VERSION ); $VERSION = 0.56; my $usage = < 'perl', VERSION => '0.01', ABSTRACT => 'Module abstract (<= 44 characters) goes here', AUTHOR => 'A. U. Thor', CPANID => 'MODAUTHOR', ORGANIZATION => 'XYZ Corp.', WEBSITE => 'http://a.galaxy.far.far.away/modules', EMAIL => 'a.u.thor@a.galaxy.far.far.away', BUILD_SYSTEM => 'ExtUtils::MakeMaker', COMPACT => 0, VERBOSE => 0, INTERACTIVE => 0, NEED_POD => 1, NEED_NEW_METHOD => 1, CHANGES_IN_POD => 0, PERMISSIONS => 0755, SAVE_AS_DEFAULTS => 0, USAGE_MESSAGE => $usage, FIRST_TEST_NUMBER => 1, TEST_NUMBER_FORMAT => "%03d", TEST_NAME => 'load', EXTRA_MODULES_SINGLE_TEST_FILE => 0, TEST_NAME_DERIVED_FROM_MODULE_NAME => 0, TEST_NAME_SEPARATOR => q{_}, INCLUDE_MANIFEST_SKIP => 0, INCLUDE_TODO => 1, INCLUDE_POD_COVERAGE_TEST => 0, INCLUDE_POD_TEST => 0, INCLUDE_LICENSE => 1, INCLUDE_SCRIPTS_DIRECTORY => 1, INCLUDE_FILE_IN_PM => 0, INCLUDE_ID_LINE => 0, INCLUDE_WARNINGS => 0, ); sub default_values { my $self = shift; return { %default_values }; } 1; #################### DOCUMENTATION #################### =head1 NAME ExtUtils::ModuleMaker::Defaults - Default values for ExtUtils::ModuleMaker objects =head1 METHODS =head3 C Usage : $self->default_values() within new(); within ExtUtils::ModuleMaker::Interactive::_prepare_author_defaults() and _prepare_directives_defaults(); within t/testlib/Testing/Defaults.pm Purpose : Set the default values for ExtUtils::ModuleMaker object elements Returns : Reference to a hash of default values Argument : n/a Comment : Can be overridden by establishing a Personal::Defaults file. Comment : See ExtUtils::ModuleMaker::PBP for an example of subclassing this method. =head1 SEE ALSO F. =cut ExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker/Licenses/0000755000175000017500000000000013043670323023542 5ustar jkeenanjkeenanExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker/Licenses/Local.pm0000644000175000017500000000570013043670123025132 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker::Licenses::Local; use strict; use warnings; BEGIN { use base qw(Exporter); use vars qw( @EXPORT_OK $VERSION ); $VERSION = 0.56; @EXPORT_OK = qw(Get_Local_License Verify_Local_License); } my %licenses = ( looselips => { function => \&License_LooseLips, fullname => 'Loose Lips License (1.0)', }, ); sub Get_Local_License { my $choice = shift; $choice = lc ($choice); return ($licenses{$choice}{function}) if (exists $licenses{$choice}); return; } sub Verify_Local_License { my $choice = shift; return (exists $licenses{lc ($choice)}); } sub interact { my $class = shift; return (bless ( { map { ($licenses{$_}{fullname}) ? ($_ => $licenses{$_}{fullname}) : () } keys (%licenses) }, ref ($class) || $class) ); } sub License_LooseLips { my %license; $license{COPYRIGHT} = < =item * C =back =head2 License_LooseLips Purpose : Get the copyright pod text and LICENSE file text for this license =head1 BUGS None known at this time. =head1 AUTHOR/MAINTAINER ExtUtils::ModuleMaker was originally written in 2001-02 by R. Geoffrey Avery (modulemaker [at] PlatypiVentures [dot] com). Since version 0.33 (July 2005) it has been maintained by James E. Keenan (jkeenan [at] cpan [dot] org). =head1 SUPPORT Send email to jkeenan [at] cpan [dot] org. Please include 'modulemaker' in the subject line. =head1 COPYRIGHT Copyright (c) 2001-2002 R. Geoffrey Avery. Revisions from v0.33 forward (c) 2005, 2017 James E. Keenan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =head1 SEE ALSO F, F, perl(1). =cut ExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker/Licenses/Standard.pm0000644000175000017500000106452013043670123025646 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker::Licenses::Standard; #$Id$ use strict; use warnings; BEGIN { use base qw(Exporter); use vars qw( @EXPORT_OK $VERSION ); $VERSION = 0.56; @EXPORT_OK = qw(Get_Standard_License Verify_Standard_License); # $VERSION : taken from lib/ExtUtils/ModuleMaker.pm } #################### DOCUMENTATION #################### =head1 NAME ExtUtils::ModuleMaker::Licenses::Standard - Open source software licenses =head1 SYNOPSIS use ExtUtils::ModuleMaker::Licenses::Standard; blah blah blah =head1 DESCRIPTION This package holds subroutines imported and used by ExtUtils::ModuleMaker to include license and copyright information in a standard Perl module distribution. =head1 BUGS None known at this time. =head1 AUTHOR/MAINTAINER ExtUtils::ModuleMaker was originally written in 2001-02 by R. Geoffrey Avery (modulemaker [at] PlatypiVentures [dot] com). Since version 0.33 (July 2005) it has been maintained by James E. Keenan (jkeenan [at] cpan [dot] org). =head1 SUPPORT Send email to jkeenan [at] cpan [dot] org. Please include 'modulemaker' in the subject line. =head1 COPYRIGHT Copyright (c) 2001-2002 R. Geoffrey Avery. Revisions from v0.33 forward (c) 2005 James E. Keenan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =head1 SEE ALSO F, F, perl(1). =cut =head1 PUBLIC METHODS Each public function/method is described here. These are how you should interact with this module. =cut my %licenses = ( perl => { function => \&License_Perl, fullname =>'Same terms as Perl itself', }, apache => { function => \&License_Apache_1_1, fullname => '' }, apache_1_1 => { function => \&License_Apache_1_1, fullname => 'Apache Software License (1.1)' }, artistic => { function => \&License_Artistic, fullname => 'Artistic License' }, artistic_agg => { function => \&License_Artistic_w_Aggregation, fullname => 'Artistic License w/ Aggregation' }, r_bsd => { function => \&License_r_BSD, fullname => 'BSD License(Raw)' }, bsd => { function => \&License_BSD, fullname => 'BSD License' }, gpl => { function => \&License_GPL_2, fullname => '' }, gpl_2 => { function => \&License_GPL_2, fullname => 'GPL - General Public License (2)' }, ibm => { function => \&License_IBM_1_0, fullname => '' }, ibm_1_0 => { function => \&License_IBM_1_0, fullname => 'IBM Public License Version (1.0)' }, intel => { function => \&License_Intel, fullname => 'Intel (BSD+)' }, jabber => { function => \&License_Jabber_1_0, fullname => '' }, jabber_1_0 => { function => \&License_Jabber_1_0, fullname => 'Jabber (1.0)' }, lgpl => { function => \&License_LGPL_2_1, fullname => '' }, lgpl_2_1 => { function => \&License_LGPL_2_1, fullname => 'LGPL - GNU Lesser General Public License (2.1)' }, mit => { function => \&License_MIT, fullname => 'MIT License' }, mitre => { function => \&License_MITRE, fullname => 'CVW - MITRE Collaborative Virtual Workspace' },#mitre includes gpl 2.0 and mozilla 1.0 mozilla => { function => \&License_Mozilla_1_1, fullname => '' }, mozilla_1_1 => { function => \&License_Mozilla_1_1, fullname => 'Mozilla Public License (1.1)' }, mozilla_1_0 => { function => \&License_Mozilla_1_0, fullname => 'Mozilla Public License (1.0)' }, mpl => { function => \&License_Mozilla_1_1, fullname => '' }, mpl_1_1 => { function => \&License_Mozilla_1_1, fullname => '' }, mpl_1_0 => { function => \&License_Mozilla_1_0, fullname => '' }, nethack => { function => \&License_Nethack, fullname => 'Nethack General Public License' }, nokia => { function => \&License_Nokia_1_0a, fullname => '' }, nokos => { function => \&License_Nokia_1_0a, fullname => '' }, nokia_1_0a => { function => \&License_Nokia_1_0a, fullname => 'Nokia Open Source License(1.0a)' }, nokos_1_0a => { function => \&License_Nokia_1_0a, fullname => '' }, python => { function => \&License_Python, fullname => 'Python License' }, q => { function => \&License_Q_1_0, fullname => '' }, q_1_0 => { function => \&License_Q_1_0, fullname => 'Q Public License (1.0)' }, ricoh => { function => \&License_Ricoh_1_0, fullname => '' }, ricoh_1_0 => { function => \&License_Ricoh_1_0, fullname => 'Ricoh Source Code Public License (1.0)' }, sun => { function => \&License_Sun, fullname => '' }, sissl => { function => \&License_Sun, fullname => 'Sun Internet Standards Source License' }, sleepycat => { function => \&License_Sleepycat, fullname => 'The Sleepycat License' }, vovida => { function => \&License_Vovida_1_0, fullname => '' }, vovida_1_0 => { function => \&License_Vovida_1_0, fullname => 'Vovida Software License (1.0)' }, zlib => { function => \&License_ZLIB, fullname => 'zlib/libpng License' }, libpng => { function => \&License_ZLIB, fullname => '' }, #not yet installed # python_2_1_1 => { function => undef, # fullname => '' # }, # commonpublic => { function => undef, # fullname => '' # }, # applepublic => { function => undef, # fullname => '' # }, # xnet => { function => undef, # fullname => '' # }, # sunpublic => { function => undef, # fullname => '' # }, # eiffel => { function => undef, # fullname => '' # }, # w3c => { function => undef, # fullname => '' # }, # motosoto => { function => undef, # fullname => '' # }, # opengroup => { function => undef, # fullname => '' # }, # zopepublic => { function => undef, # fullname => '' # }, # u_illinois_ncsa=> { function => undef, # fullname => '' # }, ); sub Get_Standard_License { my $choice = shift; $choice = lc ($choice); return ($licenses{$choice}{function}) if (exists $licenses{$choice}); return; } sub Verify_Standard_License { my $choice = shift; return (exists $licenses{lc ($choice)}); } sub interact { my $class = shift; return (bless ( { map { ($licenses{$_}{fullname}) ? ($_ => $licenses{$_}{fullname}) : () } keys (%licenses) }, ref ($class) || $class) ); } ################################################ subroutine header begin ## =head2 License_Apache Purpose : Get the copyright pod text and LICENSE file text for this license =cut ################################################## subroutine header end ## sub License_Apache_1_1 { my %license; $license{COPYRIGHT} = <. Portions of this software are based upon public domain software originally written at the National Center for Supercomputing Applications, University of Illinois, Urbana-Champaign. EOFLICENSETEXT return (\%license); } ################################################ subroutine header begin ## =head2 License_Artistic Purpose : Get the copyright pod text and LICENSE file text for this license =cut ################################################## subroutine header end ## sub License_Artistic { my %license; $license{COPYRIGHT} = < = Regents of the University of California = University of California, Berkeley = 1998 In the original BSD license, the first occurrence of the phrase "COPYRIGHT HOLDERS AND CONTRIBUTORS" in the disclaimer read "REGENTS AND CONTRIBUTORS". Here is the license template: Copyright (c) , All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EOFLICENSETEXT return (\%license); } ################################################ subroutine header begin ## =head2 License_BSD Purpose : Get the copyright pod text and LICENSE file text for this license =cut ################################################## subroutine header end ## sub License_BSD { my %license; $license{COPYRIGHT} = < Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. EOFLICENSETEXT return (\%license); } ################################################ subroutine header begin ## =head2 License_MITRE Purpose : Get the copyright pod text and LICENSE file text for this license =cut ################################################## subroutine header end ## sub License_MITRE { my %license; $license{COPYRIGHT} = < Nokia and others. All Rights Reserved. Contributor(s): ______________________________________. EOFLICENSETEXT return (\%license); } ################################################ subroutine header begin ## =head2 License_Python Purpose : Get the copyright pod text and LICENSE file text for this license =cut ################################################## subroutine header end ## sub License_Python { my %license; $license{COPYRIGHT} = < This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. EOFLICENSETEXT return (\%license); } ################################################ subroutine header begin ## =head2 License_Perl Purpose : Get the copyright pod text and LICENSE file text for this license =cut ################################################## subroutine header end ## sub License_Perl { my %license; my $gpl = License_GPL_2 (); my $artistic = License_Artistic_w_Aggregation (); $license{COPYRIGHT} = <{LICENSETEXT} --------------------------------------------------------------------------- $artistic->{LICENSETEXT} EOFLICENSETEXT return (\%license); } ################################################ subroutine header begin ## =head2 Custom_Licenses Purpose : Get the copyright pod text and LICENSE file text for some custom license provided by the programmer =cut ################################################## subroutine header end ## sub Custom_Licenses { my %license; $license{COPYRIGHT} = <{NAME} = $class; { eval "require $eumm_package"; no strict 'refs'; $self->{VERSION} = ${$eumm_package . "::VERSION"}; } $self->{PACKAGE} = $eumm_package; $self->{SCRIPT} = $eumm_script; my %standard_options = ( ( ( $opts{c} ) ? ( COMPACT => $opts{c} ) : () ), ( ( $opts{V} ) ? ( VERBOSE => $opts{V} ) : () ), ( ( $opts{C} ) ? ( CHANGES_IN_POD => $opts{C} ) : () ), ( ( $opts{P} ) ? ( NEED_POD => 0 ) : () ), ( ( $opts{q} ) ? ( NEED_NEW_METHOD => 0 ) : () ), # ( ( $opts{I} ) ? ( INTERACTIVE => 0 ) : 1 ), INTERACTIVE => ( ( $opts{I} ) ? 0 : 1 ), ( ( $opts{s} ) ? ( SAVE_AS_DEFAULTS => $opts{s} ) : () ), ( ( $opts{n} ) ? ( NAME => $opts{n} ) : () ), ( ( $opts{a} ) ? ( ABSTRACT => $opts{a} ) : () ), ( ( $opts{b} ) ? ( BUILD_SYSTEM => $opts{b} ) : () ), ( ( $opts{v} ) ? ( VERSION => $opts{v} ) : () ), ( ( $opts{l} ) ? ( LICENSE => $opts{l} ) : () ), ( ( $opts{u} ) ? ( AUTHOR => $opts{u} ) : () ), ( ( defined $opts{p} ) ? ( CPANID => $opts{p} ) : () ), ( ( defined $opts{o} ) ? ( ORGANIZATION => $opts{o} ) : () ), ( ( defined $opts{w} ) ? ( WEBSITE => $opts{w} ) : () ), ( ( $opts{e} ) ? ( EMAIL => $opts{e} ) : () ), ( ( $opts{r} ) ? ( PERMISSIONS => $opts{r} ) : () ), ( ( $opts{d} ) ? ( ALT_BUILD => $opts{d} ) : () ), USAGE_MESSAGE => Usage( $self->{SCRIPT}, $self->{PACKAGE}, $self->{VERSION}, ), ); $self->{STANDARD_OPTIONS} = { %standard_options }; return $self; } sub get_standard_options { my $self = shift; return %{ $self->{STANDARD_OPTIONS} }; } sub Usage { my ($script, $eumm_package, $eumm_version) = @_; my $message = < =head1 SYNOPSIS use ExtUtils::ModuleMaker::Opts; $eumm_package = q{ExtUtils::ModuleMaker}; $eumm_script = q{modulemaker}; $opt = ExtUtils::ModuleMaker::Opts->new( $eumm_package, $eumm_script, ); $mod = ExtUtils::ModuleMaker::Interactive->new( $opt->get_standard_options() ); =head1 DESCRIPTION The methods in this package provide processing of command-line options for F, the command-line utility associated with Perl extension ExtUtils::ModuleMaker, and for similar utilities associated with Perl extensions which subclass ExtUtils::ModuleMaker. =head1 METHODS =head2 C Usage : $opt = ExtUtils::ModuleMaker::Opts->new($package,$script) from inside a command-line utility such as modulemaker Purpose : Creates an ExtUtils::ModuleMaker::Opts object Returns : An ExtUtils::ModuleMaker::Opts object Argument : Two arguments: 1. String holding 'ExtUtils::ModuleMaker' or a package subclassed therefrom, e.g., 'ExtUtils::ModuleMaker::PBP'. 2. String holding 'modulemaker' or the name of a command-line utility similar to 'modulemaker' and found in the 'scripts/' directory of the distribution named in argument 1 =head2 C Usage : %standard_options = $opt->get_standard_options from inside a command-line utility such as modulemaker Purpose : Provide arguments to ExtUtils::ModuleMaker::Interactive::new() or to the constructor of the 'Interactive' package of a distribution subclassing ExtUtils::ModuleMaker Returns : A hash suitable for passing to ExtUtils::ModuleMaker::Interactive::new() or similar constructor Argument : n/a =head1 SEE ALSO F, F, F, F, F. =cut ExtUtils-ModuleMaker-0.56/lib/ExtUtils/ModuleMaker.pm0000644000175000017500000014215513043670123022341 0ustar jkeenanjkeenanpackage ExtUtils::ModuleMaker; use strict; use warnings; BEGIN { use vars qw( $VERSION @ISA ); $VERSION = 0.56; use base qw( ExtUtils::ModuleMaker::Defaults ExtUtils::ModuleMaker::Initializers ExtUtils::ModuleMaker::StandardText ); }; use Carp; use File::Path; use File::Spec; use Cwd; use File::Save::Home qw( get_subhome_directory_status make_subhome_directory ); #################### PUBLICLY CALLABLE METHODS #################### sub new { my $class = shift; my $self = ref($class) ? bless( {}, ref($class) ) : bless( {}, $class ); # multi-stage initialization of EU::MM object # 1. Pull in arguments supplied to constructor -- but don't do anything # with them yet. These will come from one of three sources: # a. In a script: KEY => 'Value' pairs supplied to new(); # b. From modulemaker command-line: -option 'Value' pairs following # 'modulemaker'; # c. From modulemaker interactive mode: hard-wired values which may # supersede (b) values. my @arglist = @_; croak "Must be hash or balanced list of key-value pairs: $!" if (@arglist % 2); my %supplied_params = @arglist; # 2. Determine if there already exists on system a directory capable of # holding user ExtUtils::ModuleMaker::Personal::Defaults. The name of # such a directory and whether it exists at THIS point are stored in an # array, a reference to which is the return value of # _preexists_mmkr_directory and which is then stored in the object. # NOTE: If the directory does not yet exists, it is NOT automatically # created. $self->{mmkr_dir_ref} = get_subhome_directory_status(".modulemaker"); { my $mmkr_dir = $self->{mmkr_dir_ref}->{abs}; if (defined $self->{mmkr_dir_ref}->{flag}) { push @INC, $mmkr_dir; } my $pers_file = File::Spec->catfile( $mmkr_dir, qw| ExtUtils ModuleMaker Personal Defaults.pm | ); if (-f $pers_file) { require ExtUtils::ModuleMaker::Personal::Defaults; unshift @ISA, qw(ExtUtils::ModuleMaker::Personal::Defaults); } } # 3. Populate object with default values. These values will come from # lib/ExtUtils/ModuleMaker/Defaults.pm, unless a Personal::Defaults file # has been located in step 1 above. my $defaults_ref; $defaults_ref = $self->default_values(); foreach my $param ( keys %{$defaults_ref} ) { $self->{$param} = $defaults_ref->{$param}; } # 4. Process key-value pairs supplied as arguments to new() either # from user-written program or from modulemaker utility. # These override default values (or may provide additional elements). foreach my $param ( keys %supplied_params ) { $self->{$param} = $supplied_params{$param}; } # 5. Initialize keys set from information supplied above, system # info or EU::MM itself. $self->set_author_composite(); $self->set_dates(); $self->{eumm_version} = $VERSION; $self->{MANIFEST} = ['MANIFEST']; # 6. Validate values supplied so far to weed out most likely errors $self->validate_values(); # 7. Initialize $self->{FILE} (done here because it presumes a validated # NAME, which was only done in step 6). But allow exception for # Interactive mode because it throws a spurious warning. $self->set_file_composite() unless $self->{INTERACTIVE}; # 8. Initialize keys set from EU::MM::Licenses::Local or # EU::MM::Licenses::Standard $self->initialize_license(); # 9. Any EU::MM methods stored in ExtUtils::ModuleMaker::Standard Text # can be overriden by supplying a # value for ALT_BUILD (command-line option 'd') where the value is a Perl # module located in @INC if (defined $self->{ALT_BUILD}) { my $alt_build = $self->{ALT_BUILD}; unless ($alt_build =~ m{^ExtUtils::ModuleMaker::}) { $alt_build = q{ExtUtils::ModuleMaker::} . $alt_build; } eval "require $alt_build"; if ($@) { croak "Unable to locate $alt_build for alternative methods: $!"; } else { unshift @ISA, $alt_build; }; } return $self; } sub complete_build { my $self = shift; $self->create_base_directory(); $self->create_directory( map { File::Spec->catdir( $self->{Base_Dir}, $_ ) } qw{ lib t } ); # always on $self->create_directory( map { File::Spec->catdir( $self->{Base_Dir}, $_ ) } qw{ scripts } ) if $self->{INCLUDE_SCRIPTS_DIRECTORY}; # default is on $self->print_file( 'README', $self->text_README() ); # always on $self->print_file( 'LICENSE', $self->{LicenseParts}{LICENSETEXT} ) if $self->{INCLUDE_LICENSE}; # default is on $self->print_file( 'Todo', $self->text_Todo() ) if $self->{INCLUDE_TODO}; # default is on $self->print_file( 'Changes', $self->text_Changes() ) unless ( $self->{CHANGES_IN_POD} ); # default is off $self->print_file( 'MANIFEST.SKIP', $self->text_MANIFEST_SKIP() ) if $self->{INCLUDE_MANIFEST_SKIP}; # default is off $self->print_file( qq|t/pod-coverage.t|, $self->text_pod_coverage_test() ) if $self->{INCLUDE_POD_COVERAGE_TEST}; # default is off $self->print_file( qq|t/pod.t|, $self->text_pod_test() ) if $self->{INCLUDE_POD_TEST}; # default is off if ( $self->{BUILD_SYSTEM} eq 'ExtUtils::MakeMaker' ) { $self->print_file( 'Makefile.PL', $self->text_Makefile() ); } else { $self->print_file( 'Build.PL', $self->text_Buildfile() ); if ( $self->{BUILD_SYSTEM} eq 'Module::Build and proxy Makefile.PL' or $self->{BUILD_SYSTEM} eq 'Module::Build and Proxy') { $self->print_file( 'Makefile.PL', $self->text_proxy_makefile() ); } } my @pmfiles = ( $self ); foreach my $f ( @{ $self->{EXTRA_MODULES} } ) { push @pmfiles, $f; } foreach my $module ( @pmfiles ) { my ($dir, $file) = _get_dir_and_file($module); $self->create_directory( join( '/', $self->{Base_Dir}, $dir ) ); my $text_of_pm_file = $self->text_pm_file($module); $self->print_file( join( '/', $dir, $file ), $text_of_pm_file ); } # How test files are created depends on how tests for EXTRA_MODULES # are handled: 1 test file per extra module (default) or all tests for all # modules in a single file (example: PBP). unless ($self->{EXTRA_MODULES_SINGLE_TEST_FILE}) { my $ct = $self->{FIRST_TEST_NUMBER}; foreach my $module ( @pmfiles ) { my ($teststart, $testmiddle); # Are we going to derive the lexical part of the test name from # the name of the module it is testing? (non-default) # Or are we simply going to use our pre-defined test name? # (default) if ($self->{TEST_NAME_DERIVED_FROM_MODULE_NAME}) { $testmiddle = $self->process_attribute( $module, 'NAME' ); $testmiddle =~ s|::|$self->{TEST_NAME_SEPARATOR}|g; } else { $testmiddle = $self->{TEST_NAME}; } # # Are we going to include a number at start of test name? # (default) If so, what is sprintf format and what character is # used to separate it from the lexical part of the test name? my $testfilename; if (defined $self->{TEST_NUMBER_FORMAT}) { $teststart = "t/" . $self->{TEST_NUMBER_FORMAT} . $self->{TEST_NAME_SEPARATOR}; $testfilename = sprintf( $teststart . $testmiddle . q{.t}, $ct ); } else { $teststart = "t/"; $testfilename = $teststart . $testmiddle . q{.t}; } $self->print_file( $testfilename, $self->text_test( $testfilename, $module ) ); $ct++; } } else { my ($teststart, $testfilename); if (defined $self->{TEST_NUMBER_FORMAT}) { $teststart = "t/" . $self->{TEST_NUMBER_FORMAT} . $self->{TEST_NAME_SEPARATOR}; $testfilename = sprintf( $teststart . $self->{TEST_NAME} . q{.t}, $self->{FIRST_TEST_NUMBER}); } else { $teststart = "t/"; $testfilename = $teststart . $self->{TEST_NAME} . q{.t}; } $self->print_file( $testfilename, $self->text_test_multi( $testfilename, \@pmfiles ) ); } $self->print_file( 'MANIFEST', join( "\n", @{ $self->{MANIFEST} } ) ); $self->make_selections_defaults() if $self->{SAVE_AS_DEFAULTS}; return 1; } sub dump_keys { my $self = shift; my %keys_to_be_shown = map {$_, 1} @_; require Data::Dumper; my ($k, $v, %retry); while ( ($k, $v) = each %{$self} ) { $retry{$k} = $v if $keys_to_be_shown{$k}; } my $d = Data::Dumper->new( [\%retry] ); return $d->Dump; } sub dump_keys_except { my $self = shift; my %keys_not_shown = map {$_, 1} @_; require Data::Dumper; my ($k, $v, %retry); while ( ($k, $v) = each %{$self} ) { $retry{$k} = $v unless $keys_not_shown{$k}; } my $d = Data::Dumper->new( [\%retry] ); return $d->Dump; } sub get_license { my $self = shift; return (join ("\n\n", "=====================================================================", "=====================================================================", $self->{LicenseParts}{LICENSETEXT}, "=====================================================================", "=====================================================================", $self->{LicenseParts}{COPYRIGHT}, "=====================================================================", "=====================================================================", )); } sub make_selections_defaults { my $self = shift; my %selections = %{$self}; my @dv = keys %{ $self->default_values() }; my $topfile = <<'END_TOPFILE'; package ExtUtils::ModuleMaker::Personal::Defaults; use strict; my %default_values = ( END_TOPFILE my @keys_needed; for my $k (@dv) { push @keys_needed, $k unless ( $k eq 'ABSTRACT' or $k eq 'SAVE_AS_DEFAULTS' ); } my $kvpairs; foreach my $k (@keys_needed) { $kvpairs .= (' ' x 8) . (sprintf '%-16s', $k) . '=> q{' . $selections{$k} . "},\n"; } $kvpairs .= (' ' x 8) . (sprintf '%-16s', 'ABSTRACT') . '=> q{Module abstract (<= 44 characters) goes here}' . "\n"; my $bottomfile = <<'END_BOTTOMFILE'; ); sub default_values { my $self = shift; return { %default_values }; } 1; END_BOTTOMFILE my $output = $topfile . $kvpairs . $bottomfile; my $mmkr_dir = make_subhome_directory($self->{mmkr_dir_ref}); my $full_dir = File::Spec->catdir($mmkr_dir, qw| ExtUtils ModuleMaker Personal | ); if (! -d $full_dir) { mkpath( $full_dir ); if ($@) { croak "Unable to make directory for placement of personal defaults file: $!"; }; } my $pers_full = File::Spec->catfile( $full_dir, q{Defaults.pm} ); if (-f $pers_full ) { my $modtime = (stat($pers_full))[9]; rename $pers_full, "$pers_full.$modtime" or croak "Unable to rename $pers_full: $!"; } open my $fh, '>', $pers_full or croak "Unable to open $pers_full for writing: $!"; print $fh $output or croak "Unable to print $pers_full: $!"; close $fh or croak "Unable to close $pers_full after writing: $!"; } ## C<_get_dir_and_file()> ## ## This subroutine was originally in lib/ExtUtils/ModuleMaker/Utility.pm. ## As other subroutines therein were superseded by calls to File::Save::Home ## functions, they were no longer called in the .pm or .t files, hence, became ## superfluous and uncovered by test suite. When _get_dir_and_file() became the ## last called subroutine from Utility.pm, I decided it was simpler to pull it ## into the current package. ## ## Usage : _get_dir_and_file($module) within complete_build() ## Purpose : Get directory and name for .pm file being processed ## Returns : 2-element list: First $dir; Second: $file ## Argument : $module: pointer to the module being built ## (as there can be more than one module built by EU::MM); ## for the primary module it is a pointer to $self ## Comment : Merely a utility subroutine to refactor code; not a method call. sub _get_dir_and_file { my $module = shift; my @layers = split( /::/, $module->{NAME} ); my $file = pop(@layers) . '.pm'; my $dir = join( '/', 'lib', @layers ); return ($dir, $file); } 1; #################### DOCUMENTATION #################### =head1 NAME ExtUtils::ModuleMaker - Better than h2xs for creating modules =head1 SYNOPSIS At the command prompt: % modulemaker Inside a Perl program: use ExtUtils::ModuleMaker; $mod = ExtUtils::ModuleMaker->new( NAME => 'Sample::Module' ); $mod->complete_build(); $mod->dump_keys(qw| ... # key provided as argument to constructor ... # same |); $mod->dump_keys_except(qw| ... # key provided as argument to constructor ... # same |); $license = $mod->get_license(); $mod->make_selections_defaults(); =head1 VERSION This document references version 0.56 of ExtUtils::ModuleMaker, released to CPAN on January 30 2017. =head1 DESCRIPTION This module is a replacement for the most typical use of the F utility bundled with all Perl distributions: the creation of the directories and files required for a pure-Perl module to be installable with F and distributable on the Comprehensive Perl Archive Network (CPAN). F has many options which are useful -- indeed, necessary -- for the creation of a properly structured distribution that includes C code as well as Perl code. Most of the time, however, F is used as follows % h2xs -AXn My::Module to create a distribution containing only Perl code. ExtUtils::ModuleMaker is intended to be an easy-to-use replacement for I use of F. While you can call ExtUtils::ModuleMaker from within a Perl script (as in the SYNOPSIS above), it's easier to use with a command-prompt invocation of the F script bundled with this distribution: % modulemaker Then respond to the prompts. For Perl programmers, laziness is a virtue -- and F is far and away the laziest way to create a pure Perl distribution which meets all the requirements for worldwide distribution via CPAN. =head1 USAGE =head2 Usage from the command-line with F The easiest way to use ExtUtils::ModuleMaker is to invoke the F script from the command-line. You can control the content of the files built by F either by supplying command-line options or -- easier still -- replying to the screen prompts in F's interactive mode. B which is bundled this distribution.>> Return to this document once you have become familiar with F. =head2 Use of Public Methods within a Perl Program You can use ExtUtils::ModuleMaker within a Perl script to generate the directories and files needed to begin work on a CPAN-ready Perl distribution. You will need to call C and C, both of which are described in the next section. These two methods control the building of the file and directory structure for a new Perl distribution. There are four other publicly available methods in this version of ExtUtils::ModuleMaker. C, C and C are intended primarily as shortcuts for trouble-shooting problems with an ExtUtils::ModuleMaker object. C enables you to be even lazier in your use of ExtUtils::ModuleMaker by saving keystrokes entered for attributes. =head3 C Creates and returns an ExtUtils::ModuleMaker object. Takes a list containing key-value pairs with information specifying the structure and content of the new module(s). (In this documentation, we will sometimes refer to these key-value pairs as the I of the ExtUtils::ModuleMaker object.) With the exception of key C (see below), the values in these pairs are all strings. Like most such lists of key-value pairs, this list is probably best held in a hash. Keys which may be specified are: =over 4 =item * Required Argument =over 4 =item * NAME The I required feature. This is the name of the primary module (with 'C<::>' separators if needed). Will no longer support the older, Perl 4-style separator ''C<'>'' like the module F. There is no current default for NAME; you must supply a name explicitly. =back =item * Other Important Arguments =over 4 =item * ABSTRACT A short description of the module. CPAN likes to use this feature to describe the module. If the abstract contains an apostrophe (C<'>), then the value corresponding to key C in the list passed to the constructor must be double-quoted; otherwise F gets messed up. Certain CPAN indexing features still work better if the abstract is 44 or fewer characters in length, but this does not appear to be as mandatory as in the past. (Defaults to dummy copy.) =item * VERSION A string holding the version number. For alpha releases, include an underscore to the right of the dot like C<0.31_21>. (Default is C<0.01>.) =item * LICENSE Which license to include in the Copyright section. You can choose one of the standard licenses by including 'perl', 'gpl', 'artistic', and 18 others approved by opensource.org. The default is to choose the 'perl' flavor which is to share it ''under the same terms as Perl itself.'' Other licenses can be added by individual module authors to ExtUtils::ModuleMaker::Licenses::Local to keep your company lawyers happy. Some licenses include placeholders that will be replaced with AUTHOR information. =item * BUILD_SYSTEM This can take one of three values: =over 4 =item * C<'ExtUtils::MakeMaker'> The first generates a basic Makefile.PL file for your module. =item * C<'Module::Build'> The second creates a Build.PL file. =item * C<'Module::Build and Proxy'> The third creates a Build.PL along with a proxy Makefile.PL script that attempts to install Module::Build if necessary, and then runs the Build.PL script. This option is recommended if you want to use Module::Build as your build system. See Module::Build::Compat for more details. B To correct a discrepancy between the documentation and code in earlier versions of ExtUtils::ModuleMaker, we now explicitly provide this synonym for the third option: 'Module::Build and proxy Makefile.PL' (Thanks to David A Golden for spotting this bug.) =back =item * COMPACT For a module named ''Foo::Bar::Baz'' creates a base directory named ''Foo-Bar-Baz'' instead of Foo/Bar/Baz. (Default is off.) =item * VERBOSE Prints messages to STDOUT as it creates directories, writes files, etc. (Default is off.) =item * PERMISSIONS Used to create new directories. (Default is 0.56: group and world can not write.) =item * USAGE_MESSAGE Message given when the module Cs. Scripts should set this to the same string it would print if the user asked for help. (A reasonable default is provided.) =item * NEED_POD Include POD section in F<*.pm> files created. (Default is on.) =item * NEED_NEW_METHOD Include a simple C method in the F<*.pm> files created. (Default is on.) =item * CHANGES_IN_POD Omit a F file, but instead add a HISTORY section to the POD. (Default is off). =item * INCLUDE_MANIFEST_SKIP Boolean value which, if true, includes a F file in the distribution with reasonable default values facilitating use of the F command during module development. (Thanks to David A Golden for this feature. Default is off.) =item * INCLUDE_TODO Boolean value which, if true, includes a F file in the distribution in which the module's author or maintainer can discuss future lines of development. (Default is on.) =item * INCLUDE_LICENSE Boolean value which, if true, includes a F file in the distribution. (Which LICENSE file is determined in the LICENSE option.) (Default is on.) =item * INCLUDE_SCRIPTS_DIRECTORY Boolean value which, if true, includes a F directory (at the same level as F or F). (Default is on.) =item * INCLUDE_WARNINGS Boolean value which, if true, inserts C in all Perl modules created by use of this module. (Default is off.) =item * INCLUDE_ID_LINE Boolean value which, if true, inserts C<#$Id$> in all Perl modules created by use of this module for the purpose of inserting a Subversion file 'Id' string. (Default is off.) =back =item * Arguments Related to the Module's Author =over 4 =item * AUTHOR Name of the author. If the author's name contains an apostrophe (C<'>), then the corresponding value in the list passed to the constructor must be double-quoted; otherwise F gets messed up. (Defaults to dummy copy.) =item * EMAIL Email address of the author. If the author's e-mail address contains an apostrophe (C<'>), then the corresponding value in the list passed to the constructor must be double-quoted; otherwise F gets messed up. (Defaults to dummy copy.) =item * CPANID The CPANID of the author. If this is omitted, then the line will not be added to the documentation. (Defaults to dummy copy.) =item * WEBSITE The personal or organizational website of the author. If this is omitted, then the line will not be added to the documentation. (Defaults to dummy copy.) =item * ORGANIZATION Company or group owning the module. If this is omitted, then the line will not be added to the documentation. (Defaults to dummy copy.) =back =item * Argument Related to Multiple Modules within a Distribution =over 4 =item * EXTRA_MODULES A reference to an array of hashes, each of which contains values for additional modules in the distribution. $mod = ExtUtils::ModuleMaker->new( NAME => 'Alpha::Beta', EXTRA_MODULES => [ { NAME => 'Alpha::Beta::Gamma' }, { NAME => 'Alpha::Beta::Delta' }, { NAME => 'Alpha::Beta::Gamma::Epsilon' }, ], ); As with the primary module, the only attribute required for each extra module is C. Other attributes may be supplied but the primary module's values will be used if no value is given here. Each extra module will be created in the correct relative place in the F directory. By default, a test file will also be created in the F directory corresponding to each extra module to test that it loads properly. (See EXTRA_MODULES_SINGLE_TEST_FILE below to learn how to change this behavior.) However, no other supporting documents (I README, Changes) will be created. This is one major improvement over the earlier F as you can now build multi-module packages. =back =item * Arguments Related to Test Files =over 4 =item * FIRST_TEST_NUMBER A non-negative natural number from which the count begins in test files that are numerically ordered. (Default is C<1>.) =item * TEST_NUMBER_FORMAT In test files that are numerically ordered, a Perl C formatting string that specifies how FIRST_TEST_NUMBER is to be formatted. (Default is C<"%03d">.) =item * TEST_NAME String forming the core of the name of a test file. (Default is C). =item * TEST_NAME_DERIVED_FROM_MODULE_NAME Boolean value which, when true, tells ExtUtils::ModuleMaker to create a file in the test suite with a name derived from the F<.pm> package it is testing, thereby overriding any value set in the TEST_NAME attribute. For example, for a module called 'Alpha::Sigma::Tau', a test file named F will be created. (Default is off.) =item * TEST_NAME_SEPARATOR String holding the character which joins components of a test file's name, I the character used to join C<001> and in a file named F<001_load.t>. (Defaults to an underscore C<_>.) =item * EXTRA_MODULES_SINGLE_TEST_FILE Boolean value which, when true and when extra modules have been specified in the EXTRA_MODULES attribute, will put tests for those extra modules in a single test file rather than in individual test files corresponding to each module. (Default is off.) =item * INCLUDE_POD_COVERAGE_TEST Boolean value which, if true, causes a test file called F to be included in the F directory. This test is advocated by some Perl quality assurance experts and module authors. However, since the maintainer of ExtUtils::ModuleMaker is not persuaded of its worth, default is off. =item * INCLUDE_POD_TEST Boolean value which, if true, causes a test file called F to be included in the F directory. This test is advocated by some Perl quality assurance experts and module authors. However, since the maintainer of ExtUtils::ModuleMaker is not persuaded of its worth, default is off. =item * INCLUDE_FILE_IN_PM String holding a path to a file containing Perl code and/or documentation which will be included in each F file created in a particular distribution. By default, such content is placed after any constructor and before the main POD block. This could, for example, be used to insert stub subroutines in each package within a distribution. Default is off. =back =item * Arguments for Advanced Usages =over 4 =item * INTERACTIVE Activates interactive mode in F utility. The interactive mode presents the user with a series of menus from which the user selects features by entering text at the command prompt. This attribute should only be used by interactive scripts like F. (Default is off.) =item * ALT_BUILD Name of a Perl package holding methods which override those called withiin C to shape the content of files created by using ExtUtils::ModuleMaker. See "An Alternative Approach to Subclassing" below. =back =back =head3 C Creates all directories and files as configured by the key-value pairs passed to C. Returns a true value if all specified files are created -- but this says nothing about whether those files have been created with the correct content. =head3 C When troubleshooting problems with an ExtUtils::ModuleMaker object, it is often useful to use F to dump the contents of the object. Use C when you only need to examine a few of the object's attributes. $mod->dump_keys( qw| NAME ABSTRACT | ); =head3 C When troubleshooting problems with an ExtUtils::ModuleMaker object, it is often useful to use F to dump the contents of the object. However, since certain elements of that object are often quite lengthy (I the values of keys C and C), it's handy to have a dumper function that dumps all keys I certain designated keys. $mod->dump_keys_except(qw| LicenseParts USAGE_MESSAGE |); =head3 C Returns a string which nicely formats a short version of the License and Copyright information. $license = $mod->get_license(); print $license; ... will print something like this: ===================================================================== ===================================================================== [License Information] ===================================================================== ===================================================================== [Copyright Information] ===================================================================== ===================================================================== (Earlier versions of ExtUtils::ModuleMaker contained a C function in each of submodules F and F. These functions were never publicly documented or tested. C is intended as a replacement for those two functions.) =head3 C Saves the values you entered as arguments passed to C in a personal defaults file so that they supersede the defaults provided by ExtUtils::ModuleMaker itself. This is an advanced usage of ExtUtils::ModuleMaker. If you have used ExtUtils::ModuleMaker more than once, you have probably typed in a choice for C, C, etc., more than once. To save unnecessary typing and reduce typing errors, ExtUtils::ModuleMaker now offers you the possibility of establishing B which override the default values supplied with the distribution and found in F. Suppose that you have called C as follows: $mod = ExtUtils::ModuleMaker->new( NAME => 'Sample::Module', ABSTRACT => 'Now is the time to join the party', AUTHOR => 'Hilton Stallone', CPANID => 'RAMBO', ORGANIZATION => 'Parliamentary Pictures', WEBSITE => 'http://parliamentarypictures.com', EMAIL => 'hiltons@parliamentarypictures.com', ); While C<$mod> is still in scope, you can call: $mod->make_selections_defaults() and the values selected -- B -- will be saved in a F file stored in your home directory. The next time you invoke ExtUtils::ModuleMaker, the new values will appear in the appropriate locations in the files created by C. They will also appear in the menus provided on screen by the F utility. What are those two important exceptions? =over 4 =item * C You cannot enter a default value for C: the name of the module you are creating. ExtUtil::ModuleMaker's own defaults file omits a value for C to prevent you from overwriting an already existing module. (More precisely, the default value is an empty string. ExtUtil::ModuleMaker will throw an error if you attempt to create a module whose name is empty.) This precaution applies to your personal defaults file as well. =item * C Since every module you create presumably has its own unique purpose, every module must have a unique C to summarize that purpose. ExtUtil::ModuleMaker supplies the following string as the default value for the C key: Module abstract (<= 44 characters) goes here ... a string which, not coincidentally, happens to be exactly 44 characters long -- so you can just overstrike it. This will be the default value for C in any F file you create as well. =back =head1 CUSTOMIZATION ExtUtils::ModuleMaker is designed to be customizable to your needs and to offer you more flexibility as you become more experienced with it. =head2 Via F Utility Interactive Mode As with everything else about ExtUtils::ModuleMaker, the easiest, laziest way to get started is via the F utility; see its documentation. Suppose that you have entered your correct name, email address and website at the prompts in F's Author Menu. ------------------------ modulemaker: Author Menu Feature Current Value N - Author 'John Q Public' C - CPAN ID 'MODAUTHOR' O - Organization 'XYZ Corp.' W - Website 'http://public.net/~jqpublic' E - Email 'jqpublic@public.net' R - Return to main menu X - Exit immediately Please choose which feature you would like to edit: Why should you ever have to enter this information again? Return to the F Main Menu (C). ------------------------ modulemaker: Main Menu Feature Current Value N - Name of module '' S - Abstract 'Module abstract (<= 44 characters) goes here' A - Author information L - License 'perl' D - Directives B - Build system 'ExtUtils::MakeMaker' G - Generate module H - Generate module; save selections as defaults X - Exit immediately Please choose which feature you would like to edit: Select C instead of C to generate the distribution. An internal call to C will save those selections in a personal defaults file and present them to you on the Author Menu the next time you go to use it. =head2 Via F Utility Command-Line Options Mode For simplicity, not all of ExtUtils::ModuleMaker's default values are represented on F's menus. Those that are not represented on those menus cannot be changed from there. They I, however, in many cases be specified as options passed to F on the command-line and automatically saved as personal defaults by including the C flag as one of those options. If, for example, your name is 'John Q Public' and you want all modules you create to have compact top-level directories, you would call: % modulemaker -Icsn Sample::Module -u 'John Q Public' A distribution with a top-level directory F would be created. 'John Q Public' would appear in appropriate places in F and F. You could then throw away the entire F directory tree. The I time you call C, the call % modulemaker -In Second::Module would suffice to generate a compact top-level directory and 'John Q Public' would appear in appropriate locations instead of the dreaded 'A. U. Thor'. =head2 Via C In I cases, ExtUtils::ModuleMaker's default values can be overridden with arguments passed to C inside a Perl program. The overriding can then be made permanent by calling C. Suppose, for example, =over 4 =item 1 that you want the files in your test suite to appear in a numerical order starting from C<0> rather than ExtUtils::ModuleMaker's own default starting point of C<1>; =item 2 that you want the number in the test file's name to be formatted as a two-digit string padded with zeroes rather than ExtUtils::ModuleMaker's own default format of a three-digit, zero-padded string; =item 3 that you want the numerical part of the test filename to be joined to the lexical part with a dot (C<.>) rather than ExtUtils::ModuleMaker's own default linkage character of an underscore (C<_>); and =item 4 that you want the lexical part of the test filename to reflect the module's name rather than ExtUtils::ModuleMaker's default of C. =back Your Perl program would look like this: #!/usr/local/bin/perl use strict; use warnings; use ExtUtils::ModuleMaker; my $mod = ExtUtils::ModuleMaker->new( NAME => 'Sample::Module', AUTHOR => 'John Q Public', COMPACT => 1, FIRST_TEST_NUMBER => 0, TEST_NUMBER_FORMAT => "%02d", TEST_NAME_SEPARATOR => q{.}, TEST_NAME_DERIVED_FROM_MODULE_NAME => 1, ); $mod->make_selections_defaults(); A subsequent call to the F utility, % modulemaker -In Second::Balcony::Jump would generate a directory tree with a compact top-level, 'John Q Public' in appropriate locations in F and F and a test file called F. =head2 Via Subclassing ExtUtils::ModuleMaker If you're a power-user, once you start playing with ExtUtils::ModuleMaker, you won't be able to stop. You'll ask yourself, ''Self, if I can change the default values, why can't I change the 'boilerplate' copy that appears inside the files which ExtUtils::ModuleMaker creates?'' Now, you can. You can hack on the methods which C and C call internally to customize their results to your heart's desire. The key: build an entirely new Perl extension whose F file has methods that override the methods you need overridden -- and I those methods. Follow these steps: =head3 1. Study F, F<::Initializers> and F<::StandardText> ExtUtils::ModuleMaker's default values are stored in F, specifically, in its C method. Identify those values which you wish to change. ExtUtils::ModuleMaker's other internal methods are found in two other files: F and F. Rule of thumb: If an internal method is called within C, it is found in ExtUtils::ModuleMaker::Initializers. If it is called within C, it is found in ExtUtils::ModuleMaker::StandardText. Study these two packages to identify the methods you wish to override. I If changing a default value in ExtUtils::ModuleMaker::Defaults will achieve your objective, make that change rather than trying to override methods in ExtUtils::ModuleMaker::Initializers or ExtUtils::ModuleMaker::StandardText. I You should probably think about overriding methods in ExtUtils::ModuleMaker::StandardText before overriding those in ExtUtils::ModuleMaker::Initializers. =head3 2. Use F to Create the Framework for a New Distribution You're creating a new Perl extension. Who ya gonna call? F, natch! (If you have not read the documentation for F by this point, do so now.) Suppose that you've gotten on the 'Perl Best Practices' bandwagon and want to create all your Perl extensions in the style recommended by Damian Conway in the book of the same name. Use F to create the framework: % modulemaker -Icqn ExtUtils::ModuleMaker::PBP \ -u 'James E Keenan' \ -p JKEENAN \ -o 'Perl Seminar NY' \ -w http://search.cpan.org/~jkeenan/ You used the C<-q> option above because you do I want or need a constructor in the new package you are creating. That package will I its constructor from ExtUtils::ModuleMaker. =head3 3. Edit the F File Open up the best text-editor at your disposal and proceed to hack: % vi ExtUtils-ModuleMaker-PBP/lib/ExtUtils/ModuleMaker/PBP.pm Add this line near the top of the file: use base qw{ ExtUtils::ModuleMaker }; so that ExtUtils::ModuleMaker::PBP inherits from ExtUtils::ModuleMaker (which, in turn, inherits from ExtUtils::ModuleMaker::Defaults, ExtUtils::ModuleMaker::Initializers and ExtUtils::ModuleMaker::StandardText). If you have carefully studied ExtUtils::ModuleMaker::Defaults, ExtUtils::ModuleMaker::StandardText and I, you will write methods including the following: sub default_values { my $self = shift; my $defaults_ref = $self->SUPER::default_values(); $defaults_ref->{COMPACT} = 1; $defaults_ref->{FIRST_TEST_NUMBER} = 0; $defaults_ref->{TEST_NUMBER_FORMAT} = "%02d"; $defaults_ref->{EXTRA_MODULES_SINGLE_TEST_FILE} = 1; $defaults_ref->{TEST_NAME_SEPARATOR} = q{.}; $defaults_ref->{INCLUDE_TODO} = 0; $defaults_ref->{INCLUDE_POD_COVERAGE_TEST} = 1; $defaults_ref->{INCLUDE_POD_TEST} = 1; return $defaults_ref;; } sub text_Makefile { my $self = shift; my $Makefile_format = q~ use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => '%s', AUTHOR => '%s <%s>', VERSION_FROM => '%s', ABSTRACT_FROM => '%s', PL_FILES => {}, PREREQ_PM => { 'Test::More' => 0, 'version' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => '%s-*' }, ); ~; my $text_of_Makefile = sprintf $Makefile_format, map { my $s = $_; $s =~ s{'}{\\'}g; $s; } $self->{NAME}, $self->{AUTHOR}, $self->{EMAIL}, $self->{FILE}, $self->{FILE}, $self->{FILE}; return $text_of_Makefile; } Of course, for true Perl laziness, you'll use CPAN distribution ExtUtils::ModuleMaker::PBP, written by the author of ExtUtils::ModuleMaker as an exemplar of subclassing ExtUtils::ModuleMaker and generating the same output as Damian Conway's Module::Starter::PBP. =head3 4. Test How do you know you have correctly subclassed ExtUtils::ModuleMaker? With a test suite, of course. With careful editing, you can use many of ExtUtils::ModuleMaker's own tests in your new distribution. You will, of course, have to change a number of tests, because the default values implied by Conway's recommendations are different from ExtUtils::ModuleMaker's own defaults. Among other things, you will have to do a search-and-replace on all constructor calls. % perl -pi'*.bak' -e 's{ExtUtils::ModuleMaker->new}{ExtUtils::ModuleMaker::PBP->new}g;' Of course, you I have written your tests first, right? =head3 5. Install and Use You would install your new distribution as you would any other Perl distribution, I with either ExtUtils::MakeMaker or Module::Build, depending on which you chose in creating your subclass. #!/usr/local/bin/perl use strict; use warnings; use ExtUtils::ModuleMaker::PBP; my $mod = ExtUtils::ModuleMaker::PBP->new( NAME => 'Sample::Module', ); $mod->complete_build(); For an adaptation of the F utility to work with ExtUtils::ModuleMaker::PBP, see F which is bundled with the latter package. =head3 An Alternative Approach to Subclassing There is one other way to subclass to ExtUtils::ModuleMaker which bears mentioning, more because the author used it in the development of this version of ExtUtils::ModuleMaker than because it is recommended. If for some reason you do not wish to create a full-fledged Perl distribution for your subclass, you can simply write the subclassing package and store it in the same directory hierarchy on your system in which your personal defaults file is stored. For example, suppose you are experimenting and only wish to override one method in ExtUtils::ModuleMaker::StandardText. You can create a package called ExtUtils::ModuleMaker::AlternativeText. If you are working on a Unix-like system, you would move that file such that its path would be: "$ENV{HOME}/.modulemaker/ExtUtils/ModuleMaker/AlternativeText.pm" You would then add one argument to your call to C: my $mod = ExtUtils::ModuleMaker->new( NAME => 'Sample::Module', ALT_BUILD => 'ExtUtils::ModuleMaker::AlternativeText', ); =head1 CAVEATS =over 4 =item * Tests Require Perl 5.6 While the maintainer has attempted to make the code in F and the F utility compatible with versions of Perl older than 5.6, the test suite currently requires 5.6 or later. The tests which require 5.6 or later are placed in SKIP blocks. Since the overwhelming majority of the tests I require 5.6, running the test suite on earlier Perl versions won't report much that is meaningful. =item * Testing of F's Interactive Mode The easiest, laziest and recommended way of using this distribution is the command-line utility F, especially its interactive mode. However, this is necessarily the most difficult test, as its testing would require capturing the STDIN, STDOUT and STDERR for a process spawned by a C call from within a test file. For now, the maintainer has relied on repeated visual inspection of the screen prompts generated by F. With luck, F-based tests will be available in a future version. =item * Testing F on Non-*nix-Like Operating Systems Since testing the F utility from within the test suite requires a C call, a clean test run depends in part on the way a given operating system parses command-line arguments. The maintainer has tested this on Darwin and Win32 and, thanks to a suggestion by A. Sinan Unur, solved a problem on Win32. Results on other operating systems may differ; feedback is welcome. =back =head1 TO DO =over 4 =item * Tests for F's interactive mode. =item * Possible new C attribute which would insert modules from which user's new module will inherit. USE_AS_BASE => [ qw| Template::Toolkit Module::Build Lingua::Romana::Perligata Acme::Buffy | ], Such an attribute would require replacement copy for C. =item * Creation of a mailing list for ExtUtils::ModuleMaker. =back =head1 AUTHOR/MAINTAINER ExtUtils::ModuleMaker was originally written in 2001-02 by R. Geoffrey Avery (modulemaker [at] PlatypiVentures [dot] com). Since version 0.33 (July 2005) it has been maintained by James E. Keenan (jkeenan [at] cpan [dot] org). =head1 SUPPORT Send email to jkeenan [at] cpan [dot] org. Please include 'modulemaker' in the subject line. Please report any bugs or feature requests to C, or through the web interface at L. Development repository: L =head1 ACKNOWLEDGMENTS Thanks first and foremost to Geoff Avery for creating ExtUtils::Modulemaker and popularizing it via presentations I attended at YAPC::NA::2003 (Boca Raton) and YAPC::EU::2003 (Paris). Soon after I took over maintenance of ExtUtils::ModuleMaker, David A Golden became a driving force in its ongoing development, providing suggestions for additional functionality as well as bug reports. David is the author of ExtUtils::ModuleMaker::TT which, while not a pure subclass of ExtUtils::ModuleMaker, extends its functionality for users of Template::Toolkit. Thanks for suggestions about testing the F utility to Michael G Schwern on perl.qa and A Sinan Unur and Paul Lalli on comp.lang.perl.misc. Thanks for help in dealing with a nasty bug in the testing to Perlmonks davidrw and tlm. That well known Perl hacker, Anonymous Guest, contributed another bug report on rt.cpan.org. As development proceeded, several issues were clarified by members of Perlmonks.org. CountZero, xdg, Tanktalus, holli, TheDamian and nothingmuch made particularly useful suggestions, as did Brian Clarkson. Thanks also go to the following beta testers: Alex Gill, Marc Prewitt, Scott Godin, Reinhard Urban and imacat. Version 0.39 of ExtUtils::ModuleMaker encountered spurious testing failure reports from testers.cpan.org. These were eventually diagnosed as being due to bugs in the automated testing programs and/or their operating environments on different systems -- I to problems outside ExtUtils::ModuleMaker itself. Several Perlmonks helped investigate this problem: chromatic, dave_the_m, randyk, and njh. Thanks to Paul M Sirianni for reporting bugs that led to versions 0.48 and 0.51. Thanks to Chris Kirke for pointing to reports at http://cpants.cpanauthors.org/dist/ExtUtils-ModuleMaker of inconsistent $VERSION numbers across the component files. =head1 COPYRIGHT Copyright (c) 2001-2002 R. Geoffrey Avery. Revisions from v0.33 forward (c) 2005-2015 James E. Keenan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE ''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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =head1 SEE ALSO F, F, F, F, F, F, F, F. =cut