Dist-Zilla-5.008000755000766000024 012257437015 12735 5ustar00rjbsstaff000000000000README100644000766000024 57612257437015 13666 0ustar00rjbsstaff000000000000Dist-Zilla-5.008 This archive contains the distribution Dist-Zilla, version 5.008: distribution builder; installer not included! This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v5.008. Changes100644000766000024 12757212257437015 14367 0ustar00rjbsstaff000000000000Dist-Zilla-5.008Revision history for Dist-Zilla 5.008 2013-12-27 21:57:02 America/New_York - fix utterly broken `dzil run` 5.007 2013-12-27 20:50:45-0500 America/New_York - add the ability to say "dzil run --no-build" to run a command without building inside the dist dir (in other words, no `perl Makefile.PL && make`) - Archive::Tar::Wrapper added as a recommended prereq - fix :ShareFiles (thanks, Christopher J. Madsen and Karen Etheridge) - new :All and :None filefinders (thanks, Karen Etheridge) - most files generated by dzil plugins now self-identify with comments 5.006 2013-11-06 09:21:12 America/New_York - add ->is_bytes to files; shortcut for ->encoding eq 'bytes' (thanks, David Golden) - AutoPrereqs will not try scanning binary files (thanks, David Golden) 5.005 2013-11-02 16:32:04 America/New_York - add --keep-build-dir to "dzil test" and "dzil install" 5.004 2013-11-02 09:59:18 America/New_York [THIS RELEASE MIGHT BREAK YOUR BUILD] - stable release of all the v5 changes below; READ THEM! - by default, NextRelease now adds a trial release marker on trial releases - dzil setup will not echo password during setup 5.003 2013-10-30 08:02:59 America/New_York [THIS RELEASE MIGHT BREAK YOUR BUILD] - add "dzil --version" support (thanks, Upasana Shukla) - fix boneheaded mistake that broke listdeps in 5.002 (thanks, Karen Etheridge) 5.002 2013-10-29 10:35:54 America/New_York [THIS RELEASE MIGHT BREAK YOUR BUILD] - perform encoding steps during listdeps 5.001 2013-10-23 17:40:09 America/New_York [THIS RELEASE MIGHT BREAK YOUR BUILD] - typo fixes (thanks, David Steinbrunner) 5.000 2013-10-20 08:10:02 America/New_York [THIS RELEASE MIGHT BREAK YOUR BUILD] - all files now have content, encoded_content, and encoding attributes - the Encoding plugin and EncodingProvider role have been added to allow you to set the encoding on files; the default is UTF-8 - config.ini is assumed to be in UTF-8 - Data::Section sections are assumed to be UTF-8 - the Term chrome should encode input and output 4.300039 2013-09-20 06:05:10 Asia/Tokyo - tweak metafile generator to keep CPAN::Meta validator happy (thanks, David Golden) 4.300038 2013-09-08 09:18:34 America/New_York - add horrible hack to avoid generating non-UTF-8 META.yml; seriously, don't look at the code! Thanks, David Golden, whose code was simple and probably much, much saner, but didn't cover as many cases as rjbs wanted to cover. 4.300037 2013-08-28 21:43:36 America/New_York - update repo and bugtacker URLs 4.300036 2013-08-25 21:41:21 America/New_York - read CPAN::Uploader config with CPAN::Uploader, to work with new trial releases supporting encrypted credential (thanks, Mike Doherty) - improve tester tests (thanks, Dave O'Neill!) - use Class::Load instead of Class::MOP - better error messages when a bundle can't be loaded by @Filter - make dynamic_config distmeta sticky; once one plugin sets it, it stays stuck - add a die_on_existing_version option to PkgVersion - switch (for now?) "dzil install" to use cpanm - PkgVersion won't rewrite file contents if nothing was changed (thanks, Mike Doherty!) 4.300035 2013-06-19 21:37:28 America/New_York - update for new Perl::PrereqScanner, which will find "lib" - update AutoPrereqs to skip Config and Errno - fix docs to not suggest obsolete "Prereq" name (thanks, Ivan Bessarabov!) 4.300034 2013-04-13 16:56:48 Europe/London - delay loading of CPAN::Uploader, and require a newer version to require HTTPS (thanks, Olivier Mengué!) 4.300033 2013-04-05 15:00:37 America/New_York - fix .build/latest (thanks, Karen Etheridge!) - doc fixes (thanks, Randy Stauner!) 4.300032 2013-03-29 16:41:11 America/New_York - test_requires support for ModuleBuild and MakeMaker (thanks, Tatsuhiko Miyagawa!) 4.300031 2013-03-17 21:47:31 America/New_York - stacktrace removed from exception when a plugin's minimum version check fails (thanks, Karen Etheridge!) - add 'dzil listdeps --json', which lists all prerequisites broken up by phase and type, in readable JSON format (thanks, Karen Etheridge!) - improve errors when there's not enough configuration and no global config file can be found (thanks, Dimitar Petrov) - delay loading yet more libraries until needed (thanks, Olivier Mengué!) 4.300030 2013-01-30 22:25:27 America/New_York - listdeps --versions now sorts properly (thanks, Karen Etheridge!) - delay loading more libraries until needed (thanks, Olivier Mengué!) - excluded filenames in GatherDir were sometimes matched too fuzzily (thanks, Mike Doherty) 4.300029 2013-01-14 20:03:15 America/New_York - allow :version directive in root section to require a given version of Dist::Zilla - simply and speedify some of GatherDir (Thanks, Olivier Mengué!) 4.300028 2012-10-19 10:50:42 America/New_York - when picking modules to treat as "part of the dist," be more lax in understanding libraries under ./t: ./t/lib/Foo.pm is now treated as providing t::lib::Foo, lib::Foo, and Foo 4.300027 2012-10-16 21:07:06 America/New_York - the "latest" symlink code broke Dist::Zilla on win32; fixed now! (thanks, Brendan Byrd!) 4.300026 2012-10-13 22:21:17 America/New_York - PodSyntaxTests, PodCoverageTests and MetaTests now add the right develop/requires prereqs (thanks, Olivier Mengué and Ricardo Signes!) - ModuleBuild now takes an mb_lib argument that can override the default of "inc" (thanks, ben hengst) - create .build/latest symlink when a build in .build is built (thanks, Alexei Znamensky!) - allow "-version" arg to [@Filter] to specify the version of the bundle required (thanks, Rob Hoelz) 4.300025 2012-10-07 23:02:33 America/New_York - add the LicenseProvider and NameProvider roles (thanks, Vyacheslav Matjukhin!) - make Dist::Zilla::App::Tester be a CaptureExternal App::Cmd::Tester 4.300024 2012-09-26 12:01:45 America/New_York - include $] in MetaConfig data 4.300023 2012-09-06 09:01:12 America/New_York - do not use ">" in a filename; fixes the build on Win32 (thanks, djgoku!) 4.300022 2012-09-05 08:35:27 America/New_York - do not detect an escaped "\$VERSION =" as an assignment to a variable (this is sort of a half-measure) - 'dzil run' also edits $PATH to include ExecDir directories (Karen Etheridge) 4.300021 2012-07-31 23:20:50 America/New_York - plugins can now provide a MANIFEST.SKIP that can be processed by ManifestSkip. Previously generated content was just ignored. (thanks, Olivier Mengué!) - GenerateFile can now also template its filename, with the name_is_template option (Thanks, Karen Etheridge!) 4.300020 2012-06-21 11:17:40 America/New_York - properly set the working directory when testing (thanks, Jesse Luehrs!) 4.300019 2012-06-20 15:36:01 America/New_York - avoid looking outside the dist during testing (thanks, Jesse Luehrs!) 4.300018 2012-06-07 22:25:03 America/New_York - format codes %E, %T, %U, & %V added to NextRelease (thanks, Karen Etheridge & Christopher J. Madsen!) 4.300017 2012-05-31 12:17:45 America/New_York - also check plugin version requirements in dzil authordeps --missing (Karen Etheridge) - add 'dzil add' to add new modules to an existing dist (thanks, David Golden!) - misc. bugfixes (thanks, Karen Etheridge and Olivier Mengué!) 4.300016 2012-05-04 22:09:10 America/New_York - make AutoPrereqs treat .psgi files as scannable (thanks, Jakob Voss!) - add yet more links in plugins documentation to help discoverability of other plugins. (thanks, Olivier Mengué!) - AutoPrereqs: skip author and release tests when scanning (RT#76305). (thanks, Olivier Mengué!) 4.300015 2012-04-23 21:38:21 America/New_York - require a CPAN::Meta::Requirements 2.121 to get the requirements_for_module (thanks, Olivier Mengué!) - 'dzil run' with no arguments will now invoke a new shell. (thanks, Karen Etheridge!) - dzil clean now has has a "dry run" option. (thanks, Karen Etheridge!) - add more links in plugins documentation to help discoverability of other plugins. (thanks, Olivier Mengué!) - support :version requirement for bundles (thanks, Randy Stauner!) 4.300014 2012-04-05 12:46:33 America/New_York - added the CPANFile plugin to create "cpanfile" prereq format - stop emitting an empty line in authordeps output (thanks, Olivier Mengué!) 4.300013 2012-03-31 15:55:47 Europe/Paris - dzil test has a new option, --all, which is the equivalent of --release --automated --author. 4.300012 2012-03-30 14:31:56 Europe/Paris - add 0 and never to the prereqs (thanks, David Golden) 4.300011 2012-03-30 11:42:44 Europe/Paris - do not claim that a dep is missing in "listdeps" when it is present with an undef $VERSION and we only require version 0 (reported by Matthew Horsfall) 4.300010 2012-03-15 21:38:58 America/New_York - The GatherDir::Template documentation has been improved (Thanks, Christopher J. Madsen!) - Depend on a more recent version of Config::MVP, which requires a fix in Class::Load to fix detection of plugin compilation errors on perl5.8.8 (see Class::Load Changes file for details.) (Karen Etheridge) - Add --versions support to listdeps and authordeps (Cory G Watson) - Documentation fixes 4.300009 2012-02-21 19:38:29 America/New_York - PruneCruft also excludes the _Inline/ directory and MYMETA.json - MakeMaker has been refactored to make it easier to subclass (Thanks, Christopher J. Madsen!) 4.300008 2012-02-16 17:28:34 America/New_York - work around qr//m bug in 5.8.8 and earlier (thanks, Randy Stauner!) - Fix to MakeMaker plugin: use separate scope for code that changes namespace, when inserting ShareDir code. (RT#74788) (Karen Etheridge) 4.300007 2012-02-02 22:23:05 America/New_York - Remove configs beginning with ':' from argument list before constructing that config; fixes issue where :version was being passed to a plugin that had a strict constructor. (Karen Etheridge) 4.300006 2011-12-30 15:28:34 America/New_York - New methods dist_basename & archive_filename allow plugins to reliably get that information. This makes TestRelease testable. (Thanks, Kent Fredric & Christopher J. Madsen!) - Your PAUSE password will now no be echoed if entered at the prompt, on most operating systems (Thanks, Mike Doherty!) - replace use of Version::Requirements with CPAN::Meta::Requirements, its replacement 4.300005 2011-12-13 08:49:19 America/New_York - Prereqs now actually understands -relationship as documented in 4.300004. Also, it throws an error if you give it a plugin name that does not specify a relationship (Thanks, Christopher J. Madsen!) 4.300004 2011-12-12 23:34:30 America/New_York - a new FileFinder plugin has been added, FileFinder::Filter (Thanks, Christopher J. Madsen!) - AutoPrereqs can now be told to determine configure_requires (Thanks, Christopher J. Madsen!) - the (lack of) order of check of authordeps is now a bit more predictible: - plugins declared with "; authordep" lines are loaded before others - inc:: plugins are checked first and in ASCII order (Thanks, Olivier Mengué!) - Many slow-to-load modules are now loaded opportunistically to improve startup time. (Thanks Olivier Mengué and rjbs) - ShareDir documentation has been improved (thanks, Karen Etheridge) - Prereqs documentation has been improved 4.300003 2011-10-31 23:58:19 America/New_York - If no credentials are found on disk, UploadToCPAN will now prompt for credentials during the BeforeRelease phase, not during release (Thanks, Christopher J. Madsen!) - AutoPrereqs can now be told what scanners or extra_scanners args to pass to Perl::PrereqScanner (Thanks, Christopher J. Madsen!) - Prune perl prereqs out of BUILD_REQUIRES for EU::MM, and pick the highest required perl of either runtime or built requires. (Thanks, Christopher J. Madsen!) - Test routines should now properly report the calling line for failures ($Test::Builder::Level is being set) (Thanks, Christopher J. Madsen!) - the is_filelist test assertion now works with objects that do the Dist::Zilla::Role::File role (Thanks, Christopher J. Madsen!) - a new FileFinder plugin has been added, FileFinder::ByName (Thanks, Christopher J. Madsen!) 4.300002 2011-09-22 09:43:45 America/New_York - fix a bug that does Weird Stuff when a 0b file exists (thanks, Christian Walde!) 4.300001 2011-09-19 15:46:18 America/New_York - Several improvements to how PPI is used should speed up the performance of Perl file munging and scanning. The PPI role was added. (Thanks, Dave Rolsky!) - We now use Archive::Tar::Wrapper if available, to speed up archive building. (Thanks, Dave Rolsky!) 4.300000 2011-08-19 10:12:36 America/New_York - turn on Useqq option for Dumper, to get unicode string literals set properly in Makefile.PL and Build.PL without using utf8.pm - decode user input from Chrome::Term as UTF-8 - during `dzil setup`, the config.ini file is now created with an added umask of 077 to avoid other users reading your PAUSE credentials - update almost all Moose code to use make_immutable and namespace::autoclean 4.200018 2011-08-18 11:13:03 America/New_York - correct Perl::PrereqScanner version requirement, which was too low 4.200017 2011-08-17 18:54:07 America/New_York - require and adapt to the new Perl::PrereqScanner, which does not prune out prereqs just because they're core and common 4.200016 2011-08-17 18:07:21 America/New_York - add options to exclude files from GatherDir (David Golden) 4.200015 2011-08-12 13:45:42 America/New_York - don't build the dist in a directory with -TRIAL in the name; this should fix bugs in "dzil release --trial" and probably other related bugs 4.200014 2011-08-07 18:18:01 America/New_York - add documentation for TemplateModule (thanks, Kent Fredric) - fixes to tester.t for Win32 (thanks, Christian Walde) 4.200013 2011-08-05 09:30:01 America/New_York - "dzil listdeps --missing" no longer dies if it encounters an invalid $VERSION (Jesse Luehrs) - PkgVersion and PkgDist no longer use BEGIN blocks 4.200012 2011-07-18 09:02:09 America/New_York - allow abstracts of more than one line, or with more than one word before the dash, to be properly extracted (Florian Ragwitz) - stringify tarball name to work with older Archive::Tar (Jan Tore Morken) 4.200011 2011-07-14 22:53:34 America/New_York move the file mode setting into the tar creation, not a fixup step 4.200010 2011-07-14 22:27:46 America/New_York fix [rt.cpan.org #68223] -- Test::Dzil built tarballs with bad root dirs; test and code mostly provided by Rob Hoelz 4.200009 2011-07-06 23:26:09 America/New_York the "skip" argument to AutoPrereqs can now be given multiple times authordeps now makes a rough attempt to deal with [@Filter] catch and simplify "no dist.ini" errors from MVP UploadToCPAN now takes a "upload_uri" option UploadToCPAN will now prompt for credentials if needed add follow_symlinks to GatherDir (thanks, Luc St-Louis) 4.200008 2011-06-23 11:53:56 America/New_York PodVersion no longer drops the file's last newline listdeps now includes recommended prereqs as well as required 4.200007 2011-06-01 21:52:00 America/New_York always numify the version use in "use VERSION" in Makefile.PL 4.200006 2011-04-28 21:14:04 America/New_York MakeMaker-generated Makefile.PL now only has configure_requires of 6.30 so dists can be installed on RHEL5 improve consistency and options of *_TESTING env vars (Apocalypse) improve FileFinder-related documentation (thanks, Apocalypse) add a default file finder called :IncModules (thanks, Apocalypse) add a default file finder called :MainModule (thanks, Mateu X. Hunter) phase for named Prereqs defaults to Runtime if omitted (Jonathan Yu) extract the *Runner role implementations from ModuleBuild to Role::BuildPL (Leon Timmermans) 4.200005 2011-04-25 12:20:59 America/New_York provide actual name of releaser(s) in ConfirmRelease error message if "dzil run" is run without a command to run some minor refactoring in listdeps (Jon Rockway) listdeps can now skip already-met prereqs (Jesse Luehrs) authordeps now skips plugins under inc:: (Jesse Luehrs) authordeps now scans for "; authordep" comments 4.200004 2011-02-11 16:17:37 America/New_York Add Tests for Config::MVP 2.200 changes. ( Kent Fredric ) MetaNoIndex, originally by J.T. Smith and Mark Gardner, is now included 4.200003 2011-02-06 21:37:45 America/New_York avoid test failures on systems where time zone can't be determined 4.200002 2011-02-04 18:02:16 America/New_York Test::DZil is now installed and available to other dist 4.200001 2011-01-19 21:59:18 America/New_York add --author to listdeps (Jesse Luehrs) better logging and error messages (Dave Rolsky, Jesse Luehrs) get abstract from main module more reliably (David Golden) 4.200000 2010-12-13 12:25:38 America/New_York bump version to be easier to skim, until v5 4.102346 2010-12-11 13:19:08 America/New_York make errors during TextTemplate rendering fatal (thanks, Dave Rolsky) provide MakeMaker::Runner if you want to provide your own Makefile.PL (thanks, Florian Ragwitz) 4.102345 2010-11-20 21:28:01 America/New_York add somewhat obscure missing prereq 4.102344 2010-11-19 19:34:21 America/New_York PruneCruft now prunes XS-related and build files: blib, pm_to_blib, .o, .bs, and .c files generated from .xs files PkgVersion now include a "TRIAL" comment for trial dists :InstallModules finder will now include main_modules, even if it was not otherwise found as a .pm in ./lib 4.102343 2010-11-09 07:49:50 America/New_York private packages in PkgVersion can have comments after 'package' before a newline (David Golden) PruneFiles now accepts regex via the "match" parameter (thanks, Nickolay Platonov) Test chrome can be given canned responses to expected prompts (thanks, Christopher J. Madsen) version strings now checked against LaxVersionStr type in PkgVersion, rather than our own regex 4.102342 2010-10-14 23:28:20 America/New_York Improved diagnostics for various 'main_module could not be found' conditions. ( Kent Fredric ) Improved diagnostics for apparently missing plugins (thanks, David Golden) add --missing to authordeps (thanks, Danijel Tasov) 4.102341 2010-09-17 19:14:41 America/New_York ANNOYANCES: [AutoPrereq] and [Prereq] will now complain that you should be using [AutoPrereqs] and [Prereqs]; the irregularly named plugins will be removed in Dist-Zilla v5 add the "authordeps" command avoid clobbering PERL5LIB env var when building add "append_file" parameter to DistINI plugin add "except" parameter to PruneCruft 4.102340 2010-08-22 15:47:51 America/New_York add files to archive in name-length order (thanks, Jonathan Scott Duff) improve permissions of created files on Win32 (thanks, Curtis Jewell) do not clobber PERL5LIB during build (thanks, John Napiorkowski) 4.102221 2010-08-10 11:35:00 America/New_York use the new "mute" feature of Log::Dispatchouli to simplify listdeps make TextTemplate rendering errors fatal document the changes made in 4.102220 4.102220 2010-08-10 07:46:27 America/New_York pass a $dist var to TemplateModule templates 4.101900 2010-07-09 09:05:25 America/New_York add a "subdir" directory to UploadToCPAN 4.101880 2010-07-07 09:25:41 America/New_York stop being so pushy about running dzil setup (reported by AVAR) dzil setup will not die if ~/.dzil does not exist (reported by David Golden) 4.101831 2010-07-02 18:33:58 America/New_York correctly apply another patch from LA.pm that had been misapplied earlier 4.101830 2010-07-02 10:27:24 America/New_York remove the internal-only VersionBootstrap plugin; no longer needed fix a bad logging call in global config setup (LA.pm) tweak to allow tests to pass on 5.8.7 and earlier 4.101812 2010-06-30 23:02:15 America/New_York correctly set local global config root variable (Dave Rolsky) 4.101811 2010-06-30 09:51:43 America/New_York load File::pushd in Minter, where it is needed 4.101810 2010-06-30 09:41:59 America/New_York internal reorganization of test data tests should no longer fail if you have personal config in $HOME 4.101801 2010-06-29 21:17:15 America/New_York rename ClearPrereqs to RemovePrereqs the Zilla assembler no longer provides a default zilla_class (because doing so had lost any meaning) update minter.t to work when *not* logged in as rjbs to his laptop 4.101800 2010-06-29 10:29:38 America/New_York during dist minting, ModuleMaker occurs before FileGatherer ModuleBuild's module_build argument generation is now a method Dist::Zilla is now an abstract base class, basically * Dist::Zilla::Dist::Builder and ::Minter perform the real work * Dist::Zilla::Tester has been updated to work with these a very basic test for minting, now possible, has been added added prune_file method to Dist::Zilla to eliminate the need for altering the ->files arrayref directly added the ClearPrereqs plugin [Prereq] is now called [Prereqs], but [Prereq] will continue to work until v6 or v7 or so 4.101780 2010-06-27 14:30:55 America/New_York the Chrome role now requires three input methods: prompt_any_key, prompt_yn, and prompt_str Term and Test chrome now implement the required input methods ConfirmRelease now uses Chrome to prompt for input `dzil setup` added to create a starting config.ini 4.101740 2010-06-23 22:56:51 America/New_York fix assembly of local stashes (Jesse Luehrs) fix PkgVersion and PodVersion to work on scripts (M. Gardner) add PkgDist plugin for questionable reasons add MintingProfile, `dzil new -P` (rjbs and SamuraiJack) add ModuleShareDirs for per-module ShareDir (David Golden) add the User stash and make author use it by default ManifestSkip no longer falls back to default MANIFEST.SKIP minor improvements to documentation and consistency of code layout 4.101612 2010-06-10 12:12:00 America/New_York The PAUSE indexer will not be pleased. The 4.101610 PkgVersion changes are entirely reverted. 4.101611 2010-06-10 11:37:52 America/New_York added nonsensical $VERSION = $VERSION to appease the PAUSE indexer and other garbage code that evals a single line to guess at the version's value 4.101610 2010-06-10 10:01:37 America/New_York Fix Win32 \r\n emission. \r\n is only emitted now if its there in the original code. Tests included to make sure DZil doesn't sufer the problem under itself on windows. (Kent Fredric) Fix Tar permissions. (Kent Fredric, stolen from Module::Build) @Filter can now pass arguments along to the filter if you use a new dash-prefix config convention. Consult its documentation for more information. (Florian Ragwitz) PkgVersion now adds the version assignment to the same line as the package declaration to avoid altering line numbering. (David Golden) 4.101582 2010-06-07 18:23:04 America/New_York improve tests to work with new CPAN::Meta fix incorrect type constraint in UploadToCPAN 4.101580 2010-06-07 10:21:51 America/New_York make UploadToCPAN look at the right stash by default 4.101570 2010-06-06 23:36:58 America/New_York validate distmeta before writing to disk changes to Dist-Zilla's distribution metadata to validate 4.101550 2010-06-04 11:16:13 America/New_York a number of minor changes to documentation a few improvements to use of type constraints in Zilla.pm some methods that were undocumented have been _-prefixed ModuleBuild now turns on recursive_test_files unconditionally the install_command argument to $zilla->install should now be an arrayref suppressed a stringifying-undef warning when using UploadToCPAN no longer try to compose an obsolete Dist::Zilla::Config role 4.101540 2010-06-03 23:52:52 America/New_York INCOMPATIBLE CHANGES: New global config system! Your ~/.dzil/config.ini is now broken. Running `dzil` should tell you how to fix it. Probably just replace [!release] with [%PAUSE] and delete everything else. Hope that helps! Major refactoring of our use of Config::MVP; this probably won't break anything unless you wrote your own config readers, which I'm pretty sure you haven't done! config parameters beginning with a colon are not passed to plugins (this should not really affect anyone) OTHER CHANGES: plugins are now registered as soon as their config section has been read Dist::Zilla::Role::Stash has been added :version can now be passed as a config section value to require that the config's package be of the specified version reserved config property names (plugin_name, zilla) are now fatal during config read rather than plugin instantiation core license attrs will look in the %Rights stash for defaults `dzil new` will work if you have no configured profiles generated Makefile.PL no longer has trailing spaces (Florian Ragwitz) Document 'user' parameter for :FakeRelease (Kent Fredric) will probably work just fine on Win32 now! 3.101520 2010-06-01 11:50:16 America/New_York unixify all gathered filenames (Christian Walde) ModuleBuild can use a custom M::B class (David Golden, Dave Rolsky) set release_status distmeta based on is_trial (Apocalypse) PkgVersion ignores packages which have a newline between the package keyword and the package name (Dave Rolsky) add version to :ExecFiles (scripts) as well as libraries with PkgVersion and PodVersion added --in option to the 'build' command (Marcel Gruenauer) 3.101461 2010-05-26 22:34:18 America/New_York 3.101460 2010-05-26 08:14:23 America/New_York note required version of Config::MVP::Reader::INI require a newer CPAN::Meta::Converter for laxer url validation 3.101450 2010-05-25 18:18:09 America/New_York compatibility with Config::MVP v1 merge test requires into build requires for MakeMaker require a newer CPAN::Meta::Converter for custom key downgrades 3.101421 2010-05-22 20:48:10 America/New_York note the new version of CPAN::Meta::Converter required 3.101410 2010-05-21 22:17:44 America/New_York cope with newest Config::MVP 3.101400 2010-05-20 11:30:41 America/New_York ModuleBuild now uses $^X to run Build (Christian Walde) MakeMaker now uses the "make" program found in Config (Christian Walde) 3.101390 2010-05-19 09:15:32 America/New_York INCOMPATIBLE CHANGES: the as_distmeta method of Prereqs is removed the ->prereq method on Dist::Zilla is gone (only prereqs remains) distmeta is managed by CPAN::Meta, which expects v2 spec data by default most Dist::Zilla::Types are gone, now in MooseX::Types::Perl OTHER CHANGES: META.json and META.yml are now produced by CPAN::Meta Dist::Zilla::Prereqs now proxies for CPAN::Meta::Prereqs MetaResources supports CPAN Meta Spec version 2, but still works with old-style resources as well (Dave Rolsky) quote filenames with spaces in MANIFEST (Dave Rolsky) Manifest plugin is now a FileGatherer, not an InstallTool attempted a fix for `dzil install` on Win32 (RT #57404) 2.101310 2010-05-11 09:02:45 America/New_York update_filename arg added to NextRelease `dzil new` can now be given a module name instead of dist name PkgVersion will only declare $VERSION once per package in a file 2.101290 2010-05-09 18:43:02 America/New_York added GatherDir::Template (for use in dzil new profiles) GatherDir will skip dot-dirs when excluding dotfiles 2.101241 2010-05-04 22:51:31 America/New_York tests should now pass on Win32 (these changes all thanks to APOCAL) add GenerateFile plugin make PodSyntaxTests require a newer, less-broken Test::Pod sort and indent keys of args written to Makefile.PL and Build.PL add %n and %t for \n and \t to NextRelease 2.101240 2010-05-04 07:46:47 America/New_York remove a 5.12 specific hunk of syntax (...) (thanks, BRICAS) 2.101230 2010-05-03 23:42:27 America/New_York NextRelease now has a time_zone parameter (thanks, APOCAL) add a `dzil listdeps` command based on MARCEL's work (thanks, Robin Smidsrød) the new `dzil new` does stuff, but is not documented add a "user" parameter to FakeRelease (David Golden) minor documentation improvements here and there 2.101170 2010-04-27 09:59:11 America/New_York fix a bug that broke dists with multiple - in their name 2.101160 2010-04-26 19:51:52 America/New_York `dzil new` now does nothing and says so dzil commands will not create a zilla object just for logging easy bundles will less often create names with @@ in them 2.101151 2010-04-25 23:40:28 America/New_York GatherDir and PruneCruft now both have verbose log output the App config system has been moved and made non-public; it was crazy and awful version numbers are not validated by version.pm, not my own dumb regex `dzil clean` no longer removes backup~ files (sorry, jq) TestRelease is better about picking a build location (Christopher J. Madsen) better BUILD_REQUIRES treatment on ancient installer-side EU:MM (David Golden) 2.101150 2010-04-25 11:52:11 America/New_York when duplicate files are added, report plugin_names with pkg/line add missing version on String::RewritePrefix usage (Andrew Rodland) more tweaking to how Chrome works 2.101040 2010-04-14 11:54:45 America/New_York added PluginBundle::Easy role (from Christopher J. Madsen) changed @Basic and @Classic to use PluginBundle::Easy 2.100991 2010-04-09 22:42:49 America/New_York correct the 2.100990 release, which was broken in all $VERSION nums add debug output to many more plugins improve the -v switch to allow substrings (\bNAME\b) to match 2.100990 2010-04-09 10:12:06 America/New_York fix Pod errors in @Classic (thanks Ævar) 2.100960 2010-04-06 17:00:26 America/New_York added @Basic, more suitable for basic use than @Classic delegate logging to the Dist::Zilla::App object the controller attribute is now called "chrome"; this should last replace File::chdir with File::pushd (David Golden) 2.100922 2010-04-02 18:53:55 America/New_York BuildRunner and TestRunner routines now must die, not return errors added TestRelease plugin (from Christopher J. Madsen) refactored run_tests_in out of the test method 2.100921 2010-04-02 16:04:57 America/New_York add the missing ->ensure_built method 2.100920 2010-04-02 10:45:45 America/New_York BeforeArchive plugins introduced (thanks, Graham Barr) PkgVersion now puts version declaration in a BEGIN block fix required version of Config::MVP include recommendations in distmeta 2.100880 2010-03-29 10:00:20 America/New_York first non-dev release of version 2 2.100870 2010-03-28 17:07:24 America/New_York 2.100862 2010-03-27 13:32:01 America/New_York 2.100861 2010-03-27 13:17:23 America/New_York INCOMPATIBLE CHANGES: the AllFiles plugin is now known as GatherDir the InstallDirs plugin has been replaced by ExecDir and ShareDir the PodTests plugin has been replaced by PodCoverageTests and PodSyntaxTests the FixedPrereq role is replaced with PrereqSource OTHER CHANGES: numerous improvements to testing libraries ...and numerous actual tests! added include_dotfiles option to GatherDir allow relative root directory for GatherDir AutoPrereq is now distributed with Dist::Zilla AutoPrereq will make requirements only found in ./t "build_requires" ConfirmRelease plugin added and made part of @Classic (dagolden) MakeMaker-produced Makefile.PL will produce warnings less often MakeMaker-produced Makefile.PL will require v6.31 for INSTALL_BASE Prereq plugin can target config_requires, build_requires, etc dzil takes -v arg to enable debugging globally or per-plugin PkgVersion now adds a fully-qualified $VERSION variables, not 'our' PruneCruft prunes MYMETA.yml add 'dzil nop' command to initialize zilla object and exit 1.100711 2010-03-12 12:51:55 America/New_York remove bogus attempt to load obsolete DZ::Logger::Global 1.100710 2010-03-12 09:58:10 America/New_York huge update to logging system; uses Log::Dispatchouli::Proxy UploadToCPAN, FakeRelease now log via the standard logger App::Cmd layer Zilla is shared between commands bump up some prereqs to avoid bugs fixed upstream HIGHLY EXPERIMENTAL: first pass at testing systems 1.100660 2010-03-07 07:56:30 America/New_York Global logger handles log_fatal correctly 1.100651 2010-03-06 23:18:54 America/New_York improve how plugin and pluginbundle names are generated and reported improve logging to make it clear what is logging what add a -v switch to dzil to allow "verbose" logging 1.100650 2010-03-06 11:46:23 America/New_York add some missing prereqs now configured with @RJBS rather than custom set of plugins 1.100630 2010-03-03 22:23:21 America/New_York the log method now uses a pluggable logger, defaulting to Log::Dispatchouli plugins now log with a useful prefix to indicate what is logging prerequisites are now managed by Dist::Zilla::Prereq complex prereqs (a la Version::Requirement) are possible 1.100600 2010-03-01 08:19:06 America/New_York the File role provides a mode attribute; files are chmodded on write the mode attribute may not be world-writeable files gathered by AllFiles will have their on-disk mode &= 0755 1.100520 2010-02-21 15:53:39 America/New_York MakeMaker plugin correctly requires the right version of perl again 1.100160 2010-01-16 15:37:29 America/New_York require File::Install::ShareDir if needed for Makefile.PL share 1.100130 2010-01-13 08:18:29 America/New_York the args used in generated Build.PL or Makefile.PL are now mostly generated by Data::Dumper instead of interpolation and quotemeta 1.100120 2010-01-12 18:40:00 America/New_York add 'dzil run' and BuildRunner (Jérôme Quelin) improve behavior of 'dzil clean' with backup files (Jérôme Quelin) dzil takes an -I option (Jérôme Quelin) InstallDirs can now provide File::ShareDir-style installs (rjbs, Jérôme Quelin, nperez) Role::File now requires a content method (rjbs) eliminate stupid noise spewed during 'dzil new' (rjbs) 1.093400 2009-12-06 13:56:09 America/New_York declare dependency on PPI introduced by 1.093370 1.093371 2009-12-03 18:45:11 America/New_York 1.093370 2009-12-03 18:42:30 America/New_York PruneFiles now works... for real; only "filenames" works 1.093370 2009-12-03 18:17:16 America/New_York PruneFiles now works; the documented args for PruneFiles were wrong PkgVersion now uses PPI to insert $VERSION; avoids many false inserts Fix regression where failing tests still cleaned up the build dir. ( Kent Fredric ) 1.093290 2009-11-25 14:45:45 America/New_York switch from String::Format to String::Formatter 1.093280 2009-11-24 11:24:52 America/New_York include META.yml again for now look at ~/.pause for upload config if it isn't in ~/.dzil/config 1.093250 2009-11-21 14:14:20 America/New_York refactor !release 1.093220 2009-11-18 08:15:20 America/New_York Module::Build now injects version deps in build_requires and configure_requires, hopefully solving issues with version-upgrades. new role BeforeRelease (Jérôme Quelin) new role AfterRelease (Jérôme Quelin) default format for AutoVersion plugin changed (Jérôme Quelin) NextRelease plugin updates changelog after release new plugin FakeRelease (Jérôme Quelin) 1.093160 2009-11-12 make TextTemplate use fill_this_in to avoid https://rt.cpan.org/Ticket/Display.html?id=51473 1.093140 2009-11-10 add the FileFinder role "dzil test" will exit non-zero if tests fail Split Test into plugins and have a pluggable test system. ( Kent Fredric ) 1.093000 2009-10-26 require a newer Moose to avoid a few composition errors in older Moose versions 1.092990 2009-10-26 most of Dist::Zilla::Config has been moved to Config::MVP::Reader THIS WILL BREAK BUNDLES: bundles are now passed a hashref describing the contents of the Config::MVP::Sequence configuring them, not just the payload 1.092930 2009-10-20 rebuild documentation with new PodPurler 1.092850 2009-10-11 correct logic that finds tests to run improve detection and use of main_module name (C. Madsen) stop adding versions to test files (doy) 1.092680 2009-09-25 improve error when main_module isn't found (Christopher J. Madsen) rework version generation to be as lazy as possible (C. Madsen) add a ->distmeta attribute in which metadata is collected (C. Madsen) recognize more kinds of version declaration (Nicholas Perez) fix documentation refering to ~/.dzil/config, now in ~/.dzil/config.ini ( Kent Fredric ) 1.092450 2009-09-02 fix a bug in config loading for 'dzil' command (melo) 1.092400 2009-08-28 require App::Cmd 0.300 (currently in dev) fix prereq for Config::MVP 1.092390 2009-08-27 do not break on config sections for non-moosey (app) plugins 1.092360 2009-08-24 all config readers must now produce MVP sequences the AutoVersion plugin now allows you to specify a time zone 1.092310 2009-08-18 documentation for the 'dzil' commands (Kent Fredric) restore the workingness of ~/.dzil and ~/.dzil/config 1.092200 2009-08-07 include ./xt files in shipped dist 1.092070 2009-07-27 *** MIGHT VERY WELL BREAK YOUR BUNDLES *** major revamp of configuration subsystem, including pluggable config readers and the new, highly-experimental and probably-stupid Perl config reader 1.091940 2009-07-12 fix version number of EUMM required to use LICENSE param ( https://rt.cpan.org/Public/Bug/Display.html?id=47817 ) 1.091610 2009-06-09 up the required Pod::Eventual tweak detection of Perl files by content (Jérôme Quelin) 1.091480 2009-05-28 13:59:35 UTC fix abstract-guessing to work with new Pod::Eventual 1.091440 2009-05-24 18:01:51 UTC more quotemeta in generated code add namespace::autoclean (Florian Ragwitz) remove unnecessary dep on MX::ClassAttribute (Florian Ragwitz) break type declarations into their own library (Florian Ragwitz) 1.091430 2009-05-23 01:48:20 UTC add meta-spec entry to metafiles (thanks, doy) generate MetaYAML with YAML::Tiny 1.091370 2009-05-17 MetaJSON added MetaYaml is now MetaYAML 1.091260 2009-05-06 correct naming of plugins brought in by @Classic 1.091250 2009-05-05 add AutoVersion plugin avoid some warnings when making immutable improved some documentation 1.007 2009-04-21 add MetaProvider role and MetaResources plugin inspired by the work of Fayland Lam 1.006 2009-04-18 fix a small context error that broke 'dzil install' in some cases 1.005 2009-04-18 numerous documentation fixes and minor bug fixes added 'dzil install' thanks to: hdp, sartak, Florian Ragwitz, alexv, obra TODO: proper credits file 1.004 2008-10-14 do not barf if there's no dzil config (thanks, ILMARI) 1.003 2008-10-13 add "dzil new" to create a new dist.ini, etc add "dzil release" to upload to the CPAN both of these commands are really sketchy right now use String::Flogger for log output rewriting 1.002 2008-10-07 add missing prereqs 1.001 2008-10-07 add missing prereqs 1.000 2008-10-06 alright, let's just release this thing, even if it's only half baked. well... maybe more like unbaked 0.005 ? allow alternate configuration readers begin the long, hateful process of testing LOTS of existing code some changes to AllFiles to allow more rewriting; for Data-Rx 0.004 2008-06-10 fairly complete documentation 0.003 2008-06-06 going to use this to build a bunch of stuff! LICENSE100644000766000024 4366112257437015 14055 0ustar00rjbsstaff000000000000Dist-Zilla-5.008This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2013 by Ricardo SIGNES. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2013 by Ricardo SIGNES. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End bin000755000766000024 012257437015 13426 5ustar00rjbsstaff000000000000Dist-Zilla-5.008dzil100755000766000024 133212257437015 14455 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/bin#!/usr/bin/perl use strict; use warnings; package dzil; use Dist::Zilla::App; # Let dzil --version know what to report: $main::VERSION = $Dist::Zilla::App::VERSION; # PODNAME: dzil # ABSTRACT: do stuff with your dist Dist::Zilla::App->run; __END__ =pod =encoding UTF-8 =head1 NAME dzil - do stuff with your dist =head1 VERSION version 5.008 =head1 OVERVIEW For help with Dist::Zilla, start with http://dzil.org/ or by running "dzil commands" =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut dist.ini100644000766000024 245212257437015 14465 0ustar00rjbsstaff000000000000Dist-Zilla-5.008name = Dist-Zilla author = Ricardo SIGNES license = Perl_5 copyright_holder = Ricardo SIGNES [@Filter] -bundle = @RJBS github_issues = 1 [ModuleShareDirs] Dist::Zilla::MintingProfile::Default = profiles [MetaNoIndex] dir = corpus dir = misc [MetaResources] homepage = http://dzil.org/ x_mailing_list = http://www.listbox.com/subscribe/?list_id=139292 [Prereqs / TestRequires] Test::More = 0.90 [Prereqs / RuntimeRecommends] Term::ReadLine::Gnu = 0 Archive::Tar::Wrapper = 0.15 [Prereqs] perl = v5.8.5 ; how tempted am I to set this to v5.10? very! autobox = 2.53 ; @array->method support, portability parent = 0 ; used by the AutoPrereq test corpus File::ShareDir::Install = 0.03 ; for EUMM Class::Load = 0.17 Config::MVP::Reader::INI = 2 ; ensure there's a basic config format Data::Section = 0.200000 ; default encodings to UTF-8 ExtUtils::Manifest = 1.54 ; for ManifestSkip that needs maniskip() Mixin::Linewise::Readers = 0.100 ; default encodings to UTF-8 Path::Class = 0.22 ; basename [RemovePrereqs] remove = Config ; why isn't this indexed?? -- rjbs, 2011-02-11 remove = Dist::Zilla::Tester::_Role ; mistakenly added by autoprereq remove = Some::Package::That::Does::Not::Exist::Due::To::A::Typo [CPANFile] t000755000766000024 012257437015 13121 5ustar00rjbsstaff000000000000Dist-Zilla-5.008file.t100644000766000024 1176712257437015 14421 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/tuse strict; use warnings; use utf8; use Test::More; use Test::Fatal; use Test::FailWarnings -allow_deps => 1; binmode(Test::More->builder->$_, ":utf8") for qw/output failure_output todo_output/; use Encode; use Path::Tiny; use Dist::Zilla::File::InMemory; use Dist::Zilla::File::OnDisk; use Dist::Zilla::File::FromCode; my %sample = ( dolmen => "Olivier Mengué", keedi =>"김도형 - Keedi Kim", ); my $sample = join("\n", values %sample); my $encoded_sample = encode("UTF-8", $sample); my $db_sample = $sample x 2; my $db_encoded_sample = $encoded_sample x 2; my $latin1_dolmen = encode("latin1", $sample{dolmen}); sub new_args { my (undef, $file, $line) = caller; $file = path($file)->relative; my %args = ( name => 'foo.txt', added_by => "$file line $line", @_ ); return [\%args]; } sub test_mutable_roundtrip { my ($obj) = @_; ok( $obj->DOES("Dist::Zilla::Role::MutableFile"), "does MutableFile role" ); # assumes object content starts as $sample is( $obj->content, $sample, "get content" ); is( $obj->encoded_content, $encoded_sample, "get encoded_content" ); # set content, check content & encoded_content ok( $obj->content($db_sample), "set content"); is( $obj->content, $db_sample, "get content"); is( $obj->encoded_content, $db_encoded_sample, "get encoded_content"); # set encoded_content, check encoded_content & content ok( $obj->encoded_content($encoded_sample), "set encoded_content"); is( $obj->encoded_content, $encoded_sample, "get encoded_content"); is( $obj->content, $sample, "get content"); } sub test_content_from_bytes { my ($obj, $source_re) = @_; # assumes object encoded_content is encoded sample is( $obj->encoded_content, $encoded_sample, "get encoded_content" ); my $err = exception { $obj->content }; like( $err, qr/can't decode text from 'bytes'/i, "get content from bytes should throw error" ); like( $err, $source_re, "error shows encoded_content source" ); } sub test_latin1 { my ($obj) = @_; # assumes encoded_content is $latin1_dolmen and encoding # is already set to 'latin1" is( $obj->encoded_content, $latin1_dolmen, "get encoded_content" ); is( $obj->content, $sample{dolmen}, "get content" ); } subtest "OnDisk" => sub { my $class = "Dist::Zilla::File::OnDisk"; subtest "UTF-8 file" => sub { my $tempfile = Path::Tiny->tempfile; ok( $tempfile->spew_utf8($sample), "create UTF-8 encoded tempfile" ); my $obj = new_ok( $class, new_args(name => "$tempfile") ); test_mutable_roundtrip($obj); }; subtest "binary file" => sub { my $tempfile = Path::Tiny->tempfile; ok( $tempfile->spew_raw($encoded_sample), "create binary tempfile" ); my $obj = new_ok( $class, new_args(name => "$tempfile") ); ok( $obj->encoding("bytes"), "set encoding to 'bytes'"); test_content_from_bytes($obj, qr/encoded_content set by \S+ line \d+/); }; subtest "latin1 file" => sub { my $tempfile = Path::Tiny->tempfile; ok( $tempfile->spew( { binmode => ":encoding(latin1)"}, $sample{dolmen} ), "create latin1 tempfile" ); my $obj = new_ok( $class, new_args(name => "$tempfile", encoding => 'latin1') ); test_latin1($obj); }; }; subtest "InMemory" => sub { my $class = "Dist::Zilla::File::InMemory"; subtest "UTF-8 string" => sub { my $obj = new_ok( $class, new_args(content => $sample) ); test_mutable_roundtrip($obj); }; subtest "binary string" => sub { my $obj = new_ok( $class, new_args( encoded_content => $encoded_sample ) ); ok( $obj->encoding("bytes"), "set encoding to 'bytes'"); test_content_from_bytes($obj, qr/encoded_content set by \S+ line \d+/); }; subtest "latin1 string" => sub { my $obj = new_ok( $class, new_args(encoded_content => $latin1_dolmen, encoding => "latin1") ); test_latin1($obj); }; }; subtest "FromCode" => sub { my $class = "Dist::Zilla::File::FromCode"; subtest "UTF-8 string" => sub { my $obj = new_ok( $class, new_args( code => sub { $sample } )); is( $obj->content, $sample, "content" ); is( $obj->encoded_content, $encoded_sample, "encoded_content" ); }; subtest "content immutable" => sub { my $obj = new_ok( $class, new_args( code => sub { $sample } )); like( exception { $obj->content($sample) }, qr/cannot set content/, "changing content should throw error" ); like( exception { $obj->encoded_content($encoded_sample) }, qr/cannot set encoded_content/, "changing encoded_content should throw error" ); }; subtest "binary string" => sub { my $obj = new_ok( $class, new_args( code_return_type => 'bytes', code => sub { $encoded_sample } ) ); test_content_from_bytes($obj, qr/bytes from coderef set by \S+ line \d+/); }; subtest "latin1 string" => sub { my $obj = new_ok( $class, new_args( code_return_type => 'bytes', code => sub { $latin1_dolmen }, encoding => 'latin1', ) ); test_latin1($obj); }; }; done_testing; util.t100644000766000024 141612257437015 14425 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/tuse strict; use warnings; use Test::More; use Dist::Zilla::Util; sub abstract_from_string { my ($str) = @_; my $e = Dist::Zilla::Util::PEA->_new; $e->read_string($str); return $e->{abstract}; } { my $pod = <<'EOP'; =head1 NAME Term::ReadLine - Perl interface to various C packages. If no real package is found, substitutes stubs instead of basic functions. =head1 SYNOPSIS EOP is abstract_from_string($pod), 'Perl interface to various C packages. If no real package is found, substitutes stubs instead of basic functions.'; } { my $pod = <<'EOP'; =head1 NAME Search::Dict, look - search for key in dictionary file =head1 SYNOPSIS EOP is abstract_from_string($pod), 'search for key in dictionary file'; } done_testing; META.yml100644000766000024 2703212257437015 14313 0ustar00rjbsstaff000000000000Dist-Zilla-5.008--- abstract: 'distribution builder; installer not included!' author: - 'Ricardo SIGNES ' build_requires: Software::License::None: 0 Test::FailWarnings: 0 Test::Fatal: 0 Test::File::ShareDir: 0 Test::More: 0.96 lib: 0 utf8: 0 configure_requires: ExtUtils::MakeMaker: 6.30 File::ShareDir::Install: 0.03 dynamic_config: 0 generated_by: 'Dist::Zilla version 5.008, CPAN::Meta::Converter version 2.133380' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Dist-Zilla no_index: directory: - corpus - misc recommends: Archive::Tar::Wrapper: 0.15 Term::ReadLine::Gnu: 0 requires: App::Cmd::Command::version: 0 App::Cmd::Setup: 0.309 App::Cmd::Tester: 0.306 App::Cmd::Tester::CaptureExternal: 0 Archive::Tar: 0 CPAN::Meta::Converter: 2.101550 CPAN::Meta::Prereqs: 2.120630 CPAN::Meta::Requirements: 2.121 CPAN::Meta::Validator: 2.101550 CPAN::Uploader: 0.103004 Carp: 0 Class::Load: 0.17 Config::INI::Reader: 0 Config::MVP::Assembler: 0 Config::MVP::Assembler::WithBundles: 0 Config::MVP::Reader: 2.101540 Config::MVP::Reader::Findable::ByExtension: 0 Config::MVP::Reader::Finder: 0 Config::MVP::Reader::INI: 2 Config::MVP::Section: 2.200002 Data::Dumper: 0 Data::Section: 0.200002 DateTime: 0.44 Digest::MD5: 0 Encode: 0 ExtUtils::Manifest: 1.54 File::Copy::Recursive: 0 File::Find::Rule: 0 File::HomeDir: 0 File::Path: 0 File::ShareDir: 0 File::ShareDir::Install: 0.03 File::Spec: 0 File::Temp: 0 File::pushd: 0 Hash::Merge::Simple: 0 JSON: 2 List::AllUtils: 0 List::MoreUtils: 0 List::Util: 0 Log::Dispatchouli: 1.102220 Mixin::Linewise::Readers: 0.100 Moose: 0.92 Moose::Autobox: 0.10 Moose::Role: 0 Moose::Util::TypeConstraints: 0 MooseX::LazyRequire: 0 MooseX::Role::Parameterized: 0 MooseX::SetOnce: 0 MooseX::Types: 0 MooseX::Types::Moose: 0 MooseX::Types::Path::Class: 0 MooseX::Types::Perl: 0 PPI: 0 Params::Util: 0 Path::Class: 0.22 Path::Tiny: 0 Perl::PrereqScanner: 1.016 Perl::Version: 0 Pod::Eventual: 0.091480 Scalar::Util: 0 Software::License: 0.101370 Software::LicenseUtils: 0 String::Formatter: 0.100680 String::RewritePrefix: 0.005 Sub::Exporter: 0 Sub::Exporter::ForMethods: 0 Sub::Exporter::Util: 0 Term::Encoding: 0 Term::ReadKey: 0 Term::ReadLine: 0 Term::UI: 0 Test::Deep: 0 Text::Glob: 0.08 Text::Template: 0 Try::Tiny: 0 YAML::Tiny: 0 autobox: 2.53 autodie: 0 namespace::autoclean: 0 parent: 0 perl: v5.8.5 strict: 0 version: 0 warnings: 0 resources: Mailing_list: http://www.listbox.com/subscribe/?list_id=139292 bugtracker: https://github.com/rjbs/Dist-Zilla/issues homepage: http://dzil.org/ repository: https://github.com/rjbs/Dist-Zilla.git version: 5.008 x_Dist_Zilla: perl: version: 5.018001 plugins: - class: Dist::Zilla::Plugin::Git::GatherDir name: '@Filter/Git::GatherDir' version: 2.019 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Filter/CheckPrereqsIndexed' version: 0.010 - class: Dist::Zilla::Plugin::CheckExtraTests name: '@Filter/CheckExtraTests' version: 0.016 - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::RJBS phase: build skip: [] name: '@Filter/RJBS-Outdated' version: 0.015 - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 0 modules: [] phase: release skip: [] name: '@Filter/CPAN-Outdated' version: 0.015 - class: Dist::Zilla::Plugin::PruneCruft name: '@Filter/@Filter/PruneCruft' version: 5.008 - class: Dist::Zilla::Plugin::ManifestSkip name: '@Filter/@Filter/ManifestSkip' version: 5.008 - class: Dist::Zilla::Plugin::MetaYAML name: '@Filter/@Filter/MetaYAML' version: 5.008 - class: Dist::Zilla::Plugin::License name: '@Filter/@Filter/License' version: 5.008 - class: Dist::Zilla::Plugin::Readme name: '@Filter/@Filter/Readme' version: 5.008 - class: Dist::Zilla::Plugin::ExecDir name: '@Filter/@Filter/ExecDir' version: 5.008 - class: Dist::Zilla::Plugin::ShareDir name: '@Filter/@Filter/ShareDir' version: 5.008 - class: Dist::Zilla::Plugin::MakeMaker name: '@Filter/@Filter/MakeMaker' version: 5.008 - class: Dist::Zilla::Plugin::Manifest name: '@Filter/@Filter/Manifest' version: 5.008 - class: Dist::Zilla::Plugin::TestRelease name: '@Filter/@Filter/TestRelease' version: 5.008 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Filter/@Filter/ConfirmRelease' version: 5.008 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Filter/@Filter/UploadToCPAN' version: 5.008 - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Filter/AutoPrereqs' version: 5.008 - class: Dist::Zilla::Plugin::Git::NextVersion name: '@Filter/Git::NextVersion' version: 2.019 - class: Dist::Zilla::Plugin::PkgVersion name: '@Filter/PkgVersion' version: 5.008 - class: Dist::Zilla::Plugin::MetaConfig name: '@Filter/MetaConfig' version: 5.008 - class: Dist::Zilla::Plugin::MetaJSON name: '@Filter/MetaJSON' version: 5.008 - class: Dist::Zilla::Plugin::NextRelease name: '@Filter/NextRelease' version: 5.008 - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@Filter/Test::ChangesHasContent' version: 0.006 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Filter/PodSyntaxTests' version: 5.008 - class: Dist::Zilla::Plugin::ReportVersions::Tiny name: '@Filter/ReportVersions::Tiny' version: 1.10 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@Filter/TestMoreWithSubtests' version: 5.008 - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugin: '@RJBS' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: 4.005 - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: 4.005 - class: Pod::Weaver::Plugin::SingleEncoding name: '@RJBS/SingleEncoding' version: 4.005 - class: Pod::Weaver::Section::Name name: '@RJBS/Name' version: 4.005 - class: Pod::Weaver::Section::Version name: '@RJBS/Version' version: 4.005 - class: Pod::Weaver::Section::Region name: '@RJBS/Prelude' version: 4.005 - class: Pod::Weaver::Section::Generic name: '@RJBS/Synopsis' version: 4.005 - class: Pod::Weaver::Section::Generic name: '@RJBS/Description' version: 4.005 - class: Pod::Weaver::Section::Generic name: '@RJBS/Overview' version: 4.005 - class: Pod::Weaver::Section::Generic name: '@RJBS/Stability' version: 4.005 - class: Pod::Weaver::Section::Collect name: Attributes version: 4.005 - class: Pod::Weaver::Section::Collect name: Methods version: 4.005 - class: Pod::Weaver::Section::Collect name: Functions version: 4.005 - class: Pod::Weaver::Section::Leftovers name: '@RJBS/Leftovers' version: 4.005 - class: Pod::Weaver::Section::Region name: '@RJBS/postlude' version: 4.005 - class: Pod::Weaver::Section::Authors name: '@RJBS/Authors' version: 4.005 - class: Pod::Weaver::Section::Legal name: '@RJBS/Legal' version: 4.005 - class: Pod::Weaver::Plugin::Transformer name: '@RJBS/List' version: 4.005 name: '@Filter/PodWeaver' version: 4.002 - class: Dist::Zilla::Plugin::GithubMeta name: '@Filter/GithubMeta' version: 0.42 - class: Dist::Zilla::Plugin::Git::Check name: '@Filter/@Git/Check' version: 2.019 - class: Dist::Zilla::Plugin::Git::Commit name: '@Filter/@Git/Commit' version: 2.019 - class: Dist::Zilla::Plugin::Git::Tag name: '@Filter/@Git/Tag' version: 2.019 - class: Dist::Zilla::Plugin::Git::Push name: '@Filter/@Git/Push' version: 2.019 - class: Dist::Zilla::Plugin::ModuleShareDirs name: ModuleShareDirs version: 5.008 - class: Dist::Zilla::Plugin::MetaNoIndex name: MetaNoIndex version: 5.008 - class: Dist::Zilla::Plugin::MetaResources name: MetaResources version: 5.008 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: TestRequires version: 5.008 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: recommends name: RuntimeRecommends version: 5.008 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: 5.008 - class: Dist::Zilla::Plugin::RemovePrereqs config: Dist::Zilla::Plugin::RemovePrereqs: modules_to_remove: - Config - Dist::Zilla::Tester::_Role - Some::Package::That::Does::Not::Exist::Due::To::A::Typo name: RemovePrereqs version: 5.008 - class: Dist::Zilla::Plugin::CPANFile name: CPANFile version: 5.008 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 5.008 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 5.008 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 5.008 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 5.008 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 5.008 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 5.008 - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: 5.008 - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: 5.008 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 5.008 MANIFEST100644000766000024 1621612257437015 14175 0ustar00rjbsstaff000000000000Dist-Zilla-5.008# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.008. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README bin/dzil corpus/README corpus/dist/AutoPrereqs/bin/foobar corpus/dist/AutoPrereqs/dist.ini corpus/dist/AutoPrereqs/lib/DZPA/Empty.pm corpus/dist/AutoPrereqs/lib/DZPA/Main.pm corpus/dist/AutoPrereqs/t/data.bin corpus/dist/DZ-NonAscii/Changes corpus/dist/DZ-NonAscii/dist.ini corpus/dist/DZ-NonAscii/lib/DZ1.pm corpus/dist/DZ1/dist.ini corpus/dist/DZ1/lib/DZ1.pm corpus/dist/DZ2/dist.pl corpus/dist/DZ2/lib/DZ1.pm corpus/dist/DZT/lib/DZT/Sample.pm corpus/dist/DZT/t/basic.t corpus/dist/DZT_Bin/test.pl corpus/dist/DZT_Inc/Foo.pm corpus/dist/DZT_Inc/Foo/Bar.pm corpus/dist/DZT_NoPm/lib/DZT/Sample.pod corpus/dist/DZT_NoPm/t/basic.t corpus/dist/DZT_Share/my_data.dat corpus/extra/subdir/index.html corpus/extra/vader.txt corpus/global/config.ini cpanfile dist.ini lib/Dist/Zilla.pm lib/Dist/Zilla/App.pm lib/Dist/Zilla/App/Command.pm lib/Dist/Zilla/App/Command/add.pm lib/Dist/Zilla/App/Command/authordeps.pm lib/Dist/Zilla/App/Command/build.pm lib/Dist/Zilla/App/Command/clean.pm lib/Dist/Zilla/App/Command/install.pm lib/Dist/Zilla/App/Command/listdeps.pm lib/Dist/Zilla/App/Command/new.pm lib/Dist/Zilla/App/Command/nop.pm lib/Dist/Zilla/App/Command/release.pm lib/Dist/Zilla/App/Command/run.pm lib/Dist/Zilla/App/Command/setup.pm lib/Dist/Zilla/App/Command/smoke.pm lib/Dist/Zilla/App/Command/test.pm lib/Dist/Zilla/App/Command/version.pm lib/Dist/Zilla/App/Tester.pm lib/Dist/Zilla/Chrome/Term.pm lib/Dist/Zilla/Chrome/Test.pm lib/Dist/Zilla/Dist/Builder.pm lib/Dist/Zilla/Dist/Minter.pm lib/Dist/Zilla/File/FromCode.pm lib/Dist/Zilla/File/InMemory.pm lib/Dist/Zilla/File/OnDisk.pm lib/Dist/Zilla/MVP/Assembler.pm lib/Dist/Zilla/MVP/Assembler/GlobalConfig.pm lib/Dist/Zilla/MVP/Assembler/Zilla.pm lib/Dist/Zilla/MVP/Reader/Finder.pm lib/Dist/Zilla/MVP/Reader/Perl.pm lib/Dist/Zilla/MVP/RootSection.pm lib/Dist/Zilla/MVP/Section.pm lib/Dist/Zilla/MintingProfile/Default.pm lib/Dist/Zilla/Plugin/AutoPrereq.pm lib/Dist/Zilla/Plugin/AutoPrereqs.pm lib/Dist/Zilla/Plugin/AutoVersion.pm lib/Dist/Zilla/Plugin/BumpVersion.pm lib/Dist/Zilla/Plugin/CPANFile.pm lib/Dist/Zilla/Plugin/ConfirmRelease.pm lib/Dist/Zilla/Plugin/DistINI.pm lib/Dist/Zilla/Plugin/Encoding.pm lib/Dist/Zilla/Plugin/ExecDir.pm lib/Dist/Zilla/Plugin/ExtraTests.pm lib/Dist/Zilla/Plugin/FakeRelease.pm lib/Dist/Zilla/Plugin/FileFinder/ByName.pm lib/Dist/Zilla/Plugin/FileFinder/Filter.pm lib/Dist/Zilla/Plugin/FinderCode.pm lib/Dist/Zilla/Plugin/GatherDir.pm lib/Dist/Zilla/Plugin/GatherDir/Template.pm lib/Dist/Zilla/Plugin/GenerateFile.pm lib/Dist/Zilla/Plugin/InlineFiles.pm lib/Dist/Zilla/Plugin/License.pm lib/Dist/Zilla/Plugin/MakeMaker.pm lib/Dist/Zilla/Plugin/MakeMaker/Runner.pm lib/Dist/Zilla/Plugin/Manifest.pm lib/Dist/Zilla/Plugin/ManifestSkip.pm lib/Dist/Zilla/Plugin/MetaConfig.pm lib/Dist/Zilla/Plugin/MetaJSON.pm lib/Dist/Zilla/Plugin/MetaNoIndex.pm lib/Dist/Zilla/Plugin/MetaResources.pm lib/Dist/Zilla/Plugin/MetaTests.pm lib/Dist/Zilla/Plugin/MetaYAML.pm lib/Dist/Zilla/Plugin/ModuleBuild.pm lib/Dist/Zilla/Plugin/ModuleShareDirs.pm lib/Dist/Zilla/Plugin/NextRelease.pm lib/Dist/Zilla/Plugin/PkgDist.pm lib/Dist/Zilla/Plugin/PkgVersion.pm lib/Dist/Zilla/Plugin/PodCoverageTests.pm lib/Dist/Zilla/Plugin/PodSyntaxTests.pm lib/Dist/Zilla/Plugin/PodVersion.pm lib/Dist/Zilla/Plugin/Prereq.pm lib/Dist/Zilla/Plugin/Prereqs.pm lib/Dist/Zilla/Plugin/PruneCruft.pm lib/Dist/Zilla/Plugin/PruneFiles.pm lib/Dist/Zilla/Plugin/Readme.pm lib/Dist/Zilla/Plugin/RemovePrereqs.pm lib/Dist/Zilla/Plugin/ShareDir.pm lib/Dist/Zilla/Plugin/TemplateModule.pm lib/Dist/Zilla/Plugin/TestRelease.pm lib/Dist/Zilla/Plugin/UploadToCPAN.pm lib/Dist/Zilla/PluginBundle/Basic.pm lib/Dist/Zilla/PluginBundle/Classic.pm lib/Dist/Zilla/PluginBundle/FakeClassic.pm lib/Dist/Zilla/PluginBundle/Filter.pm lib/Dist/Zilla/Prereqs.pm lib/Dist/Zilla/Role/AfterBuild.pm lib/Dist/Zilla/Role/AfterMint.pm lib/Dist/Zilla/Role/AfterRelease.pm lib/Dist/Zilla/Role/BeforeArchive.pm lib/Dist/Zilla/Role/BeforeBuild.pm lib/Dist/Zilla/Role/BeforeMint.pm lib/Dist/Zilla/Role/BeforeRelease.pm lib/Dist/Zilla/Role/BuildPL.pm lib/Dist/Zilla/Role/BuildRunner.pm lib/Dist/Zilla/Role/Chrome.pm lib/Dist/Zilla/Role/ConfigDumper.pm lib/Dist/Zilla/Role/EncodingProvider.pm lib/Dist/Zilla/Role/ExecFiles.pm lib/Dist/Zilla/Role/File.pm lib/Dist/Zilla/Role/FileFinder.pm lib/Dist/Zilla/Role/FileFinderUser.pm lib/Dist/Zilla/Role/FileGatherer.pm lib/Dist/Zilla/Role/FileInjector.pm lib/Dist/Zilla/Role/FileMunger.pm lib/Dist/Zilla/Role/FilePruner.pm lib/Dist/Zilla/Role/InstallTool.pm lib/Dist/Zilla/Role/LicenseProvider.pm lib/Dist/Zilla/Role/MetaProvider.pm lib/Dist/Zilla/Role/MintingProfile.pm lib/Dist/Zilla/Role/MintingProfile/ShareDir.pm lib/Dist/Zilla/Role/ModuleMaker.pm lib/Dist/Zilla/Role/MutableFile.pm lib/Dist/Zilla/Role/NameProvider.pm lib/Dist/Zilla/Role/PPI.pm lib/Dist/Zilla/Role/Plugin.pm lib/Dist/Zilla/Role/PluginBundle.pm lib/Dist/Zilla/Role/PluginBundle/Easy.pm lib/Dist/Zilla/Role/PrereqSource.pm lib/Dist/Zilla/Role/Releaser.pm lib/Dist/Zilla/Role/ShareDir.pm lib/Dist/Zilla/Role/Stash.pm lib/Dist/Zilla/Role/Stash/Authors.pm lib/Dist/Zilla/Role/Stash/Login.pm lib/Dist/Zilla/Role/StubBuild.pm lib/Dist/Zilla/Role/TestRunner.pm lib/Dist/Zilla/Role/TextTemplate.pm lib/Dist/Zilla/Role/VersionProvider.pm lib/Dist/Zilla/Stash/PAUSE.pm lib/Dist/Zilla/Stash/Rights.pm lib/Dist/Zilla/Stash/User.pm lib/Dist/Zilla/Tester.pm lib/Dist/Zilla/Tutorial.pm lib/Dist/Zilla/Types.pm lib/Dist/Zilla/Util.pm lib/Dist/Zilla/Util/AuthorDeps.pm lib/Test/DZil.pm misc/dzil-bash_completion misc/dzil_bootstrap misc/lib/Dist/Zilla/App/Command/gconf.pm misc/lib/Dist/Zilla/App/Command/input.pm profiles/default/extra-dist.ini profiles/default/profile.ini t/000-report-versions-tiny.t t/commands/authordeps.t t/compile.t t/diagnostics/main-module.t t/diagnostics/plugin-fail.t t/file.t t/lib/Dist/Zilla/Plugin/BrokenPlugin.pm t/lib/Dist/Zilla/Plugin/BrokenPlugin2.pm t/lib/Dist/Zilla/Plugin/BrokenPlugin3.pm t/lib/Dist/Zilla/Plugin/BrokenPlugin4.pm t/lib/Dist/Zilla/Plugin/JustForManifestSkipTests.pm t/lib/Dist/Zilla/Plugin/TestAutoLicense.pm t/lib/Dist/Zilla/Plugin/TestAutoName.pm t/lib/Dist/Zilla/Stash/Heap.pm t/minter.t t/plugins/autolicense.t t/plugins/autoname.t t/plugins/autoprereqs.t t/plugins/autoversion.t t/plugins/confirmrelease.t t/plugins/distmeta.t t/plugins/extratests.t t/plugins/fakerelease.t t/plugins/ffbyname.t t/plugins/filefinders.t t/plugins/filter-b.t t/plugins/gatherdir.t t/plugins/generatefile.t t/plugins/installdirs.t t/plugins/license.t t/plugins/makemaker.t t/plugins/manifest.t t/plugins/metanoindex.t t/plugins/metaresources.t t/plugins/misctests.t t/plugins/modulebuild.t t/plugins/nextrelease.t t/plugins/pkgdist.t t/plugins/pkgversion.t t/plugins/podsyntaxtests.t t/plugins/podversion.t t/plugins/prereqs.t t/plugins/prunes.t t/plugins/readme.t t/plugins/testrelease.t t/plugins/uploadtocpan.t t/tester-demo.t t/tester.t t/util.t todo/CHECKLIST-testing.mkdn todo/command-plugins.mkdn todo/config-arg-prefix.mkdn todo/delay-core-attrs.mkdn todo/external-core-attr.mkdn todo/version-from-prev.mkdn todo/vfs-for-files.mkdn todo/xs-improvement.mkdn xt/release/changes_has_content.t xt/release/pod-syntax.t cpanfile100644000766000024 720512257437015 14526 0ustar00rjbsstaff000000000000Dist-Zilla-5.008requires "App::Cmd::Command::version" => "0"; requires "App::Cmd::Setup" => "0.309"; requires "App::Cmd::Tester" => "0.306"; requires "App::Cmd::Tester::CaptureExternal" => "0"; requires "Archive::Tar" => "0"; requires "CPAN::Meta::Converter" => "2.101550"; requires "CPAN::Meta::Prereqs" => "2.120630"; requires "CPAN::Meta::Requirements" => "2.121"; requires "CPAN::Meta::Validator" => "2.101550"; requires "CPAN::Uploader" => "0.103004"; requires "Carp" => "0"; requires "Class::Load" => "0.17"; requires "Config::INI::Reader" => "0"; requires "Config::MVP::Assembler" => "0"; requires "Config::MVP::Assembler::WithBundles" => "0"; requires "Config::MVP::Reader" => "2.101540"; requires "Config::MVP::Reader::Findable::ByExtension" => "0"; requires "Config::MVP::Reader::Finder" => "0"; requires "Config::MVP::Reader::INI" => "2"; requires "Config::MVP::Section" => "2.200002"; requires "Data::Dumper" => "0"; requires "Data::Section" => "0.200002"; requires "DateTime" => "0.44"; requires "Digest::MD5" => "0"; requires "Encode" => "0"; requires "ExtUtils::Manifest" => "1.54"; requires "File::Copy::Recursive" => "0"; requires "File::Find::Rule" => "0"; requires "File::HomeDir" => "0"; requires "File::Path" => "0"; requires "File::ShareDir" => "0"; requires "File::ShareDir::Install" => "0.03"; requires "File::Spec" => "0"; requires "File::Temp" => "0"; requires "File::pushd" => "0"; requires "Hash::Merge::Simple" => "0"; requires "JSON" => "2"; requires "List::AllUtils" => "0"; requires "List::MoreUtils" => "0"; requires "List::Util" => "0"; requires "Log::Dispatchouli" => "1.102220"; requires "Mixin::Linewise::Readers" => "0.100"; requires "Moose" => "0.92"; requires "Moose::Autobox" => "0.10"; requires "Moose::Role" => "0"; requires "Moose::Util::TypeConstraints" => "0"; requires "MooseX::LazyRequire" => "0"; requires "MooseX::Role::Parameterized" => "0"; requires "MooseX::SetOnce" => "0"; requires "MooseX::Types" => "0"; requires "MooseX::Types::Moose" => "0"; requires "MooseX::Types::Path::Class" => "0"; requires "MooseX::Types::Perl" => "0"; requires "PPI" => "0"; requires "Params::Util" => "0"; requires "Path::Class" => "0.22"; requires "Path::Tiny" => "0"; requires "Perl::PrereqScanner" => "1.016"; requires "Perl::Version" => "0"; requires "Pod::Eventual" => "0.091480"; requires "Scalar::Util" => "0"; requires "Software::License" => "0.101370"; requires "Software::LicenseUtils" => "0"; requires "String::Formatter" => "0.100680"; requires "String::RewritePrefix" => "0.005"; requires "Sub::Exporter" => "0"; requires "Sub::Exporter::ForMethods" => "0"; requires "Sub::Exporter::Util" => "0"; requires "Term::Encoding" => "0"; requires "Term::ReadKey" => "0"; requires "Term::ReadLine" => "0"; requires "Term::UI" => "0"; requires "Test::Deep" => "0"; requires "Text::Glob" => "0.08"; requires "Text::Template" => "0"; requires "Try::Tiny" => "0"; requires "YAML::Tiny" => "0"; requires "autobox" => "2.53"; requires "autodie" => "0"; requires "namespace::autoclean" => "0"; requires "parent" => "0"; requires "perl" => "v5.8.5"; requires "strict" => "0"; requires "version" => "0"; requires "warnings" => "0"; recommends "Archive::Tar::Wrapper" => "0.15"; recommends "Term::ReadLine::Gnu" => "0"; on 'test' => sub { requires "Software::License::None" => "0"; requires "Test::FailWarnings" => "0"; requires "Test::Fatal" => "0"; requires "Test::File::ShareDir" => "0"; requires "Test::More" => "0.96"; requires "lib" => "0"; requires "utf8" => "0"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "6.30"; requires "File::ShareDir::Install" => "0.03"; }; on 'develop' => sub { requires "Test::Pod" => "1.41"; requires "version" => "0.9901"; }; META.json100644000766000024 4470712257437015 14473 0ustar00rjbsstaff000000000000Dist-Zilla-5.008{ "abstract" : "distribution builder; installer not included!", "author" : [ "Ricardo SIGNES " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.008, CPAN::Meta::Converter version 2.133380", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Dist-Zilla", "no_index" : { "directory" : [ "corpus", "misc" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30", "File::ShareDir::Install" : "0.03" } }, "develop" : { "requires" : { "Test::Pod" : "1.41", "version" : "0.9901" } }, "runtime" : { "recommends" : { "Archive::Tar::Wrapper" : "0.15", "Term::ReadLine::Gnu" : "0" }, "requires" : { "App::Cmd::Command::version" : "0", "App::Cmd::Setup" : "0.309", "App::Cmd::Tester" : "0.306", "App::Cmd::Tester::CaptureExternal" : "0", "Archive::Tar" : "0", "CPAN::Meta::Converter" : "2.101550", "CPAN::Meta::Prereqs" : "2.120630", "CPAN::Meta::Requirements" : "2.121", "CPAN::Meta::Validator" : "2.101550", "CPAN::Uploader" : "0.103004", "Carp" : "0", "Class::Load" : "0.17", "Config::INI::Reader" : "0", "Config::MVP::Assembler" : "0", "Config::MVP::Assembler::WithBundles" : "0", "Config::MVP::Reader" : "2.101540", "Config::MVP::Reader::Findable::ByExtension" : "0", "Config::MVP::Reader::Finder" : "0", "Config::MVP::Reader::INI" : "2", "Config::MVP::Section" : "2.200002", "Data::Dumper" : "0", "Data::Section" : "0.200002", "DateTime" : "0.44", "Digest::MD5" : "0", "Encode" : "0", "ExtUtils::Manifest" : "1.54", "File::Copy::Recursive" : "0", "File::Find::Rule" : "0", "File::HomeDir" : "0", "File::Path" : "0", "File::ShareDir" : "0", "File::ShareDir::Install" : "0.03", "File::Spec" : "0", "File::Temp" : "0", "File::pushd" : "0", "Hash::Merge::Simple" : "0", "JSON" : "2", "List::AllUtils" : "0", "List::MoreUtils" : "0", "List::Util" : "0", "Log::Dispatchouli" : "1.102220", "Mixin::Linewise::Readers" : "0.100", "Moose" : "0.92", "Moose::Autobox" : "0.10", "Moose::Role" : "0", "Moose::Util::TypeConstraints" : "0", "MooseX::LazyRequire" : "0", "MooseX::Role::Parameterized" : "0", "MooseX::SetOnce" : "0", "MooseX::Types" : "0", "MooseX::Types::Moose" : "0", "MooseX::Types::Path::Class" : "0", "MooseX::Types::Perl" : "0", "PPI" : "0", "Params::Util" : "0", "Path::Class" : "0.22", "Path::Tiny" : "0", "Perl::PrereqScanner" : "1.016", "Perl::Version" : "0", "Pod::Eventual" : "0.091480", "Scalar::Util" : "0", "Software::License" : "0.101370", "Software::LicenseUtils" : "0", "String::Formatter" : "0.100680", "String::RewritePrefix" : "0.005", "Sub::Exporter" : "0", "Sub::Exporter::ForMethods" : "0", "Sub::Exporter::Util" : "0", "Term::Encoding" : "0", "Term::ReadKey" : "0", "Term::ReadLine" : "0", "Term::UI" : "0", "Test::Deep" : "0", "Text::Glob" : "0.08", "Text::Template" : "0", "Try::Tiny" : "0", "YAML::Tiny" : "0", "autobox" : "2.53", "autodie" : "0", "namespace::autoclean" : "0", "parent" : "0", "perl" : "v5.8.5", "strict" : "0", "version" : "0", "warnings" : "0" } }, "test" : { "requires" : { "Software::License::None" : "0", "Test::FailWarnings" : "0", "Test::Fatal" : "0", "Test::File::ShareDir" : "0", "Test::More" : "0.96", "lib" : "0", "utf8" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/rjbs/Dist-Zilla/issues" }, "homepage" : "http://dzil.org/", "repository" : { "type" : "git", "url" : "https://github.com/rjbs/Dist-Zilla.git", "web" : "https://github.com/rjbs/Dist-Zilla" }, "x_mailing_list" : "http://www.listbox.com/subscribe/?list_id=139292" }, "version" : "5.008", "x_Dist_Zilla" : { "perl" : { "version" : "5.018001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "name" : "@Filter/Git::GatherDir", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Filter/CheckPrereqsIndexed", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@Filter/CheckExtraTests", "version" : "0.016" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::RJBS" ], "phase" : "build", "skip" : [] } }, "name" : "@Filter/RJBS-Outdated", "version" : "0.015" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : "1", "check_all_prereqs" : 0, "modules" : [], "phase" : "release", "skip" : [] } }, "name" : "@Filter/CPAN-Outdated", "version" : "0.015" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Filter/@Filter/PruneCruft", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Filter/@Filter/ManifestSkip", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Filter/@Filter/MetaYAML", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Filter/@Filter/License", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Filter/@Filter/Readme", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Filter/@Filter/ExecDir", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Filter/@Filter/ShareDir", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "@Filter/@Filter/MakeMaker", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Filter/@Filter/Manifest", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Filter/@Filter/TestRelease", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Filter/@Filter/ConfirmRelease", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Filter/@Filter/UploadToCPAN", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Filter/AutoPrereqs", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "@Filter/Git::NextVersion", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@Filter/PkgVersion", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Filter/MetaConfig", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Filter/MetaJSON", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Filter/NextRelease", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@Filter/Test::ChangesHasContent", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Filter/PodSyntaxTests", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny", "name" : "@Filter/ReportVersions::Tiny", "version" : "1.10" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@Filter/TestMoreWithSubtests", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugin" : "@RJBS", "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.005" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.005" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@RJBS/SingleEncoding", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@RJBS/Name", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@RJBS/Version", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/Prelude", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Synopsis", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Description", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Overview", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Stability", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Attributes", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Methods", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Functions", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@RJBS/Leftovers", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/postlude", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@RJBS/Authors", "version" : "4.005" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@RJBS/Legal", "version" : "4.005" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@RJBS/List", "version" : "4.005" } ] } }, "name" : "@Filter/PodWeaver", "version" : "4.002" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Filter/GithubMeta", "version" : "0.42" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@Filter/@Git/Check", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@Filter/@Git/Commit", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@Filter/@Git/Tag", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "@Filter/@Git/Push", "version" : "2.019" }, { "class" : "Dist::Zilla::Plugin::ModuleShareDirs", "name" : "ModuleShareDirs", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "MetaNoIndex", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "TestRequires", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "recommends" } }, "name" : "RuntimeRecommends", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::RemovePrereqs", "config" : { "Dist::Zilla::Plugin::RemovePrereqs" : { "modules_to_remove" : [ "Config", "Dist::Zilla::Tester::_Role", "Some::Package::That::Does::Not::Exist::Due::To::A::Typo" ] } }, "name" : "RemovePrereqs", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::CPANFile", "name" : "CPANFile", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "5.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "5.008" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.008" } } } minter.t100644000766000024 213512257437015 14745 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t#!perl use strict; use warnings; use Test::More 0.88; use lib 't/lib'; use File::pushd qw/pushd/; use Path::Class; use Test::DZil; use Dist::Zilla::App::Tester; use YAML::Tiny; use Test::File::ShareDir -share => { -module => { 'Dist::Zilla::MintingProfile::Default' => 'profiles' }, }; my $tzil = Minter->_new_from_profile( [ Default => 'default' ], { name => 'DZT-Minty', }, { global_config_root => dir('corpus/global')->absolute }, ); $tzil->mint_dist; my $pm = $tzil->slurp_file('mint/lib/DZT/Minty.pm'); like( $pm, qr/package DZT::Minty;/, "our new module has the package declaration we want", ); my $distini = $tzil->slurp_file('mint/dist.ini'); like( $distini, qr/copyright_holder = A. U. Thor/, "copyright_holder in dist.ini", ); { my $result = test_dzil( $tzil->tempdir->subdir('mint')->absolute, [qw(add Foo::Bar)] ); ok(!$result->{exit_code}) || diag($result->{error}); my $pm = dir($result->{tempdir})->file('source/lib/Foo/Bar.pm')->slurp; like( $pm, qr/package Foo::Bar;/, "our second module has the package declaration we want", ); } done_testing; tester.t100644000766000024 266712257437015 14767 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/tuse strict; use warnings; use Archive::Tar; use Test::More 0.88; use Test::DZil; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/zero' => '', 'source/dist.ini' => simple_ini({ name => 'DZT', }, 'GatherDir', 'MakeMaker', 'FakeRelease') }, }, ); $tzil->release; my $basename = $tzil->dist_basename; my $tarball = $tzil->archive_filename; $tarball = $tzil->built_in->parent->subdir('source')->file($tarball); $tarball = Archive::Tar->new($tarball->stringify); my $makefile_pl = File::Spec::Unix->catfile($basename, 'Makefile.PL'); ok( $tarball->contains_file( $makefile_pl ), "Makefile.PL is located at the root of a Test-built archive", ); my ($file) = $tarball->get_files( $makefile_pl ); like($file->get_content, qr{ExtUtils}, "the file contains the real content"); my $zero_byte = File::Spec::Unix->catfile($basename, 'zero'); my ($zero_byte_file) = $tarball->get_files( $zero_byte ); is($zero_byte_file->get_content, "", "zero byte file is empty"); my $tzil2 = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/zero' => '', 'source/dist.ini' => simple_ini({ name => 'DZT', }, 'GatherDir', 'MakeMaker', 'FakeRelease') }, }, ); $tzil2->test; ok((grep { /all's well/ } @{ $tzil2->log_messages }), "tester can run the test method"); done_testing; compile.t100644000766000024 41212257437015 15053 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/tuse strict; use warnings; use Test::More; use File::Find::Rule; use Try::Tiny; my @files = File::Find::Rule->name('*.pm')->in('lib'); plan tests => @files - 1; for (@files) { next if /Tutorial.pm/; s/^lib.//; s/.pm$//; s{[\\/]}{::}g; require_ok($_); } Makefile.PL100644000766000024 1472012257437015 15014 0ustar00rjbsstaff000000000000Dist-Zilla-5.008 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.008. use strict; use warnings; use 5.008005; use ExtUtils::MakeMaker 6.30; use File::ShareDir::Install; install_share module => "Dist::Zilla::MintingProfile::Default", "profiles"; my %WriteMakefileArgs = ( "ABSTRACT" => "distribution builder; installer not included!", "AUTHOR" => "Ricardo SIGNES ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30", "File::ShareDir::Install" => "0.03" }, "DISTNAME" => "Dist-Zilla", "EXE_FILES" => [ "bin/dzil" ], "LICENSE" => "perl", "NAME" => "Dist::Zilla", "PREREQ_PM" => { "App::Cmd::Command::version" => 0, "App::Cmd::Setup" => "0.309", "App::Cmd::Tester" => "0.306", "App::Cmd::Tester::CaptureExternal" => 0, "Archive::Tar" => 0, "CPAN::Meta::Converter" => "2.101550", "CPAN::Meta::Prereqs" => "2.120630", "CPAN::Meta::Requirements" => "2.121", "CPAN::Meta::Validator" => "2.101550", "CPAN::Uploader" => "0.103004", "Carp" => 0, "Class::Load" => "0.17", "Config::INI::Reader" => 0, "Config::MVP::Assembler" => 0, "Config::MVP::Assembler::WithBundles" => 0, "Config::MVP::Reader" => "2.101540", "Config::MVP::Reader::Findable::ByExtension" => 0, "Config::MVP::Reader::Finder" => 0, "Config::MVP::Reader::INI" => 2, "Config::MVP::Section" => "2.200002", "Data::Dumper" => 0, "Data::Section" => "0.200002", "DateTime" => "0.44", "Digest::MD5" => 0, "Encode" => 0, "ExtUtils::Manifest" => "1.54", "File::Copy::Recursive" => 0, "File::Find::Rule" => 0, "File::HomeDir" => 0, "File::Path" => 0, "File::ShareDir" => 0, "File::ShareDir::Install" => "0.03", "File::Spec" => 0, "File::Temp" => 0, "File::pushd" => 0, "Hash::Merge::Simple" => 0, "JSON" => 2, "List::AllUtils" => 0, "List::MoreUtils" => 0, "List::Util" => 0, "Log::Dispatchouli" => "1.102220", "Mixin::Linewise::Readers" => "0.100", "Moose" => "0.92", "Moose::Autobox" => "0.10", "Moose::Role" => 0, "Moose::Util::TypeConstraints" => 0, "MooseX::LazyRequire" => 0, "MooseX::Role::Parameterized" => 0, "MooseX::SetOnce" => 0, "MooseX::Types" => 0, "MooseX::Types::Moose" => 0, "MooseX::Types::Path::Class" => 0, "MooseX::Types::Perl" => 0, "PPI" => 0, "Params::Util" => 0, "Path::Class" => "0.22", "Path::Tiny" => 0, "Perl::PrereqScanner" => "1.016", "Perl::Version" => 0, "Pod::Eventual" => "0.091480", "Scalar::Util" => 0, "Software::License" => "0.101370", "Software::LicenseUtils" => 0, "String::Formatter" => "0.100680", "String::RewritePrefix" => "0.005", "Sub::Exporter" => 0, "Sub::Exporter::ForMethods" => 0, "Sub::Exporter::Util" => 0, "Term::Encoding" => 0, "Term::ReadKey" => 0, "Term::ReadLine" => 0, "Term::UI" => 0, "Test::Deep" => 0, "Text::Glob" => "0.08", "Text::Template" => 0, "Try::Tiny" => 0, "YAML::Tiny" => 0, "autobox" => "2.53", "autodie" => 0, "namespace::autoclean" => 0, "parent" => 0, "strict" => 0, "version" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Software::License::None" => 0, "Test::FailWarnings" => 0, "Test::Fatal" => 0, "Test::File::ShareDir" => 0, "Test::More" => "0.96", "lib" => 0, "utf8" => 0 }, "VERSION" => "5.008", "test" => { "TESTS" => "t/*.t t/commands/*.t t/diagnostics/*.t t/plugins/*.t" } ); my %FallbackPrereqs = ( "App::Cmd::Command::version" => 0, "App::Cmd::Setup" => "0.309", "App::Cmd::Tester" => "0.306", "App::Cmd::Tester::CaptureExternal" => 0, "Archive::Tar" => 0, "CPAN::Meta::Converter" => "2.101550", "CPAN::Meta::Prereqs" => "2.120630", "CPAN::Meta::Requirements" => "2.121", "CPAN::Meta::Validator" => "2.101550", "CPAN::Uploader" => "0.103004", "Carp" => 0, "Class::Load" => "0.17", "Config::INI::Reader" => 0, "Config::MVP::Assembler" => 0, "Config::MVP::Assembler::WithBundles" => 0, "Config::MVP::Reader" => "2.101540", "Config::MVP::Reader::Findable::ByExtension" => 0, "Config::MVP::Reader::Finder" => 0, "Config::MVP::Reader::INI" => 2, "Config::MVP::Section" => "2.200002", "Data::Dumper" => 0, "Data::Section" => "0.200002", "DateTime" => "0.44", "Digest::MD5" => 0, "Encode" => 0, "ExtUtils::Manifest" => "1.54", "File::Copy::Recursive" => 0, "File::Find::Rule" => 0, "File::HomeDir" => 0, "File::Path" => 0, "File::ShareDir" => 0, "File::ShareDir::Install" => "0.03", "File::Spec" => 0, "File::Temp" => 0, "File::pushd" => 0, "Hash::Merge::Simple" => 0, "JSON" => 2, "List::AllUtils" => 0, "List::MoreUtils" => 0, "List::Util" => 0, "Log::Dispatchouli" => "1.102220", "Mixin::Linewise::Readers" => "0.100", "Moose" => "0.92", "Moose::Autobox" => "0.10", "Moose::Role" => 0, "Moose::Util::TypeConstraints" => 0, "MooseX::LazyRequire" => 0, "MooseX::Role::Parameterized" => 0, "MooseX::SetOnce" => 0, "MooseX::Types" => 0, "MooseX::Types::Moose" => 0, "MooseX::Types::Path::Class" => 0, "MooseX::Types::Perl" => 0, "PPI" => 0, "Params::Util" => 0, "Path::Class" => "0.22", "Path::Tiny" => 0, "Perl::PrereqScanner" => "1.016", "Perl::Version" => 0, "Pod::Eventual" => "0.091480", "Scalar::Util" => 0, "Software::License" => "0.101370", "Software::License::None" => 0, "Software::LicenseUtils" => 0, "String::Formatter" => "0.100680", "String::RewritePrefix" => "0.005", "Sub::Exporter" => 0, "Sub::Exporter::ForMethods" => 0, "Sub::Exporter::Util" => 0, "Term::Encoding" => 0, "Term::ReadKey" => 0, "Term::ReadLine" => 0, "Term::UI" => 0, "Test::Deep" => 0, "Test::FailWarnings" => 0, "Test::Fatal" => 0, "Test::File::ShareDir" => 0, "Test::More" => "0.96", "Text::Glob" => "0.08", "Text::Template" => 0, "Try::Tiny" => 0, "YAML::Tiny" => 0, "autobox" => "2.53", "autodie" => 0, "lib" => 0, "namespace::autoclean" => 0, "parent" => 0, "strict" => 0, "utf8" => 0, "version" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); { package MY; use File::ShareDir::Install qw(postamble); } corpus000755000766000024 012257437015 14171 5ustar00rjbsstaff000000000000Dist-Zilla-5.008README100644000766000024 32712257437015 15173 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus This directory contains a set of distributions used by testing. Since the distributions contain *.t files, it's easier to put them outside of ./t so that recursive test harnesses do not try running their dists. tester-demo.t100644000766000024 200712257437015 15675 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/tuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Dist::Zilla::App::Tester; use Test::DZil; ## SIMPLE TEST WITH DZIL::APP TESTER $ENV{DZIL_GLOBAL_CONFIG_ROOT} = 't'; my $result = test_dzil('corpus/dist/DZ1', [ qw(build) ]); is($result->error, undef, 'No errors'); is($result->exit_code, 0, "dzil would have exited 0"); ok( (grep { $_ eq '[DZ] writing archive to DZ1-0.001.tar.gz' } @{ $result->log_messages }), "we logged the archive-creation", ); ## SIMPLE TEST WITH DZIL TESTER my $tester = Dist::Zilla::Tester->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini('@Classic') }, } ); $tester->build; ok( (grep { $_->{message} =~ m<^\[DZ\]\s> } @{ $tester->chrome->logger->events }), "we have at least some expected log content", ); use YAML::Tiny; my $yaml = YAML::Tiny->read($tester->built_in->file('META.yml')); my $meta = $yaml->[0]; like($meta->{generated_by}, qr{Dist::Zilla}, "powered by... ROBOT DINOSAUR"); done_testing; Test000755000766000024 012257437015 14343 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/libDZil.pm100644000766000024 1324112257437015 15724 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Testuse strict; use warnings; package Test::DZil; { $Test::DZil::VERSION = '5.008'; } # ABSTRACT: tools for testing Dist::Zilla plugins use Dist::Zilla::Tester; use Params::Util qw(_HASH0); use JSON 2; use Scalar::Util qw(blessed); use Test::Deep (); use YAML::Tiny; use Sub::Exporter -setup => { exports => [ is_filelist => is_yaml => is_json => dist_ini => \'_dist_ini', simple_ini => \'_simple_ini', Builder => Minter => ], groups => [ default => [ qw(-all) ] ], }; sub is_filelist { my ($have, $want, $comment) = @_; my @want = sort @$want; my @have = sort map { my $str = (blessed $_ and $_->DOES('Dist::Zilla::Role::File')) ? $_->name : $_; $str =~ s{\\}{/}g; $str } @$have; local $Test::Builder::Level = $Test::Builder::Level + 1; Test::More::is_deeply(\@have, \@want, $comment); } sub is_yaml { my ($yaml, $want, $comment) = @_; my $have = YAML::Tiny->read_string($yaml) or die "Cannot decode YAML"; local $Test::Builder::Level = $Test::Builder::Level + 1; Test::Deep::cmp_deeply($have->[0], $want, $comment); } sub is_json { my ($json, $want, $comment) = @_; my $have = JSON->new->ascii(1)->decode($json) or die "Cannot decode JSON"; local $Test::Builder::Level = $Test::Builder::Level + 1; Test::Deep::cmp_deeply($have, $want, $comment); } sub _build_ini_builder { my ($starting_core) = @_; $starting_core ||= {}; sub { my (@arg) = @_; my $new_core = _HASH0($arg[0]) ? shift(@arg) : {}; my $core_config = { %$starting_core, %$new_core }; my $config = ''; for my $key (keys %$core_config) { my @values = ref $core_config->{ $key } ? @{ $core_config->{ $key } } : $core_config->{ $key }; $config .= "$key = $_\n" for grep {defined} @values; } $config .= "\n" if length $config; for my $line (@arg) { my @plugin = ref $line ? @$line : ($line, {}); my $moniker = shift @plugin; my $name = _HASH0($plugin[0]) ? undef : shift @plugin; my $payload = shift(@plugin) || {}; Carp::confess("bogus plugin configuration: too many args") if @plugin; $config .= '[' . $moniker; $config .= ' / ' . $name if defined $name; $config .= "]\n"; for my $key (keys %$payload) { my @values = ref $payload->{ $key } ? @{ $payload->{ $key } } : $payload->{ $key }; $config .= "$key = $_\n" for grep {defined} @values; } $config .= "\n"; } return $config; } } sub _dist_ini { _build_ini_builder; } sub _simple_ini { _build_ini_builder({ name => 'DZT-Sample', abstract => 'Sample DZ Dist', version => '0.001', author => 'E. Xavier Ample ', license => 'Perl_5', copyright_holder => 'E. Xavier Ample', }); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Test::DZil - tools for testing Dist::Zilla plugins =head1 VERSION version 5.008 =head1 DESCRIPTION Test::DZil provides routines for writing tests for Dist::Zilla plugins. =head1 FUNCTIONS =head2 Builder =head2 Minter my $tzil = Builder->from_config(...); These return class names that subclass L or L, respectively, with the L behavior added. =head2 is_filelist is_filelist( \@files_we_have, \@files_we_want, $desc ); This test assertion compares two arrayrefs of filenames, taking care of slash normalization and sorting. C<@files_we_have> may also contain objects that do L. =head2 is_yaml is_yaml( $yaml_string, $want_struct, $comment ); This test assertion deserializes the given YAML string and does a C>. =head2 is_json is_json( $json_string, $want_struct, $comment ); This test assertion deserializes the given JSON string and does a C>. =head2 dist_ini my $ini_text = dist_ini(\%root_config, @plugins); This routine returns a string that could be used to populate a simple F file. The C<%root_config> gives data for the "root" section of the configuration. To provide a line multiple times, provide an arrayref. For example, the root section could read: { name => 'Dist-Sample', author => [ 'J. Smith ', 'Q. Smith ', ], } The root section is optional. Plugins can be given in a few ways: =over 4 =item C<"PluginMoniker"> =item C<[ "PluginMoniker" ]> These become C<[PluginMoniker]> =item C<[ "PluginMoniker", "PluginName" ]> This becomes C<[PluginMoniker / PluginName]> =item C<[ "PluginMoniker", { ... } ]> =item C<[ "PluginMoniker", "PluginName", { ... } ]> These use the given hashref as the parameters inside the section, with the same semantics as the root section. =back =head2 simple_ini This behaves exactly like C, but it merges any given root config into a starter config, which means that you can often skip any explicit root config. The starter config may change slightly over time, but is something like this: { name => 'DZT-Sample', abstract => 'Sample DZ Dist', version => '0.001', author => 'E. Xavier Ample ', license => 'Perl_5', copyright_holder => 'E. Xavier Ample', } =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Dist000755000766000024 012257437015 14327 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/libZilla.pm100644000766000024 4606312257437015 16131 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Distpackage Dist::Zilla; { $Dist::Zilla::VERSION = '5.008'; } # ABSTRACT: distribution builder; installer not included! use Moose 0.92; # role composition fixes with 'Dist::Zilla::Role::ConfigDumper'; use Moose::Autobox 0.09; # ->flatten use MooseX::Types::Moose qw(ArrayRef Bool HashRef Object Str); use MooseX::Types::Perl qw(DistName LaxVersionStr); use MooseX::Types::Path::Class qw(Dir File); use Moose::Util::TypeConstraints; use Dist::Zilla::Types qw(License); use Log::Dispatchouli 1.100712; # proxy_loggers, quiet_fatal use Path::Class; use Path::Tiny; use List::Util qw(first); use Software::License 0.101370; # meta2_name use String::RewritePrefix; use Try::Tiny; use Dist::Zilla::Prereqs; use Dist::Zilla::File::OnDisk; use Dist::Zilla::Role::Plugin; use Dist::Zilla::Util; use namespace::autoclean; has chrome => ( is => 'rw', isa => role_type('Dist::Zilla::Role::Chrome'), required => 1, ); has name => ( is => 'ro', isa => DistName, lazy => 1, builder => '_build_name', ); has _version_override => ( isa => LaxVersionStr, is => 'ro' , init_arg => 'version', ); # XXX: *clearly* this needs to be really much smarter -- rjbs, 2008-06-01 has version => ( is => 'rw', isa => LaxVersionStr, lazy => 1, init_arg => undef, builder => '_build_version', ); sub _build_name { my ($self) = @_; my $name; for my $plugin ($self->plugins_with(-NameProvider)->flatten) { next unless defined(my $this_name = $plugin->provide_name); $self->log_fatal('attempted to set name twice') if defined $name; $name = $this_name; } $self->log_fatal('no name was ever set') unless defined $name; $name; } sub _build_version { my ($self) = @_; my $version = $self->_version_override; for my $plugin ($self->plugins_with(-VersionProvider)->flatten) { next unless defined(my $this_version = $plugin->provide_version); $self->log_fatal('attempted to set version twice') if defined $version; $version = $this_version; } $self->log_fatal('no version was ever set') unless defined $version; $version; } has abstract => ( is => 'rw', isa => 'Str', lazy => 1, default => sub { my ($self) = @_; unless ($self->main_module) { die "no abstract given and no main_module found; make sure your main module is in ./lib\n"; } my $file = $self->main_module; $self->log("extracting distribution abstract from " . $file->name); my $abstract = Dist::Zilla::Util->abstract_from_file($file); if (!defined($abstract)) { my $filename = $file->name; die "Unable to extract an abstract from $filename. Please add the following comment to the file with your abstract: # ABSTRACT: turns baubles into trinkets "; } return $abstract; } ); has _main_module_override => ( isa => 'Str', is => 'ro' , init_arg => 'main_module', predicate => '_has_main_module_override', ); has main_module => ( is => 'ro', isa => 'Dist::Zilla::Role::File', lazy => 1, init_arg => undef, default => sub { my ($self) = @_; my $file; my $guessing = q{}; my $guess; if ( $self->_has_main_module_override ) { $file = first { $_->name eq $self->_main_module_override } $self->files->flatten; } else { $guessing = 'guessing '; # We're having to guess ($guess = $self->name) =~ s{-}{/}g; $guess = "lib/$guess.pm"; $file = (first { $_->name eq $guess } $self->files->flatten) || $self->files ->grep(sub { $_->name =~ m{\.pm\z} and $_->name =~ m{\Alib/} }) ->sort(sub { length $_[0]->name <=> length $_[1]->name }) ->head; } if (not $file) { my @errorlines; push @errorlines, "Unable to find main_module in the distribution"; if ( $self->_has_main_module_override ) { push @errorlines, "'main_module' was specified in dist.ini but the file '" . $self->_main_module_override . "' is not to be found in our dist. ( Did you add it? )"; } else { push @errorlines,"We tried to guess '$guess' but no file like that existed"; } if ( not $self->files->flatten ) { push @errorlines, "Upon further inspection we didn't find any files in your dist, did you add any?"; } elsif ( not $self->files->grep(sub{ $_->name =~ m{\.pm\z} })->head ){ push @errorlines, "We didn't find any .pm files in your dist, this is probably a problem."; } push @errorlines,"Cannot continue without a main_module"; $self->log_fatal( join qq{\n}, @errorlines ); } $self->log("${guessing}dist's main_module is " . $file->name); return $file; }, ); has license => ( is => 'ro', isa => License, lazy => 1, init_arg => 'license_obj', predicate => '_has_license', builder => '_build_license', handles => { copyright_holder => 'holder', copyright_year => 'year', }, ); sub _build_license { my ($self) = @_; my $license_class = $self->_license_class; my $copyright_holder = $self->_copyright_holder; my $copyright_year = $self->_copyright_year; my $provided_license; for my $plugin ($self->plugins_with(-LicenseProvider)->flatten) { my $this_license = $plugin->provide_license({ copyright_holder => $copyright_holder, copyright_year => $copyright_year, }); next unless defined $this_license; $self->log_fatal('attempted to set license twice') if defined $provided_license; $provided_license = $this_license; } return $provided_license if defined $provided_license; if ($license_class) { $license_class = String::RewritePrefix->rewrite( { '=' => '', '' => 'Software::License::' }, $license_class, ); } else { require Software::LicenseUtils; my @guess = Software::LicenseUtils->guess_license_from_pod( $self->main_module->content ); if (@guess != 1) { $self->log_fatal( "no license data in config, no %Rights stash,", "couldn't make a good guess at license from Pod; giving up. ", "Perhaphs you need set global config file (dzil setup)?" ); } my $filename = $self->main_module->name; $license_class = $guess[0]; $self->log("based on POD in $filename, guessing license is $guess[0]"); } Class::Load::load_class($license_class); my $license = $license_class->new({ holder => $self->_copyright_holder, year => $self->_copyright_year, }); $self->_clear_license_class; $self->_clear_copyright_holder; $self->_clear_copyright_year; return $license; } has _license_class => ( is => 'ro', isa => 'Maybe[Str]', lazy => 1, init_arg => 'license', clearer => '_clear_license_class', default => sub { my $stash = $_[0]->stash_named('%Rights'); $stash && return $stash->license_class; return; } ); has _copyright_holder => ( is => 'ro', isa => 'Maybe[Str]', lazy => 1, init_arg => 'copyright_holder', clearer => '_clear_copyright_holder', default => sub { return unless my $stash = $_[0]->stash_named('%Rights'); $stash && return $stash->copyright_holder; return; } ); has _copyright_year => ( is => 'ro', isa => 'Int', lazy => 1, init_arg => 'copyright_year', clearer => '_clear_copyright_year', default => sub { # Oh man. This is a terrible idea! I mean, what if by the code gets run # around like Dec 31, 23:59:59.9 and by the time the default gets called # it's the next year but the default was already set up? Oh man. That # could ruin lives! I guess we could make this a sub to defer the guess, # but think of the performance hit! I guess we'll have to suffer through # this until we can optimize the code to not take .1s to run, right? -- # rjbs, 2008-06-13 my $stash = $_[0]->stash_named('%Rights'); my $year = $stash && $stash->copyright_year; return defined $year ? $year : (localtime)[5] + 1900; } ); has authors => ( is => 'ro', isa => ArrayRef[Str], lazy => 1, default => sub { my ($self) = @_; if (my $stash = $self->stash_named('%User')) { return $stash->authors; } my $author = try { $self->copyright_holder }; return [ $author ] if defined $author and length $author; $self->log_fatal( "No %User stash and no copyright holder;", "can't determine dist author; configure author or a %User section", ); }, ); has files => ( is => 'ro', isa => ArrayRef[ role_type('Dist::Zilla::Role::File') ], lazy => 1, init_arg => undef, default => sub { [] }, ); sub prune_file { my ($self, $file) = @_; my @files = @{ $self->files }; for my $i (0 .. $#files) { next unless $file == $files[ $i ]; splice @{ $self->files }, $i, 1; return; } return; } has root => ( is => 'ro', isa => Dir, coerce => 1, required => 1, ); has is_trial => ( is => 'rw', # XXX: make SetOnce -- rjbs, 2010-03-23 isa => Bool, default => sub { $ENV{TRIAL} ? 1 : 0 } ); has plugins => ( is => 'ro', isa => 'ArrayRef[Dist::Zilla::Role::Plugin]', init_arg => undef, default => sub { [ ] }, ); has distmeta => ( is => 'ro', isa => 'HashRef', init_arg => undef, lazy => 1, builder => '_build_distmeta', ); sub _build_distmeta { my ($self) = @_; my $meta = { 'meta-spec' => { version => 2, url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', }, name => $self->name, version => $self->version, abstract => $self->abstract, author => $self->authors, license => [ $self->license->meta2_name ], # XXX: what about unstable? release_status => ($self->is_trial or $self->version =~ /_/) ? 'testing' : 'stable', dynamic_config => 0, # problematic, I bet -- rjbs, 2010-06-04 generated_by => $self->_metadata_generator_id . ' version ' . (defined $self->VERSION ? $self->VERSION : '(undef)') }; require Hash::Merge::Simple; my $dynamic; for ($self->plugins_with(-MetaProvider)->flatten) { my $plugin_meta = $_->metadata; $meta = Hash::Merge::Simple::merge($meta, $plugin_meta); $dynamic = 1 if $plugin_meta->{dynamic_config}; } $meta->{dynamic_config} = 1 if $dynamic; return $meta; } sub _metadata_generator_id { 'Dist::Zilla' } has prereqs => ( is => 'ro', isa => 'Dist::Zilla::Prereqs', init_arg => undef, default => sub { Dist::Zilla::Prereqs->new }, handles => [ qw(register_prereqs) ], ); sub plugin_named { my ($self, $name) = @_; my $plugin = first { $_->plugin_name eq $name } $self->plugins->flatten; return $plugin if $plugin; return; } sub plugins_with { my ($self, $role) = @_; $role =~ s/^-/Dist::Zilla::Role::/; my $plugins = $self->plugins->grep(sub { $_->does($role) }); return $plugins; } sub find_files { my ($self, $finder_name) = @_; $self->log_fatal("no plugin named $finder_name found") unless my $plugin = $self->plugin_named($finder_name); $self->log_fatal("plugin $finder_name is not a FileFinder") unless $plugin->does('Dist::Zilla::Role::FileFinder'); $plugin->find_files; } sub _check_dupe_files { my ($self) = @_; my %files_named; for my $file ($self->files->flatten) { ($files_named{ $file->name} ||= [])->push($file); } return unless my @dupes = grep { $files_named{$_}->length > 1 } keys %files_named; for my $name (@dupes) { $self->log("attempt to add $name multiple times; added by: " . join('; ', map { $_->added_by } @{ $files_named{ $name } }) ); } Carp::croak("aborting; duplicate files would be produced"); } sub _write_out_file { my ($self, $file, $build_root) = @_; # Okay, this is a bit much, until we have ->debug. -- rjbs, 2008-06-13 # $self->log("writing out " . $file->name); my $file_path = file($file->name); my $to_dir = $build_root->subdir( $file_path->dir ); my $to = $to_dir->file( $file_path->basename ); $to_dir->mkpath unless -e $to_dir; die "not a directory: $to_dir" unless -d $to_dir; Carp::croak("attempted to write $to multiple times") if -e $to; path("$to")->spew_raw( $file->encoded_content ); chmod $file->mode, "$to" or die "couldn't chmod $to: $!"; } has logger => ( is => 'ro', isa => 'Log::Dispatchouli::Proxy', # could be duck typed, I guess lazy => 1, handles => [ qw(log log_debug log_fatal) ], default => sub { $_[0]->chrome->logger->proxy({ proxy_prefix => '[DZ] ' }) }, ); around dump_config => sub { my ($orig, $self) = @_; my $config = $self->$orig; $config->{is_trial} = $self->is_trial; return $config; }; has _local_stashes => ( is => 'ro', isa => HashRef[ Object ], lazy => 1, default => sub { {} }, ); has _global_stashes => ( is => 'ro', isa => HashRef[ Object ], lazy => 1, default => sub { {} }, ); sub stash_named { my ($self, $name) = @_; return $self->_local_stashes->{ $name } if $self->_local_stashes->{$name}; return $self->_global_stashes->{ $name }; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla - distribution builder; installer not included! =head1 VERSION version 5.008 =head1 DESCRIPTION Dist::Zilla builds distributions of code to be uploaded to the CPAN. In this respect, it is like L, L, or L. Unlike those tools, however, it is not also a system for installing code that has been downloaded from the CPAN. Since it's only run by authors, and is meant to be run on a repository checkout rather than on published, released code, it can do much more than those tools, and is free to make much more ludicrous demands in terms of prerequisites. If you have access to the web, you can learn more and find an interactive tutorial at B>. If not, try L. =head1 ATTRIBUTES =head2 name The name attribute (which is required) gives the name of the distribution to be built. This is usually the name of the distribution's main module, with the double colons (C<::>) replaced with dashes. For example: C. =head2 version This is the version of the distribution to be created. =head2 abstract This is a one-line summary of the distribution. If none is given, one will be looked for in the L of the dist. =head2 main_module This is the module where Dist::Zilla might look for various defaults, like the distribution abstract. By default, it's derived from the distribution name. If your distribution is Foo-Bar, and F exists, that's the main_module. Otherwise, it's the shortest-named module in the distribution. This may change! You can override the default by specifying the file path explicitly, ie: main_module = lib/Foo/Bar.pm =head2 license This is the L object for this dist's license and copyright. It will be created automatically, if possible, with the C and C attributes. If necessary, it will try to guess the license from the POD of the dist's main module. A better option is to set the C name in the dist's config to something understandable, like C. =head2 authors This is an arrayref of author strings, like this: [ 'Ricardo Signes ', 'X. Ample, Jr ', ] This is likely to change at some point in the near future. =head2 files This is an arrayref of objects implementing L that will, if left in this arrayref, be built into the dist. Non-core code should avoid altering this arrayref, but sometimes there is not other way to change the list of files. In the future, the representation used for storing files B. =head2 root This is the root directory of the dist, as a L. It will nearly always be the current working directory in which C was run. =head2 is_trial This attribute tells us whether or not the dist will be a trial release. =head2 plugins This is an arrayref of plugins that have been plugged into this Dist::Zilla object. Non-core code B alter this arrayref. Public access to this attribute B in the future. =head2 distmeta This is a hashref containing the metadata about this distribution that will be stored in META.yml or META.json. You should not alter the metadata in this hash; use a MetaProvider plugin instead. =head2 prereqs This is a L object, which is a thin layer atop L, and describes the distribution's prerequisites. =head2 logger This attribute stores a L object, used to log messages. By default, a proxy to the dist's L is taken. The following methods are delegated from the Dist::Zilla object to the logger: =over 4 =item * log =item * log_debug =item * log_fatal =back =head1 METHODS =head2 plugin_named my $plugin = $zilla->plugin_named( $plugin_name ); =head2 plugins_with my $roles = $zilla->plugins_with( -SomeRole ); This method returns an arrayref containing all the Dist::Zilla object's plugins that perform a the named role. If the given role name begins with a dash, the dash is replaced with "Dist::Zilla::Role::" =head2 find_files my $files = $zilla->find_files( $finder_name ); This method will look for a L-performing plugin with the given name and return the result of calling C on it. If no plugin can be found, an exception will be raised. =head2 stash_named my $stash = $zilla->stash_named( $name ); This method will return the stash with the given name, or undef if none exists. It looks for a local stash (for this dist) first, then falls back to a global stash (from the user's global configuration). =head1 SUPPORT There are usually people on C in C<#distzilla>, even if they're idling. The L has several valuable resources for learning to use Dist::Zilla. There is a mailing list to discuss Dist::Zilla. You can L or L. =head1 SEE ALSO =over 4 =item * In the Dist::Zilla distribution: =over 4 =item * Plugin bundles: L<@Basic|Dist::Zilla::PluginBundle::Basic>, L<@Filter|Dist::Zilla::PluginBundle::Filter>. =item * Major plugins: L, L, L, L, L, ... =back =item * On the CPAN: =over 4 =item * Search for plugins: L =item * Search for plugin bundles: L =back =back =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut plugins000755000766000024 012257437015 14602 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/tprunes.t100644000766000024 1046112257437015 16465 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; for my $skip_skip (0..3) { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ GatherDir => BonusFiles => { root => '../corpus/extra', prefix => 'bonus', } ], ($skip_skip > 1 ? 'ManifestSkip' : ()), ), 'source/MANIFEST.SKIP' => join('', map {; "$_\n" } ( 'dist.ini', '.*\.txt', ($skip_skip & 1 ? 'MANIFEST.SKIP' : ()), )), }, also_copy => { 'corpus/extra' => 'corpus/extra' }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( $tzil->files, [ qw(bonus/subdir/index.html lib/DZT/Sample.pm t/basic.t), ($skip_skip >= 2 ? () : ('dist.ini', 'bonus/vader.txt')), ($skip_skip == 3 ? () : 'MANIFEST.SKIP'), ], "ManifestSkip prunes files from MANIFEST.SKIP ($skip_skip)", ); } # Test ManifestSkip with InlineFiles-generated files RT#76036 for my $skip_skip (0..1) { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ GatherDir => BonusFiles => { root => '../corpus/extra', prefix => 'bonus', } ], 'JustForManifestSkipTests', ($skip_skip & 1 ? [ ManifestSkip => { skipfile => 'FOO.SKIP' } ] : ()), ), }, also_copy => { 'corpus/extra' => 'corpus/extra' }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( $tzil->files, [ qw(bonus/subdir/index.html lib/DZT/Sample.pm t/basic.t), ($skip_skip & 1 ? () : (qw(foo.txt dist.ini bonus/vader.txt FOO.SKIP))), ], "ManifestSkip prunes files from generated FOO.SKIP ($skip_skip)", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Build' => "This file is cruft.\n", 'source/dist.ini' => simple_ini('GatherDir'), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw(dist.ini lib/DZT/Sample.pm t/basic.t Build) ], "./Build is included by default...", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Build' => "This file is cruft.\n", 'source/dist.ini' => simple_ini('GatherDir', 'PruneCruft'), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw(dist.ini lib/DZT/Sample.pm t/basic.t) ], "...but /Build is pruned by PruneCruft", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Build' => "This file is cruft.\n", 'source/dist.ini' => simple_ini( 'GatherDir', [ 'PruneCruft' => { except => 'Build' } ], ), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw(dist.ini lib/DZT/Sample.pm t/basic.t Build) ], "...but /Build isn't pruned by PruneCruft if we exclude it", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/_Inline/foo.c' => "This file is cruft.\n", 'source/dist.ini' => simple_ini('GatherDir', 'PruneCruft'), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw(dist.ini lib/DZT/Sample.pm t/basic.t) ], "./_Inline/* is excluded by default...", ); } for my $arg (qw(filename filenames)) { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', [ PruneFiles => { $arg => 'dist.ini' } ], ), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw(lib/DZT/Sample.pm t/basic.t) ], "we can prune a specific file by request (arg $arg)", ); } done_testing; readme.t100644000766000024 170312257437015 16365 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; use lib 't/lib'; use autodie; use Test::DZil; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini('Readme'), }, }, ); $tzil->build; my $contents = $tzil->slurp_file('build/README'); like( $contents, qr{This software is copyright .c. [0-9]+ by E\. Xavier Ample}i, "copyright appears in README file", ); like( $contents, qr{same terms as (the )?perl.*itself}i, "'same terms as perl'-ish text appears in README", ); my $name = $tzil->name; like( $contents, qr{\Q$name\E}, "dist name appears in README", ); { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZ-NonAscii' }, ); $tzil->build; my $contents = $tzil->slurp_file('build/README'); like( $contents, qr{ภูมิพลอดุลยเดช}, "HRH unmangled in README", ); } done_testing; misc000755000766000024 012257437015 13611 5ustar00rjbsstaff000000000000Dist-Zilla-5.008dzil_bootstrap100644000766000024 212712257437015 16735 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/misc#!/usr/bin/perl use strict; use warnings; use CPAN; use CPAN::Version; sub _uptodate { my ($mod, $modname, $modver) = @_; return unless $mod and defined $mod->inst_version; return CPAN::Version->vge($mod->inst_version, $modver); } sub _install { for (@_) { my ($modname, $modver); if (ref $_ eq 'ARRAY') { ($modname, $modver) = @$_; } else { $modname = $_; $modver = 0; } print "Looking for $modname $modver\n"; my $mod = CPAN::Shell->expand(Module => $modname); next if _uptodate($mod, $modname, $modver); CPAN::Shell->install($modname); $mod = CPAN::Shell->expand(Module => $modname); die "$modname had failures, aborting" unless _uptodate($mod, $modname, $modver); } } unless (-e "dist.ini") { die "No 'dist.ini' file; is this really a Dist::Zilla distribution?\n" } unless (eval "require Config::INI::Reader; 1") { _install('Config::INI::Reader'); require Config::INI::Reader; } my $data = Config::INI::Reader->read_file('dist.ini'); _install( map { [ $_ => $data->{Prereq}->{$_} ] } keys %{ $data->{Prereq} } ); license.t100644000766000024 201412257437015 16546 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; use lib 't/lib'; use autodie; use Test::DZil; subtest "ASCII-only author" => sub { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini('License'), }, }, ); $tzil->build; my $contents = $tzil->slurp_file('build/LICENSE'); like( $contents, qr{This software is copyright .c. [0-9]+ by E\. Xavier Ample}i, "copyright appears in LICENSE file", ); like( $contents, qr{same terms as (the )?perl.*itself}i, "'same terms as perl'-ish text appears in LICENSE", ); }; subtest "non-ASCII author" => sub { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZ-NonAscii' }, ); $tzil->build; my $contents = $tzil->slurp_file('build/LICENSE'); like( $contents, qr{This software is copyright .c. [0-9]+ by ภูมิพลอดุลยเดช}, "copyright appears in LICENSE file", ); }; done_testing; pkgdist.t100644000766000024 573412257437015 16605 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use autodie; use Test::DZil; my $with_version = ' package DZT::WVer; our $DIST = \'DZT-Blort\'; 1; '; my $two_packages = ' package DZT::TP1; package DZT::TP2; 1; '; my $repeated_packages = ' package DZT::R1; package DZT::R2; package DZT::R1; 1; '; my $monkey_patched = ' package DZT::TP1; package DZT::TP2; 1; '; my $script = ' #!/usr/bin/perl print "hello world\n"; '; my $script_pkg = ' #!/usr/bin/perl package DZT::Script; '; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/lib/DZT/TP1.pm' => $two_packages, 'source/lib/DZT/WVer.pm' => $with_version, 'source/lib/DZT/R1.pm' => $repeated_packages, 'source/lib/DZT/Monkey.pm' => $monkey_patched, 'source/bin/script_pkg.pl' => $script_pkg, 'source/bin/script_ver.pl' => $script_pkg . "our \$DIST = 'DZT-Blort';\n", 'source/bin/script.pl' => $script, 'source/dist.ini' => simple_ini('GatherDir', 'PkgDist', 'ExecDir'), }, }, ); $tzil->build; my $dzt_sample = $tzil->slurp_file('build/lib/DZT/Sample.pm'); like( $dzt_sample, qr{^\s*\$\QDZT::Sample::DIST = 'DZT-Sample';\E\s*$}m, "added version to DZT::Sample", ); my $dzt_tp1 = $tzil->slurp_file('build/lib/DZT/TP1.pm'); like( $dzt_tp1, qr{^\s*\$\QDZT::TP1::DIST = 'DZT-Sample';\E\s*$}m, "added version to DZT::TP1", ); like( $dzt_tp1, qr{^\s*\$\QDZT::TP2::DIST = 'DZT-Sample';\E\s*$}m, "added version to DZT::TP2", ); my $dzt_wver = $tzil->slurp_file('build/lib/DZT/WVer.pm'); unlike( $dzt_wver, qr{^\s*\$\QDZT::WVer::DIST = 'DZT-Sample';\E\s*$}m, "*not* added to DZT::WVer; we have one already", ); my $dzt_script_pkg = $tzil->slurp_file('build/bin/script_pkg.pl'); like( $dzt_script_pkg, qr{^\s*\$\QDZT::Script::DIST = 'DZT-Sample';\E\s*$}m, "added version to DZT::Script", ); TODO: { local $TODO = 'only scanning for packages right now'; my $dzt_script = $tzil->slurp_file('build/bin/script.pl'); like( $dzt_script, qr{^\s*\$\QDZT::Script::DIST = 'DZT-Sample';\E\s*$}m, "added version to plain script", ); }; my $script_wver = $tzil->slurp_file('build/bin/script_ver.pl'); unlike( $script_wver, qr{^\s*\$\QDZT::WVer::DIST = 'DZT-Sample';\E\s*$}m, "*not* added to versioned DZT::Script; we have one already", ); ok( grep({ m(skipping lib/DZT/WVer\.pm: assigns to \$DIST) } @{ $tzil->log_messages }), "we report the reason for no updateing WVer", ); my $dzt_r1 = $tzil->slurp_file('build/lib/DZT/R1.pm'); my @matches = grep { /R1::DIST/ } split /\n/, $dzt_r1; is(@matches, 1, "we add at most 1 DIST per package"); my $dzt_monkey = $tzil->slurp_file('build/lib/DZT/Monkey.pm'); unlike( $dzt_monkey, qr{\$DZT::TP2::DIST}, "no version for DZT::TP2 when it looks like a monkey patch" ); ok( grep({ m(skipping .+ DZT::TP2) } @{ $tzil->log_messages }), "we report the reason for not updating Monkey", ); done_testing; prereqs.t100644000766000024 1306112257437015 16631 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Fatal qw(exception); use lib 't/lib'; use JSON 2; use Test::DZil; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ MetaJSON => ], [ Prereqs => => { A => 1 } ], [ Prereqs => RuntimeRequires => { A => 2, B => 3 } ], [ Prereqs => DevelopSuggests => { C => 4 } ], [ Prereqs => TestConflicts => { C => 5, D => 6 } ], [ Prereqs => Recommends => { E => 7 } ], ), }, }, ); $tzil->build; my $json = $tzil->slurp_file('build/META.json'); my $meta = JSON->new->decode($json); is_deeply( $meta->{prereqs}, { develop => { suggests => { C => 4 } }, runtime => { requires => { A => 2, B => 3 }, recommends => { E => 7 }, }, test => { conflicts => { C => 5, D => 6 } }, }, "prereqs merged", ); } # test that we avoid a CPAN.pm bug by synchronizing Runtime|Build|Test requires { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ MetaJSON => ], [ Prereqs => RuntimeRequires => { A => 2, B => 0, C => 2 } ], [ RemovePrereqs => { remove => [ qw(C) ] } ], [ Prereqs => TestRequires => { A => 1, B => 1, C => 1 } ], [ Prereqs => BuildRequires => { A => 0, B => 2, C => 0 } ], ), }, }, ); $tzil->build; my $json = $tzil->slurp_file('build/META.json'); my $meta = JSON->new->decode($json); is_deeply( $meta->{prereqs}, { runtime => { requires => { A => 2, B => 2 }, }, test => { requires => { A => 2, B => 2, C => 1 }, }, build => { requires => { A => 2, B => 2, C => 1 }, }, }, "prereqs synchronized across runtime, build & test phases", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ MetaJSON => ], [ Prereqs => => { A => 1 } ], [ Prereqs => RuntimeRequires => { A => 2, B => 3 } ], [ Prereqs => DevelopSuggests => { C => 4 } ], [ Prereqs => TestConflicts => { C => 5, D => 6 } ], [ RemovePrereqs => { remove => [ qw(B C) ] } ], ), }, }, ); $tzil->build; my $json = $tzil->slurp_file('build/META.json'); my $meta = JSON->new->decode($json); is_deeply( $meta->{prereqs}, { runtime => { requires => { A => 2 } }, test => { conflicts => { D => 6 } }, }, "prereqs merged and pruned", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ MetaJSON => ], [ Prereqs => { A => 1 } ], [ Prereqs => P1 => { qw(-phase runtime -type requires), A => 2, B => 3 } ], [ Prereqs => P2 => { qw(-phase develop -type suggests), C => 4 } ], [ Prereqs => P3 => { qw(-phase test -relationship conflicts), C => 5, D => 6 } ], [ Prereqs => P4 => { qw(-type recommends), E => 7 } ], ), }, }, ); $tzil->build; my $json = $tzil->slurp_file('build/META.json'); my $meta = JSON->new->decode($json); is_deeply( $meta->{prereqs}, { develop => { suggests => { C => 4 } }, runtime => { requires => { A => 2, B => 3 }, recommends => { E => 7 }, }, test => { conflicts => { C => 5, D => 6 } }, }, "-phase, -type, & -relationship", ); } { like( exception { Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ Prereqs => { A => 1 } ], [ Prereqs => NotMagic => { B => 3 } ], ), }, }, ); }, qr/No -phase or -relationship specified/, "non-magic name dies"); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ Prereqs => 'Bundle/Prereqs' => { A => 1 } ], [ Prereqs => 'Other/Prereq' => { B => 1 } ], [ Prereqs => P1 => { qw(-phase runtime), C => 2 } ], [ Prereqs => P2 => { qw(-relationship requires), D => 2 } ], [ Prereqs => P3 => { qw(-phase configure), E => 2 } ], [ Prereqs => P4 => { qw(-phase build -type suggests), F => 2 } ], # Mixing a magic name with -phase or -type is *NOT RECOMMENDED* # but it does work (at least for now) [ Prereqs => Recommends => { qw(-phase test), G => 2 } ], ), }, }, ); my @expected = qw( Bundle/Prereqs runtime requires Other/Prereq runtime requires P1 runtime requires P2 runtime requires P3 configure requires P4 build suggests Recommends test recommends ); while (@expected) { my $name = shift @expected; my $p = $tzil->plugin_named($name); is($p->prereq_phase, shift @expected, "$name phase"); is($p->prereq_type, shift @expected, "$name relationship"); } } done_testing; autoname.t100644000766000024 70212257437015 16717 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; use YAML::Tiny; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( { name => undef }, 'GatherDir', 'TestAutoName', ), }, }, ); $tzil->build; is($tzil->name, 'FooBar', "dist name is set (in DZ obj)"); } done_testing; distmeta.t100644000766000024 1103112257437015 16755 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; use lib 't/lib'; use Test::DZil; use JSON 2; use YAML::Tiny; { # 2.0 my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', [ MetaResources => HomePage => {homepage => 'http://bana.na/phone'}], [ MetaResources => License => {license => 'http://b.sd/license' }], [ Prereqs => { 'Foo::Bar' => '1.234' } ], [ Prereqs => RuntimeRecommends => { 'Foo::Bar::Opt' => '1.234' } ], [ Prereqs => BuildRequires => { 'Test::Foo' => '2.34' } ], [ Prereqs => ConfigureRequires => { 'Build::Foo' => '0.12' } ], 'MetaJSON', [ MetaYAML => { version => 2 } ], 'MetaConfig', ), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; my %meta; my $json = $tzil->slurp_file('build/META.json'); $meta{json} = JSON->new->decode($json); my $yaml = $tzil->slurp_file('build/META.yml'); $meta{yaml} = YAML::Tiny->new->read_string($yaml)->[0]; is_deeply($meta{json}, $meta{yaml}, "META.json is_deeply META.yml"); for my $type (qw(json yaml)) { my $meta = $meta{$type}; my %want = ( name => 'DZT-Sample', abstract => 'Sample DZ Dist', author => [ 'E. Xavier Ample ' ], prereqs => { runtime => { requires => { 'Foo::Bar' => '1.234' }, recommends => { 'Foo::Bar::Opt' => '1.234' }, }, build => { requires => { 'Test::Foo' => '2.34' } }, configure => { requires => { 'Build::Foo' => '0.12' } }, }, license => [ 'perl_5' ], resources => { homepage => 'http://bana.na/phone', license => [ 'http://b.sd/license' ], }, version => '0.001', ); for my $key (sort keys %want) { is_deeply( $meta->{ $key }, $want{ $key }, "$key is what we want in 2.0 $type", ); } } } { # 1.4 my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', [ MetaResources => HomePage => {homepage => 'http://bana.na/phone'}], [ MetaResources => License => {license => 'http://b.sd/license' }], [ Prereqs => { 'Foo::Bar' => '1.234' } ], [ Prereqs => RuntimeRecommends => { 'Foo::Bar::Opt' => '1.234' } ], [ Prereqs => BuildRequires => { 'Test::Foo' => '2.34' } ], [ Prereqs => ConfigureRequires => { 'Build::Foo' => '0.12' } ], [ MetaJSON => { version => 1.4 } ], 'MetaYAML', 'MetaConfig', ), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; my %meta; my $json = $tzil->slurp_file('build/META.json'); $meta{json} = JSON->new->decode($json); my $yaml = $tzil->slurp_file('build/META.yml'); $meta{yaml} = YAML::Tiny->new->read_string($yaml)->[0]; is_deeply($meta{json}, $meta{yaml}, "META.json is_deeply META.yml"); for my $type (qw(json yaml)) { my $meta = $meta{$type}; my %want = ( name => 'DZT-Sample', abstract => 'Sample DZ Dist', author => [ 'E. Xavier Ample ' ], configure_requires => { 'Build::Foo' => '0.12' }, build_requires => { 'Test::Foo' => '2.34' }, requires => { 'Foo::Bar' => '1.234' }, recommends => { 'Foo::Bar::Opt' => '1.234' }, license => 'perl', resources => { homepage => 'http://bana.na/phone', license => 'http://b.sd/license', }, version => '0.001', ); for my $key (sort keys %want) { is_deeply( $meta->{ $key }, $want{ $key }, "$key is what we want in 1.4 $type", ); } } } { # non-ASCII my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZ-NonAscii' }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; my %meta; my $json = $tzil->slurp_file('build/META.json'); $meta{json} = JSON->new->decode($json); my $yaml = $tzil->slurp_file('build/META.yml'); $meta{yaml} = YAML::Tiny->new->read_string($yaml)->[0]; for my $type (qw(json yaml)) { is_deeply( $meta{$type}{author}, [ 'Olivier Mengué ', '김도형 ' ], "authors ($type) are set as expected, decode properly", ); } } done_testing; ffbyname.t100644000766000024 1302112257437015 16733 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/plugins#!perl # Test the FileFinder::ByName and FileFinder::Filter plugins use strict; use warnings; use Test::More 0.88; # done_testing use Test::DZil qw(Builder simple_ini is_filelist); use Dist::Zilla::File::InMemory; my $tzil; my @dist_files = map { Dist::Zilla::File::InMemory->new( name => $_, content => '') } qw( Changes LICENSE MANIFEST META.json META.yml Makefile.PL README Template_strict.patch bin/foo.pl bin/.hidden/foo.pl corpus/DZT/README corpus/DZT/lib/DZT/Sample.pm corpus/DZT/t/basic.t corpus/README corpus/archives/DZT-Sample-0.01.tar.gz corpus/archives/DZT-Sample-0.02.tar.gz corpus/archives/DZT-Sample-0.03.tar.gz corpus/gitvercheck.git lib/Dist/Zilla/Plugin/ArchiveRelease.pm lib/Dist/Zilla/Plugin/FindFiles.pm lib/Dist/Zilla/Plugin/GitVersionCheckCJM.pm lib/Dist/Zilla/Plugin/Metadata.pm lib/Dist/Zilla/Plugin/ModuleBuild/Custom.pm lib/Dist/Zilla/Plugin/TemplateCJM.pm lib/Dist/Zilla/Plugin/VersionFromModule.pm lib/Dist/Zilla/Role/ModuleInfo.pm t/00-compile.t t/arcrel.t t/gitvercheck.t t/mb_custom.t t/metadata.t t/release-pod-coverage.t t/release-pod-syntax.t t/template.t t/vermod.t ); #--------------------------------------------------------------------- sub is_found { my ($plugin, $want, $comment) = @_; my $have = $tzil->plugin_named($plugin)->find_files; #printf " %s\n", $_->name for @$have; local $Test::Builder::Level = $Test::Builder::Level + 1; is_filelist($have, $want, $comment || $plugin); } #--------------------------------------------------------------------- sub make_tzil { $tzil = Builder->from_config( { dist_root => 'corpus/DZT' }, { add_files => { 'source/dist.ini' => simple_ini(@_), }, }, ); # Don't bother building anything, we just need a list of filenames: @{ $tzil->files } = @dist_files; } #--------------------------------------------------------------------- make_tzil([ 'FileFinder::ByName' => {qw(dir corpus skip archives)}], [ 'FileFinder::Filter' => {qw(finder FileFinder::ByName skip DZT)}]); is_found('FileFinder::ByName' => [qw( corpus/DZT/README corpus/DZT/lib/DZT/Sample.pm corpus/DZT/t/basic.t corpus/README corpus/gitvercheck.git )], 'dir corpus skip archives'); is_found('FileFinder::Filter' => [qw( corpus/README corpus/gitvercheck.git )], 'filter DZT'); #--------------------------------------------------------------------- make_tzil( [ 'FileFinder::ByName' => InBin => {qw(dir bin)}], [ 'FileFinder::ByName' => AllPerl => { file => [qw( *.pl *.pm)] }], [ 'FileFinder::ByName' => Plugins => {qw( dir lib match \.pm$ skip /Role/)}], [ 'FileFinder::ByName' => Synopsis => { file => '*.pl', dir => [qw(bin lib)], match => '\.pm$', skip => '(?i)version' }], [ 'FileFinder::Filter' => Everything => { finder => [qw(InBin AllPerl Plugins Synopsis)] }], [ 'FileFinder::Filter' => NoPluginM => { finder => 'AllPerl', skip => 'Plugin/M' }], ); is_found(InBin => [qw( bin/foo.pl bin/.hidden/foo.pl )]); is_found(AllPerl => [qw( bin/foo.pl bin/.hidden/foo.pl corpus/DZT/lib/DZT/Sample.pm lib/Dist/Zilla/Plugin/ArchiveRelease.pm lib/Dist/Zilla/Plugin/FindFiles.pm lib/Dist/Zilla/Plugin/GitVersionCheckCJM.pm lib/Dist/Zilla/Plugin/Metadata.pm lib/Dist/Zilla/Plugin/ModuleBuild/Custom.pm lib/Dist/Zilla/Plugin/TemplateCJM.pm lib/Dist/Zilla/Plugin/VersionFromModule.pm lib/Dist/Zilla/Role/ModuleInfo.pm )]); is_found(Plugins => [qw( lib/Dist/Zilla/Plugin/ArchiveRelease.pm lib/Dist/Zilla/Plugin/FindFiles.pm lib/Dist/Zilla/Plugin/GitVersionCheckCJM.pm lib/Dist/Zilla/Plugin/Metadata.pm lib/Dist/Zilla/Plugin/ModuleBuild/Custom.pm lib/Dist/Zilla/Plugin/TemplateCJM.pm lib/Dist/Zilla/Plugin/VersionFromModule.pm )]); is_found(Synopsis => [qw( bin/foo.pl bin/.hidden/foo.pl lib/Dist/Zilla/Plugin/ArchiveRelease.pm lib/Dist/Zilla/Plugin/FindFiles.pm lib/Dist/Zilla/Plugin/Metadata.pm lib/Dist/Zilla/Plugin/ModuleBuild/Custom.pm lib/Dist/Zilla/Plugin/TemplateCJM.pm lib/Dist/Zilla/Role/ModuleInfo.pm )]); is_found(Everything => [qw( bin/foo.pl bin/.hidden/foo.pl corpus/DZT/lib/DZT/Sample.pm lib/Dist/Zilla/Plugin/ArchiveRelease.pm lib/Dist/Zilla/Plugin/FindFiles.pm lib/Dist/Zilla/Plugin/GitVersionCheckCJM.pm lib/Dist/Zilla/Plugin/Metadata.pm lib/Dist/Zilla/Plugin/ModuleBuild/Custom.pm lib/Dist/Zilla/Plugin/TemplateCJM.pm lib/Dist/Zilla/Plugin/VersionFromModule.pm lib/Dist/Zilla/Role/ModuleInfo.pm )]); is_found(NoPluginM => [qw( bin/foo.pl bin/.hidden/foo.pl corpus/DZT/lib/DZT/Sample.pm lib/Dist/Zilla/Plugin/ArchiveRelease.pm lib/Dist/Zilla/Plugin/FindFiles.pm lib/Dist/Zilla/Plugin/GitVersionCheckCJM.pm lib/Dist/Zilla/Plugin/TemplateCJM.pm lib/Dist/Zilla/Plugin/VersionFromModule.pm lib/Dist/Zilla/Role/ModuleInfo.pm )]); #--------------------------------------------------------------------- make_tzil([ 'FileFinder::ByName' => 'Everything' ], [ 'FileFinder::ByName' => 'EverythingButPerl' => {skip => [qw( \.t$ (?i)\.p[lm]$ )]} ]); is_found(Everything => [ map { $_->name } @dist_files ]); is_found(EverythingButPerl => [qw( Changes LICENSE MANIFEST META.json META.yml README Template_strict.patch corpus/DZT/README corpus/README corpus/archives/DZT-Sample-0.01.tar.gz corpus/archives/DZT-Sample-0.02.tar.gz corpus/archives/DZT-Sample-0.03.tar.gz corpus/gitvercheck.git )]); done_testing; filter-b.t100644000766000024 167212257437015 16641 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use Dist::Zilla::PluginBundle::Classic; use Dist::Zilla::PluginBundle::Filter; my @classic = Dist::Zilla::PluginBundle::Classic->bundle_config({ name => '@Classic', package => 'Dist::Zilla::PluginBundle::Classic', payload => { }, }); my @filtered = Dist::Zilla::PluginBundle::Filter->bundle_config({ name => '@CF', package => 'Dist::Zilla::PluginBundle::Filter', payload => { bundle => '@Classic', remove => [ qw(ManifestSkip PkgVersion) ], }, }); is(@filtered, @classic - 2, "filtering 2 plugins gets us 2 fewer plugins!"); my $before_count = grep { $_->[1] =~ /\ADist::Zilla::Plugin::(?:ManifestSkip|PkgVersion)\z/ } @classic; is($before_count, 2, "we started with the 2 we wanted to remove"); my $after_count = grep { $_->[1] =~ /\ADist::Zilla::Plugin::(?:ManifestSkip|PkgVersion)\z/ } @filtered; is($after_count, 0, "...then we removed them"); done_testing; manifest.t100644000766000024 260112257437015 16734 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use ExtUtils::Manifest; use lib 't/lib'; use Test::DZil; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { q{source/file with spaces.txt} => "foo\n", # q{source/file\\with some\\whacks.txt} => "bar\n", # q{source/'file-with-ticks.txt'} => "baz\n", # q{source/file'with'quotes\\or\\backslash.txt} => "quux\n", 'source/dist.ini' => simple_ini( 'GatherDir', 'Manifest', ), }, }, ); $tzil->build; my $manihash = ExtUtils::Manifest::maniread($tzil->built_in->file('MANIFEST')); is_deeply( [ sort keys %$manihash ], [ sort( 'MANIFEST', q{file with spaces.txt}, # q{file\\with some\\whacks.txt}, # q{file'with'quotes\\or\\backslash.txt}, # q{'file-with-ticks.txt'}, 'dist.ini', 'lib/DZT/Sample.pm', 't/basic.t', ) ], 'manifest quotes files with spaces' ); my @manilines = grep { ! /^#/ } split /\n/, $tzil->slurp_file('build/MANIFEST'); chomp @manilines; is_deeply( [ sort @manilines ], [ sort( 'MANIFEST', q{'file with spaces.txt'}, # q{'file\\\\with some\\\\whacks.txt'}, # q{'\\'file-with-ticks.txt\\''}, # q{'file\\'with\\'quotes\\\\or\\\\backslash.txt'}, 'dist.ini', 'lib/DZT/Sample.pm', 't/basic.t', ) ], 'manifest quotes files with spaces' ); done_testing; Zilla000755000766000024 012257437015 15402 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/DistApp.pm100644000766000024 1066412257437015 16647 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zillause strict; use warnings; package Dist::Zilla::App; { $Dist::Zilla::App::VERSION = '5.008'; } # ABSTRACT: Dist::Zilla's App::Cmd use App::Cmd::Setup 0.309 -app; # better compilation error detection use Carp (); use Dist::Zilla::MVP::Reader::Finder; use Dist::Zilla::Util; use Moose::Autobox; use Try::Tiny; sub global_opt_spec { return ( [ "verbose|v:s@", "log additional output" ], [ "lib-inc|I=s@", "additional \@INC dirs", { callbacks => { 'always fine' => sub { unshift @INC, @{$_[0]}; } } } ] ); } sub _build_global_stashes { my ($self) = @_; return $self->{__global_stashes__} if $self->{__global_stashes__}; # tests shouldn't depend on the user's configuration return {} if $ENV{DZIL_TESTING}; my $stash_registry = $self->{__global_stashes__} = {}; my $config_dir = Dist::Zilla::Util->_global_config_root; my $config_base = $config_dir->file('config'); require Dist::Zilla::MVP::Assembler::GlobalConfig; require Dist::Zilla::MVP::Section; my $assembler = Dist::Zilla::MVP::Assembler::GlobalConfig->new({ chrome => $self->chrome, stash_registry => $stash_registry, section_class => 'Dist::Zilla::MVP::Section', # make this DZMA default }); try { my $reader = Dist::Zilla::MVP::Reader::Finder->new({ if_none => sub { # warn <<'END_WARN'; # WARNING: No global configuration file was found in ~/.dzil -- this limits the # ability of Dist::Zilla to perform some tasks. You can run "dzil setup" to # create a simple first-pass configuration file, or you can touch the file # ~/.dzil/config.ini to suppress this message in the future. # END_WARN return $_[2]->{assembler}->sequence }, }); my $seq = $reader->read_config($config_base, { assembler => $assembler }); } catch { die <<'END_DIE'; Your global configuration file couldn't be loaded. It's a file matching ~/.dzil/config.* You can try deleting the file or you might need to upgrade from pre-version 4 format. In most cases, this will just mean replacing [!release] with [%PAUSE] and deleting any [!new] stanza. You can also delete the existing file and run "dzil setup" END_DIE }; return $stash_registry; } sub chrome { my ($self) = @_; require Dist::Zilla::Chrome::Term; return $self->{__chrome__} if $self->{__chrome__}; $self->{__chrome__} = Dist::Zilla::Chrome::Term->new; my @v_plugins = $self->global_options->verbose ? grep { length } @{ $self->global_options->verbose } : (); my $verbose = $self->global_options->verbose && ! @v_plugins; $self->{__chrome__}->logger->set_debug($verbose ? 1 : 0); return $self->{__chrome__}; } sub zilla { my ($self) = @_; require Dist::Zilla::Dist::Builder; return $self->{'' . __PACKAGE__}{zilla} ||= do { my @v_plugins = $self->global_options->verbose ? grep { length } @{ $self->global_options->verbose } : (); my $verbose = $self->global_options->verbose && ! @v_plugins; $self->chrome->logger->set_debug($verbose ? 1 : 0); my $core_debug = grep { m/\A[-_]\z/ } @v_plugins; my $zilla; try { $zilla = Dist::Zilla::Dist::Builder->from_config({ chrome => $self->chrome, _global_stashes => $self->_build_global_stashes, }); } catch { die $_ unless try { $_->isa('Config::MVP::Error') } && $_->ident =~ /no viable config/; $self->chrome->logger->log_fatal("no configuration (e.g, dist.ini) found"); }; $zilla->logger->set_debug($verbose ? 1 : 0); VERBOSE_PLUGIN: for my $plugin_name (grep { ! m{\A[-_]\z} } @v_plugins) { my @plugins = grep { $_->plugin_name =~ /\b\Q$plugin_name\E\b/ } $zilla->plugins->flatten; $zilla->log_fatal("can't find plugins matching $plugin_name to set debug") unless @plugins; $_->logger->set_debug(1) for @plugins; } $zilla; } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App - Dist::Zilla's App::Cmd =head1 VERSION version 5.008 =head1 METHODS =head2 zilla This returns the Dist::Zilla object in use by the command. If none has yet been constructed, one will be by calling C<< Dist::Zilla->from_config >>. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut gatherdir.t100644000766000024 346512257437015 17110 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use ExtUtils::Manifest 'maniread'; use Test::DZil; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ GatherDir => BonusFiles => { root => '../corpus/extra', prefix => 'bonus', } ], [ GatherDir => DottyFiles => { root => '../corpus/extra', prefix => 'dotty', include_dotfiles => 1, } ], [ GatherDir => Selective => { root => '../corpus/extra', prefix => 'some', exclude_filename => 'notme.txt', } ], [ GatherDir => SelectiveMatch => { root => '../corpus/extra', prefix => 'xmatch', exclude_match => 'notme\.*', } ], 'Manifest', ), 'source/.profile' => "Bogus dotfile.\n", 'corpus/extra/.dotfile' => "Bogus dotfile.\n", 'corpus/extra/notme.txt' => "A file to exclude.\n", }, also_copy => { 'corpus/extra' => 'corpus/extra' }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw( bonus/subdir/index.html bonus/vader.txt bonus/notme.txt dotty/subdir/index.html dotty/vader.txt dotty/.dotfile dotty/notme.txt some/subdir/index.html some/vader.txt xmatch/subdir/index.html xmatch/vader.txt dist.ini lib/DZT/Sample.pm t/basic.t MANIFEST ) ], "GatherDir gathers all files in the source dir", ); my $manifest = maniread($tzil->tempdir->file('build/MANIFEST')->stringify); my $count = grep { exists $manifest->{$_} } @files; ok($count == @files, "all files found were in manifest"); ok(keys(%$manifest) == @files, "all files in manifest were on disk"); done_testing; makemaker.t100644000766000024 334512257437015 17071 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', 'MakeMaker', [ Prereqs => { 'Foo::Bar' => '1.20', perl => '5.008' } ], [ Prereqs => BuildRequires => { 'Builder::Bob' => '9.901' } ], [ Prereqs => TestRequires => { 'Test::Deet' => '7', perl => '5.008' } ], ), }, }, ); $tzil->build; my $makemaker = $tzil->plugin_named('MakeMaker'); my %want = ( DISTNAME => 'DZT-Sample', NAME => 'DZT::Sample', ABSTRACT => 'Sample DZ Dist', VERSION => '0.001', AUTHOR => 'E. Xavier Ample ', LICENSE => 'perl', PREREQ_PM => { 'Foo::Bar' => '1.20' }, BUILD_REQUIRES => { 'Builder::Bob' => '9.901', }, TEST_REQUIRES => { 'Test::Deet' => '7', }, CONFIGURE_REQUIRES => { 'ExtUtils::MakeMaker' => '6.30' }, ); for my $key (sort keys %want) { is_deeply( $makemaker->__write_makefile_args->{ $key }, $want{ $key }, "correct value set for $key", ); } } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', 'MakeMaker', [ Prereqs => { perl => '5.8.1' } ], ), }, }, ); $tzil->build; my $content = $tzil->slurp_file('build/Makefile.PL'); like($content, qr/^use 5\.008001;\s*$/m, "normalized the perl version needed"); } done_testing; misctests.t100644000766000024 231712257437015 17150 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use autodie; use JSON 2; use Test::DZil; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( qw(GatherDir MetaTests PodSyntaxTests PodCoverageTests MetaJSON) ), }, }, ); $tzil->build; my $meta_test = $tzil->slurp_file('build/xt/release/distmeta.t'); like($meta_test, qr{meta_yaml_ok}, "we have a distmeta file that tests it"); my $pod_test = $tzil->slurp_file('build/xt/release/pod-syntax.t'); like($pod_test, qr{all_pod_files_ok}, "we have a pod-syntax test"); my $pod_c_test = $tzil->slurp_file('build/xt/release/pod-coverage.t'); like($pod_c_test, qr{all_pod_coverage_ok}, "we have a pod-coverage test"); my $json = $tzil->slurp_file('build/META.json'); my $meta = JSON->new->decode($json); is_deeply( $meta->{prereqs}, { develop => { requires => { # PodSyntaxTests 'Test::Pod' => '1.41', # PodCoverageTests 'Test::Pod::Coverage' => '1.08', 'Pod::Coverage::TrustPod' => 0, # MetaTests 'Test::CPAN::Meta' => 0, }, }, }, 'develop prereqs' ); done_testing; extra000755000766000024 012257437015 15314 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpusvader.txt100644000766000024 2512257437015 17253 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/extra (breathing sounds) Util.pm100644000766000024 652712257437015 17027 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zillause strict; use warnings; package Dist::Zilla::Util; { $Dist::Zilla::Util::VERSION = '5.008'; } # ABSTRACT: random snippets of code that Dist::Zilla wants use Carp (); use String::RewritePrefix 0.002; # better string context behavior { package Dist::Zilla::Util::PEA; @Dist::Zilla::Util::PEA::ISA = ('Pod::Eventual'); sub _new { # Load Pod::Eventual only when used (and not yet loaded) unless (exists $INC{'Pod/Eventual.pm'}) { require Pod::Eventual; Pod::Eventual->VERSION(0.091480); # better nonpod/blank events } bless {} => shift; } sub handle_nonpod { my ($self, $event) = @_; return if $self->{abstract}; return $self->{abstract} = $1 if $event->{content}=~ /^\s*#+\s*ABSTRACT:\s*(.+)$/m; return; } sub handle_event { my ($self, $event) = @_; return if $self->{abstract}; if ( ! $self->{in_name} and $event->{type} eq 'command' and $event->{command} eq 'head1' and $event->{content} =~ /^NAME\b/ ) { $self->{in_name} = 1; return; } return unless $self->{in_name}; if ( $event->{type} eq 'text' and $event->{content} =~ /^(?:\S+\s+)+?-+\s+(.+)\n$/s ) { $self->{abstract} = $1; } } } sub abstract_from_file { my ($self, $file) = @_; my $e = Dist::Zilla::Util::PEA->_new; $e->read_string($file->content); return $e->{abstract}; } sub expand_config_package_name { my ($self, $package) = @_; my $str = String::RewritePrefix->rewrite( { '=' => '', '@' => 'Dist::Zilla::PluginBundle::', '%' => 'Dist::Zilla::Stash::', '' => 'Dist::Zilla::Plugin::', }, $package, ); return $str; } sub _global_config_root { require Path::Class; return Path::Class::dir($ENV{DZIL_GLOBAL_CONFIG_ROOT}) if $ENV{DZIL_GLOBAL_CONFIG_ROOT}; require File::HomeDir; my $homedir = File::HomeDir->my_home or Carp::croak("couldn't determine home directory"); return Path::Class::dir($homedir)->subdir('.dzil'); } sub _assert_loaded_class_version_ok { my ($self, $pkg, $version) = @_; require CPAN::Meta::Requirements; my $req = CPAN::Meta::Requirements->from_string_hash({ $pkg => $version, }); my $have_version = $pkg->VERSION; unless ($req->accepts_module($pkg => $have_version)) { die( sprintf "%s version (%s) not match required version: %s\n", $pkg, $have_version, $version, ); } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Util - random snippets of code that Dist::Zilla wants =head1 VERSION version 5.008 =head1 METHODS =head2 abstract_from_file This method, I, tries to guess the abstract of a given file, assuming that it's Perl code. It looks for a POD C<=head1> section called "NAME" or a comment beginning with C. =head2 expand_config_package_name my $pkg_name = Util->expand_config_package_name($string); This method, I, rewrites the given string into a package name. Consult L for more information. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut extratests.t100644000766000024 331012257437015 17332 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use autodie; use Test::DZil; use Test::Deep; my $generic_test = <<'END_TEST'; #!perl use strict; use warnings; use Test::More 0.88; use Foo::%s 392; ok(0, "stop building me!"); done_testing; END_TEST my @xt_types = qw(smoke author release); my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini(qw), (map {; "source/xt/$_/huffer.t" => sprintf($generic_test, $_) } @xt_types, qw(blort)) }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_deeply( [ sort @files ], [ sort qw( META.json dist.ini lib/DZT/Sample.pm t/basic.t t/smoke-huffer.t t/author-huffer.t t/release-huffer.t xt/blort/huffer.t ) ], "filenames rewritten by ExtraTests", ); for my $type (@xt_types) { my $test_program = $tzil->slurp_file("build/t/$type-huffer.t"); my $env = uc sprintf "%s_TESTING", $type eq 'smoke' ? 'automated' : $type; like( $test_program, qr/\$ENV\{$env\}/, "we mention $env in the rewritten $type test", ); } my $meta = $tzil->slurp_file('build/META.json'); is_json( $meta, superhashof({ prereqs => { runtime => { requires => { strict => 0, warnings => 0, }, }, test => { requires => { 'Test::More' => '0.88', 'Foo::smoke' => '392', # Foo::author and Foo::release are # not here because they are not required by the end user # (See RT#76305) }, }, }, }), 'dependencies ok', ) or diag $meta; done_testing; pkgversion.t100644000766000024 1077112257437015 17344 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use autodie; use Test::DZil; my $with_version = ' package DZT::WVer; our $VERSION = 1.234; 1; '; my $with_version_two_lines = ' package DZT::WVerTwoLines; our $VERSION; $VERSION = 1.234; 1; '; my $in_a_string_escaped = ' package DZT::WStrEscaped; print "\$VERSION = 1.234;" 1; '; my $two_packages = ' package DZT::TP1; package DZT::TP2; 1; '; my $repeated_packages = ' package DZT::R1; package DZT::R2; package DZT::R1; 1; '; my $monkey_patched = ' package DZT::TP1; package DZT::TP2; 1; '; my $hide_me_comment = ' package DZT::HMC; package # hide me from toolchain DZT::TP2; 1; '; my $script = ' #!/usr/bin/perl print "hello world\n"; '; my $script_pkg = ' #!/usr/bin/perl package DZT::Script; '; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/lib/DZT/TP1.pm' => $two_packages, 'source/lib/DZT/WVer.pm' => $with_version, 'source/lib/DZT/WVerTwoLines.pm' => $with_version_two_lines, 'source/lib/DZT/WStrEscaped.pm' => $in_a_string_escaped, 'source/lib/DZT/R1.pm' => $repeated_packages, 'source/lib/DZT/Monkey.pm' => $monkey_patched, 'source/lib/DZT/HideMe.pm' => $hide_me_comment, 'source/bin/script_pkg.pl' => $script_pkg, 'source/bin/script_ver.pl' => $script_pkg . "our \$VERSION = 1.234;\n", 'source/bin/script.pl' => $script, 'source/dist.ini' => simple_ini('GatherDir', 'PkgVersion', 'ExecDir'), }, }, ); $tzil->build; my $dzt_sample = $tzil->slurp_file('build/lib/DZT/Sample.pm'); like( $dzt_sample, qr{^\s*\$\QDZT::Sample::VERSION = '0.001';\E\s*$}m, "added version to DZT::Sample", ); my $dzt_tp1 = $tzil->slurp_file('build/lib/DZT/TP1.pm'); like( $dzt_tp1, qr{^\s*\$\QDZT::TP1::VERSION = '0.001';\E\s*$}m, "added version to DZT::TP1", ); like( $dzt_tp1, qr{^\s*\$\QDZT::TP2::VERSION = '0.001';\E\s*$}m, "added version to DZT::TP2", ); my $dzt_wver = $tzil->slurp_file('build/lib/DZT/WVer.pm'); unlike( $dzt_wver, qr{^\s*\$\QDZT::WVer::VERSION = '0.001';\E\s*$}m, "*not* added to DZT::WVer; we have one already", ); my $dzt_wver_two_lines = $tzil->slurp_file('build/lib/DZT/WVerTwoLines.pm'); unlike( $dzt_wver_two_lines, qr{^\s*\$\QDZT::WVerTwoLines::VERSION = '0.001';\E\s*$}m, "*not* added to DZT::WVerTwoLines; we have one already", ); my $dzt_wver_str_escaped = $tzil->slurp_file('build/lib/DZT/WStrEscaped.pm'); like( $dzt_wver_str_escaped, qr{^\s*\$\QDZT::WStrEscaped::VERSION = '0.001';\E\s*$}m, "added to DZT::WStrEscaped; the one we have is escaped", ); my $dzt_script_pkg = $tzil->slurp_file('build/bin/script_pkg.pl'); like( $dzt_script_pkg, qr{^\s*\$\QDZT::Script::VERSION = '0.001';\E\s*$}m, "added version to DZT::Script", ); TODO: { local $TODO = 'only scanning for packages right now'; my $dzt_script = $tzil->slurp_file('build/bin/script.pl'); like( $dzt_script, qr{^\s*\$\QDZT::Script::VERSION = '0.001';\E\s*$}m, "added version to plain script", ); }; my $script_wver = $tzil->slurp_file('build/bin/script_ver.pl'); unlike( $script_wver, qr{^\s*\$\QDZT::WVer::VERSION = '0.001';\E\s*$}m, "*not* added to versioned DZT::Script; we have one already", ); ok( grep({ m(skipping lib/DZT/WVer\.pm: assigns to \$VERSION) } @{ $tzil->log_messages }), "we report the reason for no updateing WVer", ); my $dzt_r1 = $tzil->slurp_file('build/lib/DZT/R1.pm'); my @matches = grep { /R1::VER/ } split /\n/, $dzt_r1; is(@matches, 1, "we add at most 1 VERSION per package"); my $dzt_monkey = $tzil->slurp_file('build/lib/DZT/Monkey.pm'); unlike( $dzt_monkey, qr{\$DZT::TP2::VERSION}, "no version for DZT::TP2 when it looks like a monkey patch" ); ok( grep({ m(skipping .+ DZT::TP2) } @{ $tzil->log_messages }), "we report the reason for not updating Monkey", ); my $dzt_hideme = $tzil->slurp_file('build/lib/DZT/HideMe.pm'); unlike( $dzt_hideme, qr{\$DZT::TP2::VERSION}, "no version for DZT::TP2 when it was hidden with a comment" ); { local $ENV{TRIAL} = 1; my $tzil_trial = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini('GatherDir', 'PkgVersion', 'ExecDir'), }, }, ); $tzil_trial->build; my $dzt_sample_trial = $tzil_trial->slurp_file('build/lib/DZT/Sample.pm'); like( $dzt_sample_trial, qr{^\s*\$\QDZT::Sample::VERSION = '0.001'; # TRIAL\E\s*$}m, "added version with 'TRIAL' comment when \$ENV{TRIAL}=1", ); } done_testing; podversion.t100644000766000024 366712257437015 17333 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use autodie; use Test::DZil; my $with_place_for_pod = ' package DZT::WPFP; =head1 NAME DZT::WPFP - with place for pod! =cut sub foo { } 1; '; my $with_version = ' package DZT::WVer; =head1 NAME DZT::WVer - version in pod! =head1 VERSION version 1.234 =cut sub foo { } 1; '; my $with_multi_line_abstract = ' package DZT::MLA; =head1 NAME DZT::MLA - This abstract spans multiple lines. =cut sub foo { } 1; '; my $script = ' #!/usr/bin/perl =head1 NAME script.pl - a podded script! =cut print "hello world\n"; '; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/lib/DZT/WPFP.pm' => $with_place_for_pod, 'source/lib/DZT/WVer.pm' => $with_version, 'source/lib/DZT/MLA.pm' => $with_multi_line_abstract, 'source/bin/script.pl' => $script, 'source/dist.ini' => simple_ini('GatherDir', 'PodVersion', 'ExecDir'), }, }, ); $tzil->build; my $want = <<'END_POD'; =head1 VERSION version 0.001 =cut END_POD my $want_mla = <<'END_POD'; =head1 NAME DZT::MLA - This abstract spans multiple lines. =head1 VERSION version 0.001 =cut END_POD my $dzt_sample = $tzil->slurp_file('build/lib/DZT/Sample.pm'); ok( index($dzt_sample, $want) == -1, "we didn't add version pod to Sample; it has no NAME", ); my $dzt_wpfp = $tzil->slurp_file('build/lib/DZT/WPFP.pm'); ok( index($dzt_wpfp, $want) > 0, "we did add version pod to WPFP", ); my $dzt_wver = $tzil->slurp_file('build/lib/DZT/WVer.pm'); ok( index($dzt_wver, $want) == -1, "we didn't add version pod to WVer; it has one already", ); my $dzt_mla = $tzil->slurp_file('build/lib/DZT/MLA.pm'); ok( index($dzt_mla, $want_mla) > 0, "we properly skipped over multi-line abstract", ); my $dzt_script = $tzil->slurp_file('build/bin/script.pl'); ok( index($dzt_script, $want) > 0, "we did add version pod to script", ); done_testing; DZ2000755000766000024 012257437015 15533 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/distdist.pl100644000766000024 25012257437015 17150 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ2name => 'DZ2', version => '0.001', author => 'E. Xavier Ample ', license => 'Perl_5', copyright_holder => 'E. Xavier Ample', [ '@Classic', ] Types.pm100644000766000024 221312257437015 17202 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zillapackage Dist::Zilla::Types; { $Dist::Zilla::Types::VERSION = '5.008'; } # ABSTRACT: dzil-specific type library use namespace::autoclean; use MooseX::Types -declare => [qw(License OneZero YesNoStr)]; use MooseX::Types::Moose qw(Str Int); subtype License, as class_type('Software::License'); subtype OneZero, as Str, where { $_ eq '0' or $_ eq '1' }; subtype YesNoStr, as Str, where { /\A(?:y|ye|yes)\Z/i or /\A(?:n|no)\Z/i }; coerce OneZero, from YesNoStr, via { /\Ay/i ? 1 : 0 }; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Types - dzil-specific type library =head1 VERSION version 5.008 =head1 OVERVIEW This library provides L types for use by Dist::Zilla. These types are not (yet?) for public consumption, and you should not rely on them. Dist::Zilla uses a number of types found in L. Maybe that's what you want. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut commands000755000766000024 012257437015 14722 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/tauthordeps.t100644000766000024 74212257437015 17410 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/commandsuse strict; use warnings; use Test::More 0.88 tests => 1; use lib 't/lib'; use autodie; use Dist::Zilla::Util::AuthorDeps; use Path::Class; my $authordeps = Dist::Zilla::Util::AuthorDeps::extract_author_deps( dir('corpus/dist/AutoPrereqs'), 0 ); is_deeply( $authordeps, [ map { +{"Dist::Zilla::Plugin::$_" => 0} } qw ], "authordeps in corpus/dist/AutoPrereqs" ) or diag explain $authordeps; done_testing; autolicense.t100644000766000024 115412257437015 17443 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; use YAML::Tiny; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( { license => undef, copyright_year => 2012, }, 'GatherDir', 'TestAutoLicense', ), }, }, ); $tzil->build; is($tzil->license->name, '"No License" License', "dist license is set by plugin"); is($tzil->license->year, 2012, "copyright_year used instead of default year"); } done_testing; autoprereqs.t100644000766000024 571312257437015 17507 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/plugins#!perl use strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; use YAML::Tiny; sub build_meta { my $tzil = shift; $tzil->build; YAML::Tiny->new->read($tzil->tempdir->file('build/META.yml'))->[0]; } my $tzil = Builder->from_config( { dist_root => 'corpus/dist/AutoPrereqs' }, { }, ); # check found prereqs my $meta = build_meta($tzil); my %wanted = ( # DZPA::Main should not be extracted 'DZPA::Base::Moose1' => 0, 'DZPA::Base::Moose2' => 0, 'DZPA::Base::base1' => 0, 'DZPA::Base::base2' => 0, 'DZPA::Base::base3' => 0, 'DZPA::Base::parent1' => 0, 'DZPA::Base::parent2' => 0, 'DZPA::Base::parent3' => 0, 'DZPA::IgnoreAPI' => 0, 'DZPA::IndentedRequire' => '3.45', 'DZPA::IndentedUse' => '0.13', 'DZPA::MinVerComment' => '0.50', 'DZPA::ModRequire' => 0, 'DZPA::NotInDist' => 0, 'DZPA::Role' => 0, 'DZPA::ScriptUse' => 0, 'base' => 0, 'lib' => 0, 'parent' => 0, 'perl' => 5.008, 'strict' => 0, 'warnings' => 0, ); is_deeply( $meta->{prereqs}{runtime}{requires}, \%wanted, 'all requires found, but no more', ); # Try again with configure_finder: $tzil = Builder->from_config( { dist_root => 'corpus/dist/AutoPrereqs' }, { add_files => { 'source/dist.ini' => simple_ini( qw(GatherDir ExecDir), [ AutoPrereqs => { skip => '^DZPA::Skip', configure_finder => ':IncModules' } ], [ MetaYAML => { version => 2 } ], ), 'source/inc/DZPA.pm' => "use DZPA::NotInDist;\n use DZPA::Configure;\n", }, }, ); # check found prereqs $meta = build_meta($tzil); is_deeply( $meta->{prereqs}{runtime}{requires}, \%wanted, 'configure_finder did not change requires', ); my %want_configure = ( 'DZPA::Configure' => 0, 'DZPA::NotInDist' => 0, ); is_deeply( $meta->{prereqs}{configure}{requires}, \%want_configure, 'configure_requires is correct', ); # Try again with a customized scanner list: $tzil = Builder->from_config( { dist_root => 'corpus/dist/AutoPrereqs' }, { add_files => { 'source/dist.ini' => simple_ini( qw(GatherDir ExecDir), [ AutoPrereqs => { scanner => 'Perl5', extra_scanner => 'Aliased' } ], [ MetaYAML => { version => 2 } ], ), 'source/lib/DZPA/Aliased.pm' => "use aliased 'Long::Class::Name';\n", }, }, ); # check found prereqs $meta = build_meta($tzil); # Moose-style prereqs should not be recognized this time: delete $wanted{'DZPA::Base::Moose1'}; delete $wanted{'DZPA::Base::Moose2'}; delete $wanted{'DZPA::Role'}; $wanted{'DZPA::Skip::Blah'} = 0; # not skipping anymore $wanted{'DZPA::Skip::Foo'} = 0; $wanted{'aliased'} = 0; $wanted{'Long::Class::Name'} = 0; is_deeply( $meta->{prereqs}{runtime}{requires}, \%wanted, 'custom scanner list', ); done_testing; autoversion.t100644000766000024 104512257437015 17505 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; use YAML::Tiny; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( { version => undef }, 'GatherDir', [ AutoVersion => { major => 6, format => '{{$major}}.{{$^T}}' } ], ), }, }, ); $tzil->build; my $want_version = "6." . $^T; is($tzil->version, $want_version, "dist version is set (in DZ obj)"); } done_testing; fakerelease.t100644000766000024 246312257437015 17403 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil qw(Builder simple_ini); use Test::Fatal qw(exception); { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini(qw(GatherDir FakeRelease)), }, }, ); $tzil->release; ok( grep({ /fake release happen/i } @{ $tzil->log_messages }), "we log a fake release when we fake release", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ '@Filter' => { bundle => '@FakeClassic', remove => 'ConfirmRelease', } ] ), }, }, ); $tzil->release; ok( grep({ /fake release happen/i } @{ $tzil->log_messages }), "we log a fake release when we fake release", ); } { like( exception { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini(qw(GatherDir FakeRelease)), }, }, ); local $ENV{DZIL_FAKERELEASE_FAIL} = 1; $tzil->release; }, qr/DZIL_FAKERELEASE_FAIL set, aborting/i, "we can make FakeRelease fail when we want!" ); } done_testing; filefinders.t100644000766000024 505412257437015 17425 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use ExtUtils::Manifest 'maniread'; use Test::DZil; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ GatherDir => MyINC => { root => '../corpus/dist/DZT_Inc', prefix => 'inc', } ], [ GatherDir => MyBIN => { root => '../corpus/dist/DZT_Bin', prefix => 'bin', } ], [ GatherDir => MySHARE => { root => '../corpus/dist/DZT_Share', prefix => 'share', } ], [ ExecDir => ], [ ShareDir => ], 'Manifest', ), }, also_copy => { 'corpus/dist/DZT_Inc' => 'corpus/dist/DZT_Inc', 'corpus/dist/DZT_Bin' => 'corpus/dist/DZT_Bin', 'corpus/dist/DZT_Share' => 'corpus/dist/DZT_Share' }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw( dist.ini lib/DZT/Sample.pm share/my_data.dat t/basic.t MANIFEST inc/Foo.pm inc/Foo/Bar.pm bin/test.pl ) ], "GatherDir gathers all files in the source dir", ); my $manifest = maniread($tzil->tempdir->file('build/MANIFEST')->stringify); my $count = grep { exists $manifest->{$_} } @files; ok($count == @files, "all files found were in manifest"); ok(keys(%$manifest) == @files, "all files in manifest were on disk"); # Test our finders my $files = $tzil->find_files(':InstallModules'); is_filelist( [ map {; $_->name } @$files ], [ qw( lib/DZT/Sample.pm ) ], "InstallModules finds all modules", ); $files = $tzil->find_files(':IncModules'); is_filelist( [ map {; $_->name } @$files ], [ qw( inc/Foo.pm inc/Foo/Bar.pm ) ], "IncModules finds all modules", ); $files = $tzil->find_files(':TestFiles'); is_filelist( [ map {; $_->name } @$files ], [ qw( t/basic.t ) ], "TestFiles finds all files", ); $files = $tzil->find_files(':ExecFiles'); is_filelist( [ map {; $_->name } @$files ], [ qw( bin/test.pl ) ], "ExecFiles finds all files", ); $files = $tzil->find_files(':ShareFiles'); is_filelist( [ map {; $_->name } @$files ], [ qw( share/my_data.dat ) ], "ShareFiles finds all files", ); $files = $tzil->find_files(':AllFiles'); is_filelist( [ map {; $_->name } @$files ], [ @files ], ":AllFiles finds all files", ); $files = $tzil->find_files(':NoFiles'); is_filelist( [ map {; $_->name } @$files ], [ ], ":NoFiles finds no files", ); done_testing; installdirs.t100644000766000024 1672012257437015 17505 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; sub test_this { my ($plugins, $add_files, $assertion) = @_; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', @$plugins, [ Prereqs => { 'Foo::Bar' => '1.20' } ], [ Prereqs => BuildRequires => { 'Builder::Bob' => '9.901' } ], [ Prereqs => TestRequires => { 'Test::Deet' => '7' } ], ), %$add_files, }, }, ); $tzil->build; $assertion->($tzil); } # ShareDir test_this( [ qw(MakeMaker) ], { }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); unlike($makefile, qr/install_share dist => .share./, "not going to install share"); }, ); test_this( [ qw(MakeMaker ShareDir) ], { }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); unlike($makefile, qr/install_share dist => .share./, "not going to install share"); }, ); test_this( [ qw(MakeMaker) ], { 'source/share/stupid-share.txt' => "This is a sharedir file.\n" }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); unlike( $makefile, qr/install_share dist => .share./, "files in ./share, but no ShareDir, so we will not install_share" ); }, ); test_this( [ qw(MakeMaker ShareDir) ], { 'source/share/stupid-share.txt' => "This is a sharedir file.\n" }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); like( $makefile, qr/install_share dist => .share./, "files in ./share, ShareDir, so we will install_share" ); }, ); test_this( [ qw(ModuleBuild ShareDir) ], { 'source/share/stupid-share.txt' => "This is a sharedir file.\n" }, sub { my $tzil = shift; my $modulebuild = $tzil->plugin_named('ModuleBuild'); is( $modulebuild->__module_build_args->{share_dir}{dist}, 'share', "files in ./share, ShareDir, so we have a Build.PL share_dir" ); }, ); # ModuleShareDirs test_this( [ qw(MakeMaker) ], { }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); unlike($makefile, qr/install_share module => .DZT::Simple., .share./, "not going to install module-based share" ); }, ); test_this( [ qw(MakeMaker ModuleShareDirs) ], { }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); unlike($makefile, qr/install_share module => .DZT::Simple., .share./, "not going to install module-based share" ); }, ); test_this( [ qw(MakeMaker ModuleShareDirs) ], { 'source/share/stupid-share.txt' => "This is a sharedir file.\n" }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); unlike($makefile, qr/install_share module => .DZT::Simple., .share./, "files in ./share, empty ModuleShareDirs, so we will not install_share" ); }, ); test_this( [ 'MakeMaker', ['ModuleShareDirs' => { 'DZT::Simple' => 'share' } ], ], { 'source/share/stupid-share.txt' => "This is a sharedir file.\n" }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); like($makefile, qr/install_share module => .DZT::Simple., .share./, "files in ./share, ModuleShareDirs given, so we will install_share" ); }, ); test_this( [ 'MakeMaker', ['ModuleShareDirs' => { 'DZT::Simple' => 'share', 'DZT::Other' => 'other' } ], ], { 'source/share/stupid-share.txt' => "This is a sharedir file.\n", 'source/other/stupid-other.txt' => "This is another sharedir file.\n", }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); like($makefile, qr/install_share module => .DZT::Simple., .share./, "files in ./share, ModuleShareDirs given, so we will install_share" ); like($makefile, qr/install_share module => .DZT::Other., .other./, "files in ./other, another ModuleShareDirs given, so we will install_share" ); }, ); test_this( [ 'MakeMaker', 'ShareDir', ['ModuleShareDirs' => { 'DZT::Simple' => 'simple', 'DZT::Other' => 'other' } ], ], { 'source/share/stupid-share.txt' => "This is a sharedir file.\n", 'source/other/stupid-other.txt' => "This is another sharedir file.\n", 'source/simple/stupid-other.txt' => "This is another simple sharedir file.\n", }, sub { my $tzil = shift; my $makefile = $tzil->slurp_file('build/Makefile.PL'); like($makefile, qr/install_share dist => .share./, "ShareDir and ModuleShareDirs: dist share" ); like($makefile, qr/install_share module => .DZT::Simple., .simple./, "ShareDir and ModuleShareDirs: first module share", ); like($makefile, qr/install_share module => .DZT::Other., .other./, "ShareDir and ModuleShareDirs: other module share" ); }, ); test_this( [ 'ModuleBuild', ['ModuleShareDirs' => { 'DZT::Simple' => 'share' } ], ], { 'source/share/stupid-share.txt' => "This is a sharedir file.\n" }, sub { my $tzil = shift; my $modulebuild = $tzil->plugin_named('ModuleBuild'); is( $modulebuild->__module_build_args->{share_dir}{module}{'DZT::Simple'}, 'share', "files in ./share, ModuleShareDirs given, so we have a Build.PL share_dir" ); }, ); test_this( [ 'ModuleBuild', 'ShareDir', ['ModuleShareDirs' => { 'DZT::Simple' => 'simple', 'DZT::Other' => 'other' } ], ], { 'source/share/stupid-share.txt' => "This is a sharedir file.\n", 'source/other/stupid-other.txt' => "This is another sharedir file.\n", 'source/simple/stupid-other.txt' => "This is another simple sharedir file.\n", }, sub { my $tzil = shift; my $modulebuild = $tzil->plugin_named('ModuleBuild'); is_deeply( $modulebuild->__module_build_args->{share_dir}, { dist => 'share', module => { 'DZT::Simple' => 'simple', 'DZT::Other' => 'other', }, }, "ModuleBuild with ShareDir and ModuleShareDirs" ); }, ); # ExecDir test_this( [ qw(MakeMaker) ], { }, sub { my $tzil = shift; my $makemaker = $tzil->plugin_named('MakeMaker'); is_deeply( $makemaker->__write_makefile_args->{EXE_FILES}, [], "not going to install execs", ); }, ); test_this( [ qw(MakeMaker) ], { 'source/bin/be-stiff' => "#!perl\nuse D::Evo;\nuse B::Stuff;\n" }, sub { my $tzil = shift; my $makemaker = $tzil->plugin_named('MakeMaker'); is_deeply( $makemaker->__write_makefile_args->{EXE_FILES}, [], "files in ./bin, but no ExecDir, not going to install execs", ); }, ); test_this( [ qw(MakeMaker ExecDir) ], { 'source/bin/be-stiff' => "#!perl\nuse D::Evo;\nuse B::Stuff;\n" }, sub { my $tzil = shift; my $makemaker = $tzil->plugin_named('MakeMaker'); is_deeply( $makemaker->__write_makefile_args->{EXE_FILES}, [ 'bin/be-stiff' ], "files in ./bin, ExecDir, going to install execs", ); }, ); test_this( [ qw(ModuleBuild ExecDir) ], { 'source/bin/be-stiff' => "#!perl\nuse D::Evo;\nuse B::Stuff;\n" }, sub { my $tzil = shift; my $modulebuild = $tzil->plugin_named('ModuleBuild'); is_deeply( $modulebuild->__module_build_args->{script_files}, [ 'bin/be-stiff' ], "files in ./bin, ExecDir, going to install execs in Build.PL", ); }, ); done_testing; metanoindex.t100644000766000024 321412257437015 17442 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/plugins#!perl use strict; use warnings; use Test::More; use Test::Deep; use Test::DZil; my %TEST_ATTR = ( files => { values => [ qw(My/Module.pm My/Module2.pm) ], aliases => [ qw(files) ], }, directories => { values => [ qw(My/Private My/Private2) ], aliases => [ qw(dir directory folder) ], }, packages => { values => [ qw(My::Module::Stuff My::Module::Things) ], aliases => [ qw(class module package) ], }, namespaces => { values => [ qw(My::Module::Stuff My::Module::Things)], aliases => [ qw(namespace) ], }, ); my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'MetaJSON', [ MetaNoIndex => { file => 'file-1.txt', files => 'file-2.txt', dir => 'dir-1', directory => 'dir-2', directories => 'dir-3', folder => 'dir-4', package => 'Package::1', packages => 'Package::2', class => 'Class::1', module => 'Module::1', namespace => 'Namespace::1', namespaces => 'Namespaces::1', }, ], ), }, }, ); $tzil->build; my $meta = $tzil->slurp_file('build/META.json'); is_json( $meta, superhashof({ no_index => { file => bag(qw(file-1.txt file-2.txt)), directory => bag(qw(dir-1 dir-2 dir-3 dir-4)), package => bag(qw(Package::1 Package::2 Class::1 Module::1)), namespace => bag(qw(Namespace::1 Namespaces::1)), }}), "we generated the no_index entry we expected", ); done_testing; modulebuild.t100644000766000024 514412257437015 17440 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', 'ModuleBuild', [ Prereqs => { 'Foo::Bar' => '1.20' } ], [ Prereqs => BuildRequires => { 'Builder::Bob' => '9.901' } ], [ Prereqs => TestRequires => { 'Test::Deet' => '7' } ], ), }, }, ); $tzil->build; my $modulebuild = $tzil->plugin_named('ModuleBuild'); my $have = $modulebuild->__module_build_args; my %want = ( 'module_name' => 'DZT::Sample', 'dist_name' => 'DZT-Sample', 'dist_abstract' => 'Sample DZ Dist', 'dist_version' => '0.001', 'dist_author' => [ 'E. Xavier Ample ' ], 'license' => 'perl', 'requires' => { 'Foo::Bar' => '1.20' }, build_requires => { 'Builder::Bob' => '9.901', 'Module::Build' => '0.3601', }, test_requires => { 'Test::Deet' => '7', }, 'configure_requires' => { 'Module::Build' => '0.3601', }, ); for my $key (sort keys %want) { is_deeply( $have->{ $key }, $want{ $key }, "correct value set for $key", ); } is($modulebuild->_use_custom_class, q{}, 'no custom class by default'); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', [ 'ModuleBuild' => { mb_class => 'Foo::Build' } ], ), }, }, ); $tzil->build; my $modulebuild = $tzil->plugin_named('ModuleBuild'); is( $modulebuild->_use_custom_class, q{use lib qw{inc}; use Foo::Build;}, 'loads custom class from inc' ); my $build = $tzil->slurp_file('build/Build.PL'); like($build, qr/\QFoo::Build->new/, 'Build.PL calls ->new on Foo::Build'); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', [ 'ModuleBuild' => { mb_class => 'Foo::Build', mb_lib => 'inc,priv,something' } ], ), }, }, ); $tzil->build; my $modulebuild = $tzil->plugin_named('ModuleBuild'); is( $modulebuild->_use_custom_class, q{use lib qw{inc priv something}; use Foo::Build;}, 'loads custom class from items specificed in mb_lib' ); my $build = $tzil->slurp_file('build/Build.PL'); like($build, qr/\QFoo::Build->new/, 'Build.PL calls ->new on Foo::Build'); } done_testing; nextrelease.t100644000766000024 1537012257437015 17474 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; use lib 't/lib'; use Test::DZil; use Test::Fatal; local $ENV{TZ} = 'America/New_York'; my $changes = <<'END_CHANGES'; Revision history for {{$dist->name}} {{$NEXT}} got included in an awesome test suite 0.000 2009-01-02 finally left home, proving to mom I can make it! END_CHANGES { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini(qw(GatherDir NextRelease FakeRelease)), }, }, ); $tzil->build; like( $tzil->slurp_file('build/Changes'), qr{0\.001}, "new version appears in build Changes file", ); unlike( $tzil->slurp_file('source/Changes'), qr{0\.001}, "new version does not yet appear in source Changes file", ); unlike( $tzil->slurp_file('build/Changes'), qr{\r}, "no \\r added to build Changelog", ); $tzil->release; like( $tzil->slurp_file('source/Changes'), qr{0\.001}, "new version appears in source Changes file after release", ); ok( grep({ /fake release happen/i } @{ $tzil->log_messages }), "we log a fake release when we fake release", ); unlike( $tzil->slurp_file('source/Changes'), qr{\r}, "No new \\r's added to post-release changelog", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini(qw(GatherDir NextRelease FakeRelease)), }, }, ); $tzil->build; like( $tzil->slurp_file('build/Changes'), qr{0\.001}, "new version appears in build Changes file", ); unlike( $tzil->slurp_file('source/Changes'), qr{0\.001}, "new version does not yet appear in source Changes file", ); like( exception { local $ENV{DZIL_FAKERELEASE_FAIL} = 1; $tzil->release; }, qr/DZIL_FAKERELEASE_FAIL set, aborting/i, "we can make FakeRelease fail when we want!" ); unlike( $tzil->slurp_file('source/Changes'), qr{0\.001}, "no new version in source Changes after failed release", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini( 'GatherDir', [ NextRelease => { format => "** FOOTASTIC %-9v", } ], 'FakeRelease', ), }, }, ); $tzil->build; like( $tzil->slurp_file('build/Changes'), qr{FOOTASTIC}, "setting a custom format works", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini( 'GatherDir', [ NextRelease => { time_zone => 'UTC', } ], 'FakeRelease', ), }, }, ); $tzil->build; like( $tzil->slurp_file('build/Changes'), qr{UTC}, "setting a custom time_zone works", ); } { local $ENV{TRIAL} = 1; my $tzil_trial = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini( qw(GatherDir NextRelease FakeRelease) ), }, }, ); $tzil_trial->build; like( $tzil_trial->slurp_file('build/Changes'), # not using /m here because it stinks on 5.8.8 qr{0\.001 .+ \(TRIAL RELEASE\)}, "adding -TRIAL works", ); } { local $ENV{TRIAL} = 1; my $tzil_trial = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini( 'GatherDir', [ NextRelease => { format => "%v%T", } ], 'FakeRelease', ), }, }, ); $tzil_trial->build; like( $tzil_trial->slurp_file('build/Changes'), qr{0.001-TRIAL}, "adding -TRIAL works", ); } { local $ENV{TRIAL} = 1; my $tzil_trial = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini( 'GatherDir', [ NextRelease => { format => "%-12V ohhai", } ], 'FakeRelease', ), }, }, ); $tzil_trial->build; like( $tzil_trial->slurp_file('build/Changes'), qr{0.001-TRIAL ohhai}, "adding -TRIAL with padding works", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini( 'GatherDir', [ NextRelease => { format => "%v %U %E", } ], 'FakeRelease', ), }, }, ); like( exception { $tzil->build }, qr{\QYou must enter your name in the [%User] section\E}, "complains about missing name", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini( 'GatherDir', [ NextRelease => { format => "%v %U <%E>", } ], 'FakeRelease', [ '%User' => { name => 'E.X. Ample', email => 'me@example.com' } ], ), }, }, ); is( exception { $tzil->build }, undef, "build successfully with name & email", ); like( $tzil->slurp_file('build/Changes'), qr{^0\.001 E\.X\. Ample }m, "adding name and email works", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini( 'GatherDir', [ NextRelease => { format => "%v %U <%E>", user_stash => '%Info' } ], 'FakeRelease', [ '%User' => '%Info' => { name => 'E.X. Ample', email => 'me@example.com' } ], ), }, }, ); is( exception { $tzil->build }, undef, "build successfully with %Info stash", ); like( $tzil->slurp_file('build/Changes'), qr{^0\.001 E\.X\. Ample }m, "adding name and email from %Info works", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZ-NonAscii' }, ); $tzil->build; like( $tzil->slurp_file('build/Changes'), qr{Olivier Mengué}, "dolmen's name is unmangled", ); } done_testing; testrelease.t100644000766000024 145412257437015 17453 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Fatal; use Test::DZil; use File::Temp qw( tempdir ); sub new_tzil { #my $tmpdir = tdir(); my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT', }, { add_files => { 'source/dist.ini' => simple_ini(qw(GatherDir MakeMaker TestRelease FakeRelease)), }, }, ); } sub release_happened { scalar grep( {/Fake release happening/i} @{ shift->log_messages } ),; } { my $tzil = new_tzil; is( exception { $tzil->build }, undef, "No failures occured building the release with TestRelease", ); is( exception { $tzil->release }, undef, "No failures occured in testing the release with TestRelease", ); note explain { root => ''. $tzil->root }; ok( release_happened($tzil), "Release happened" ); } done_testing; todo000755000766000024 012257437015 13623 5ustar00rjbsstaff000000000000Dist-Zilla-5.008vfs-for-files.mkdn100644000766000024 75712257437015 17311 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/todo # VIRTUAL FILESYSTEM TO REPLACE "FILES" ARRAY Right now, files are simple objects stored in an array. This is nice and simple, but also a bit of a mess. It allows duplicate filenames forces us to use regex to find files in a given directory, and so on. Instead, we should use Path::Resolver (or something) to build a simple virtual filesystem. Then we could have filename changes detect conflicts immediately, we could have $file->replace_with( $other_file ), and other nice improvements. release000755000766000024 012257437015 14731 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/xtpod-syntax.t100644000766000024 33212257437015 17342 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/xt/release#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); DZ1000755000766000024 012257437015 15532 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/distdist.ini100644000766000024 21612257437015 17315 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ1name = DZ1 version = 0.001 author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample [@Classic] global000755000766000024 012257437015 15431 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpusconfig.ini100644000766000024 17112257437015 17516 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/global [%User] name = E. Xavier Ample email = ea@example.com [%Rights] license_class = BSD copyright_holder = A. U. Thor Tester.pm100644000766000024 1504712257437015 17375 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zillapackage Dist::Zilla::Tester; { $Dist::Zilla::Tester::VERSION = '5.008'; } use Moose; extends 'Dist::Zilla::Dist::Builder'; # ABSTRACT: a testing-enabling stand-in for Dist::Zilla # XXX: Adding this autoclean causes problem. "Builder" and "Minter" do not # show in tests. I'm really not sure why. -- rjbs, 2011-08-19 # use namespace::autoclean; use autodie; use Dist::Zilla::Chrome::Test; use File::pushd (); use File::Spec; use File::Temp; use Path::Tiny; use Sub::Exporter::Util (); use Sub::Exporter -setup => { exports => [ Builder => sub { $_[0]->can('builder') }, Minter => sub { $_[0]->can('minter') }, ], groups => [ default => [ qw(Builder Minter) ] ], }; sub from_config { my ($self, @arg) = @_; $self->builder->from_config(@arg); } sub builder { 'Dist::Zilla::Tester::_Builder' } sub minter { 'Dist::Zilla::Tester::_Minter' } { package Dist::Zilla::Tester::_Role; { $Dist::Zilla::Tester::_Role::VERSION = '5.008'; } use Moose::Role; has tempdir => ( is => 'ro', writer => '_set_tempdir', init_arg => undef, ); sub clear_log_events { my ($self) = @_; $self->chrome->logger->clear_events; } sub log_events { my ($self) = @_; $self->chrome->logger->events; } sub log_messages { my ($self) = @_; [ map {; $_->{message} } @{ $self->chrome->logger->events } ]; } sub slurp_file { my ($self, $filename) = @_; Path::Tiny::path( $self->tempdir->file($filename) )->slurp_utf8; } sub slurp_file_raw { my ($self, $filename) = @_; Path::Tiny::path( $self->tempdir->file($filename) )->slurp_raw; } sub _metadata_generator_id { 'Dist::Zilla::Tester' } no Moose::Role; } { package Dist::Zilla::Tester::_Builder; { $Dist::Zilla::Tester::_Builder::VERSION = '5.008'; } use Moose; extends 'Dist::Zilla::Dist::Builder'; with 'Dist::Zilla::Tester::_Role'; use File::Copy::Recursive qw(dircopy); use Path::Class; around from_config => sub { my ($orig, $self, $arg, $tester_arg) = @_; confess "dist_root required for from_config" unless $arg->{dist_root}; my $source = $arg->{dist_root}; my $tempdir_root = exists $tester_arg->{tempdir_root} ? $tester_arg->{tempdir_root} : 'tmp'; mkdir $tempdir_root if defined $tempdir_root and not -d $tempdir_root; my $tempdir = dir( File::Temp::tempdir( CLEANUP => 1, (defined $tempdir_root ? (DIR => $tempdir_root) : ()), ))->absolute; my $root = $tempdir->subdir('source'); $root->mkpath; dircopy($source, $root); if ($tester_arg->{also_copy}) { while (my ($src, $dest) = each %{ $tester_arg->{also_copy} }) { dircopy($src, $tempdir->subdir($dest)); } } if (my $files = $tester_arg->{add_files}) { while (my ($name, $content) = each %$files) { my $fn = $tempdir->file($name); $fn->dir->mkpath; Path::Tiny::path($fn)->spew_utf8($content); } } local $arg->{dist_root} = "$root"; local $arg->{chrome} = Dist::Zilla::Chrome::Test->new; local @INC = map {; ref($_) ? $_ : File::Spec->rel2abs($_) } @INC; my $zilla = $self->$orig($arg); $zilla->_set_tempdir($tempdir); return $zilla; }; around build_in => sub { my ($orig, $self, $target) = @_; # XXX: We *must eliminate* the need for this! It's only here because right # now building a dist with (root <> cwd) doesn't work. -- rjbs, 2010-03-08 my $wd = File::pushd::pushd($self->root); $target ||= do { my $target = dir($self->tempdir)->subdir('build'); $target->mkpath; $target; }; return $self->$orig($target); }; around ['test', 'release'] => sub { my ($orig, $self) = @_; # XXX: We *must eliminate* the need for this! It's only here because right # now building a dist with (root <> cwd) doesn't work. -- rjbs, 2010-03-08 my $wd = File::pushd::pushd($self->root); return $self->$orig; }; no Moose; } { package Dist::Zilla::Tester::_Minter; { $Dist::Zilla::Tester::_Minter::VERSION = '5.008'; } use Moose; extends 'Dist::Zilla::Dist::Minter'; with 'Dist::Zilla::Tester::_Role'; use File::Copy::Recursive qw(dircopy); use Path::Class; sub _mint_target_dir { my ($self) = @_; my $name = $self->name; my $dir = $self->tempdir->subdir('mint')->absolute; $self->log_fatal("$dir already exists") if -e $dir; return $dir; } sub _setup_global_config { my ($self, $dir, $arg) = @_; my $config_base = $dir->file('config'); my $stash_registry = {}; require Dist::Zilla::MVP::Assembler::GlobalConfig; require Dist::Zilla::MVP::Section; my $assembler = Dist::Zilla::MVP::Assembler::GlobalConfig->new({ chrome => $arg->{chrome}, stash_registry => $stash_registry, section_class => 'Dist::Zilla::MVP::Section', # make this DZMA default }); require Dist::Zilla::MVP::Reader::Finder; my $reader = Dist::Zilla::MVP::Reader::Finder->new; my $seq = $reader->read_config($config_base, { assembler => $assembler }); return $stash_registry; } around _new_from_profile => sub { my ($orig, $self, $profile_data, $arg, $tester_arg) = @_; my $tempdir_root = exists $tester_arg->{tempdir_root} ? $tester_arg->{tempdir_root} : 'tmp'; mkdir $tempdir_root if defined $tempdir_root and not -d $tempdir_root; my $tempdir = dir( File::Temp::tempdir( CLEANUP => 1, (defined $tempdir_root ? (DIR => $tempdir_root) : ()), ))->absolute; local $arg->{chrome} = Dist::Zilla::Chrome::Test->new; local @INC = map {; ref($_) ? $_ : File::Spec->rel2abs($_) } @INC; local $ENV{DZIL_GLOBAL_CONFIG_ROOT} = $tester_arg->{global_config_root}; my $global_stashes = $self->_setup_global_config( $tester_arg->{global_config_root}, { chrome => $arg->{chrome} }, ); local $arg->{_global_stashes} = $global_stashes; my $zilla = $self->$orig($profile_data, $arg); $zilla->_set_tempdir($tempdir); return $zilla; }; } no Moose; # XXX: namespace::autoclean caused problems -- rjbs, 2011-08-19 __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Tester - a testing-enabling stand-in for Dist::Zilla =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut generatefile.t100644000766000024 571312257437015 17567 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; use lib 't/lib'; use autodie; use Test::DZil; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GenerateFile => Dingo => { filename => 'txt/dingo.txt', is_template => 1, content => [ 'Welcome to Dingo Kidneys ⽝ {{ $dist->version }}', 'Generated by {{ $plugin->VERSION || 0 }}', ], } ], [ GenerateFile => Kidneys => { filename => 'txt/dingo.tmpl', content => [ 'Welcome to Dingo Kidneys ⽝ {{ $dist->version }}', 'Generated by {{ $plugin->VERSION || 0 }}', ], } ], ) }, }, ); $tzil->build; { my $contents = $tzil->slurp_file('build/txt/dingo.txt'); like( $contents, qr{Kidneys ⽝ 0.001\n}sm, 'we render $dist stuff into dingo.txt', ); like( $contents, qr{^Generated by \d}sm, 'we render $plugin stuff into dingo.txt', ); } { my $contents = $tzil->slurp_file('build/txt/dingo.tmpl'); is( $contents, <<'END_TMPL', Welcome to Dingo Kidneys ⽝ {{ $dist->version }} Generated by {{ $plugin->VERSION || 0 }} END_TMPL 'we include template literals into dingo.tmpl', ); } # filename template tests $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GenerateFile => Dingo => { filename => 'txt/{{ $dist->name }}/dingo.txt', content_is_template => 1, name_is_template => 1, content => [ 'Welcome to Dingo Kidneys {{ $dist->version }}', 'Generated by {{ $plugin->VERSION || 0 }}', ], } ], [ # this example doesn't really make sense but it mirrors the # is_template=0 example from t/plugins/generatefile.t GenerateFile => Kidneys => { filename => 'txt/{{ testing }}/dingo.tmpl', content => [ 'Welcome to Dingo Kidneys {{ $dist->version }}', 'Generated by {{ $plugin->VERSION || 0 }}', ], } ], ) }, }, ); $tzil->build; { my $contents = $tzil->slurp_file('build/txt/DZT-Sample/dingo.txt'); like( $contents, qr{Kidneys 0.001\n}sm, 'we render $dist stuff into dingo.txt', ); like( $contents, qr{^Generated by \d}sm, 'we render $plugin stuff into dingo.txt (contents and filename)', ); } { my $contents = $tzil->slurp_file('build/txt/{{ testing }}/dingo.tmpl'); is( $contents, <<'END_TMPL', Welcome to Dingo Kidneys {{ $dist->version }} Generated by {{ $plugin->VERSION || 0 }} END_TMPL 'we include template literals into dingo.tmpl (contents and filename)', ); } done_testing; uploadtocpan.t100644000766000024 774012257437015 17630 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88 tests => 16; use lib 't/lib'; use File::Spec (); use Test::DZil qw(Builder simple_ini); use Test::Fatal qw(exception); #--------------------------------------------------------------------- # Install a fake upload_file method for testing purposes: sub Dist::Zilla::Plugin::UploadToCPAN::_Uploader::upload_file { my ($self, $archive) = @_; $self->log("PAUSE $_ is $self->{$_}") for qw(user password); $self->log("Uploading $archive") if -f $archive; } #--------------------------------------------------------------------- # Create a Builder with a simple configuration: sub build_tzil { Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini('GatherDir', @_), }, }, ); } #--------------------------------------------------------------------- # Set responses for the username and password prompts: sub set_responses { my $chrome = shift->chrome; $chrome->set_response_for('PAUSE username: ', shift); $chrome->set_response_for('PAUSE password: ', shift); } #--------------------------------------------------------------------- # Pass invalid upload_uri to UploadToCPAN as an extra precaution, # and don't let it look for ~/.pause: my %safety_first = (qw(upload_uri http://bogus.example.com/do/not/upload/), pause_cfg_file => File::Spec->devnull); #--------------------------------------------------------------------- # config from %PAUSE stash in dist.ini: { my $tzil = build_tzil( [ UploadToCPAN => { %safety_first } ], 'FakeRelease', [ '%PAUSE' => {qw( username user password password )}], ); $tzil->release; my $msgs = $tzil->log_messages; ok(grep({ /PAUSE user is user/ } @$msgs), "read username"); ok(grep({ /PAUSE password is password/ } @$msgs), "read password"); ok(grep({ /Uploading.*DZT-Sample/ } @$msgs), "uploaded archive"); ok( grep({ /fake release happen/i } @$msgs), "releasing continues after upload", ); } #--------------------------------------------------------------------- # Config from user input: { my $tzil = build_tzil( [ UploadToCPAN => { %safety_first } ], 'FakeRelease', ); set_responses($tzil, qw(user password)); $tzil->release; my $msgs = $tzil->log_messages; ok(grep({ /PAUSE user is user/ } @$msgs), "entered username"); ok(grep({ /PAUSE password is password/ } @$msgs), "entered password"); ok(grep({ /Uploading.*DZT-Sample/ } @$msgs), "uploaded archive manually"); ok( grep({ /fake release happen/i } @$msgs), "releasing continues after manual upload", ); } #--------------------------------------------------------------------- # No config at all: { my $tzil = build_tzil( 'FakeRelease', [ UploadToCPAN => { %safety_first } ], ); # Pretend user just hits Enter at the prompts: set_responses($tzil, '', ''); like( exception { $tzil->release }, qr/You need to supply a username/, "release without credentials fails"); my $msgs = $tzil->log_messages; ok(grep({ /You need to supply a username/} @$msgs), "insist on username"); ok(!grep({ /Uploading.*DZT-Sample/ } @$msgs), "no upload without credentials"); ok( !grep({ /fake release happen/i } @$msgs), "no release without credentials" ); } #--------------------------------------------------------------------- # No config at all, but enter username: { my $tzil = build_tzil( 'FakeRelease', [ UploadToCPAN => { %safety_first } ], ); # Pretend user just hits Enter at the password prompt: set_responses($tzil, 'user', ''); like( exception { $tzil->release }, qr/You need to supply a password/, "release without password fails"); my $msgs = $tzil->log_messages; ok(grep({ /You need to supply a password/} @$msgs), "insist on password"); ok(!grep({ /Uploading.*DZT-Sample/ } @$msgs), "no upload without password"); ok( !grep({ /fake release happen/i } @$msgs), "no release without password" ); } xs-improvement.mkdn100644000766000024 16112257437015 17611 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/todo # XS AUTHORING First order of business: ask the XS authors what would help beyond the now-released `dzil run`. t000755000766000024 012257437015 16040 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZTbasic.t100644000766000024 34412257437015 17427 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT/tuse strict; use warnings; use Test::More 0.88; use DZT::Sample; is_deeply( DZT::Sample->return_arrayref_of_values_passed(1, [ 2 ], { 3 => 4 }), [ 1, [ 2 ], { 3 => 4 } ], "we do what we say on the tin", ); done_testing; Prereqs.pm100644000766000024 763712257437015 17536 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zillapackage Dist::Zilla::Prereqs; { $Dist::Zilla::Prereqs::VERSION = '5.008'; } # ABSTRACT: the prerequisites of a Dist::Zilla distribution use Moose; use Moose::Autobox; use MooseX::Types::Moose qw(Bool HashRef); use CPAN::Meta::Prereqs 2.120630; # add_string_requirement use Path::Class (); use String::RewritePrefix; use CPAN::Meta::Requirements 2.121; # requirements_for_module use namespace::autoclean; has cpan_meta_prereqs => ( is => 'ro', isa => 'CPAN::Meta::Prereqs', init_arg => undef, default => sub { CPAN::Meta::Prereqs->new }, handles => [ qw( finalize is_finalized requirements_for as_string_hash ) ], ); # storing this is sort of gross, but MakeMaker winds up needing the same data # anyway. -- xdg, 2013-10-22 has merged_requires => ( is => 'ro', isa => 'CPAN::Meta::Requirements', init_arg => undef, default => sub { CPAN::Meta::Requirements->new }, ); sub register_prereqs { my $self = shift; my $arg = ref($_[0]) ? shift(@_) : {}; my %prereq = @_; my $phase = $arg->{phase} || 'runtime'; my $type = $arg->{type} || 'requires'; my $req = $self->requirements_for($phase, $type); while (my ($package, $version) = each %prereq) { $req->add_string_requirement($package, $version || 0); } return; } before 'finalize' => sub { my ($self) = @_; $self->sync_runtime_build_test_requires; }; # this avoids a long-standing CPAN.pm bug that incorrectly merges runtime and # "build" (build+test) requirements by ensuring requirements stay unified # across all three phases sub sync_runtime_build_test_requires { my $self = shift; # first pass: generated merged requirements for my $phase ( qw/runtime build test/ ) { my $req = $self->requirements_for($phase, 'requires'); $self->merged_requires->add_requirements( $req ); }; # second pass: update from merged requirements for my $phase ( qw/runtime build test/ ) { my $req = $self->requirements_for($phase, 'requires'); for my $mod ( $req->required_modules ) { $req->clear_requirement( $mod ); $req->add_string_requirement( $mod => $self->merged_requires->requirements_for_module($mod) ); } } return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Prereqs - the prerequisites of a Dist::Zilla distribution =head1 VERSION version 5.008 =head1 DESCRIPTION Dist::Zilla::Prereqs is a subcomponent of Dist::Zilla. The C attribute on your Dist::Zilla object is a Dist::Zilla::Prereqs object, and is responsible for keeping track of the distribution's prerequisites. In fact, a Dist::Zilla::Prereqs object is just a thin layer over a L object, stored in the C attribute. Almost everything this object does is proxied to the CPAN::Meta::Prereqs object, so you should really read how I works. Dist::Zilla::Prereqs proxies the following methods to the CPAN::Meta::Prereqs object: =over 4 =item * finalize =item * is_finalized =item * requirements_for =item * as_string_hash =back =head1 METHODS =head2 register_prereqs $prereqs->register_prereqs(%prereqs); $prereqs->register_prereqs(\%arg, %prereqs); This method adds new minimums to the prereqs object. If a hashref is the first arg, it may have entries for C and C to indicate what kind of prereqs are being registered. (For more information on phase and type, see L.) For example, you might say: $prereqs->register_prereqs( { phase => 'test', type => 'recommends' }, 'Test::Foo' => '1.23', 'XML::YZZY' => '2.01', ); If not given, phase and type default to runtime and requires, respectively. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut dzil-bash_completion100644000766000024 60012257437015 17756 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/misc# dzil(1) completion # _dzil_actions() { COMPREPLY=( $( compgen -W 'commands help authordeps build clean install listdeps new nop release run setup smoke test' \ -- $cur ) ) } _dzil() { local cur COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} if [[ $COMP_CWORD -eq 1 ]] ; then _dzil_actions else return 0 fi } complete -F _dzil dzil metaresources.t100644000766000024 1163712257437015 20040 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; use Test::Deep; use CPAN::Meta::Converter; my $generated_by = 'Dist::Zilla::Tester version ' . (Builder->VERSION || '(undef)'); my $converted_by = "CPAN::Meta::Converter version " . CPAN::Meta::Converter->VERSION; my $generated_by_re = qr/\A\Q$generated_by\E(?:, \Q$converted_by\E)?\z/; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ 'MetaResources' => { homepage => 'http://example.com', bugtracker => 'http://bugs.example.com', repository => 'git://example.com/project.git', }, ], ['MetaYAML'], ['MetaJSON'], ), }, }, ); eval { $tzil->build }; ok(!$@, 'no errors from old-style bugtracker and repository for MetaResources'); is_yaml( $tzil->slurp_file('build/META.yml'), { abstract => 'Sample DZ Dist', author => ['E. Xavier Ample '], build_requires => {}, dynamic_config => 0, generated_by => re($generated_by_re), license => 'perl', 'meta-spec' => { url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', version => '1.4' }, name => 'DZT-Sample', resources => { homepage => 'http://example.com', bugtracker => 'http://bugs.example.com', repository => 'git://example.com/project.git', }, version => '0.001' }, 'META.yml matches expected 1.4 spec output' ); is_json( $tzil->slurp_file('build/META.json'), { abstract => 'Sample DZ Dist', author => ['E. Xavier Ample '], dynamic_config => 0, generated_by => re($generated_by_re), license => [ 'perl_5' ], 'meta-spec' => { url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', version => 2 }, name => 'DZT-Sample', prereqs => {}, release_status => 'stable', resources => { bugtracker => { web => 'http://bugs.example.com' }, homepage => 'http://example.com', repository => superhashof({ url => 'git://example.com/project.git' }), }, version => '0.001' }, 'META.json was 2.0 output, old-style resources were upgraded' ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ 'MetaResources' => { homepage => 'http://example.com', 'bugtracker.web' => 'http://bugs.example.com', 'bugtracker.mailto' => 'project@bugs.example.com', 'repository.url' => 'git://example.com/project.git', 'repository.web' => 'http://example.com/git/project', 'repository.type' => 'git', }, ], ['MetaYAML'], ['MetaJSON'], ), }, }, ); eval { $tzil->build }; ok(!$@, 'no errors from new-style bugtracker and repository for MetaResources'); is_yaml( $tzil->slurp_file('build/META.yml'), { abstract => 'Sample DZ Dist', author => ['E. Xavier Ample '], build_requires => {}, dynamic_config => 0, generated_by => re($generated_by_re), license => 'perl', 'meta-spec' => { url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', version => '1.4' }, name => 'DZT-Sample', resources => { homepage => 'http://example.com', bugtracker => 'http://bugs.example.com', repository => 'git://example.com/project.git', }, version => '0.001' }, 'META.yml matches expected 1.4 spec output, new style resources were down-graded' ); is_json( $tzil->slurp_file('build/META.json'), { abstract => 'Sample DZ Dist', author => ['E. Xavier Ample '], dynamic_config => 0, generated_by => re($generated_by_re), license => [ 'perl_5' ], 'meta-spec' => { url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', version => 2 }, name => 'DZT-Sample', prereqs => {}, release_status => 'stable', resources => { bugtracker => { web => 'http://bugs.example.com', mailto => 'project@bugs.example.com', }, homepage => 'http://example.com', repository => { type => 'git', url => 'git://example.com/project.git', web => 'http://example.com/git/project', } }, version => '0.001' }, 'META.json was 2.0 output' ); } done_testing; command-plugins.mkdn100644000766000024 51212257437015 17711 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/todo # COMMAND PLUGIN PROTOCOL Right now, we just load all the available plugins via App::Cmd. This is probably going to be a pain, in the future. There should be a way to mitigate an overabundance of command plugins. One option is that only the "core" ones are loaded unless you have ~/.dzil/config.ini with: [!newcommand] lib000755000766000024 012257437015 16300 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ1DZ1.pm100644000766000024 20312257437015 17347 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ1/libuse strict; use warnings; package DZ1; # ABSTRACT: this is a sample package for testing Dist::Zilla; sub main { return 1; } 1; lib000755000766000024 012257437015 16301 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ2DZ1.pm100644000766000024 47412257437015 17362 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ2/libuse strict; use warnings; package DZ1; sub main { return 1; } 1; __END__ =head1 NAME DZ1 - this is a sample package for testing Dist::Zilla; =head1 HEY, MAINTAINER Note that we have C<< =head1 NAME >> here, and not an ABSTRACT comment. That's to exercize C. -- rjbs, 2011-11-18 =cut DZT_Inc000755000766000024 012257437015 16366 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/distFoo.pm100644000766000024 6712257437015 17552 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT_Inc#!/usr/bin/perl package Foo; sub baz { 'baz'; } 1; Role000755000766000024 012257437015 16303 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaPPI.pm100644000766000024 515512257437015 17437 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::PPI; { $Dist::Zilla::Role::PPI::VERSION = '5.008'; } # ABSTRACT: a role for plugins which use PPI use Moose::Role; use Moose::Util::TypeConstraints; use namespace::autoclean; use Digest::MD5 qw(md5); my %CACHE; sub ppi_document_for_file { my ($self, $file) = @_; my $content = $file->content; my $encoded_content = $file->encoded_content; # We cache on the MD5 checksum to detect if the document has been modified # by some other plugin since it was last parsed, our document is invalid. my $md5 = md5($encoded_content); return $CACHE{$md5} if $CACHE{$md5}; my $document = PPI::Document->new(\$content) or Carp::croak(PPI::Document->errstr); return $CACHE{$md5} = $document; } sub save_ppi_document_to_file { my ($self, $document, $file) = @_; my $new_content = $document->serialize; $file->content($new_content); $CACHE{ md5($file->encoded_content) } = $document; } sub document_assigns_to_variable { my ($self, $document, $variable) = @_; my $finder = sub { my $node = $_[1]; return 1 if $node->isa('PPI::Statement') && $node->content =~ /(?find_any($finder); Carp::croak($document->errstr) unless defined $rv; return $rv; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::PPI - a role for plugins which use PPI =head1 VERSION version 5.008 =head1 DESCRIPTION This role provides some common utilities for plugins which use PPI =head1 METHODS =head2 ppi_document_for_file my $document = $self->ppi_document_for_file($file); Given a dzil file object (anything that does L), this method returns a new L for that file's content. Internally, this method caches these documents. If multiple plugins want a document for the same file, this avoids reparsing it. =head2 save_ppi_document_to_file my $document = $self->save_ppi_document_to_file($document,$file); Given a L and a dzil file object (anything that does L), this method saves the serialized document in the file. It also updates the internal PPI document cache with the new document. =head2 document_assigns_to_variable if( $self->ppi_document_for_file($document, '$FOO')) { ... } This method returns true if the document assigns to the given variable. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Tutorial.pm100644000766000024 1262112257437015 17725 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zillause strict; use warnings; package Dist::Zilla::Tutorial; { $Dist::Zilla::Tutorial::VERSION = '5.008'; } # ABSTRACT: how to use this "Dist::Zilla" thing use Carp (); Carp::confess "you're not meant to use the tutorial, just read it!"; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Tutorial - how to use this "Dist::Zilla" thing =head1 VERSION version 5.008 =head1 SYNOPSIS B: Maybe you should be looking at the web-based tutorial instead. It's more complete. L Dist::Zilla builds distributions to be uploaded to the CPAN. That means that the first thing you'll need is some code. Once you've got that, you'll need to configure Dist::Zilla. Here's a simple F: name = Carbon-Dating version = 0.003 author = Alan Smithee license = Perl_5 copyright_holder = Alan Smithee [@Basic] [Prereqs] App::Cmd = 0.013 Number::Nary = 0 Sub::Exporter = 0.981 The topmost section configures Dist::Zilla itself. Here are some of the entries it expects: name - (required) the name of the dist being built version - (required) the version of the dist abstract - (required) a short description of the dist author - (optional) the dist author (you may have multiple entries for this) license - (required) the dist license; must be a Software::License::* name copyright_holder - (required) the entity holding copyright on the dist Some of the required values above may actually be provided by means other than the top-level section of the config. For example, L plugins can set the version, and a line like this in the "main module" of the dist will set the abstract: # ABSTRACT: a totally cool way to do totally great stuff The main modules is the module that shares the same name as the dist, in general. Named sections load plugins, with the following rules: If a section name begins with an equals sign (C<=>), the rest of the section name is left intact and not expanded. If the section name begins with an at sign (C<@>), it is prepended with C. Otherwise, it is prepended with C. The values inside a section are given as configuration to the plugin. Consult each plugin's documentation for more information. The "Basic" bundle, seen above, builds a fairly normal distribution. It rewrites tests from F<./xt>, adds some information to POD, and builds a F. For more information, you can look at the docs for L<@Basic|Dist::Zilla::PluginBundle::Basic> and see the plugins it includes. =head1 BUILDING YOUR DIST Maybe we're getting ahead of ourselves, here. Configuring a bunch of plugins won't do you a lot of good unless you know how to use them to build your dist. Dist::Zilla ships with a command called F that will get installed by default. While it can be extended to offer more commands, there are two really useful ones: $ dzil build The C command will build the distribution. Say you're using the configuration in the SYNOPSIS above. You'll end up with a file called F. As long as you've done everything right, it will be suitable for uploading to the CPAN. Of course, you should really test it out first. You can test the dist you'd be building by running another F command: $ dzil test This will build a new copy of your distribution and run its tests, so you'll know whether the dist that C would build is worth releasing! =head1 HOW BUILDS GET BUILT This is really more of a sketchy overview than a spec. First, all the plugins that perform the L perform their C tasks. The build root (where the dist is being built) is made. The Ls gather and inject files into the distribution, then the Ls remove some of them. All the Ls get a chance to muck about with each file, possibly changing its name, content, or installability. Now that the distribution is basically set up, it needs an install tool, like a F. All the L-performing plugins are used to do whatever is needed to make the dist installable. Everything is just about done. The files are all written out to disk and the L plugins do their thing. =head1 RELEASING YOUR DIST By running C, you'll test your distribution, build a tarball of it, and upload it to the CPAN. Plugins are able to do things like check your version control system to make sure you're releasing a new version and that you tag the version you've just uploaded. It can also update your Changelog file, too, making sure that you don't need to know what your next version number will be before releasing. The final CPAN release process is implemented by the L plugin. However you can replace it by your own to match your own (company?) process. =head1 SEE ALSO L =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut confirmrelease.t100644000766000024 465312257437015 20135 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Fatal; use Test::Deep; use Test::DZil; sub new_tzil { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini(qw(GatherDir ConfirmRelease FakeRelease)), }, }, ); } sub release_happened { scalar grep({/Fake release happening/i} @{ shift->log_messages }),; } my $release_aborted = qr/aborting release/i; { my $tzil = new_tzil; like( exception { $tzil->release }, $release_aborted, "ConfirmRelease aborts by default", ); ok(!release_happened($tzil), "release did not happen by default"); } for my $no (qw(n no)) { local $ENV{DZIL_CONFIRMRELEASE_DEFAULT} = $no; my $tzil = new_tzil; like( exception { $tzil->release }, $release_aborted, "ConfirmRelease aborts when DZIL_CONFIRMRELEASE_DEFAULT=$no", ); ok( !release_happened($tzil), "release did not happen when DZIL_CONFIRMRELEASE_DEFAULT=$no", ); } for my $yes (qw(y yes)) { local $ENV{DZIL_CONFIRMRELEASE_DEFAULT} = $yes; my $tzil = new_tzil; is( exception { $tzil->release }, undef, "DZIL_CONFIRMRELEASE_DEFAULT=$yes no exception", ); ok( release_happened($tzil), "DZIL_CONFIRMRELEASE_DEFAULT=$yes allows release", ); } my $prompt = "Do you want to continue the release process?"; for my $no (qw(n no)) { my $tzil = new_tzil; $tzil->chrome->set_response_for($prompt, $no); like( exception { $tzil->release }, $release_aborted, "ConfirmRelease aborts when answering '$no'", ); cmp_deeply( $tzil->log_messages, supersetof("[ConfirmRelease] *** Preparing to release DZT-Sample-0.001.tar.gz with FakeRelease ***"), 'supplementary information was also displayed', ) or diag explain $tzil->log_messages; ok(!release_happened($tzil), "release did not happen when answering '$no'"); } for my $yes (qw(y yes)) { my $tzil = new_tzil; $tzil->chrome->set_response_for($prompt, $yes); is( exception { $tzil->release }, undef, "ConfirmRelease no exception when answering '$yes'", ); cmp_deeply( $tzil->log_messages, supersetof("[ConfirmRelease] *** Preparing to release DZT-Sample-0.001.tar.gz with FakeRelease ***"), 'supplementary information was also displayed', ) or diag explain $tzil->log_messages; ok(release_happened($tzil), "answering '$yes' allows release"); } done_testing; podsyntaxtests.t100644000766000024 145012257437015 20243 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Fatal qw(exception); use lib 't/lib'; use JSON 2; use Test::DZil; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ PodSyntaxTests => ], [ MetaJSON => ], ), }, }, ); $tzil->build; my $json = $tzil->slurp_file('build/META.json'); my $meta = JSON->new->decode($json); is_deeply( $meta->{prereqs}, { develop => { requires => { 'Test::Pod' => '1.41' } }, }, 'PodSyntaxTests develop prereqs' ); like( $tzil->slurp_file('build/xt/release/pod-syntax.t'), qr/\Quse Test::Pod 1.41/, 'xt/release/pod-syntax.t content' ); } done_testing; delay-core-attrs.mkdn100644000766000024 107312257437015 20016 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/todo # DELAY CORE ATTRIBUTE INIT We might want something like $zilla->name to come from some plugin that converts from main_module, or yadda yadda. This will allow register-on-the-fly of plugins because we can construct the Zilla before we know all its required attribute values. We'll probably mark those values as LazyRequired and SetOnce. ## ATTRIBUTES TO FIX, IN ORDER: * main_module, name -- interdependent * abstract * version - it's unique and should be simplified * copyright_{holder,year} - should come from a plugin somehow, too * license * authors * root? DZT_Bin000755000766000024 012257437015 16365 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/disttest.pl100644000766000024 5612257437015 20002 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT_Bin#!/usr/bin/perl print "Hello World!\n"; exit; File.pm100644000766000024 532212257437015 17662 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::File; { $Dist::Zilla::Role::File::VERSION = '5.008'; } # ABSTRACT: something that can act like a file use Moose::Role; use Moose::Util::TypeConstraints; use Try::Tiny; use namespace::autoclean; with 'Dist::Zilla::Role::StubBuild'; has name => ( is => 'rw', isa => 'Str', # Path::Class::File? required => 1, ); has added_by => ( is => 'ro', writer => '_set_added_by', isa => 'Str', ); my $safe_file_mode = subtype( as 'Int', where { not( $_ & 0002) }, message { "file mode would be world-writeable" } ); has mode => ( is => 'rw', isa => $safe_file_mode, default => 0644, ); requires 'encoding'; requires 'content'; requires 'encoded_content'; sub is_bytes { my ($self) = @_; return $self->encoding eq 'bytes'; } sub _encode { my ($self, $text) = @_; my $enc = $self->encoding; if ( $self->is_bytes ) { return $text; # XXX hope you were right that it really was bytes } else { require Encode; my $bytes = try { Encode::encode($enc, $text, Encode::FB_CROAK()) } catch { $self->_throw("encode $enc" => $_) }; return $bytes; } } sub _decode { my ($self, $bytes) = @_; my $enc = $self->encoding; if ( $self->is_bytes ) { $self->_throw(decode => "Can't decode text from 'bytes' encoding"); } else { require Encode; my $text = try { Encode::decode($enc, $bytes, Encode::FB_CROAK()) } catch { $self->_throw("decode $enc" => $_) }; return $text; } } sub _throw { my ($self, $op, $msg) = @_; my ($name, $added_by) = map {; $self->$_ } qw/name added_by/; confess( "Could not $op $name; $added_by; error was: $msg" ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::File - something that can act like a file =head1 VERSION version 5.008 =head1 DESCRIPTION This role describes a file that may be written into the shipped distribution. =head1 ATTRIBUTES =head2 name This is the name of the file to be written out. =head2 added_by This is a string describing when and why the file was added to the distribution. It will generally be set by a plugin implementing the L role. =head2 mode This is the mode with which the file should be written out. It's an integer with the usual C semantics. It defaults to 0644. =head1 METHODS =head2 is_bytes Returns true if the C is bytes. When true, accessing C will be an error. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut diagnostics000755000766000024 012257437015 15430 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/tmain-module.t100644000766000024 605412257437015 20171 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/diagnosticsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; use YAML::Tiny; sub mkconfig { my $root = shift; my $t = Builder->from_config( { dist_root => $root }, { add_files => { 'source/dist.ini' => simple_ini(@_) } } ); $t->build; return $t; } sub testeval(&&) { my ( $evaler, $testcode ) = @_; local $@; eval { $evaler->(); }; my $lasterror = $@; $lasterror = undef if $lasterror eq ""; $testcode->( defined $lasterror, $lasterror ); } # # no main_module + No Gatherdir + Legit Filesystem # testeval { mkconfig( 'corpus/dist/DZT', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module } sub { my ( $died, $error ) = @_; ok( $died, 'fails with no main_module' ); like( $error, qr/didn't find any files in your dist/, 'tells users there are no files in dist' ); like( $error, qr{tried to guess 'lib/DZT/Sample.pm'}, 'tells user what we expected to find' ); }; # no main_module + gatherdir + legit filesystem # testeval { mkconfig( 'corpus/dist/DZT', 'GatherDir', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module } sub { my ( $died, $error ) = @_; ok( !$died, 'should not fail with main_module' ); }; # no main_module + gatherdir + bogus filesystem # testeval { mkconfig( 'corpus/dist/DZT_NoPm', 'GatherDir', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module } sub { my ( $died, $error ) = @_; ok( $died, 'fails with no main_module' ); like( $error, qr{tried to guess 'lib/DZT/Sample.pm'}, 'tells user what we expected to find' ); like( $error, qr{We didn't find any \.pm files}, 'tells the user there are no pm files' ); }; # bad main_module, no gatherdir, legit filesystem # testeval { mkconfig( 'corpus/dist/DZT', { main_module => 'lib/Bogus/Adventure.pm' }, [ Prereqs => { 'Test::Simple' => 0.88 } ] ) ->main_module; } sub { my ( $died, $error ) = @_; ok( $died, 'should fail with missing main_module' ); like( $error, qr/didn't find any files in your dist/, 'tells users there are no files in dist' ); like( $error, qr{but the file 'lib/Bogus/Adventure.pm' is not to be found}, 'tells user their main_module was fubar' ); }; # bad main_module, gatherdir, legit filesystem # testeval { mkconfig( 'corpus/dist/DZT', { main_module => 'lib/Bogus/Adventure.pm' }, 'GatherDir', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module; } sub { my ( $died, $error ) = @_; ok( $died, 'should fail with missing main_module' ); like( $error, qr{but the file 'lib/Bogus/Adventure.pm' is not to be found}, 'tells user their main_module was fubar' ); }; # bad main_module, gatherdir, bogus filesystem # testeval { mkconfig( 'corpus/dist/DZT_NoPm', { main_module => 'lib/Bogus/Adventure.pm' }, 'GatherDir', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module; } sub { my ( $died, $error ) = @_; ok( $died, 'should fail with missing main_module' ); like( $error, qr{but the file 'lib/Bogus/Adventure.pm' is not to be found}, 'tells user their main_module was fubar' ); like( $error, qr{We didn't find any \.pm files}, 'tells the user there are no pm files' ); }; done_testing; plugin-fail.t100644000766000024 466312257437015 20175 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/diagnostics use strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; sub mkconfig { my $root = shift; my $t = Builder->from_config( { dist_root => $root }, { add_files => { 'source/dist.ini' => simple_ini(@_) } } ); $t->build; return $t; } sub testeval(&&) { my ( $evaler, $testcode ) = @_; local $@; eval { $evaler->(); }; my $lasterror = $@; $testcode->( defined $lasterror, $lasterror ); } testeval { mkconfig( 'corpus/dist/DZT', [ 'BrokenPlugin' => {} ] ); } sub { my ( $died, $error ) = @_; subtest "BrokenPlugin" => sub { ok( $died, "Failure occurs when a plugin is broken" ); like( $error, qr{Compilation failed in require}, "Exception is a compilation failure" ); like( $error, qr{This plugin is broken!}, "Exception reports the original problem" ); }; }; testeval { mkconfig( 'corpus/dist/DZT', [ 'BrokenPlugin2' => {} ] ); } sub { my ( $died, $error ) = @_; subtest "BrokenPlugin2" => sub { ok( $died, "Failure occurs when a plugin is broken" ); like( $error, qr{Compilation failed in require}, "Exception is a compilation failure" ); like( $error, qr{This plugin is broken!}, "Exception reports the original problem" ); }; }; testeval { mkconfig( 'corpus/dist/DZT', [ 'BrokenPlugin3' => {} ] ); } sub { my ( $died, $error ) = @_; subtest "BrokenPlugin3" => sub { ok( $died, "Failure occurs when a plugin is broken" ); like( $error, qr{Compilation failed}, "Exception explains that it couldn't load the plugin" ); like( $error, qr{Missing right curly or square bracket}, "Exception reports the original problem" ); }; }; testeval { mkconfig( 'corpus/dist/DZT', [ 'BrokenPlugin4' => {} ] ); } sub { my ( $died, $error ) = @_; subtest "BrokenPlugin4" => sub { ok( $died, "Failure occurs when a plugin is broken" ); like( $error, qr{Can't locate}, "Exception explains that it couldn't load the plugin 2-layers down" ); like( $error, qr{Some/Package/That/Does/Not/Exist/}, "Exception reports the original problem" ); }; }; testeval { mkconfig( 'corpus/dist/DZT', [ 'Not::A::Plugin' => {} ] ); } sub { my ( $died, $error ) = @_; subtest "Not::A::Plugin" => sub { ok( $died, "Failure occurs when a plugin is missing" ); like( $error, qr{Not::A::Plugin.*isn't installed}, "Exception explains that the plugin is not installed" ); like( $error, qr{dzil authordeps}, "Exception suggests using authordeps" ); }; }; done_testing; CHECKLIST-testing.mkdn100644000766000024 225712257437015 17630 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/todo# METHODS OF Dist::Zilla - these are actually really important (and hard?) * find_files * build, build_in * ensure_built_in * build_archive * test * release * install * clean # COMMANDS IN Dist::Zilla::App - should stop being interesting as overhauled * Dist::Zilla::App::Command * Dist::Zilla::App::Command::build * Dist::Zilla::App::Command::clean * Dist::Zilla::App::Command::install * Dist::Zilla::App::Command::new * Dist::Zilla::App::Command::release * Dist::Zilla::App::Command::run * Dist::Zilla::App::Command::smoke * Dist::Zilla::App::Command::test # CONFIG STUFF - don't bother until assembly overhaul happens Dist::Zilla::Config Dist::Zilla::Config::Finder Dist::Zilla::Config::Perl # FILE CLASSES - probably tested sufficiently by testing plugins Dist::Zilla::File::FromCode Dist::Zilla::File::InMemory Dist::Zilla::File::OnDisk # PLUGINS * Dist::Zilla::Plugin::BumpVersion - not worth testing, doomed to be replaced * Dist::Zilla::Plugin::InlineFiles - exercised by other plugins * Dist::Zilla::Plugin::UploadToCPAN - difficult to test # PREREQ HANDLING Dist::Zilla::Prereqs # MISC Dist::Zilla::Tester Dist::Zilla::Types Dist::Zilla::Util Dist::Zilla::Util::MVPAssembler config-arg-prefix.mkdn100644000766000024 221212257437015 20142 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/todo # CONFIG ARG PREFIX RESERVATIONS 1. All config arg names that start with [a-z] are reserved for the plugin. 2. All config arg names that start with - are reserved for the plugin. 3. All config arg names that start with : are reserved for Dist::Zilla. 4. All config arg names that start with = are prohibited and are used internall for things like plugin_name (?) This will let us say: [Plugin] :version = 1.23 ...which will then assert: Plugin->VERSION(1.23) The first two rules are already more or less in place for things like the Prereq plugin. It might be cool to make it easy for plugin authors to get at the two sets of args (-x and x) in their BUILDARGS or something. Possibly a Plugin-role-provided method to partition the args. We should also try to set aside the :-args as early as possible, so they're never available during plugin init without really digging. This would be similar to the way in which -args are not provided to generators in Sub::Exporter. ## TODO Think about applying the same rules to plugin names. For example, in the future virtual plugins could be created with names like :Blorgle that do... stuff. version-from-prev.mkdn100644000766000024 37712257437015 20225 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/todo # NEXT VERSION FROM PREVIOUS VERSION Sort of like BumpVersion, but with pluggable version-finding and -bumping. Ævar wrote something like this, and it should be cored after being rewritten to use plugin-by-name finding and some other future dzilisms. App000755000766000024 012257437015 16122 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaTester.pm100644000766000024 424712257437015 20075 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Appuse strict; package Dist::Zilla::App::Tester; { $Dist::Zilla::App::Tester::VERSION = '5.008'; } use parent 'App::Cmd::Tester::CaptureExternal'; use App::Cmd::Tester 0.306 (); # result_class, ->app # ABSTRACT: testing library for Dist::Zilla::App use Dist::Zilla::App; use File::Copy::Recursive qw(dircopy); use File::pushd (); use File::Spec; use File::Temp; use Path::Class; use Sub::Exporter::Util (); use Sub::Exporter -setup => { exports => [ test_dzil => Sub::Exporter::Util::curry_method() ], groups => [ default => [ qw(test_dzil) ] ], }; sub result_class { 'Dist::Zilla::App::Tester::Result' } sub test_dzil { my ($self, $source, $argv, $arg) = @_; $arg ||= {}; local @INC = map {; File::Spec->rel2abs($_) } @INC; my $tmpdir = $arg->{tempdir} || File::Temp::tempdir(CLEANUP => 1); my $root = dir($tmpdir)->subdir('source'); $root->mkpath; dircopy($source, $root); my $wd = File::pushd::pushd($root); local $ENV{DZIL_TESTING} = 1; my $result = $self->test_app('Dist::Zilla::App' => $argv); $result->{tempdir} = $tmpdir; return $result; } { package Dist::Zilla::App::Tester::Result; { $Dist::Zilla::App::Tester::Result::VERSION = '5.008'; } BEGIN { our @ISA = qw(App::Cmd::Tester::Result); } sub tempdir { my ($self) = @_; return $self->{tempdir}; } sub zilla { my ($self) = @_; return $self->app->zilla; } sub build_dir { my ($self) = @_; return $self->zilla->built_in; } sub clear_log_events { my ($self) = @_; $self->app->zilla->logger->logger->clear_events; } sub log_events { my ($self) = @_; $self->app->zilla->logger->logger->events; } sub log_messages { my ($self) = @_; [ map {; $_->{message} } @{ $self->app->zilla->logger->logger->events } ]; } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Tester - testing library for Dist::Zilla::App =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Stash.pm100644000766000024 202512257437015 20062 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::Stash; { $Dist::Zilla::Role::Stash::VERSION = '5.008'; } # ABSTRACT: something that stores options or data for later reference use Moose::Role; use namespace::autoclean; sub register_component { my ($class, $name, $arg, $section) = @_; # $self->log_debug([ 'online, %s v%s', $self->meta->name, $version ]); my $entry = $class->stash_from_config($name, $arg, $section); $section->sequence->assembler->register_stash($name, $entry); return; } sub stash_from_config { my ($class, $name, $arg, $section) = @_; my $self = $class->new($arg); return $self; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::Stash - something that stores options or data for later reference =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Stash000755000766000024 012257437015 16464 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaUser.pm100644000766000024 156612257437015 20110 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Stashpackage Dist::Zilla::Stash::User; { $Dist::Zilla::Stash::User::VERSION = '5.008'; } use Moose; # ABSTRACT: a stash of user name and email use namespace::autoclean; has name => ( is => 'ro', isa => 'Str', required => 1, ); has email => ( is => 'ro', isa => 'Str', required => 1, ); sub authors { my ($self) = @_; return [ sprintf "%s <%s>", $self->name, $self->email ]; } with 'Dist::Zilla::Role::Stash::Authors'; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Stash::User - a stash of user name and email =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut default000755000766000024 012257437015 16125 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/profilesprofile.ini100644000766000024 5012257437015 20361 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/profiles/default [DistINI] append_file = extra-dist.ini external-core-attr.mkdn100644000766000024 153112257437015 20356 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/todo # EXTERNALIZE CORE ATTRIBUTES Right now you can't initialize a Zilla without a few attributes like name, author, etc. These should be autodetectable, meaning they should be able to wait until plugin initialization is complete -- or at least underway. (...but probably until it's complete. It should be possible, for example, to defer decision on name and version until FileGather-ing is done.) ## STRATEGY? I think what I want is some simple attribute traits: has name => ( ... traits => [ qw(WORM Demanded) ], ); WORM is what it sounds like. Once set, the value cannot be changed. The writer throws if the predicate returns true. Demanded means that the accessor is fatal if the predicate is false. Together, it means you *must initialize* the value before reading it, and you *must not* try to change it once initialized. 000-report-versions-tiny.t100644000766000024 1540712257437015 20134 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/tuse strict; use warnings; use Test::More 0.88; # This is a relatively nice way to avoid Test::NoWarnings breaking our # expectations by adding extra tests, without using no_plan. It also helps # avoid any other test module that feels introducing random tests, or even # test plans, is a nice idea. our $success = 0; END { $success && done_testing; } # List our own version used to generate this my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n"; eval { # no excuses! # report our Perl details my $want = 'v5.8.5'; $v .= "perl: $] (wanted $want) on $^O from $^X\n\n"; }; defined($@) and diag("$@"); # Now, our module version dependencies: sub pmver { my ($module, $wanted) = @_; $wanted = " (want $wanted)"; my $pmver; eval "require $module;"; if ($@) { if ($@ =~ m/Can't locate .* in \@INC/) { $pmver = 'module not found.'; } else { diag("${module}: $@"); $pmver = 'died during require.'; } } else { my $version; eval { $version = $module->VERSION; }; if ($@) { diag("${module}: $@"); $pmver = 'died during VERSION check.'; } elsif (defined $version) { $pmver = "$version"; } else { $pmver = ''; } } # So, we should be good, right? return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n"); } eval { $v .= pmver('App::Cmd::Command::version','any version') }; eval { $v .= pmver('App::Cmd::Setup','0.309') }; eval { $v .= pmver('App::Cmd::Tester','0.306') }; eval { $v .= pmver('App::Cmd::Tester::CaptureExternal','any version') }; eval { $v .= pmver('Archive::Tar','any version') }; eval { $v .= pmver('Archive::Tar::Wrapper','0.15') }; eval { $v .= pmver('CPAN::Meta::Converter','2.101550') }; eval { $v .= pmver('CPAN::Meta::Prereqs','2.120630') }; eval { $v .= pmver('CPAN::Meta::Requirements','2.121') }; eval { $v .= pmver('CPAN::Meta::Validator','2.101550') }; eval { $v .= pmver('CPAN::Uploader','0.103004') }; eval { $v .= pmver('Carp','any version') }; eval { $v .= pmver('Class::Load','0.17') }; eval { $v .= pmver('Config::INI::Reader','any version') }; eval { $v .= pmver('Config::MVP::Assembler','any version') }; eval { $v .= pmver('Config::MVP::Assembler::WithBundles','any version') }; eval { $v .= pmver('Config::MVP::Reader','2.101540') }; eval { $v .= pmver('Config::MVP::Reader::Findable::ByExtension','any version') }; eval { $v .= pmver('Config::MVP::Reader::Finder','any version') }; eval { $v .= pmver('Config::MVP::Reader::INI','2') }; eval { $v .= pmver('Config::MVP::Section','2.200002') }; eval { $v .= pmver('Data::Dumper','any version') }; eval { $v .= pmver('Data::Section','0.200002') }; eval { $v .= pmver('DateTime','0.44') }; eval { $v .= pmver('Digest::MD5','any version') }; eval { $v .= pmver('Encode','any version') }; eval { $v .= pmver('ExtUtils::MakeMaker','6.30') }; eval { $v .= pmver('ExtUtils::Manifest','1.54') }; eval { $v .= pmver('File::Copy::Recursive','any version') }; eval { $v .= pmver('File::Find::Rule','any version') }; eval { $v .= pmver('File::HomeDir','any version') }; eval { $v .= pmver('File::Path','any version') }; eval { $v .= pmver('File::ShareDir','any version') }; eval { $v .= pmver('File::ShareDir::Install','0.03') }; eval { $v .= pmver('File::Spec','any version') }; eval { $v .= pmver('File::Temp','any version') }; eval { $v .= pmver('File::pushd','any version') }; eval { $v .= pmver('Hash::Merge::Simple','any version') }; eval { $v .= pmver('JSON','2') }; eval { $v .= pmver('List::AllUtils','any version') }; eval { $v .= pmver('List::MoreUtils','any version') }; eval { $v .= pmver('List::Util','any version') }; eval { $v .= pmver('Log::Dispatchouli','1.102220') }; eval { $v .= pmver('Mixin::Linewise::Readers','0.100') }; eval { $v .= pmver('Moose','0.92') }; eval { $v .= pmver('Moose::Autobox','0.10') }; eval { $v .= pmver('Moose::Role','any version') }; eval { $v .= pmver('Moose::Util::TypeConstraints','any version') }; eval { $v .= pmver('MooseX::LazyRequire','any version') }; eval { $v .= pmver('MooseX::Role::Parameterized','any version') }; eval { $v .= pmver('MooseX::SetOnce','any version') }; eval { $v .= pmver('MooseX::Types','any version') }; eval { $v .= pmver('MooseX::Types::Moose','any version') }; eval { $v .= pmver('MooseX::Types::Path::Class','any version') }; eval { $v .= pmver('MooseX::Types::Perl','any version') }; eval { $v .= pmver('PPI','any version') }; eval { $v .= pmver('Params::Util','any version') }; eval { $v .= pmver('Path::Class','0.22') }; eval { $v .= pmver('Path::Tiny','any version') }; eval { $v .= pmver('Perl::PrereqScanner','1.016') }; eval { $v .= pmver('Perl::Version','any version') }; eval { $v .= pmver('Pod::Eventual','0.091480') }; eval { $v .= pmver('Scalar::Util','any version') }; eval { $v .= pmver('Software::License','0.101370') }; eval { $v .= pmver('Software::License::None','any version') }; eval { $v .= pmver('Software::LicenseUtils','any version') }; eval { $v .= pmver('String::Formatter','0.100680') }; eval { $v .= pmver('String::RewritePrefix','0.005') }; eval { $v .= pmver('Sub::Exporter','any version') }; eval { $v .= pmver('Sub::Exporter::ForMethods','any version') }; eval { $v .= pmver('Sub::Exporter::Util','any version') }; eval { $v .= pmver('Term::Encoding','any version') }; eval { $v .= pmver('Term::ReadKey','any version') }; eval { $v .= pmver('Term::ReadLine','any version') }; eval { $v .= pmver('Term::ReadLine::Gnu','any version') }; eval { $v .= pmver('Term::UI','any version') }; eval { $v .= pmver('Test::Deep','any version') }; eval { $v .= pmver('Test::FailWarnings','any version') }; eval { $v .= pmver('Test::Fatal','any version') }; eval { $v .= pmver('Test::File::ShareDir','any version') }; eval { $v .= pmver('Test::More','0.96') }; eval { $v .= pmver('Text::Glob','0.08') }; eval { $v .= pmver('Text::Template','any version') }; eval { $v .= pmver('Try::Tiny','any version') }; eval { $v .= pmver('YAML::Tiny','any version') }; eval { $v .= pmver('autobox','2.53') }; eval { $v .= pmver('autodie','any version') }; eval { $v .= pmver('lib','any version') }; eval { $v .= pmver('namespace::autoclean','any version') }; eval { $v .= pmver('parent','any version') }; eval { $v .= pmver('strict','any version') }; eval { $v .= pmver('utf8','any version') }; eval { $v .= pmver('version','any version') }; eval { $v .= pmver('warnings','any version') }; # All done. $v .= <<'EOT'; Thanks for using my code. I hope it works for you. If not, please try and include this output in the bug report. That will help me reproduce the issue and solve your problem. EOT diag($v); ok(1, "we really didn't test anything, just reporting data"); $success = 1; # Work around another nasty module on CPAN. :/ no warnings 'once'; $Template::Test::NO_FLUSH = 1; exit 0; Command.pm100644000766000024 201712257437015 20176 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Appuse strict; use warnings; package Dist::Zilla::App::Command; { $Dist::Zilla::App::Command::VERSION = '5.008'; } # ABSTRACT: base class for dzil commands use App::Cmd::Setup -command; use Moose::Autobox; sub zilla { return $_[0]->app->zilla; } sub log { $_[0]->app->chrome->logger->log($_[1]); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command - base class for dzil commands =head1 VERSION version 5.008 =head1 METHODS =head2 zilla This returns the Dist::Zilla object in use by the command. If none has yet been constructed, one will be by calling C<< Dist::Zilla->from_config >>. (This method just delegates to the Dist::Zilla::App object!) =head2 log This method calls the C method of the application's chrome. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Chrome000755000766000024 012257437015 16617 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaTerm.pm100644000766000024 631012257437015 20224 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Chromepackage Dist::Zilla::Chrome::Term; { $Dist::Zilla::Chrome::Term::VERSION = '5.008'; } use Moose; # ABSTRACT: chrome used for terminal-based interaction use Dist::Zilla::Types qw(OneZero); use Log::Dispatchouli 1.102220; use namespace::autoclean; has logger => ( is => 'ro', isa => 'Log::Dispatchouli', init_arg => undef, writer => '_set_logger', lazy_build => 1, ); sub _build_logger { my $self = shift; my $layer = sprintf(":encoding(%s)", $self->term_enc); binmode( STDOUT, $layer ); binmode( STDERR, $layer ); return Log::Dispatchouli->new({ ident => 'Dist::Zilla', to_stdout => 1, log_pid => 0, to_self => ($ENV{DZIL_TESTING} ? 1 : 0), quiet_fatal => 'stdout', }); } has term_ui => ( is => 'ro', isa => 'Object', lazy => 1, default => sub { require Term::ReadLine; require Term::UI; Term::ReadLine->new('dzil') }, ); has term_enc => ( is => 'ro', isa =>'Str', lazy => 1, default => sub { require Term::Encoding; return Term::Encoding::get_encoding(); }, ); sub prompt_str { my ($self, $prompt, $arg) = @_; $arg ||= {}; my $default = $arg->{default}; my $check = $arg->{check}; require Encode; my $term_enc = $self->term_enc; if ($arg->{noecho}) { require Term::ReadKey; Term::ReadKey::ReadMode('noecho'); } my $input_bytes = $self->term_ui->get_reply( prompt => Encode::encode($term_enc, $prompt, Encode::FB_CROAK()), allow => $check || sub { defined $_[0] and length $_[0] }, (defined $default ? (default => Encode::encode($term_enc, $default, Encode::FB_CROAK())) : () ), ); if ($arg->{noecho}) { Term::ReadKey::ReadMode('normal'); # The \n ending user input disappears under noecho; this ensures # the next output ends up on the next line. print "\n"; } my $input = Encode::decode($term_enc, $input_bytes, Encode::FB_CROAK()); chomp $input; return $input; } sub prompt_yn { my ($self, $prompt, $arg) = @_; $arg ||= {}; my $default = $arg->{default}; my $input = $self->term_ui->ask_yn( prompt => $prompt, (defined $default ? (default => OneZero->coerce($default)) : ()), ); return $input; } sub prompt_any_key { my ($self, $prompt) = @_; $prompt ||= 'press any key to continue'; my $isa_tty = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); if ($isa_tty) { local $| = 1; print $prompt; require Term::ReadKey; Term::ReadKey::ReadMode('cbreak'); Term::ReadKey::ReadKey(0); Term::ReadKey::ReadMode('normal'); print "\n"; } } with 'Dist::Zilla::Role::Chrome'; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Chrome::Term - chrome used for terminal-based interaction =head1 VERSION version 5.008 =head1 OVERVIEW This class provides a L implementation for use in a terminal environment. It's the default chrome used by L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Test.pm100644000766000024 450312257437015 20236 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Chromepackage Dist::Zilla::Chrome::Test; { $Dist::Zilla::Chrome::Test::VERSION = '5.008'; } use Moose; # ABSTRACT: the chrome used by Dist::Zilla::Tester use MooseX::Types::Moose qw(ArrayRef HashRef Str); use Dist::Zilla::Types qw(OneZero); use Log::Dispatchouli 1.102220; has logger => ( is => 'ro', default => sub { Log::Dispatchouli->new({ ident => 'Dist::Zilla::Tester', log_pid => 0, to_self => 1, }); } ); has response_for => ( isa => HashRef[ ArrayRef | Str ], traits => [ 'Hash' ], default => sub { {} }, handles => { response_for => 'get', set_response_for => 'set', }, ); sub prompt_str { my ($self, $prompt, $arg) = @_; $arg ||= {}; my $response = $self->response_for($prompt); $response = shift @$response if ref $response; $response = $arg->{default} unless defined $response; $self->logger->log_fatal("no response for test prompt '$prompt'") unless defined $response; return $response; } sub prompt_yn { my $self = shift; return OneZero->coerce( $self->prompt_str(@_) ); } sub prompt_any_key { return } with 'Dist::Zilla::Role::Chrome'; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Chrome::Test - the chrome used by Dist::Zilla::Tester =head1 VERSION version 5.008 =head1 ATTRIBUTES =head2 response_for The response_for attribute (which exists only in the Test chrome) is a hashref that lets you specify the answer to questions asked by C or C. The key is the prompt string. If the value is a string, it is returned every time that question is asked. If the value is an arrayref, the first element is shifted off and returned every time the question is asked. If the arrayref is empty (or the prompt is not listed in the hash), the default answer (if any) is returned. Since you can't pass arguments to the Chrome constructor, response_for is initialized to an empty hash, and you can add entries after construction with the C method: $chrome->set_response_for($prompt => $response); =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Dist000755000766000024 012257437015 16305 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaMinter.pm100644000766000024 760712257437015 20253 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Distpackage Dist::Zilla::Dist::Minter; { $Dist::Zilla::Dist::Minter::VERSION = '5.008'; } # ABSTRACT: distribution builder; installer not included! use Moose 0.92; # role composition fixes extends 'Dist::Zilla'; use File::pushd (); use Moose::Autobox; use Path::Class; use namespace::autoclean; sub _setup_default_plugins { my ($self) = @_; unless ($self->plugin_named(':DefaultModuleMaker')) { require Dist::Zilla::Plugin::TemplateModule; my $plugin = Dist::Zilla::Plugin::TemplateModule->new({ plugin_name => ':DefaultModuleMaker', zilla => $self, }); $self->plugins->push($plugin); } } sub _new_from_profile { my ($class, $profile_data, $arg) = @_; $arg ||= {}; my $config_class = $arg->{config_class} ||= 'Dist::Zilla::MVP::Reader::Finder'; Class::Load::load_class($config_class); $arg->{chrome}->logger->log_debug( { prefix => '[DZ] ' }, "reading configuration using $config_class" ); require Dist::Zilla::MVP::Assembler::Zilla; require Dist::Zilla::MVP::Section; my $assembler = Dist::Zilla::MVP::Assembler::Zilla->new({ chrome => $arg->{chrome}, zilla_class => $class, section_class => 'Dist::Zilla::MVP::Section', # make this DZMA default }); for ($assembler->sequence->section_named('_')) { $_->add_value(name => $arg->{name}); $_->add_value(chrome => $arg->{chrome}); $_->add_value(_global_stashes => $arg->{_global_stashes}) if $arg->{_global_stashes}; } my $module = String::RewritePrefix->rewrite( { '' => 'Dist::Zilla::MintingProfile::', '=', => '' }, $profile_data->[0], ); Class::Load::load_class($module); my $profile_dir = $module->profile_dir($profile_data->[1]); $assembler->sequence->section_named('_')->add_value(root => $profile_dir); my $seq = $config_class->read_config( $profile_dir->file('profile'), { assembler => $assembler }, ); my $self = $seq->section_named('_')->zilla; $self->_setup_default_plugins; return $self; } sub _mint_target_dir { my ($self) = @_; my $name = $self->name; my $dir = dir($name); $self->log_fatal("./$name already exists") if -e $dir; return $dir = $dir->absolute; } sub mint_dist { my ($self, $arg) = @_; my $name = $self->name; my $dir = $self->_mint_target_dir; # XXX: We should have a way to get more than one module name in, and to # supply plugin names for the minter to use. -- rjbs, 2010-05-03 my @modules = do { (my $module_name = $name) =~ s/-/::/g; ({ name => $module_name }); }; $self->log("making target dir $dir"); $dir->mkpath; my $wd = File::pushd::pushd($self->root); $_->before_mint for $self->plugins_with(-BeforeMint)->flatten; for my $module (@modules) { my $minter = $self->plugin_named( $module->{minter_name} || ':DefaultModuleMaker' ); $minter->make_module({ name => $module->{name} }) } $_->gather_files for $self->plugins_with(-FileGatherer)->flatten; $_->set_file_encodings for $self->plugins_with(-EncodingProvider)->flatten; $_->prune_files for $self->plugins_with(-FilePruner)->flatten; $_->munge_files for $self->plugins_with(-FileMunger)->flatten; $self->_check_dupe_files; $self->log("writing files to $dir"); for my $file ($self->files->flatten) { $self->_write_out_file($file, $dir); } $_->after_mint({ mint_root => $dir }) for $self->plugins_with(-AfterMint)->flatten; $self->log("dist minted in ./$name"); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Dist::Minter - distribution builder; installer not included! =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut File000755000766000024 012257437015 16261 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaOnDisk.pm100644000766000024 262212257437015 20150 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Filepackage Dist::Zilla::File::OnDisk; { $Dist::Zilla::File::OnDisk::VERSION = '5.008'; } # ABSTRACT: a file that comes from your filesystem use Moose; use Path::Tiny; use namespace::autoclean; with 'Dist::Zilla::Role::MutableFile', 'Dist::Zilla::Role::StubBuild'; has _original_name => ( is => 'ro', writer => '_set_original_name', isa => 'Str', init_arg => undef, ); after 'BUILD' => sub { my ($self) = @_; $self->_set_original_name( $self->name ); }; sub _build_encoded_content { my ($self) = @_; return path($self->_original_name)->slurp_raw; } sub _build_content_source { return "encoded_content" } # should never be called, as content will always be generated from # encoded content sub _build_content { die "shouldn't reach here" } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::File::OnDisk - a file that comes from your filesystem =head1 VERSION version 5.008 =head1 DESCRIPTION This represents a file stored on disk. Its C attribute is read from the originally given file name when first read, but is then kept in memory and may be altered by plugins. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MVP000755000766000024 012257437015 16044 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaSection.pm100644000766000024 237712257437015 20157 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/MVPpackage Dist::Zilla::MVP::Section; { $Dist::Zilla::MVP::Section::VERSION = '5.008'; } use Moose; extends 'Config::MVP::Section'; # ABSTRACT: a standard section in Dist::Zilla's configuration sequence use namespace::autoclean; use Config::MVP::Section 2.200002; # for not-installed error use Moose::Autobox; after finalize => sub { my ($self) = @_; my ($name, $plugin_class, $arg) = ( $self->name, $self->package, $self->payload, ); my %payload = %{ $self->payload }; my %dzil; $dzil{$_} = delete $payload{":$_"} for grep { s/\A:// } keys %payload; if (defined $dzil{version}) { Dist::Zilla::Util->_assert_loaded_class_version_ok( $plugin_class, $dzil{version}, ); } $plugin_class->register_component($name, \%payload, $self); return; }; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::MVP::Section - a standard section in Dist::Zilla's configuration sequence =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Chrome.pm100644000766000024 133712257437015 20222 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::Chrome; { $Dist::Zilla::Role::Chrome::VERSION = '5.008'; } # ABSTRACT: something that provides a user interface for Dist::Zilla use Moose::Role; use namespace::autoclean; requires 'logger'; requires 'prompt_str'; requires 'prompt_yn'; requires 'prompt_any_key'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::Chrome - something that provides a user interface for Dist::Zilla =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Plugin.pm100644000766000024 446512257437015 20250 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::Plugin; { $Dist::Zilla::Role::Plugin::VERSION = '5.008'; } # ABSTRACT: something that gets plugged in to Dist::Zilla use Moose::Role; with 'Dist::Zilla::Role::ConfigDumper'; use Params::Util qw(_HASHLIKE); use Moose::Autobox; use MooseX::Types; use namespace::autoclean; has plugin_name => ( is => 'ro', isa => 'Str', required => 1, ); has zilla => ( is => 'ro', isa => class_type('Dist::Zilla'), required => 1, weak_ref => 1, ); has logger => ( is => 'ro', lazy => 1, handles => [ qw(log log_debug log_fatal) ], default => sub { $_[0]->zilla->chrome->logger->proxy({ proxy_prefix => '[' . $_[0]->plugin_name . '] ', }); }, ); # We define these effectively-pointless subs here to allow other roles to # modify them with around. -- rjbs, 2010-03-21 sub mvp_multivalue_args {}; sub mvp_aliases { return {} }; sub plugin_from_config { my ($class, $name, $arg, $section) = @_; my $self = $class->new( $arg->merge({ plugin_name => $name, zilla => $section->sequence->assembler->zilla, }), ); } sub register_component { my ($class, $name, $arg, $section) = @_; my $self = $class->plugin_from_config($name, $arg, $section); my $version = $self->VERSION || 0; $self->log_debug([ 'online, %s v%s', $self->meta->name, $version ]); $self->zilla->plugins->push($self); return; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::Plugin - something that gets plugged in to Dist::Zilla =head1 VERSION version 5.008 =head1 DESCRIPTION The Plugin role should be applied to all plugin classes. It provides a few key methods and attributes that all plugins will need. =head1 ATTRIBUTES =head2 plugin_name The plugin name is generally determined when configuration is read. =head2 zilla This attribute contains the Dist::Zilla object into which the plugin was plugged. =head1 METHODS =head2 log The plugin's C method delegates to the Dist::Zilla object's L method after including a bit of argument-munging. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PAUSE.pm100644000766000024 173112257437015 20041 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Stashpackage Dist::Zilla::Stash::PAUSE; { $Dist::Zilla::Stash::PAUSE::VERSION = '5.008'; } use Moose; # ABSTRACT: a stash of your PAUSE credentials use namespace::autoclean; sub mvp_aliases { return { user => 'username' }; } has username => ( is => 'ro', isa => 'Str', required => 1, ); has password => ( is => 'ro', isa => 'Str', required => 1, ); with 'Dist::Zilla::Role::Stash::Login'; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Stash::PAUSE - a stash of your PAUSE credentials =head1 VERSION version 5.008 =head1 OVERVIEW The PAUSE stash is a L stash generally used for uploading to PAUSE. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Foo000755000766000024 012257437015 17111 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT_IncBar.pm100644000766000024 7412257437015 20254 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT_Inc/Foo#!/usr/bin/perl package Foo::Bar; sub baz { 'bar'; } 1; t000755000766000024 012257437015 16771 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT_NoPmbasic.t100644000766000024 34412257437015 20360 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT_NoPm/tuse strict; use warnings; use Test::More 0.88; use DZT::Sample; is_deeply( DZT::Sample->return_arrayref_of_values_passed(1, [ 2 ], { 3 => 4 }), [ 1, [ 2 ], { 3 => 4 } ], "we do what we say on the tin", ); done_testing; subdir000755000766000024 012257437015 16604 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/extraindex.html100644000766000024 7012257437015 20676 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/extra/subdir

SUPPLIES

Builder.pm100644000766000024 5061212257437015 20415 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Distpackage Dist::Zilla::Dist::Builder; { $Dist::Zilla::Dist::Builder::VERSION = '5.008'; } # ABSTRACT: dist zilla subclass for building dists use Moose 0.92; # role composition fixes extends 'Dist::Zilla'; use Moose::Autobox 0.09; # ->flatten use MooseX::Types::Moose qw(HashRef); use MooseX::Types::Path::Class qw(Dir File); use File::pushd (); use Path::Class; use Path::Tiny; # because more Path::* is better, eh? use Try::Tiny; use namespace::autoclean; sub from_config { my ($class, $arg) = @_; $arg ||= {}; my $root = dir($arg->{dist_root} || '.'); my $sequence = $class->_load_config({ root => $root, chrome => $arg->{chrome}, config_class => $arg->{config_class}, _global_stashes => $arg->{_global_stashes}, }); my $self = $sequence->section_named('_')->zilla; $self->_setup_default_plugins; return $self; } sub _setup_default_plugins { my ($self) = @_; unless ($self->plugin_named(':InstallModules')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':InstallModules', zilla => $self, style => 'grep', code => sub { my ($file, $self) = @_; local $_ = $file->name; return 1 if m{\Alib/} and m{\.(pm|pod)$}; return 1 if $_ eq $self->zilla->main_module; return; }, }); $self->plugins->push($plugin); } unless ($self->plugin_named(':IncModules')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':IncModules', zilla => $self, style => 'grep', code => sub { my ($file, $self) = @_; local $_ = $file->name; return 1 if m{\Ainc/} and m{\.pm$}; return; }, }); $self->plugins->push($plugin); } unless ($self->plugin_named(':TestFiles')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':TestFiles', zilla => $self, style => 'grep', code => sub { local $_ = $_->name; m{\At/} }, }); $self->plugins->push($plugin); } unless ($self->plugin_named(':ExecFiles')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':ExecFiles', zilla => $self, style => 'list', code => sub { my $plugins = $_[0]->zilla->plugins_with(-ExecFiles); my @files = map {; @{ $_->find_files } } @$plugins; return \@files; }, }); $self->plugins->push($plugin); } unless ($self->plugin_named(':ShareFiles')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':ShareFiles', zilla => $self, style => 'list', code => sub { my $self = shift; my $map = $self->zilla->_share_dir_map; my @files; if ( $map->{dist} ) { push @files, $self->zilla->files->grep(sub { $_->name =~ m{\A\Q$map->{dist}\E/} })->flatten; } if ( my $mod_map = $map->{module} ) { for my $mod ( keys %$mod_map ) { push @files, $self->zilla->files->grep(sub { $_->name =~ m{\A\Q$mod_map->{$mod}\E/} })->flatten; } } return \@files; }, }); $self->plugins->push($plugin); } unless ($self->plugin_named(':MainModule')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':MainModule', zilla => $self, style => 'grep', code => sub { my ($file, $self) = @_; local $_ = $file->name; return 1 if $_ eq $self->zilla->main_module->name; return; }, }); $self->plugins->push($plugin); } unless ($self->plugin_named(':AllFiles')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':AllFiles', zilla => $self, style => 'grep', code => sub { return 1 }, }); $self->plugins->push($plugin); } unless ($self->plugin_named(':NoFiles')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':NoFiles', zilla => $self, style => 'list', code => sub { return }, }); $self->plugins->push($plugin); } } has _share_dir_map => ( is => 'ro', isa => HashRef, init_arg => undef, lazy => 1, builder => '_build_share_dir_map', ); sub _build_share_dir_map { my ($self) = @_; my $share_dir_map = {}; for my $plugin ( $self->plugins_with(-ShareDir)->flatten ) { next unless my $sub_map = $plugin->share_dir_map; if ( $sub_map->{dist} ) { $self->log_fatal("can't install more than one distribution ShareDir") if $share_dir_map->{dist}; $share_dir_map->{dist} = $sub_map->{dist}; } if ( my $mod_map = $sub_map->{module} ) { for my $mod ( keys %$mod_map ) { $self->log_fatal("can't install more than one ShareDir for $mod") if $share_dir_map->{module}{$mod}; $share_dir_map->{module}{$mod} = $mod_map->{$mod}; } } } return $share_dir_map; } sub _load_config { my ($class, $arg) = @_; $arg ||= {}; my $config_class = $arg->{config_class} ||= 'Dist::Zilla::MVP::Reader::Finder'; Class::Load::load_class($config_class); $arg->{chrome}->logger->log_debug( { prefix => '[DZ] ' }, "reading configuration using $config_class" ); my $root = $arg->{root}; require Dist::Zilla::MVP::Assembler::Zilla; require Dist::Zilla::MVP::Section; my $assembler = Dist::Zilla::MVP::Assembler::Zilla->new({ chrome => $arg->{chrome}, zilla_class => $class, section_class => 'Dist::Zilla::MVP::Section', # make this DZMA default }); for ($assembler->sequence->section_named('_')) { $_->add_value(chrome => $arg->{chrome}); $_->add_value(root => $arg->{root}); $_->add_value(_global_stashes => $arg->{_global_stashes}) if $arg->{_global_stashes}; } my $seq; try { $seq = $config_class->read_config( $root->file('dist'), { assembler => $assembler }, ); } catch { die $_ unless try { $_->isa('Config::MVP::Error') and $_->ident eq 'package not installed' }; my $package = $_->package; my $bundle = $package =~ /^@/ ? ' bundle' : ''; die <<"END_DIE"; Required plugin$bundle $package isn't installed. Run 'dzil authordeps' to see a list of all required plugins. You can pipe the list to your CPAN client to install or update them: dzil authordeps --missing | cpanm END_DIE }; return $seq; } sub build { $_[0]->build_in } sub build_in { my ($self, $root) = @_; $self->log_fatal("tried to build with a minter") if $self->isa('Dist::Zilla::Dist::Minter'); $self->log_fatal("attempted to build " . $self->name . " a second time") if $self->built_in; $_->before_build for $self->plugins_with(-BeforeBuild)->flatten; $self->log("beginning to build " . $self->name); $_->gather_files for $self->plugins_with(-FileGatherer)->flatten; $_->set_file_encodings for $self->plugins_with(-EncodingProvider)->flatten; $_->prune_files for $self->plugins_with(-FilePruner)->flatten; $_->munge_files for $self->plugins_with(-FileMunger)->flatten; $_->register_prereqs for $self->plugins_with(-PrereqSource)->flatten; $self->prereqs->finalize; # Barf if someone has already set up a prereqs entry? -- rjbs, 2010-04-13 $self->distmeta->{prereqs} = $self->prereqs->as_string_hash; $_->setup_installer for $self->plugins_with(-InstallTool)->flatten; $self->_check_dupe_files; my $build_root = $self->_prep_build_root($root); $self->log("writing " . $self->name . " in $build_root"); for my $file ($self->files->flatten) { $self->_write_out_file($file, $build_root); } $_->after_build({ build_root => $build_root }) for $self->plugins_with(-AfterBuild)->flatten; $self->built_in($build_root); } has built_in => ( is => 'rw', isa => Dir, init_arg => undef, ); sub ensure_built { $_[0]->ensure_built_in; } sub ensure_built_in { my ($self, $root) = @_; # $root ||= $self->name . q{-} . $self->version; return $self->built_in if $self->built_in and (!$root or ($self->built_in eq $root)); Carp::croak("dist is already built, but not in $root") if $self->built_in; $self->build_in($root); } sub dist_basename { my ($self) = @_; return join(q{}, $self->name, '-', $self->version, ); } sub archive_filename { my ($self) = @_; return join(q{}, $self->dist_basename, ( $self->is_trial ? '-TRIAL' : '' ), '.tar.gz' ); } sub build_archive { my ($self) = @_; my $built_in = $self->ensure_built; my $basename = $self->dist_basename; my $basedir = dir($basename); $_->before_archive for $self->plugins_with(-BeforeArchive)->flatten; my $method = Class::Load::load_optional_class('Archive::Tar::Wrapper', { -version => 0.15 }) ? '_build_archive_with_wrapper' : '_build_archive'; my $archive = $self->$method($built_in, $basename, $basedir); my $file = file($self->archive_filename); $self->log("writing archive to $file"); $archive->write("$file", 9); return $file; } sub _build_archive { my ($self, $built_in, $basename, $basedir) = @_; $self->log("building archive with Archive::Tar; install Archive::Tar::Wrapper 0.15 or newer for improved speed"); require Archive::Tar; my $archive = Archive::Tar->new; my %seen_dir; for my $distfile ( sort { length($a->name) <=> length($b->name) } $self->files->flatten ) { my $in = file($distfile->name)->dir; unless ($seen_dir{ $in }++) { $archive->add_data( $basedir->subdir($in), '', { type => Archive::Tar::Constant::DIR(), mode => 0755 }, ) } my $filename = $built_in->file( $distfile->name ); $archive->add_data( $basedir->file( $distfile->name ), path($filename)->slurp_raw, { mode => (stat $filename)[2] & ~022 }, ); } return $archive; } sub _build_archive_with_wrapper { my ($self, $built_in, $basename, $basedir) = @_; $self->log("building archive with Archive::Tar::Wrapper"); my $archive = Archive::Tar::Wrapper->new; for my $distfile ( sort { length($a->name) <=> length($b->name) } $self->files->flatten ) { my $in = file($distfile->name)->dir; my $filename = $built_in->file( $distfile->name ); $archive->add( $basedir->file( $distfile->name )->stringify, $filename->stringify, { perm => (stat $filename)[2] & ~022 }, ); } return $archive; } sub _prep_build_root { my ($self, $build_root) = @_; $build_root = dir($build_root || $self->dist_basename); $build_root->mkpath unless -d $build_root; my $dist_root = $self->root; $build_root->rmtree if -d $build_root; return $build_root; } sub release { my $self = shift; Carp::croak("you can't release without any Releaser plugins") unless my @releasers = $self->plugins_with(-Releaser)->flatten; $ENV{DZIL_RELEASING} = 1; my $tgz = $self->build_archive; # call all plugins implementing BeforeRelease role $_->before_release($tgz) for $self->plugins_with(-BeforeRelease)->flatten; # do the actual release $_->release($tgz) for @releasers; # call all plugins implementing AfterRelease role $_->after_release($tgz) for $self->plugins_with(-AfterRelease)->flatten; } sub clean { my ($self, $dry_run) = @_; require File::Path; for my $x (grep { -e } '.build', glob($self->name . '-*')) { if ($dry_run) { $self->log("clean: would remove $x"); } else { $self->log("clean: removing $x"); File::Path::rmtree($x); } }; } sub ensure_built_in_tmpdir { my $self = shift; require File::Temp; my $build_root = dir('.build'); $build_root->mkpath unless -d $build_root; my $target = dir( File::Temp::tempdir(DIR => $build_root) ); $self->log("building distribution under $target for installation"); my $os_has_symlinks = eval { symlink("",""); 1 }; my $previous; my $latest; if( $os_has_symlinks ) { $previous = file( $build_root, 'previous' ); $latest = file( $build_root, 'latest' ); if( -l $previous ) { $previous->remove or $self->log("cannot remove old .build/previous link"); } if( -l $latest ) { rename $latest, $previous or $self->log("cannot move .build/latest link to .build/previous"); } symlink $target->basename, $latest or $self->log('cannot create link .build/latest'); } $self->ensure_built_in($target); return ($target, $latest, $previous); } sub install { my ($self, $arg) = @_; $arg ||= {}; my ($target, $latest) = $self->ensure_built_in_tmpdir; eval { ## no critic Punctuation my $wd = File::pushd::pushd($target); my @cmd = $arg->{install_command} ? @{ $arg->{install_command} } : (cpanm => "."); $self->log_debug([ 'installing via %s', \@cmd ]); system(@cmd) && $self->log_fatal([ "error running %s", \@cmd ]); }; if ($@) { $self->log($@); $self->log("left failed dist in place at $target"); } else { if ($arg->{keep_build_dir}) { $self->log("all's well; left dist in place at $target"); } else { $self->log("all's well; removing $target"); $target->rmtree; $latest->remove if $latest; } } return; } sub test { my ($self, $arg) = @_; Carp::croak("you can't test without any TestRunner plugins") unless my @testers = $self->plugins_with(-TestRunner)->flatten; my ($target, $latest) = $self->ensure_built_in_tmpdir; my $error = $self->run_tests_in($target); if ($arg and $arg->{keep_build_dir}) { $self->log("all's well; left dist in place at $target"); return; } $self->log("all's well; removing $target"); $target->rmtree; $latest->remove if $latest; } sub run_tests_in { my ($self, $target) = @_; Carp::croak("you can't test without any TestRunner plugins") unless my @testers = $self->plugins_with(-TestRunner)->flatten; for my $tester (@testers) { my $wd = File::pushd::pushd($target); $tester->test( $target ); } } sub run_in_build { my ($self, $cmd, $arg) = @_; # The sort below is a cheap hack to get ModuleBuild ahead of # ExtUtils::MakeMaker. -- rjbs, 2010-01-05 $self->log_fatal("you can't build without any BuildRunner plugins") unless my @builders = $self->plugins_with(-BuildRunner)->sort->reverse->flatten; require "Config.pm"; # skip autoprereq my ($target, $latest) = $self->ensure_built_in_tmpdir; my $abstarget = $target->absolute; # building the dist for real my $ok = eval { my $wd = File::pushd::pushd($target); if ($arg and exists $arg->{build} and ! $arg->{build}) { system(@$cmd) and die "error while running: @$cmd"; return 1; } $builders[0]->build; local $ENV{PERL5LIB} = join $Config::Config{path_sep}, (map { $abstarget->subdir('blib', $_) } qw(arch lib)), (defined $ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()); local $ENV{PATH} = join $Config::Config{path_sep}, (map { $abstarget->subdir('blib', $_) } qw(bin script)), (defined $ENV{PATH} ? $ENV{PATH} : ()); system(@$cmd) and die "error while running: @$cmd"; 1; }; if ($ok) { $self->log("all's well; removing $target"); $target->rmtree; $latest->remove if $latest; } else { my $error = $@ || '(unknown error)'; $self->log($error); $self->log_fatal("left failed dist in place at $target"); } } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Dist::Builder - dist zilla subclass for building dists =head1 VERSION version 5.008 =head1 ATTRIBUTES =head2 built_in This is the L, if any, in which the dist has been built. =head1 METHODS =head2 from_config my $zilla = Dist::Zilla->from_config(\%arg); This routine returns a new Zilla from the configuration in the current working directory. This method should not be relied upon, yet. Its semantics are B to change. Valid arguments are: config_class - the class to use to read the config default: Dist::Zilla::MVP::Reader::Finder =head2 build_in $zilla->build_in($root); This method builds the distribution in the given directory. If no directory name is given, it defaults to DistName-Version. If the distribution has already been built, an exception will be thrown. =head2 build This method just calls C with no arguments. It gets you the default behavior without the weird-looking formulation of C with no object for the preposition! =head2 ensure_built_in $zilla->ensure_built_in($root); This method behaves like C>, but if the dist is already built in C<$root> (or the default root, if no root is given), no exception is raised. =head2 ensure_built This method just calls C with no arguments. It gets you the default behavior without the weird-looking formulation of C with no object for the preposition! =head2 dist_basename my $basename = $zilla->dist_basename; This method will return the dist's basename (e.g. C. The basename is used as the top-level directory in the tarball. It does not include C<-TRIAL>, even if building a trial dist. =head2 archive_filename my $tarball = $zilla->archive_filename; This method will return the filename (e.g. C) of the tarball of this dist. It will include C<-TRIAL> if building a trial dist. The tarball might not exist. =head2 build_archive $zilla->build_archive; This method will ensure that the dist has been built, and will then build a tarball of the build directory in the current directory. =head2 release $zilla->release; This method releases the distribution, probably by uploading it to the CPAN. The actual effects of this method (as with most of the methods) is determined by the loaded plugins. =head2 clean This method removes temporary files and directories suspected to have been produced by the Dist::Zilla build process. Specifically, it deletes the F<.build> directory and any entity that starts with the dist name and a hyphen, like matching the glob C. =head2 ensure_built_in_tmpdir $zilla->ensure_built_in_tmpdir; This method will consistently build the distribution in a temporary subdirectory. It will return the path for the temporary build location. =head2 install $zilla->install( \%arg ); This method installs the distribution locally. The distribution will be built in a temporary subdirectory, then the process will change directory to that subdir and an installer will be run. Valid arguments are: keep_build_dir - if true, don't rmtree the build dir, even if everything seemed to work install_command - the command to run in the subdir to install the dist default (roughly): $^X -MCPAN -einstall . this argument should be an arrayref =head2 test $zilla->test(\%arg); This method builds a new copy of the distribution and tests it using C>. C<\%arg> may be omitted. Otherwise, valid arguments are: keep_build_dir - if true, don't rmtree the build dir, even if everything seemed to work =head2 run_tests_in my $error = $zilla->run_tests_in($directory); This method runs the tests in $directory (a Path::Class::Dir), which must contain an already-built copy of the distribution. It will throw an exception if there are test failures. It does I set any of the C<*_TESTING> environment variables, nor does it clean up C<$directory> afterwards. =head2 run_in_build $zilla->run_in_build( \@cmd ); This method makes a temporary directory, builds the distribution there, executes the dist's first L, and then runs the given command in the build directory. If the command exits non-zero, the directory will be left in place. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut BuildPL.pm100644000766000024 260712257437015 20301 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BuildPL; { $Dist::Zilla::Role::BuildPL::VERSION = '5.008'; } use Moose::Role; with qw( Dist::Zilla::Role::InstallTool Dist::Zilla::Role::BuildRunner Dist::Zilla::Role::TestRunner ); use namespace::autoclean; sub build { my $self = shift; system $^X, 'Build.PL' and die "error with Build.PL\n"; system $^X, 'Build' and die "error running $^X Build\n"; return; } sub test { my ($self, $target) = @_; $self->build; my @testing = $self->zilla->logger->get_debug ? '--verbose' : (); system $^X, 'Build', 'test', @testing and die "error running $^X Build test\n"; return; } 1; # ABSTRACT: Common ground for Build.PL based builders __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::BuildPL - Common ground for Build.PL based builders =head1 VERSION version 5.008 =head1 DESCRIPTION This role is a helper for Build.PL based installers. It implements the L and L roles, and requires you to implement the L and L roles yourself. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Rights.pm100644000766000024 156512257437015 20431 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Stashpackage Dist::Zilla::Stash::Rights; { $Dist::Zilla::Stash::Rights::VERSION = '5.008'; } use Moose; with 'Dist::Zilla::Role::Stash'; # ABSTRACT: a stash of your default licensing terms use namespace::autoclean; has license_class => ( is => 'ro', isa => 'Str', required => 1, ); has copyright_holder => ( is => 'ro', isa => 'Str', required => 1, ); has copyright_year => ( is => 'ro', isa => 'Int', ); __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Stash::Rights - a stash of your default licensing terms =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Stash000755000766000024 012257437015 16727 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/lib/Dist/ZillaHeap.pm100644000766000024 64612257437015 20270 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/t/lib/Dist/Zilla/Stashpackage Dist::Zilla::Stash::Heap; use Moose; with 'Dist::Zilla::Role::Stash'; # ABSTRACT: a stash that's just a big heap of names and values has payload => ( is => 'ro', isa => 'HashRef', required => 1, ); sub value { my ($self, $name) = @_; $self->payload->{ $name }; } sub stash_from_config { my ($class, $name, $arg, $section) = @_; my $self = $class->new({ payload => $arg }); return $self; } 1; DZ-NonAscii000755000766000024 012257437015 17152 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/distChanges100644000766000024 12412257437015 20562 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ-NonAsciiRevision history for {{$dist->name}} {{$NEXT}} - Olivier Mengué was here! FromCode.pm100644000766000024 440712257437015 20462 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Filepackage Dist::Zilla::File::FromCode; { $Dist::Zilla::File::FromCode::VERSION = '5.008'; } # ABSTRACT: a file whose content is (re-)built on demand use Moose; use Moose::Util::TypeConstraints; use namespace::autoclean; with 'Dist::Zilla::Role::File'; has code => ( is => 'rw', isa => 'CodeRef|Str', required => 1, ); has code_return_type => ( is => 'ro', isa => enum([ qw(text bytes) ]), default => 'text', ); sub encoding; has encoding => ( is => 'ro', isa => 'Str', lazy => 1, builder => "_build_encoding", ); sub _build_encoding { my ($self) = @_; return $self->code_return_type eq 'text' ? 'UTF-8' : 'bytes'; } sub content { my ($self) = @_; confess("cannot set content of a FromCode file") if @_ > 1; my $code = $self->code; my $result = $self->$code; if ( $self->code_return_type eq 'text' ) { return $result; } else { $self->_decode($result); } } sub encoded_content { my ($self) = @_; confess( "cannot set encoded_content of a FromCode file" ) if @_ > 1; my $code = $self->code; my $result = $self->$code; if ( $self->code_return_type eq 'bytes' ) { return $result; } else { $self->_encode($result); } } around 'added_by' => sub { my ($orig, $self) = @_; return sprintf("%s from coderef set by %s", $self->code_return_type, $self->$orig); }; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::File::FromCode - a file whose content is (re-)built on demand =head1 VERSION version 5.008 =head1 DESCRIPTION This represents a file whose contents will be generated on demand from a callback or method name. It has one attribute, C, which may be a method name (string) or a coderef. When the file's C method is called, the code is used to generate the content. This content is I cached. It is recomputed every time the content is requested. =head1 ATTRIBUTES =head2 code_return_type 'text' or 'bytes' =head2 encoding =head2 content =head2 encoded_content =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut InMemory.pm100644000766000024 305012257437015 20514 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Filepackage Dist::Zilla::File::InMemory; { $Dist::Zilla::File::InMemory::VERSION = '5.008'; } # ABSTRACT: a file that you build entirely in memory use Moose; use namespace::autoclean; with 'Dist::Zilla::Role::MutableFile', 'Dist::Zilla::Role::StubBuild'; after 'BUILD' => sub { my ($self,$opts) = @_; my @sources = qw/encoded_content content/; my @given = grep { exists $opts->{$_} } @sources; unless ( @given == 1 ) { $self->log_fatal(__PACKAGE__ . " requires have one and only one of: @sources"); } my $source = $given[0]; my $setter = "_$source"; $self->_content_source($source); $self->$setter( $opts->{$source} ); }; # these should never be called since we ensure one of _content or # _encoded_content content is set in BUILD and set the source accordingly sub _build_content { die "shouldn't reach here" } sub _build_encoded_content { die "shouldn't reach here" } sub _build_content_source { die "shouldn't reach here" } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::File::InMemory - a file that you build entirely in memory =head1 VERSION version 5.008 =head1 DESCRIPTION This represents a file created in memory -- it's not much more than a glorified string. See L for details. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Assembler.pm100644000766000024 456312257437015 20467 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/MVPpackage Dist::Zilla::MVP::Assembler; { $Dist::Zilla::MVP::Assembler::VERSION = '5.008'; } use Moose; extends 'Config::MVP::Assembler'; with 'Config::MVP::Assembler::WithBundles'; # ABSTRACT: Dist::Zilla-specific subclass of Config::MVP::Assembler use namespace::autoclean; use Dist::Zilla::Util; has chrome => ( is => 'rw', does => 'Dist::Zilla::Role::Chrome', required => 1, ); has logger => ( is => 'ro', isa => 'Log::Dispatchouli::Proxy', # could be duck typed, I guess lazy => 1, handles => [ qw(log log_debug log_fatal) ], default => sub { $_[0]->chrome->logger->proxy({ proxy_prefix => '[DZ] ' }) }, ); sub expand_package { return scalar Dist::Zilla::Util->expand_config_package_name($_[1]); } sub package_bundle_method { my ($self, $pkg) = @_; return unless $pkg->isa('Moose::Object') and $pkg->does('Dist::Zilla::Role::PluginBundle'); return 'bundle_config'; } before add_value => sub { my ($self, $name) = @_; return unless $name =~ /\A(?:plugin_name|zilla)\z/; my $section_name = $self->current_section->name; $self->log_fatal( "$section_name arguments attempted to provide reserved argument $name" ); }; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::MVP::Assembler - Dist::Zilla-specific subclass of Config::MVP::Assembler =head1 VERSION version 5.008 =head1 DESCRIPTION B If you don't understand how L works, reading about how the Dist::Zilla-specific Assembler works is not going to be useful. Dist::Zilla::MVP::Assembler extends L and composes L. For potential plugin bundles (things composing L) The Assembler has chrome, so it can log and will (eventually) be able to get input from the user. The Assembler's C method delegates to Dist::Zilla::Util's L method. The Assembler will throw an exception if it is instructed to add a value for C or C. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Plugin000755000766000024 012257437015 16640 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaPrereq.pm100644000766000024 225312257437015 20576 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Prereq; { $Dist::Zilla::Plugin::Prereq::VERSION = '5.008'; } # ABSTRACT: (DEPRECATED) the old name of the Prereqs plugin use Moose; extends 'Dist::Zilla::Plugin::Prereqs'; use namespace::autoclean; before register_component => sub { die "[Prereq] is incompatible with Dist::Zilla >= v5; replace it with [Prereqs] (note the 's')" if Dist::Zilla->VERSION >= 5; warn "!!! [Prereq] will be removed in Dist::Zilla v5; replace it with [Prereqs] (note the 's')\n"; }; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::Prereq - (DEPRECATED) the old name of the Prereqs plugin =head1 VERSION version 5.008 =head1 SYNOPSIS This plugin extends C<[Prereqs]> and adds nothing. It is the old name for Prereqs, and will be removed in a few versions. =head1 SEE ALSO Dist::Zilla plugins: L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Readme.pm100644000766000024 302712257437015 20535 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Readme; { $Dist::Zilla::Plugin::Readme::VERSION = '5.008'; } # ABSTRACT: build a README file use Moose; use Moose::Autobox; with qw/Dist::Zilla::Role::FileGatherer Dist::Zilla::Role::TextTemplate/; use namespace::autoclean; sub gather_files { my ($self, $arg) = @_; require Dist::Zilla::File::InMemory; my $template = q| This archive contains the distribution {{ $dist->name }}, version {{ $dist->version }}: {{ $dist->abstract }} {{ $dist->license->notice }} This README file was generated by {{ $generated_by }}. |; my $content = $self->fill_in_string( $template, { dist => \($self->zilla), generated_by => \sprintf("%s v%s", ref($self), $self->VERSION || '(dev)'), }, ); my $file = Dist::Zilla::File::InMemory->new({ content => $content, name => 'README', }); $self->add_file($file); return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::Readme - build a README file =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin adds a very simple F file to the distribution, citing the dist's name, version, abstract, and license. It may be more useful or informative in the future. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Releaser.pm100644000766000024 150212257437015 20541 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::Releaser; { $Dist::Zilla::Role::Releaser::VERSION = '5.008'; } # ABSTRACT: something that makes a release of the dist use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'release'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::Releaser - something that makes a release of the dist =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called when releasing. It's passed the distribution tarball to be released. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ShareDir.pm100644000766000024 173612257437015 20511 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::ShareDir; { $Dist::Zilla::Role::ShareDir::VERSION = '5.008'; } # ABSTRACT: something that picks a directory to install as shared files use Moose::Role; with 'Dist::Zilla::Role::FileFinder'; use namespace::autoclean; # Must return a hashref with any of the keys 'dist' and 'module'. The 'dist' # must be a scalar with a directory to include and 'module' must be a hashref # mapping module names to directories to include. If there are no directories # to include, it must return undef. requires 'share_dir_map'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::ShareDir - something that picks a directory to install as shared files =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut extra-dist.ini100644000766000024 3212257437015 21005 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/profiles/defaultversion = 0.001 [@Basic] AutoPrereqs000755000766000024 012257437015 17406 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/distdist.ini100644000766000024 36312257437015 21174 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/AutoPrereqsname = Foo version = 1.23 author = foobar license = Perl_5 copyright_holder = foobar copyright_year = 2009 [GatherDir] [ExecDir] [AutoPrereqs] skip = ^DZPA::Skip [MetaYAML] version = 2 [Encoding] encoding = bytes filename = t/data.bin dist.ini100644000766000024 36112257437015 20736 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ-NonAsciiname = DZ-NonAscii version = 0.001 author = Olivier Mengué author = 김도형 license = Perl_5 copyright_holder = ภูมิพลอดุลยเดช [@Classic] [MetaJSON] [NextRelease] DistINI.pm100644000766000024 563112257437015 20606 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::DistINI; { $Dist::Zilla::Plugin::DistINI::VERSION = '5.008'; } # ABSTRACT: a plugin to add a dist.ini to newly-minted dists use Moose; with qw(Dist::Zilla::Role::FileGatherer); use Dist::Zilla::File::FromCode; use Moose::Autobox 0.10; # for ->each_value use MooseX::Types::Moose qw(ArrayRef Str); use Path::Tiny; use namespace::autoclean; sub mvp_multivalue_args { qw(append_file) } has append_file => ( is => 'ro', isa => ArrayRef[ Str ], default => sub { [] }, ); sub gather_files { my ($self, $arg) = @_; my $zilla = $self->zilla; my $postlude = ''; $self->append_file->each_value(sub { my $fn = $self->zilla->root->file($_); $postlude .= path($fn)->slurp_utf8; }); my $code = sub { my @core_attrs = qw(name authors copyright_holder); my $license = ref $zilla->license; if ($license =~ /^Software::License::(.+)$/) { $license = $1; } else { $license = "=$license"; } my $content = ''; $content .= sprintf "name = %s\n", $zilla->name; $content .= sprintf "author = %s\n", $_ for @{ $zilla->authors }; $content .= sprintf "license = %s\n", $license; $content .= sprintf "copyright_holder = %s\n", $zilla->copyright_holder; $content .= sprintf "copyright_year = %s\n", (localtime)[5] + 1900; $content .= "\n"; $content .= $postlude; }; my $file = Dist::Zilla::File::FromCode->new({ name => 'dist.ini', code => $code, }); $self->add_file($file); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::DistINI - a plugin to add a dist.ini to newly-minted dists =head1 VERSION version 5.008 =head1 DESCRIPTION This plugins produces a F file in a new dist, specifying the required core attributes from the dist being minted. This plugin is dead simple and pretty stupid, but should get better as dist minting facilities improve. For example, it will not specify any plugins. In the meantime, you may be happier with a F template. =head1 ATTRIBUTES =head2 append_file This parameter may be a filename in the profile's directory to append to the generated F with things like plugins. In other words, if your make this file, called F: [@Basic] [NextRelease] [@Git] ...and your F includes: [DistINI] append_file = plugins.ini ...then the generated C in a newly-minted dist will look something like this: name = My-New-Dist author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample copyright_year = 2010 [@Basic] [NextRelease] [@Git] =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ExecDir.pm100644000766000024 203112257437015 20655 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ExecDir; { $Dist::Zilla::Plugin::ExecDir::VERSION = '5.008'; } # ABSTRACT: install a directory's contents as executables use Moose; use namespace::autoclean; use Moose::Autobox; has dir => ( is => 'ro', isa => 'Str', default => 'bin', ); sub find_files { my ($self) = @_; my $dir = $self->dir; my $files = $self->zilla->files->grep(sub { index($_->name, "$dir/") == 0 }); } with 'Dist::Zilla::Role::ExecFiles'; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::ExecDir - install a directory's contents as executables =head1 VERSION version 5.008 =head1 SYNOPSIS In your F: [ExecDir] dir = scripts If no C is provided, the default is F. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut License.pm100644000766000024 254312257437015 20724 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::License; { $Dist::Zilla::Plugin::License::VERSION = '5.008'; } # ABSTRACT: output a LICENSE file use Moose; with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; use Dist::Zilla::File::InMemory; sub gather_files { my ($self, $arg) = @_; my $file = Dist::Zilla::File::InMemory->new({ name => 'LICENSE', content => $self->zilla->license->fulltext, }); $self->add_file($file); return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::License - output a LICENSE file =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin adds a F file containing the full text of the distribution's license, as produced by the C method of the dist's L object. =head1 SEE ALSO =over 4 =item * the C attribute of the L object to select the license to use. =item * Dist::Zilla roles: L. =item * Other modules: L, L. =back =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PkgDist.pm100644000766000024 634212257437015 20710 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PkgDist; { $Dist::Zilla::Plugin::PkgDist::VERSION = '5.008'; } # ABSTRACT: add a $DIST to your packages use Moose; with( 'Dist::Zilla::Role::FileMunger', 'Dist::Zilla::Role::FileFinderUser' => { default_finders => [ ':InstallModules', ':ExecFiles' ], }, 'Dist::Zilla::Role::PPI', ); use namespace::autoclean; use PPI; sub munge_files { my ($self) = @_; $self->munge_file($_) for @{ $self->found_files }; } sub munge_file { my ($self, $file) = @_; # XXX: for test purposes, for now! evil! -- rjbs, 2010-03-17 return if $file->name =~ /^corpus\//; return if $file->name =~ /\.t$/i; return $self->munge_perl($file) if $file->name =~ /\.(?:pm|pl)$/i; return $self->munge_perl($file) if $file->content =~ /^#!(?:.*)perl(?:$|\s)/; return; } sub munge_perl { my ($self, $file) = @_; my $dist_name = $self->zilla->name; my $document = $self->ppi_document_for_file($file); if ($self->document_assigns_to_variable($document, '$DIST')) { $self->log([ 'skipping %s: assigns to $DIST', $file->name ]); return; } return unless my $package_stmts = $document->find('PPI::Statement::Package'); my %seen_pkg; for my $stmt (@$package_stmts) { my $package = $stmt->namespace; if ($seen_pkg{ $package }++) { $self->log([ 'skipping package re-declaration for %s', $package ]); next; } if ($stmt->content =~ /package\s*\n\s*\Q$package/) { $self->log([ 'skipping private package %s', $package ]); next; } # the \x20 hack is here so that when we scan *this* document we don't find # an assignment to version; it shouldn't be needed, but it's been annoying # enough in the past that I'm keeping it here until tests are better my $perl = "{\n \$$package\::DIST\x20=\x20'$dist_name';\n}\n"; my $dist_doc = PPI::Document->new(\$perl); my @children = $dist_doc->schildren; $self->log_debug([ 'adding $DIST assignment to %s in %s', $package, $file->name, ]); Carp::carp('error inserting $DIST in ' . $file->name) unless $stmt->insert_after($children[0]->clone) and $stmt->insert_after( PPI::Token::Whitespace->new("\n") ); } $self->save_ppi_document_to_file($document, $file); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::PkgDist - add a $DIST to your packages =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin will add a line like the following to each package in each Perl module or program (more or less) within the distribution: { our $DIST = 'My-CPAN-Dist'; } # where 'My-CPAN-Dist' is your dist name It will skip any package declaration that includes a newline between the C keyword and the package name, like: package Foo::Bar; This sort of declaration is also ignored by the CPAN toolchain, and is typically used when doing monkey patching or other tricky things. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Prereqs.pm100644000766000024 1140712257437015 21002 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Prereqs; { $Dist::Zilla::Plugin::Prereqs::VERSION = '5.008'; } # ABSTRACT: list simple prerequisites use Moose; with 'Dist::Zilla::Role::PrereqSource'; use namespace::autoclean; has prereq_phase => ( is => 'ro', isa => 'Str', lazy => 1, init_arg => 'phase', default => 'runtime', ); has prereq_type => ( is => 'ro', isa => 'Str', lazy => 1, init_arg => 'type', default => 'requires', ); around dump_config => sub { my ($orig, $self) = @_; my $config = $self->$orig; my $this_config = { type => $self->prereq_type, phase => $self->prereq_phase, }; $config->{'' . __PACKAGE__} = $this_config; return $config; }; has _prereq => ( is => 'ro', isa => 'HashRef', default => sub { {} }, ); sub mvp_aliases { return { -relationship => '-type' } } sub BUILDARGS { my ($class, @arg) = @_; my %copy = ref $arg[0] ? %{$arg[0]} : @arg; my $zilla = delete $copy{zilla}; my $name = delete $copy{plugin_name}; my @dashed = grep { /^-/ } keys %copy; my %other; for my $dkey (@dashed) { (my $key = $dkey) =~ s/^-//; $other{ $key } = delete $copy{ $dkey }; } confess "don't try to pass -_prereq as a build arg!" if $other{_prereq}; # Handle magic plugin names: unless (($other{phase} and $other{type}) or $name =~ m! (?: \A | / ) Prereqs? \z !x) { my ($phase, $type) = $name =~ /\A (Build|Test|Runtime|Configure|Develop)? (Requires|Recommends|Suggests|Conflicts) \z/x; if ($type) { $other{phase} ||= lc $phase if defined $phase; $other{type} ||= lc $type; } else { $zilla->chrome->logger->log_fatal({ prefix => "[$name] " }, "No -phase or -relationship specified") unless $other{phase} or $other{type}; } } return { zilla => $zilla, plugin_name => $name, _prereq => \%copy, %other, } } sub register_prereqs { my ($self) = @_; $self->zilla->register_prereqs( { type => $self->prereq_type, phase => $self->prereq_phase, }, %{ $self->_prereq }, ); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::Prereqs - list simple prerequisites =head1 VERSION version 5.008 =head1 SYNOPSIS In your F: [Prereqs] Foo::Bar = 1.002 MRO::Compat = 10 Sub::Exporter = 0 You can specify requirements for different phases and relationships with: [Prereqs] -phase = test -relationship = recommends Fitz::Fotz = 1.23 Text::SoundEx = 3 Remember that if you load two Prereqs plugins, each will needs its own name, added like this: [Prereqs / PluginName] -phase = test -relationship = recommends Fitz::Fotz = 1.23 Text::SoundEx = 3 If the name is the CamelCase concatenation of a phase and relationship (or just a relationship), it will set those parameters implicitly. If you use a custom name, but it does not specify the relationship, and you didn't specify either C<-phase> or C<-relationship>, it throws the error C. This is to prevent a typo that makes the name meaningless from slipping by unnoticed. The example below is equivalent to the example above, except for the name of the resulting plugin: [Prereqs / TestRecommends] Fitz::Fotz = 1.23 Text::SoundEx = 3 =head1 DESCRIPTION This module adds "fixed" prerequisites to your distribution. These are prereqs with a known, fixed minimum version that doesn't change based on platform or other conditions. You can specify prerequisites for different phases and kinds of relationships. In C, the phase is Runtime and the relationship is Requires. These are described in more detail in the L. The phases are: =over 4 =item * configure =item * build =item * test =item * runtime =item * develop =back The relationship types are: =over 4 =item * requires =item * recommends =item * suggests =item * conflicts =back If the phase is omitted, it will default to I; thus, specifying "Prereqs / Recommends" in your dist.ini is equivalent to I. Not all of these phases are useful for all tools, especially tools that only understand version 1.x CPAN::Meta files. =head1 SEE ALSO =over 4 =item * Core Dist::Zilla plugins: L<@Basic|Dist::Zilla::PluginBundle::Basic>, L. =item * The CPAN Meta specification: L. =back =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut AfterMint.pm100644000766000024 165612257437015 20702 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::AfterMint; { $Dist::Zilla::Role::AfterMint::VERSION = '5.008'; } # ABSTRACT: something that runs after minting is mostly complete use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'after_mint'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::AfterMint - something that runs after minting is mostly complete =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called once all the files have been written out. It is passed a hashref with the following data: mint_root - the directory in which the dist was minted =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ExecFiles.pm100644000766000024 151212257437015 20647 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::ExecFiles; { $Dist::Zilla::Role::ExecFiles::VERSION = '5.008'; } # ABSTRACT: something that finds files to install as executables use Moose::Role; with 'Dist::Zilla::Role::FileFinder'; use namespace::autoclean; requires 'dir'; sub find_files { my ($self) = @_; my $dir = $self->dir; my $files = $self->zilla->files->grep(sub { index($_->name, "$dir/") == 0 }); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::ExecFiles - something that finds files to install as executables =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut StubBuild.pm100644000766000024 111512257437015 20674 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::StubBuild; { $Dist::Zilla::Role::StubBuild::VERSION = '5.008'; } # ABSTRACT: provides an empty BUILD methods use Moose::Role; sub BUILD {} 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::StubBuild - provides an empty BUILD methods =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut changes_has_content.t100644000766000024 201112257437015 21245 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/xt/release#!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '5.008'; my $trial_token = '-TRIAL'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; # _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit # by Jerome Quelin sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } DZT000755000766000024 012257437015 17004 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT/libSample.pm100644000766000024 20312257437015 20676 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT/lib/DZTuse strict; use warnings; package DZT::Sample; sub return_arrayref_of_values_passed { my $invocant = shift; return \@_; } 1; DZT_Share000755000766000024 012257437015 16717 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/distmy_data.dat100644000766000024 5212257437015 21124 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT_Sharesome random data that should be shared... Command000755000766000024 012257437015 17500 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Appadd.pm100644000766000024 435612257437015 20736 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::add; { $Dist::Zilla::App::Command::add::VERSION = '5.008'; } # ABSTRACT: add a module to a dist use Dist::Zilla::App -command; use Path::Class; use File::pushd (); sub abstract { 'add modules to an existing dist' } sub usage_desc { '%c %o ' } sub opt_spec { [ 'profile|p=s', 'name of the profile to use', { default => 'default' } ], [ 'provider|P=s', 'name of the profile provider to use', { default => 'Default' } ], # [ 'module|m=s@', 'module(s) to create; may be given many times' ], } sub validate_args { my ($self, $opt, $args) = @_; require MooseX::Types::Perl; $self->usage_error('dzil add takes one or more arguments') if @$args < 1; for my $name ( @$args ) { $self->usage_error("$name is not a valid module name") unless MooseX::Types::Perl::is_ModuleName($name); } } sub execute { my ($self, $opt, $arg) = @_; my $zilla = $self->zilla; my $dist = $zilla->name; require Dist::Zilla::Dist::Minter; my $minter = Dist::Zilla::Dist::Minter->_new_from_profile( [ $opt->provider, $opt->profile ], { chrome => $self->app->chrome, name => $dist, _global_stashes => $self->app->_build_global_stashes, }, ); my $root = dir($zilla->root)->absolute; my $wd = File::pushd::pushd($minter->root); for my $name ( @$arg ) { my $factory = $minter->plugin_named(':DefaultModuleMaker'); $factory->make_module({ name => $name }); for my $file ( @{ $factory->zilla->files} ) { $zilla->_write_out_file($file, $root); } } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::add - add a module to a dist =head1 VERSION version 5.008 =head1 SYNOPSIS Adds a new module to a Dist::Zilla-based distribution $ dzil add Some::New::Module There are two arguments, C<-p> and C<-P>. C<-P> specify the minting profile provider and C<-p> - the profile name. These work just like C. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut new.pm100644000766000024 521412257437015 20771 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::new; { $Dist::Zilla::App::Command::new::VERSION = '5.008'; } # ABSTRACT: mint a new dist use Dist::Zilla::App -command; sub abstract { 'mint a new dist' } sub usage_desc { '%c %o ' } sub opt_spec { [ 'profile|p=s', 'name of the profile to use', { default => 'default' } ], [ 'provider|P=s', 'name of the profile provider to use', { default => 'Default' } ], # [ 'module|m=s@', 'module(s) to create; may be given many times' ], } sub validate_args { my ($self, $opt, $args) = @_; require MooseX::Types::Perl; $self->usage_error('dzil new takes exactly one argument') if @$args != 1; my $name = $args->[0]; $name =~ s/::/-/g if MooseX::Types::Perl::is_ModuleName($name) and not MooseX::Types::Perl::is_DistName($name); $self->usage_error("$name is not a valid distribution name") unless MooseX::Types::Perl::is_DistName($name); $args->[0] = $name; } sub execute { my ($self, $opt, $arg) = @_; my $dist = $arg->[0]; require Dist::Zilla::Dist::Minter; my $minter = Dist::Zilla::Dist::Minter->_new_from_profile( [ $opt->provider, $opt->profile ], { chrome => $self->app->chrome, name => $dist, _global_stashes => $self->app->_build_global_stashes, }, ); $minter->mint_dist({ # modules => $opt->module, }); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::new - mint a new dist =head1 VERSION version 5.008 =head1 SYNOPSIS Creates a new Dist-Zilla based distribution under the current directory. $ dzil new Main::Module::Name There are two arguments, C<-p> and C<-P>. C<-P> specify the minting profile provider and C<-p> - the profile name. The default profile provider first looks in the F<~/.dzil/profiles/$profile_name> and then among standard profiles, shipped with Dist::Zilla. For example: $ dzil new -p work Corporate::Library This command would instruct C to look in F<~/.dzil/profiles/work> for a F (or other "profile" config file). If no profile name is given, C will look for the C profile. If no F directory exists, it will use a very simple configuration shipped with Dist::Zilla. $ dzil new -P Foo Corporate::Library This command would instruct C to consult the Foo provider about the directory of 'default' profile. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut nop.pm100644000766000024 175012257437015 20775 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::nop; { $Dist::Zilla::App::Command::nop::VERSION = '5.008'; } # ABSTRACT: initialize dzil, then exit use Dist::Zilla::App -command; sub abstract { 'do nothing: initialize dzil, then exit' } sub execute { my ($self, $opt, $arg) = @_; $self->zilla; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::nop - initialize dzil, then exit =head1 VERSION version 5.008 =head1 SYNOPSIS This command does nothing. It initializes Dist::Zilla, then exits. This is useful to see the logging output of plugin initialization. dzil nop -v Seriously, this command is almost entirely for diagnostic purposes. Don't overthink it, okay? =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut run.pm100644000766000024 443412257437015 21007 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::run; { $Dist::Zilla::App::Command::run::VERSION = '5.008'; } # ABSTRACT: run stuff in a dir where your dist is built use Dist::Zilla::App -command; sub abstract { 'run stuff in a dir where your dist is built' } sub opt_spec { [ 'build!' => 'do the Build actions before running the command; done by default', { default => 1 } ], } sub usage_desc { return '%c run %o [ run command [ arg1 arg2 ... ] ]'; } sub execute { my ($self, $opt, $args) = @_; unless (@$args) { my $envname = $^O eq 'MSWin32' ? 'COMSPEC' : 'SHELL'; unless ($ENV{$envname}) { $self->usage_error("no command supplied to run and no \$$envname set"); } $args = [ $ENV{$envname} ]; $self->log("no command supplied to run so using \$$envname: $args->[0]"); } $self->zilla->run_in_build($args, { build => $opt->build }); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::run - run stuff in a dir where your dist is built =head1 VERSION version 5.008 =head1 SYNOPSIS $ dzil run ./bin/myscript $ dzil run prove -bv t/mytest.t $ dzil run bash =head1 DESCRIPTION This command will build your dist with Dist::Zilla, then build the distribution and then run a command in the build directory. It's something like doing this: dzil build rsync -avp My-Project-version/ .build/ cd .build perl Makefile.PL # or perl Build.PL make # or ./Build export PERL5LIB=$PWD/blib/lib:$PWD/blib/arch Except for the fact it's built directly in a subdir of .build (like F<.build/69105y2>). A command returning with an non-zero error code will left the build directory behind for analysis, and C will exit with a non-zero status. Otherwise, the build directory will be removed and dzil will exit with status zero. If no run command is provided, a new default shell is invoked. This can be useful for testing your distribution as if it were installed. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Reader000755000766000024 012257437015 17246 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/MVPPerl.pm100644000766000024 324512257437015 20652 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/MVP/Readerpackage Dist::Zilla::MVP::Reader::Perl; { $Dist::Zilla::MVP::Reader::Perl::VERSION = '5.008'; } use Moose; extends 'Config::MVP::Reader'; with qw(Config::MVP::Reader::Findable::ByExtension); # ABSTRACT: the reader for dist.pl files use namespace::autoclean; sub default_extension { 'pl' } sub read_into_assembler { my ($self, $location, $asm) = @_; my @input = do $location; while (@input and ! ref $input[0]) { my ($key, $value) = (shift(@input), shift(@input)); $asm->add_value($key => $value); } my $plugins = shift @input; confess "too much input" if @input; while (my ($ident, $arg) = splice @$plugins, 0, 2) { unless (ref $arg) { unshift @$plugins, $arg; $arg = []; } my ($moniker, $name) = ref $ident ? @$ident : (($ident) x 2); $asm->change_section($moniker, $name); my @to_iter = ref $arg eq 'HASH' ? %$arg : @$arg; while (my ($key, $value) = splice @to_iter, 0, 2) { $asm->add_value($key, $value); } } # should be done ... elsewhere? -- rjbs, 2009-08-24 $self->assembler->end_section if $self->assembler->current_section; return $self->assembler->sequence; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::MVP::Reader::Perl - the reader for dist.pl files =head1 VERSION version 5.008 =head1 DESCRIPTION Dist::Zilla::Config reads in the F file for a distribution. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut RootSection.pm100644000766000024 404312257437015 21013 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/MVPpackage Dist::Zilla::MVP::RootSection; { $Dist::Zilla::MVP::RootSection::VERSION = '5.008'; } use Moose; extends 'Config::MVP::Section'; # ABSTRACT: a standard section in Dist::Zilla's configuration sequence use namespace::autoclean; use MooseX::LazyRequire; use MooseX::SetOnce; use Moose::Util::TypeConstraints; has '+name' => (default => '_'); has '+aliases' => (default => sub { return { author => 'authors' } }); has '+multivalue_args' => (default => sub { [ qw(authors) ] }); has zilla => ( is => 'ro', isa => class_type('Dist::Zilla'), traits => [ qw(SetOnce) ], writer => 'set_zilla', lazy_required => 1, ); after finalize => sub { my ($self) = @_; my $assembler = $self->sequence->assembler; my %payload = %{ $self->payload }; my %dzil; $dzil{$_} = delete $payload{":$_"} for grep { s/\A:// } keys %payload; my $zilla = $assembler->zilla_class->new( \%payload ); if (defined $dzil{version}) { Dist::Zilla::Util->_assert_loaded_class_version_ok( 'Dist::Zilla', $dzil{version}, ); } $self->set_zilla($zilla); }; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::MVP::RootSection - a standard section in Dist::Zilla's configuration sequence =head1 VERSION version 5.008 =head1 DESCRIPTION This is a subclass of L, used as the starting section by L. It has a number of useful defaults, as well as a C attribute which will, after section finalization, contain a Dist::Zilla object with which subsequent plugin sections may register. Those useful defaults are: =over 4 =item * name defaults to _ =item * aliases defaults to { author => 'authors' } =item * multivalue_args defaults to [ 'authors' ] =back =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut CPANFile.pm100644000766000024 432312257437015 20661 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::CPANFile; { $Dist::Zilla::Plugin::CPANFile::VERSION = '5.008'; } # ABSTRACT: produce a cpanfile prereqs file use Moose; use Moose::Autobox; with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; use Dist::Zilla::File::FromCode; has filename => ( is => 'ro', isa => 'Str', default => 'cpanfile', ); sub _hunkify_hunky_hunk_hunks { my ($self, $indent, $type, $req) = @_; my $str = ''; for my $module (sort $req->required_modules) { my $vstr = $req->requirements_for_module($module); $str .= qq{$type "$module" => "$vstr";\n}; } $str =~ s/^/' ' x $indent/egm; return $str; } sub gather_files { my ($self, $arg) = @_; my $zilla = $self->zilla; my $file = Dist::Zilla::File::FromCode->new({ name => $self->filename, code => sub { my $prereqs = $zilla->prereqs; my @types = qw(requires recommends suggests conflicts); my @phases = qw(runtime build test configure develop); my $str = ''; for my $phase (@phases) { for my $type (@types) { my $req = $prereqs->requirements_for($phase, $type); next unless $req->required_modules; $str .= qq[\non '$phase' => sub {\n] unless $phase eq 'runtime'; $str .= $self->_hunkify_hunky_hunk_hunks( ($phase eq 'runtime' ? 0 : 1), $type, $req, ); $str .= qq[};\n] unless $phase eq 'runtime'; } } return $str; }, }); $self->add_file($file); return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::CPANFile - produce a cpanfile prereqs file =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin will add a F file to the distribution. =head1 ATTRIBUTES =head2 filename If given, parameter allows you to specify an alternate name for the generated file. It defaults, of course, to F. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Encoding.pm100644000766000024 445112257437015 21070 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Encoding; { $Dist::Zilla::Plugin::Encoding::VERSION = '5.008'; } # ABSTRACT: set the encoding of arbitrary files use Moose; with 'Dist::Zilla::Role::EncodingProvider'; use namespace::autoclean; sub mvp_multivalue_args { qw(filenames matches) } sub mvp_aliases { return { filename => 'filenames', match => 'matches' } } has encoding => ( is => 'ro', isa => 'Str', required => 1, ); has filenames => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); has matches => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); sub set_file_encodings { my ($self) = @_; # never match (at least the filename characters) my $matches_regex = qr/\000/; $matches_regex = qr/$matches_regex|$_/ for @{$self->matches}; # \A\Q$_\E should also handle the `eq` check $matches_regex = qr/$matches_regex|\A\Q$_\E/ for @{$self->filenames}; for my $file (@{$self->zilla->files}) { next unless $file->name =~ $matches_regex; $self->log_debug([ 'setting encoding of %s to %s', $file->name, $self->encoding, ]); $file->encoding($self->encoding); } return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::Encoding - set the encoding of arbitrary files =head1 VERSION version 5.008 =head1 SYNOPSIS This plugin allows you to explicitly set the encoding on some files in your distribution. You can either specify the exact set of files (with the "filenames" parameter) or provide the regular expressions to check (using "match"). In your F: [Encoding] encoding = Latin-3 filename = t/esperanto.t ; this file is Esperanto match = ^t/urkish/ ; these are all Turkish =head1 ATTRIBUTES =head2 encoding This is the encoding to set on the selected files. =head2 filenames This is an arrayref of filenames to have their encoding set. =head2 matches This is an arrayref of regular expressions. Any file whose name matches one of these regex will have its encoding set. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Manifest.pm100644000766000024 345712257437015 21115 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Manifest; { $Dist::Zilla::Plugin::Manifest::VERSION = '5.008'; } # ABSTRACT: build a MANIFEST file use Moose; use Moose::Autobox; with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; use Dist::Zilla::File::FromCode; sub __fix_filename { my ($name) = @_; return $name unless $name =~ /[ '\\]/; $name =~ s/\\/\\\\/g; $name =~ s/'/\\'/g; return qq{'$name'}; } sub gather_files { my ($self, $arg) = @_; my $zilla = $self->zilla; my $file = Dist::Zilla::File::FromCode->new({ name => 'MANIFEST', code => sub { my $generated_by = sprintf "%s v%s", ref($self), $self->VERSION || '(dev)'; return "# This file was automatically generated by $generated_by.\n" . $zilla->files->map(sub { $_->name }) ->sort->map( sub { __fix_filename($_) } )->join("\n") . "\n", }, }); $self->add_file($file); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::Manifest - build a MANIFEST file =head1 VERSION version 5.008 =head1 DESCRIPTION If included, this plugin will produce a F file for the distribution, listing all of the files it contains. For obvious reasons, it should be included as close to last as possible. This plugin is included in the L<@Basic|Dist::Zilla::PluginBundle::Basic> bundle. =head1 SEE ALSO Dist::Zilla core plugins: L<@Basic|Dist::Zilla::PluginBundle::Manifest>, L. Other modules: L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MetaJSON.pm100644000766000024 562212257437015 20723 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaJSON; { $Dist::Zilla::Plugin::MetaJSON::VERSION = '5.008'; } # ABSTRACT: produce a META.json use Moose; use Moose::Autobox; with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; use Dist::Zilla::File::FromCode; has filename => ( is => 'ro', isa => 'Str', default => 'META.json', ); has version => ( is => 'ro', isa => 'Num', default => '2', ); sub gather_files { my ($self, $arg) = @_; my $zilla = $self->zilla; require JSON; JSON->VERSION(2); require CPAN::Meta::Converter; CPAN::Meta::Converter->VERSION(2.101550); # improved downconversion require CPAN::Meta::Validator; CPAN::Meta::Validator->VERSION(2.101550); # improved downconversion my $file = Dist::Zilla::File::FromCode->new({ name => $self->filename, # RJBS and XDG didn't 100% agree on this, it's probably fine until somebody # comes up with a really good argument to change it (or to remove this # comment, settling the argument). -- rjbs, 2013-10-19 code_return_type => 'bytes', code => sub { my $distmeta = $zilla->distmeta; my $validator = CPAN::Meta::Validator->new($distmeta); unless ($validator->is_valid) { my $msg = "Invalid META structure. Errors found:\n"; $msg .= join( "\n", $validator->errors ); $self->log_fatal($msg); } my $converter = CPAN::Meta::Converter->new($distmeta); my $output = $converter->convert(version => $self->version); JSON->new->ascii(1)->canonical(1)->pretty->encode($output) . "\n"; }, }); $self->add_file($file); return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaJSON - produce a META.json =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin will add a F file to the distribution. This file is meant to replace the old-style F. For more information on this file, see L and L. =head1 ATTRIBUTES =head2 filename If given, parameter allows you to specify an alternate name for the generated file. It defaults, of course, to F. =head2 version This parameter lets you pick what version of the spec to use when generating the output. It defaults to 2 at present, but may be updated to new specs as they are released and adopted. If you want a fixed version, specify it. =head1 SEE ALSO Core Dist::Zilla plugins: L<@Basic|Dist::Zilla::PluginBundle::Basic>, L. Dist::Zilla roles: L. Other modules: L, L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MetaYAML.pm100644000766000024 551212257437015 20712 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaYAML; { $Dist::Zilla::Plugin::MetaYAML::VERSION = '5.008'; } # ABSTRACT: produce a META.yml use Moose; use Moose::Autobox; with 'Dist::Zilla::Role::FileGatherer'; use Try::Tiny; use namespace::autoclean; has filename => ( is => 'ro', isa => 'Str', default => 'META.yml', ); has version => ( is => 'ro', isa => 'Num', default => '1.4', ); sub gather_files { my ($self, $arg) = @_; require Dist::Zilla::File::FromCode; require YAML::Tiny; require CPAN::Meta::Converter; CPAN::Meta::Converter->VERSION(2.101550); # improved downconversion require CPAN::Meta::Validator; CPAN::Meta::Validator->VERSION(2.101550); # improved downconversion my $zilla = $self->zilla; my $file = Dist::Zilla::File::FromCode->new({ name => $self->filename, code_return_type => 'text', code => sub { my $distmeta = $zilla->distmeta; my $validator = CPAN::Meta::Validator->new($distmeta); unless ($validator->is_valid) { my $msg = "Invalid META structure. Errors found:\n"; $msg .= join( "\n", $validator->errors ); $self->log_fatal($msg); } my $converter = CPAN::Meta::Converter->new($distmeta); my $output = $converter->convert(version => $self->version); my $yaml = try { YAML::Tiny->new($output)->write_string; # text! } catch { $self->log_fatal("Could not create YAML string: " . YAML::Tiny->errstr) }; return $yaml; }, }); $self->add_file($file); return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaYAML - produce a META.yml =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin will add a F file to the distribution. For more information on this file, see L and L. =head1 ATTRIBUTES =head2 filename If given, parameter allows you to specify an alternate name for the generated file. It defaults, of course, to F. =head2 version This parameter lets you pick what version of the spec to use when generating the output. It defaults to 1.4, the most commonly supported version at present. B Once version 2 of the META file spec is more widely supported, this may default to 2. =head1 SEE ALSO Core Dist::Zilla plugins: L<@Basic|Dist::Zilla::PluginBundle::Basic>, L. Dist::Zilla roles: L. Other modules: L, L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ShareDir.pm100644000766000024 226412257437015 21043 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ShareDir; { $Dist::Zilla::Plugin::ShareDir::VERSION = '5.008'; } # ABSTRACT: install a directory's contents as "ShareDir" content use Moose; use namespace::autoclean; use Moose::Autobox; has dir => ( is => 'ro', isa => 'Str', default => 'share', ); sub find_files { my ($self) = @_; my $dir = $self->dir; my $files = $self->zilla->files->grep(sub { index($_->name, "$dir/") == 0 }); } sub share_dir_map { my ($self) = @_; my $files = $self->find_files; return unless @$files; return { dist => $self->dir }; } with 'Dist::Zilla::Role::ShareDir'; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::ShareDir - install a directory's contents as "ShareDir" content =head1 VERSION version 5.008 =head1 SYNOPSIS In your F: [ShareDir] dir = share If no C is provided, the default is F. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut AfterBuild.pm100644000766000024 166512257437015 21032 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::AfterBuild; { $Dist::Zilla::Role::AfterBuild::VERSION = '5.008'; } # ABSTRACT: something that runs after building is mostly complete use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'after_build'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::AfterBuild - something that runs after building is mostly complete =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called once all the files have been written out. It is passed a hashref with the following data: build_root - the directory in which the dist was built =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut BeforeMint.pm100644000766000024 147612257437015 21043 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BeforeMint; { $Dist::Zilla::Role::BeforeMint::VERSION = '5.008'; } # ABSTRACT: something that runs before minting really begins use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'before_mint'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::BeforeMint - something that runs before minting really begins =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called before any other plugins are consulted. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut FileFinder.pm100644000766000024 335012257437015 21011 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileFinder; { $Dist::Zilla::Role::FileFinder::VERSION = '5.008'; } # ABSTRACT: something that finds files within the distribution use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; use Moose::Autobox; requires 'find_files'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::FileFinder - something that finds files within the distribution =head1 VERSION version 5.008 =head1 DESCRIPTION A FileFinder plugin locates files within the distribution. This role exists so that sets of files can be easily described in one configuration section and then used by one or more other plugin. Plugins implementing this role must provide a C method which will be called with no arguments and must return an arrayref of files. (This arrayref should not be re-used, as it may be altered once returned.) For example, imagine a simple glob-like FileFinder that expects configuration like this: [Glob / RootModules] glob = *.pm This sets up a FileFinder named "RootModules" which will contain all F files in the root directory. Another plugin that knows how to use FileFinder plugins might be configured like this: [ModuleRelocator] finder = RootModules relocate_to = attic Finders may operate on any rules they like, checking file size, content, name, or other properties. They should re-perform their "finding" on each call to C as the files in the distribution may have changed. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut FileMunger.pm100644000766000024 305512257437015 21041 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileMunger; { $Dist::Zilla::Role::FileMunger::VERSION = '5.008'; } # ABSTRACT: something that alters a file's destination or content use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; use Moose::Autobox; sub munge_files { my ($self) = @_; $self->log_fatal("no munge_file behavior implemented!") unless $self->can('munge_file'); $self->munge_file($_) for grep { ! $_->is_bytes } $self->zilla->files->flatten; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::FileMunger - something that alters a file's destination or content =head1 VERSION version 5.008 =head1 DESCRIPTION A FileMunger has an opportunity to mess around with each file that will be included in the distribution. Each FileMunger's C method is called once. By default, this method will just call the C method (note the missing terminal 's') once for each file, excluding files with an encoding attribute of 'bytes'. The C method is expected to change attributes about the file before it is written out to the built distribution. If you want to modify all files (including ones with an encoding of 'bytes') or want to select a more limited set of files, you can provide your own C method. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut FilePruner.pm100644000766000024 175112257437015 21060 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FilePruner; { $Dist::Zilla::Role::FilePruner::VERSION = '5.008'; } # ABSTRACT: something that removes found files from the distribution use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'prune_files'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::FilePruner - something that removes found files from the distribution =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing FilePruner have their C method called once all the L plugins have been called. They are expected to (optionally) remove files from the list of files to be included in the distribution. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut TestRunner.pm100644000766000024 164312257437015 21116 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::TestRunner; { $Dist::Zilla::Role::TestRunner::VERSION = '5.008'; } # ABSTRACT: something used as a delegating agent to 'dzil test' use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'test'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::TestRunner - something used as a delegating agent to 'dzil test' =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called when testing. It's passed the root directory of the build test dir. =head1 METHODS =head2 test This method should throw an exception on failure. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Util000755000766000024 012257437015 16317 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaAuthorDeps.pm100644000766000024 673512257437015 21106 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Utiluse strict; use warnings; package Dist::Zilla::Util::AuthorDeps; { $Dist::Zilla::Util::AuthorDeps::VERSION = '5.008'; } # ABSTRACT: Utils for listing your distribution's author dependencies use Dist::Zilla::Util; use Path::Class; use List::MoreUtils (); sub format_author_deps { my ($reqs, $versions) = @_; my $formatted = ''; foreach my $rec (@{ $reqs }) { my ($mod, $ver) = each(%{ $rec }); $formatted .= $versions ? "$mod = $ver\n" : "$mod\n"; } chomp($formatted); return $formatted; } sub extract_author_deps { my ($root, $missing) = @_; my $ini = $root->file('dist.ini'); die "dzil authordeps only works on dist.ini files, and you don't have one\n" unless -e $ini; my $fh = $ini->openr; binmode($fh, ":encoding(UTF-8)"); require Config::INI::Reader; my $config = Config::INI::Reader->read_handle($fh); require CPAN::Meta::Requirements; my $reqs = CPAN::Meta::Requirements->new; my @packs = map { s/\s.*//; $_ } grep { $_ ne '_' } keys %$config; foreach my $pack (@packs) { my $version = 0; if(exists $config->{$pack} && exists $config->{$pack}->{':version'}) { $version = $config->{$pack}->{':version'}; } my $realname = Dist::Zilla::Util->expand_config_package_name($pack); $reqs->add_minimum($realname => $version); } seek $fh, 0, 0; my $in_filter = 0; while (<$fh>) { next unless $in_filter or /^\[\s*\@Filter/; $in_filter = 0, next if /^\[/ and ! /^\[\s*\@Filter/; $in_filter = 1; next unless /\A-bundle\s*=\s*([^;\s]+)/; my $pname = $1; chomp($pname); $reqs->add_minimum(Dist::Zilla::Util->expand_config_package_name($1) => 0) } seek $fh, 0, 0; my @packages; while (<$fh>) { chomp; next unless /\A\s*;\s*authordep\s*(\S+)\s*(=\s*(\S+))?\s*\z/; my $ver = defined $3 ? $3 : "0"; # Any "; authordep " is inserted at the beginning of the list # in the file order so the user can control the order of at least a part of # the plugin list push @packages, $1; # And added to the requirements so we can use it later $reqs->add_minimum($1 => $ver); } my $vermap = $reqs->as_string_hash; # Add the other requirements push(@packages, sort keys %{ $vermap }); # Move inc:: first in list as they may impact the loading of other # plugins (in particular local ones). # Also order inc:: so that those that want to hack @INC with inc:: plugins # can have a consistent playground. # We don't sort the others packages to preserve the same (random) ordering # for the common case (no inc::, no '; authordep') as in previous dzil # releases. @packages = ((sort grep /^inc::/, @packages), (grep !/^inc::/, @packages)); # Now that we have a sorted list of packages, use that to build an array of # hashrefs for display. require List::MoreUtils; require Class::Load; my @final = map { { $_ => $vermap->{$_} } } grep { $missing ? (! Class::Load::try_load_class($_, ($vermap->{$_} ? {-version => $vermap->{$_}} : ()))) : 1 } List::MoreUtils::uniq @packages; return \@final; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Util::AuthorDeps - Utils for listing your distribution's author dependencies =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut bin000755000766000024 012257437015 20156 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/AutoPrereqsfoobar100644000766000024 31312257437015 21466 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/AutoPrereqs/bin#!/usr/bin/perl use strict; use warnings; use lib 'mylib'; # require in a script use DZPA::ScriptUse; # module shipped by dist use DZPA::Main; # DZPA::Skip should be trimmed require DZPA::Skip::Foo; t000755000766000024 012257437015 17651 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/AutoPrereqsdata.bin100644000766000024 3412257437015 21351 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/AutoPrereqs/tpretend this is binary, OK? lib000755000766000024 012257437015 17720 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ-NonAsciiDZ1.pm100644000766000024 20312257437015 20767 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZ-NonAscii/libuse strict; use warnings; package DZ1; # ABSTRACT: this is a sample package for testing Dist::Zilla; sub main { return 1; } 1; test.pm100644000766000024 453612257437015 21165 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::test; { $Dist::Zilla::App::Command::test::VERSION = '5.008'; } # ABSTRACT: test your dist use Dist::Zilla::App -command; sub opt_spec { [ 'release' => 'enables the RELEASE_TESTING env variable', { default => 0 } ], [ 'automated' => 'enables the AUTOMATED_TESTING env variable', { default => 0 } ], [ 'author!' => 'enables the AUTHOR_TESTING env variable (default behavior)', { default => 1 } ], [ 'all' => 'enables the RELEASE_TESTING, AUTOMATED_TESTING and AUTHOR_TESTING env variables', { default => 0 } ], [ 'keep-build-dir|keep' => 'keep the build directory even after a success' ], } sub abstract { 'test your dist' } sub execute { my ($self, $opt, $arg) = @_; local $ENV{RELEASE_TESTING} = 1 if $opt->release or $opt->all; local $ENV{AUTHOR_TESTING} = 1 if $opt->author or $opt->all; local $ENV{AUTOMATED_TESTING} = 1 if $opt->automated or $opt->all; $self->zilla->test({ $opt->keep_build_dir ? (keep_build_dir => 1) : (), }); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::test - test your dist =head1 VERSION version 5.008 =head1 SYNOPSIS dzil test [ --release ] [ --no-author ] [ --automated ] [ --all ] =head1 DESCRIPTION This command is a thin wrapper around the L method in Dist::Zilla. It builds your dist and runs the tests with the AUTHOR_TESTING environment variable turned on, so it's like doing this: export AUTHOR_TESTING=1 dzil build --no-tgz cd $BUILD_DIRECTORY perl Makefile.PL make make test A build that fails tests will be left behind for analysis, and F will exit a non-zero value. If the tests are successful, the build directory will be removed and F will exit with status 0. =head1 OPTIONS =head2 --release This will run the test suite with RELEASE_TESTING=1 =head2 --automated This will run the test suite with AUTOMATED_TESTING=1 =head2 --no-author This will run the test suite without setting AUTHOR_TESTING =head2 --all Equivalent to --release --automated --author =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut GatherDir.pm100644000766000024 1150112257437015 21225 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::GatherDir; { $Dist::Zilla::Plugin::GatherDir::VERSION = '5.008'; } # ABSTRACT: gather all the files in a directory use Moose; use Moose::Autobox; use MooseX::Types::Path::Class qw(Dir File); with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; use File::Find::Rule; use File::HomeDir; use File::Spec; use Path::Class; use namespace::autoclean; has root => ( is => 'ro', isa => Dir, lazy => 1, coerce => 1, required => 1, default => sub { shift->zilla->root }, ); has prefix => ( is => 'ro', isa => 'Str', default => '', ); has include_dotfiles => ( is => 'ro', isa => 'Bool', default => 0, ); has follow_symlinks => ( is => 'ro', isa => 'Bool', default => 0, ); sub mvp_multivalue_args { qw(exclude_filename exclude_match) } has exclude_filename => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); has exclude_match => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); sub gather_files { my ($self) = @_; my $exclude_regex = qr/\000/; $exclude_regex = qr/$exclude_regex|$_/ for ($self->exclude_match->flatten); my %is_excluded = map {; $_ => 1 } $self->exclude_filename->flatten; my $root = "" . $self->root; $root =~ s{^~([\\/])}{File::HomeDir->my_home . $1}e; $root = Path::Class::dir($root); my $rule = File::Find::Rule->new(); $rule->extras({follow => $self->follow_symlinks}); FILE: for my $filename ($rule->file->in($root)) { my $file = file($filename)->relative($root); unless ($self->include_dotfiles) { next FILE if $file->basename =~ qr/^\./; next FILE if grep { /^\.[^.]/ } $file->dir->dir_list; } next if $file =~ $exclude_regex; next if $is_excluded{ $file }; # _file_from_filename is overloaded in GatherDir::Template my $fileobj = $self->_file_from_filename($filename); $file = Path::Class::file($self->prefix, $file) if $self->prefix; $fileobj->name($file->as_foreign('Unix')->stringify); $self->add_file($fileobj); } return; } sub _file_from_filename { my ($self, $filename) = @_; return Dist::Zilla::File::OnDisk->new({ name => $filename, mode => (stat $filename)[2] & 0755, # kill world-writeability }); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::GatherDir - gather all the files in a directory =head1 VERSION version 5.008 =head1 DESCRIPTION This is a very, very simple L plugin. It looks in the directory named in the L attribute and adds all the files it finds there. If the root begins with a tilde, the tilde is replaced with the current user's home directory according to L. Almost every dist will be built with one GatherDir plugin, since it's the easiest way to get files from disk into your dist. Most users just need: [GatherDir] ...and this will pick up all the files from the current directory into the dist. You can use it multiple times, as you can any other plugin, by providing a plugin name. For example, if you want to include external specification files into a subdir of your dist, you might write: [GatherDir] ; this plugin needs no config and gathers most of your files [GatherDir / SpecFiles] ; this plugin gets all the files in the root dir and adds them under ./spec root = ~/projects/my-project/spec prefix = spec =head1 ATTRIBUTES =head2 root This is the directory in which to look for files. If not given, it defaults to the dist root -- generally, the place where your F or other configuration file is located. =head2 prefix This parameter can be set to place the gathered files under a particular directory. See the L above for an example. =head2 include_dotfiles By default, files will not be included if they begin with a dot. This goes both for files and for directories relative to the C. In almost all cases, the default value (false) is correct. =head2 follow_symlinks By default, directories that are symlinks will not be followed. Note on the other hand that in all followed directories, files which are symlinks are always gathered. =head2 exclude_filename To exclude certain files from being gathered, use the C option. This may be used multiple times to specify multiple files to exclude. =head2 exclude_match This is just like C but provides a regular expression pattern. Files matching the pattern are not gathered. This may be used multiple times to specify multiple patterns to exclude. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MakeMaker.pm100644000766000024 2014212257437015 21212 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MakeMaker; { $Dist::Zilla::Plugin::MakeMaker::VERSION = '5.008'; } # ABSTRACT: build a Makefile.PL that uses ExtUtils::MakeMaker use Moose; use Moose::Autobox; use namespace::autoclean; use Config; use CPAN::Meta::Requirements 2.121; # requirements_for_module use List::MoreUtils qw(any uniq); use Dist::Zilla::File::InMemory; use Dist::Zilla::Plugin::MakeMaker::Runner; has eumm_version => ( isa => 'Str', is => 'rw', default => '6.30', ); has 'make_path' => ( isa => 'Str', is => 'ro', default => $Config{make} || 'make', ); has '_runner' => ( is => 'ro', lazy => 1, handles => [qw(build test)], default => sub { my ($self) = @_; Dist::Zilla::Plugin::MakeMaker::Runner->new({ zilla => $self->zilla, plugin_name => $self->plugin_name . '::Runner', make_path => $self->make_path, }); }, ); # This is here, rather than at the top, so that the "build" and "test" methods # will exist, as they are required by BuildRunner and TestRunner respectively. # I had originally fixed this with stub methods, but stub methods to not behave # properly with this use case until Moose 2.0300. -- rjbs, 2012-02-08 with qw( Dist::Zilla::Role::BuildRunner Dist::Zilla::Role::InstallTool Dist::Zilla::Role::PrereqSource Dist::Zilla::Role::TestRunner Dist::Zilla::Role::TextTemplate ); my $template = q! # This file was automatically generated by {{ $generated_by }}. use strict; use warnings; {{ $perl_prereq ? qq[use $perl_prereq;] : ''; }} use ExtUtils::MakeMaker {{ $eumm_version }}; {{ $share_dir_code{preamble} || '' }} my {{ $WriteMakefileArgs }} my {{ $fallback_prereqs }} unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); {{ $share_dir_code{postamble} || '' }} !; sub register_prereqs { my ($self) = @_; $self->zilla->register_prereqs( { phase => 'configure' }, 'ExtUtils::MakeMaker' => $self->eumm_version, ); return unless keys %{ $self->zilla->_share_dir_map }; $self->zilla->register_prereqs( { phase => 'configure' }, 'File::ShareDir::Install' => 0.03, ); } sub share_dir_code { my ($self) = @_; my $share_dir_code = {}; my $share_dir_map = $self->zilla->_share_dir_map; if ( keys %$share_dir_map ) { my $preamble = qq{use File::ShareDir::Install;\n}; if ( my $dist_share_dir = $share_dir_map->{dist} ) { $dist_share_dir = quotemeta $dist_share_dir; $preamble .= qq{install_share dist => "$dist_share_dir";\n}; } if ( my $mod_map = $share_dir_map->{module} ) { for my $mod ( keys %$mod_map ) { my $mod_share_dir = quotemeta $mod_map->{$mod}; $preamble .= qq{install_share module => "$mod", "$mod_share_dir";\n}; } } $share_dir_code->{preamble} = $preamble; $share_dir_code->{postamble} = qq{\{\npackage\nMY;\nuse File::ShareDir::Install qw(postamble);\n\}\n}; } return $share_dir_code; } sub write_makefile_args { my ($self) = @_; (my $name = $self->zilla->name) =~ s/-/::/g; my @exe_files = $self->zilla->find_files(':ExecFiles')->map(sub { $_->name })->flatten; $self->log_fatal("can't install files with whitespace in their names") if grep { /\s/ } @exe_files; my %test_dirs; for my $file ($self->zilla->files->flatten) { next unless $file->name =~ m{\At/.+\.t\z}; (my $dir = $file->name) =~ s{/[^/]+\.t\z}{/*.t}g; $test_dirs{ $dir } = 1; } my $prereqs = $self->zilla->prereqs; my $perl_prereq = $prereqs->requirements_for(qw(runtime requires)) ->clone ->add_requirements($prereqs->requirements_for(qw(build requires))) ->as_string_hash->{perl}; $perl_prereq = version->parse($perl_prereq)->numify if $perl_prereq; my $prereqs_dump = sub { $prereqs->requirements_for(@_) ->clone ->clear_requirement('perl') ->as_string_hash; }; my $build_prereq = $prereqs->requirements_for(qw(build requires)) ->clone ->clear_requirement('perl') ->as_string_hash; my $test_prereq = $prereqs->requirements_for(qw(test requires)) ->clone ->clear_requirement('perl') ->as_string_hash; my %write_makefile_args = ( DISTNAME => $self->zilla->name, NAME => $name, AUTHOR => $self->zilla->authors->join(q{, }), ABSTRACT => $self->zilla->abstract, VERSION => $self->zilla->version, LICENSE => $self->zilla->license->meta_yml_name, EXE_FILES => [ @exe_files ], CONFIGURE_REQUIRES => $prereqs_dump->(qw(configure requires)), BUILD_REQUIRES => $build_prereq, TEST_REQUIRES => $test_prereq, PREREQ_PM => $prereqs_dump->(qw(runtime requires)), test => { TESTS => join q{ }, sort keys %test_dirs }, ); $write_makefile_args{MIN_PERL_VERSION} = $perl_prereq if $perl_prereq; return \%write_makefile_args; } sub _dump_as { my ($self, $ref, $name) = @_; require Data::Dumper; my $dumper = Data::Dumper->new( [ $ref ], [ $name ] ); $dumper->Sortkeys( 1 ); $dumper->Indent( 1 ); $dumper->Useqq( 1 ); return $dumper->Dump; } sub fallback_prereq_pm { my $self = shift; my $fallback = $self->zilla->prereqs->merged_requires ->clone ->clear_requirement('perl') ->as_string_hash; return $self->_dump_as( $fallback, '*FallbackPrereqs' ); } sub setup_installer { my ($self, $arg) = @_; my $write_makefile_args = $self->write_makefile_args; $self->__write_makefile_args($write_makefile_args); # save for testing my $perl_prereq = delete $write_makefile_args->{MIN_PERL_VERSION}; my $dumped_args = $self->_dump_as($write_makefile_args, '*WriteMakefileArgs'); my $content = $self->fill_in_string( $template, { eumm_version => \($self->eumm_version), perl_prereq => \$perl_prereq, share_dir_code => $self->share_dir_code, fallback_prereqs => \($self->fallback_prereq_pm), WriteMakefileArgs => \$dumped_args, generated_by => \sprintf("%s v%s", ref($self), $self->VERSION || '(dev)'), }, ); my $file = Dist::Zilla::File::InMemory->new({ name => 'Makefile.PL', content => $content, }); $self->add_file($file); return; } # XXX: Just here to facilitate testing. -- rjbs, 2010-03-20 has __write_makefile_args => ( is => 'rw', isa => 'HashRef', ); __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MakeMaker - build a Makefile.PL that uses ExtUtils::MakeMaker =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin will produce an L-powered F for the distribution. If loaded, the L plugin should also be loaded. =head1 ATTRIBUTES =head2 eumm_version This option declares the version of ExtUtils::MakeMaker required to configure and build the distribution. It defaults to 6.30, which ensures a working C. It can be safely set to earlier versions, although I. =head2 make_path This option sets the path to F, used to build your dist and run tests. It defaults to the value for C in L, or to C if that isn't set. You probably won't need to set this option. =head1 SEE ALSO Core Dist::Zilla plugins: L<@Basic|Dist::Zilla::PluginBundle::Basic>, L, L. Dist::Zilla roles: L, L, L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MetaTests.pm100644000766000024 353212257437015 21252 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaTests; { $Dist::Zilla::Plugin::MetaTests::VERSION = '5.008'; } # ABSTRACT: common extra tests for META.yml use Moose; extends 'Dist::Zilla::Plugin::InlineFiles'; with 'Dist::Zilla::Role::PrereqSource'; use namespace::autoclean; # Register the release test prereq as a "develop requires" # so it will be listed in "dzil listdeps --author" sub register_prereqs { my ($self) = @_; $self->zilla->register_prereqs( { phase => 'develop', type => 'requires', }, 'Test::CPAN::Meta' => 0, ); } __PACKAGE__->meta->make_immutable; 1; =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaTests - common extra tests for META.yml =head1 VERSION version 5.008 =head1 DESCRIPTION This is an extension of L, providing the following files: xt/release/meta-yaml.t - a standard Test::CPAN::Meta test Note that this test doesn't actually do anything unless you have L installed. L will be added as a C dependency. =head1 SEE ALSO Core Dist::Zilla plugins: L, L, L, L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __DATA__ ___[ xt/release/distmeta.t ]___ #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::More; eval "use Test::CPAN::Meta"; plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; meta_yaml_ok(); BeforeBuild.pm100644000766000024 150512257437015 21164 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BeforeBuild; { $Dist::Zilla::Role::BeforeBuild::VERSION = '5.008'; } # ABSTRACT: something that runs before building really begins use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'before_build'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::BeforeBuild - something that runs before building really begins =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called before any other plugins are consulted. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut BuildRunner.pm100644000766000024 167412257437015 21242 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BuildRunner; { $Dist::Zilla::Role::BuildRunner::VERSION = '5.008'; } # ABSTRACT: something used as a delegating agent during 'dzil run' use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'build'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::BuildRunner - something used as a delegating agent during 'dzil run' =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called during C. It's passed the root directory of the build test dir. =head1 REQUIRED METHODS =head2 build This method will throw an exception on failure. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut InstallTool.pm100644000766000024 224412257437015 21247 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::InstallTool; { $Dist::Zilla::Role::InstallTool::VERSION = '5.008'; } # ABSTRACT: something that creates an install program for a dist use Moose::Role; with qw( Dist::Zilla::Role::Plugin Dist::Zilla::Role::FileInjector ); use namespace::autoclean; use Moose::Autobox; requires 'setup_installer'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::InstallTool - something that creates an install program for a dist =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing InstallTool have their C method called to inject files after all other file injection and munging has taken place. They're expected to produce files needed to make the distribution installable, like F or F and add them with the C method provided by L, which is also composed by this role. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ModuleMaker.pm100644000766000024 223512257437015 21210 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::ModuleMaker; { $Dist::Zilla::Role::ModuleMaker::VERSION = '5.008'; } # ABSTRACT: something that injects module files into the dist use Moose::Role; with qw( Dist::Zilla::Role::Plugin Dist::Zilla::Role::FileInjector ); use namespace::autoclean; requires 'make_module'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::ModuleMaker - something that injects module files into the dist =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called for each module requesting creation by the plugin with this name. It is passed a hashref with the following data: name - the name of the module to make (a MooseX::Types::Perl::ModuleName) Classes composing this role also compose L and are expected to inject a file for the module being created. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MutableFile.pm100644000766000024 715412257437015 21201 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::MutableFile; { $Dist::Zilla::Role::MutableFile::VERSION = '5.008'; } # ABSTRACT: something that can act like a file with changeable contents use Moose::Role; use Moose::Util::TypeConstraints; use MooseX::SetOnce; use namespace::autoclean; with 'Dist::Zilla::Role::File'; sub encoding; has encoding => ( is => 'rw', isa => 'Str', lazy => 1, default => 'UTF-8', traits => [ qw(SetOnce) ], ); has _content => ( is => 'rw', isa => 'Str', lazy => 1, builder => '_build_content', clearer => 'clear_content', predicate => 'has_content', ); sub content { my $self = shift; if ( ! @_ ) { # if we have it or we're tasked to provide it, return it (possibly lazily # generated from a builder); otherwise, get it from the encoded_content if ( $self->has_content || $self->_content_source eq 'content' ) { return $self->_content; } else { return $self->_content($self->_decode($self->encoded_content)); } } else { my ($pkg, undef, $line) = caller; $self->_update_by('content', sprintf( "%s line %s", $pkg, $line)); $self->clear_encoded_content; return $self->_content(@_); } } has _encoded_content => ( is => 'rw', isa => 'Str', lazy => 1, builder => '_build_encoded_content', clearer => 'clear_encoded_content', predicate => 'has_encoded_content', ); sub encoded_content { my $self = shift; if ( ! @_ ) { # if we have it or we're tasked to provide it, return it (possibly lazily # generated from a builder); otherwise, get it from the content if ($self->has_encoded_content || $self->_content_source eq 'encoded_content') { return $self->_encoded_content; } else { return $self->_encoded_content($self->_encode($self->content)); } } my ($pkg, undef, $line) = caller; $self->_update_by('encoded_content', sprintf( "%s line %s", $pkg, $line)); $self->clear_content; $self->_encoded_content(@_); } has _content_source => ( is => 'rw', isa => enum([qw/content encoded_content/]), lazy => 1, builder => '_build_content_source', ); sub _update_by { my ($self, $attr, $from) = @_; $self->_content_source($attr); $self->_set_added_by($from); } around 'added_by' => sub { my ($orig, $self) = @_; return sprintf("%s set by %s", $self->_content_source, $self->$orig); }; # we really only need one of these and only if _content or _encoded_content # isn't provided, but roles can't do that, so we'll insist on both just in case # and let classes provide stubs if they provide _content or _encoded_content # another way requires '_build_content'; requires '_build_encoded_content'; # we need to know the content source so we know where we might need to rely on # lazy loading to give us content. It should be set by the class if there is a # class-wide default or just stubbed if a BUILD modifier sets it per-object. requires '_build_content_source'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::MutableFile - something that can act like a file with changeable contents =head1 VERSION version 5.008 =head1 DESCRIPTION This role describes a file whose contents may be modified =head1 ATTRIBUTES =head2 encoding Default is 'UTF-8'. Can only be set once. =head2 content =head2 encoded_content =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Stash000755000766000024 012257437015 17365 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/RoleLogin.pm100644000766000024 143012257437015 21131 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Role/Stashpackage Dist::Zilla::Role::Stash::Login; { $Dist::Zilla::Role::Stash::Login::VERSION = '5.008'; } use Moose::Role; with 'Dist::Zilla::Role::Stash'; # ABSTRACT: a stash with username/password credentials use namespace::autoclean; requires 'username'; requires 'password'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::Stash::Login - a stash with username/password credentials =head1 VERSION version 5.008 =head1 OVERVIEW A Login stash must provide a C and C method. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut build.pm100644000766000024 410312257437015 21273 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::build; { $Dist::Zilla::App::Command::build::VERSION = '5.008'; } # ABSTRACT: build your dist use Dist::Zilla::App -command; sub abstract { 'build your dist' } sub opt_spec { [ 'trial' => 'build a trial release that PAUSE will not index' ], [ 'tgz!' => 'build a tarball (default behavior)', { default => 1 } ], [ 'in=s' => 'the directory in which to build the distribution' ] } sub execute { my ($self, $opt, $args) = @_; if ($opt->in) { $self->zilla->build_in($opt->in); } else { my $method = $opt->tgz ? 'build_archive' : 'build'; my $zilla = $self->zilla; $zilla->is_trial(1) if $opt->trial; $zilla->$method; } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::build - build your dist =head1 VERSION version 5.008 =head1 SYNOPSIS dzil build [ --trial ] [ --tgz | --no-tgz ] [ --in /path/to/build/dir ] =head1 DESCRIPTION This command is a very thin layer over the Dist::Zilla C method, which does all the things required to build your distribution. By default, it will also archive your distribution and leave you with a complete, ready-to-release distribution tarball. =head1 EXAMPLE $ dzil build $ dzil build --no-tgz $ dzil build --in /path/to/build/dir =head1 OPTIONS =head2 --trial This will build a trial distribution. Among other things, it will generally mean that the built tarball's basename ends in F<-TRIAL>. =head2 --tgz | --no-tgz Builds a .tar.gz in your project directory after building the distribution. --tgz behaviour is by default, use --no-tgz to disable building an archive. =head2 --in Specifies the directory into which the distribution should be built. If necessary, the directory will be created. An archive will not be created. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut clean.pm100644000766000024 246712257437015 21271 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::clean; { $Dist::Zilla::App::Command::clean::VERSION = '5.008'; } # ABSTRACT: clean up after build, test, or install use Dist::Zilla::App -command; sub opt_spec { [ 'dry-run|n' => 'don\'t actually remove anything, just show what would be done' ], } sub abstract { 'clean up after build, test, or install' } sub execute { my ($self, $opt, $arg) = @_; $self->zilla->clean($opt->dry_run); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::clean - clean up after build, test, or install =head1 VERSION version 5.008 =head1 SYNOPSIS dzil clean [ --dry-run|-n ] This command removes some files that are created during build, test, and install. It's a very thin layer over the C> method on the Dist::Zilla object. The documentation for that method gives more information about the files that will be removed. =head1 OPTIONS =head2 -n, --dry-run Nothing is removed; instead, everything that would be removed will be listed. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut setup.pm100644000766000024 743612257437015 21350 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::setup; { $Dist::Zilla::App::Command::setup::VERSION = '5.008'; } # ABSTRACT: set up a basic global config file use Dist::Zilla::App -command; use autodie; sub abstract { 'set up a basic global config file' } sub validate_args { my ($self, $opt, $args) = @_; $self->usage_error('too many arguments') if @$args != 0; } sub execute { my ($self, $opt, $arg) = @_; my $chrome = $self->app->chrome; my $config_root = Dist::Zilla::Util->_global_config_root; if ( -d $config_root and my @files = grep { -f and $_->basename =~ /\Aconfig\.[^.]+\z/ } $config_root->children ) { $chrome->logger->log_fatal([ "per-user configuration files already exist in %s: %s", "$config_root", join(q{, }, @files), ]); return unless $chrome->prompt_yn("Continue anyway?", { default => 0 }); } my $realname = $chrome->prompt_str( "What's your name? ", { check => sub { defined $_[0] and $_[0] =~ /\S/ } }, ); my $email = $chrome->prompt_str( "What's your email address? ", { check => sub { defined $_[0] and $_[0] =~ /\A\S+\@\S+\z/ } }, ); my $c_holder = $chrome->prompt_str( "Who, by default, holds the copyright on your code? ", { check => sub { defined $_[0] and $_[0] =~ /\S/ }, default => $realname, }, ); my $license = $chrome->prompt_str( "What license will you use by default (Perl_5, BSD, etc.)? ", { default => 'Perl_5', check => sub { my $str = String::RewritePrefix->rewrite( { '' => 'Software::License::', '=' => '' }, $_[0], ); return Params::Util::_CLASS($str) && eval "require $str; 1"; }, }, ); my %pause; if ( $chrome->prompt_yn( 'Do you want to enter your PAUSE account details? ', { default => 0 }, ) ) { my $default_pause; if ($email =~ /\A(.+?)\@cpan\.org\z/i) { $default_pause = uc $1; } $pause{username} = $chrome->prompt_str( "What is your PAUSE id? ", { check => sub { defined $_[0] and $_[0] =~ /\A\w+\z/ }, default => $default_pause, }, ); $pause{password} = $chrome->prompt_str( "What is your PAUSE password? ", { check => sub { defined $_[0] and length $_[0] }, noecho => 1, }, ); } $config_root->mkpath unless -d $config_root; my $umask = umask; umask( $umask | 077 ); # this file might contain PAUSE pw; make it go-r open my $fh, '>:encoding(UTF-8)', $config_root->file('config.ini'); $fh->print("[%User]\n"); $fh->print("name = $realname\n"); $fh->print("email = $email\n\n"); $fh->print("[%Rights]\n"); $fh->print("license_class = $license\n"); $fh->print("copyright_holder = $c_holder\n\n"); if (keys %pause) { $fh->print("[%PAUSE]\n"); $fh->print("username = $pause{username}\n"); if (defined $pause{password} and length $pause{password}) { $fh->print("password = $pause{password}\n"); } $fh->print("\n"); } close $fh; umask $umask; $self->log("config.ini file created!"); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::setup - set up a basic global config file =head1 VERSION version 5.008 =head1 SYNOPSIS $ dzil setup Enter your name> Ricardo Signes ... Dist::Zilla looks for per-user configuration in F<~/.dzil/config.ini>. This command prompts the user for some basic information that can be used to produce the most commonly needed F sections. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut smoke.pm100644000766000024 407012257437015 21315 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::smoke; { $Dist::Zilla::App::Command::smoke::VERSION = '5.008'; } # ABSTRACT: smoke your dist use Dist::Zilla::App -command; sub opt_spec { [ 'release' => 'enables the RELEASE_TESTING env variable', { default => 0 } ], [ 'automated!' => 'enables the AUTOMATED_TESTING env variable (default behavior)', { default => 1 } ], [ 'author' => 'enables the AUTHOR_TESTING env variable', { default => 0 } ] } sub abstract { 'smoke your dist' } sub execute { my ($self, $opt, $arg) = @_; local $ENV{RELEASE_TESTING} = 1 if $opt->release; local $ENV{AUTHOR_TESTING} = 1 if $opt->author; local $ENV{AUTOMATED_TESTING} = 1 if $opt->automated; $self->zilla->test; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::smoke - smoke your dist =head1 VERSION version 5.008 =head1 SYNOPSIS dzil smoke [ --release ] [ --author ] [ --no-automated ] =head1 DESCRIPTION This command builds and tests the distribution in "smoke testing mode." This command is a thin wrapper around the L method in Dist::Zilla. It builds your dist and runs the tests with the AUTOMATED_TESTING environment variable turned on, so it's like doing this: export AUTOMATED_TESTING=1 dzil build --no-tgz cd $BUILD_DIRECTORY perl Makefile.PL make make test A build that fails tests will be left behind for analysis, and F will exit a non-zero value. If the tests are successful, the build directory will be removed and F will exit with status 0. =head1 OPTIONS =head2 --release This will run the test suite with RELEASE_TESTING=1 =head2 --no-automated This will run the test suite without setting AUTOMATED_TESTING =head2 --author This will run the test suite with AUTHOR_TESTING=1 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Finder.pm100644000766000024 151312257437015 21153 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/MVP/Readerpackage Dist::Zilla::MVP::Reader::Finder; { $Dist::Zilla::MVP::Reader::Finder::VERSION = '5.008'; } use Moose; use Config::MVP::Reader 2.101540; # if_none extends 'Config::MVP::Reader::Finder'; # ABSTRACT: the reader for dist.ini files use namespace::autoclean; use Dist::Zilla::MVP::Assembler; sub default_search_path { return qw(Dist::Zilla::MVP::Reader Config::MVP::Reader); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::MVP::Reader::Finder - the reader for dist.ini files =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut AutoPrereq.pm100644000766000024 211112257437015 21420 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::AutoPrereq; { $Dist::Zilla::Plugin::AutoPrereq::VERSION = '5.008'; } use Moose; extends 'Dist::Zilla::Plugin::AutoPrereqs'; # ABSTRACT: (DEPRECATED) the old name for Dist::Zilla::Plugin::AutoPrereqs use namespace::autoclean; before register_component => sub { die "[AutoPrereq] will be removed in Dist::Zilla v5; replace it with [AutoPrereqs] (note the 's')\n" if Dist::Zilla->VERSION >= 5; warn "!!! [AutoPrereq] will be removed in Dist::Zilla v5; replace it with [AutoPrereqs] (note the 's')\n"; }; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::AutoPrereq - (DEPRECATED) the old name for Dist::Zilla::Plugin::AutoPrereqs =head1 VERSION version 5.008 =head1 SEE ALSO L =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ExtraTests.pm100644000766000024 424012257437015 21444 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ExtraTests; { $Dist::Zilla::Plugin::ExtraTests::VERSION = '5.008'; } # ABSTRACT: rewrite ./xt tests to ./t tests with skips use Moose; with 'Dist::Zilla::Role::FileMunger'; use namespace::autoclean; sub munge_file { my ($self, $file) = @_; return unless $file->name =~ m{\Axt/(smoke|author|release)/.+\.t\z}; my $method = "_rewrite_$1\_test"; $self->log("rewriting $1 test " . $file->name); $self->$method($file); } sub _rewrite_smoke_test { my ($self, $file) = @_; $self->_rewrite($file, 'AUTOMATED_TESTING', '"smoke bot" testing'); } sub _rewrite_author_test { my ($self, $file) = @_; $self->_rewrite($file, 'AUTHOR_TESTING', 'testing by the author'); } sub _rewrite_release_test { my ($self, $file) = @_; $self->_rewrite($file, 'RELEASE_TESTING', 'release candidate testing'); } sub _rewrite { my ($self, $file, $env, $msg) = @_; (my $name = $file->name) =~ s{^xt/([^/]+)/}{t/$1-}; $file->name($name); my @lines = split /\n/, $file->content; my $after = $lines[0] =~ /\A#!/ ? 1 : 0; splice @lines, $after, 0, qq| BEGIN { unless (\$ENV{$env}) { require Test::More; Test::More::plan(skip_all => 'these tests are for $msg'); } } |; $file->content(join "\n", @lines, ''); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::ExtraTests - rewrite ./xt tests to ./t tests with skips =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin rewrites tests found in the following directories: ./xt/author - tests for author testing (env AUTHOR_TESTING is true) ./xt/release - tests for pre-release testers (env RELEASE_TESTING is true) ./xt/smoke - tests for automated testers (env AUTOMATED_TESTING is true) The tests are renamed and moved to F<./t>, and they are rewritten to include some simple Perl code to skip all included tests if the correct env vars are not set. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut FinderCode.pm100644000766000024 230612257437015 21341 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::FinderCode; { $Dist::Zilla::Plugin::FinderCode::VERSION = '5.008'; } use Moose; with 'Dist::Zilla::Role::FileFinder'; # ABSTRACT: a callback-based FileFinder plugin use namespace::autoclean; use Moose::Autobox; use Moose::Util::TypeConstraints; has code => ( is => 'ro', isa => 'CodeRef', required => 1, ); has style => ( is => 'ro', isa => enum([ qw(grep list) ]), required => 1, ); sub find_files { my ($self) = @_; my $method = '_find_via_' . $self->style; $self->$method; } sub _find_via_grep { my ($self) = @_; my @files = grep { $self->code->($_, $self) } $self->zilla->files->flatten; return \@files; } sub _find_via_list { my ($self) = @_; my $code = $self->code; $self->$code; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::FinderCode - a callback-based FileFinder plugin =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MetaConfig.pm100644000766000024 363212257437015 21356 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaConfig; { $Dist::Zilla::Plugin::MetaConfig::VERSION = '5.008'; } # ABSTRACT: summarize Dist::Zilla configuration into distmeta use Moose; with 'Dist::Zilla::Role::MetaProvider'; use namespace::autoclean; sub metadata { my ($self) = @_; my $dump = { }; my @plugins; $dump->{plugins} = \@plugins; my $config = $self->zilla->dump_config; $dump->{zilla} = { class => $self->zilla->meta->name, version => $self->zilla->VERSION, (keys %$config ? (config => $config) : ()), }; $dump->{perl} = { version => $], }; for my $plugin (@{ $self->zilla->plugins }) { my $config = $plugin->dump_config; push @plugins, { class => $plugin->meta->name, name => $plugin->plugin_name, version => $plugin->VERSION, (keys %$config ? (config => $config) : ()), }; } return { x_Dist_Zilla => $dump }; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaConfig - summarize Dist::Zilla configuration into distmeta =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin adds a top-level C key to the L for the distribution. It describe the Dist::Zilla version used as well as all the plugins used. Each plugin's name, package, and version will be included. Plugins may augment their implementation of the L role methods to add more data to this dump. More information may be added to the top-level of this metadata as time goes on. =head1 SEE ALSO Dist::Zilla roles: L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PkgVersion.pm100644000766000024 1074612257437015 21455 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PkgVersion; { $Dist::Zilla::Plugin::PkgVersion::VERSION = '5.008'; } # ABSTRACT: add a $VERSION to your packages use Moose; with( 'Dist::Zilla::Role::FileMunger', 'Dist::Zilla::Role::FileFinderUser' => { default_finders => [ ':InstallModules', ':ExecFiles' ], }, 'Dist::Zilla::Role::PPI', ); use PPI; use MooseX::Types::Perl qw(LaxVersionStr); use namespace::autoclean; sub munge_files { my ($self) = @_; $self->munge_file($_) for @{ $self->found_files }; } sub munge_file { my ($self, $file) = @_; # XXX: for test purposes, for now! evil! -- rjbs, 2010-03-17 return if $file->name =~ /^corpus\//; return if $file->name =~ /\.t$/i; return $self->munge_perl($file) if $file->name =~ /\.(?:pm|pl)$/i; return $self->munge_perl($file) if $file->content =~ /^#!(?:.*)perl(?:$|\s)/; return; } has die_on_existing_version => ( is => 'ro', isa => 'Bool', default => 0, ); sub munge_perl { my ($self, $file) = @_; my $version = $self->zilla->version; Carp::croak("invalid characters in version") unless LaxVersionStr->check($version); my $document = $self->ppi_document_for_file($file); if ($self->document_assigns_to_variable($document, '$VERSION')) { if ($self->die_on_existing_version) { $self->log_fatal([ 'existing assignment to $VERSION in %s', $file->name ]); } $self->log([ 'skipping %s: assigns to $VERSION', $file->name ]); return; } return unless my $package_stmts = $document->find('PPI::Statement::Package'); my %seen_pkg; my $munged = 0; for my $stmt (@$package_stmts) { my $package = $stmt->namespace; if ($seen_pkg{ $package }++) { $self->log([ 'skipping package re-declaration for %s', $package ]); next; } if ($stmt->content =~ /package\s*(?:#.*)?\n\s*\Q$package/) { $self->log([ 'skipping private package %s in %s', $package, $file->name ]); next; } # the \x20 hack is here so that when we scan *this* document we don't find # an assignment to version; it shouldn't be needed, but it's been annoying # enough in the past that I'm keeping it here until tests are better my $trial = $self->zilla->is_trial ? ' # TRIAL' : ''; my $perl = "{\n \$$package\::VERSION\x20=\x20'$version';$trial\n}\n"; my $version_doc = PPI::Document->new(\$perl); my @children = $version_doc->schildren; $self->log_debug([ 'adding $VERSION assignment to %s in %s', $package, $file->name, ]); Carp::carp("error inserting version in " . $file->name) unless $stmt->insert_after($children[0]->clone) and $stmt->insert_after( PPI::Token::Whitespace->new("\n") ); $munged = 1; } $self->save_ppi_document_to_file($document, $file) if $munged; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::PkgVersion - add a $VERSION to your packages =head1 VERSION version 5.008 =head1 SYNOPSIS in dist.ini [PkgVersion] =head1 DESCRIPTION This plugin will add lines like the following to each package in each Perl module or program (more or less) within the distribution: { $MyModule::VERSION = 0.001; } ...where 0.001 is the version of the dist, and MyModule is the name of the package being given a version. (In other words, it always uses fully-qualified names to assign versions.) It will skip any package declaration that includes a newline between the C keyword and the package name, like: package Foo::Bar; This sort of declaration is also ignored by the CPAN toolchain, and is typically used when doing monkey patching or other tricky things. =head1 ATTRIBUTES =head2 die_on_existing_version If true, then when PkgVersion sees an existing C<$VERSION> assignment, it will throw an exception rather than skip the file. This attribute defaults to false. =head1 SEE ALSO Core Dist::Zilla plugins: L, L, L. Other Dist::Zilla plugins: L inserts version numbers using C and without changing line numbers =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PodVersion.pm100644000766000024 460512257437015 21433 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PodVersion; { $Dist::Zilla::Plugin::PodVersion::VERSION = '5.008'; } # ABSTRACT: add a VERSION head1 to each Perl document use Moose; with( 'Dist::Zilla::Role::FileMunger', 'Dist::Zilla::Role::FileFinderUser' => { default_finders => [ ':InstallModules', ':ExecFiles' ], }, ); use namespace::autoclean; sub munge_files { my ($self) = @_; $self->munge_file($_) for @{ $self->found_files }; } sub munge_file { my ($self, $file) = @_; return $self->munge_pod($file); } sub munge_pod { my ($self, $file) = @_; my @content = split /\n/, $file->content; require List::MoreUtils; if (List::MoreUtils::any(sub { $_ =~ /^=head1 VERSION\b/ }, @content)) { $self->log($file->name . ' already has a VERSION section in POD'); return; } for (0 .. $#content) { next until $content[$_] =~ /^=head1 NAME/; $_++; # move past the =head1 line itself $_++ while $content[$_] =~ /^\s*$/; $_++ while $content[$_] !~ /^\s*$/; # move past the abstract $_++ while $content[$_] =~ /^\s*$/; splice @content, $_ - 1, 0, ( q{}, "=head1 VERSION", q{}, "version " . $self->zilla->version . q{}, ); $self->log_debug([ 'adding VERSION Pod section to %s', $file->name ]); my $content = join "\n", @content; $content .= "\n" if length $content; $file->content($content); return; } $self->log([ "couldn't find '=head1 NAME' in %s, not adding '=head1 VERSION'", $file->name, ]); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::PodVersion - add a VERSION head1 to each Perl document =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin adds a C<=head1 VERSION> section to most perl files in the distribution, indicating the version of the dist being built. This section is added after C<=head1 NAME>. If there is no such section, the version section will not be added. =head1 SEE ALSO Core Dist::Zilla plugins: L, L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PruneCruft.pm100644000766000024 533212257437015 21436 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PruneCruft; { $Dist::Zilla::Plugin::PruneCruft::VERSION = '5.008'; } # ABSTRACT: prune stuff that you probably don't mean to include use Moose; use Moose::Autobox; use Moose::Util::TypeConstraints; with 'Dist::Zilla::Role::FilePruner'; use namespace::autoclean; { my $type = subtype as 'ArrayRef[RegexpRef]'; coerce $type, from 'ArrayRef[Str]', via { [map { qr/$_/ } @$_] }; has except => ( is => 'ro', isa => $type, coerce => 1, default => sub { [] }, ); sub mvp_multivalue_args { qw(except) } } sub _dont_exclude_file { my ($self, $file) = @_; for my $exception ($self->except->flatten) { return 1 if $file->name =~ $exception; } return; } sub exclude_file { my ($self, $file) = @_; return 0 if $self->_dont_exclude_file($file); return 1 if index($file->name, $self->zilla->name . '-') == 0; return 1 if $file->name =~ /\A\./; return 1 if $file->name =~ /\A(?:Build|Makefile)\z/; return 1 if $file->name =~ /\Ablib/; return 1 if $file->name =~ /\.(?:o|bs)$/; return 1 if $file->name =~ /\A_Inline/; return 1 if $file->name eq 'MYMETA.yml'; return 1 if $file->name eq 'MYMETA.json'; return 1 if $file->name eq 'pm_to_blib'; if ((my $file = $file->name) =~ s/\.c$//) { for my $other ($self->zilla->files->flatten) { return 1 if $other->name eq "${file}.xs"; } } return; } sub prune_files { my ($self) = @_; for my $file ($self->zilla->files->flatten) { next unless $self->exclude_file($file); $self->log_debug([ 'pruning %s', $file->name ]); $self->zilla->prune_file($file); } return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::PruneCruft - prune stuff that you probably don't mean to include =head1 VERSION version 5.008 =head1 SYNOPSIS This plugin tries to compensate for the stupid crap that turns up in your working copy, removing it before it gets into your dist and screws everything up. In your F: [PruneCruft] If you would like to exclude certain exclusions, use the C option (it can be specified multiple times): [PruneCruft] except = \.gitignore except = t/.*/\.keep$ This plugin is included in the L<@Basic|Dist::Zilla::PluginBundle::Basic> bundle. =head1 SEE ALSO Dist::Zilla plugins: L<@Basic|Dist::Zilla::PluginBundle::Basic>, L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PruneFiles.pm100644000766000024 476012257437015 21421 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PruneFiles; { $Dist::Zilla::Plugin::PruneFiles::VERSION = '5.008'; } # ABSTRACT: prune arbitrary files from the dist use Moose; use Moose::Autobox; with 'Dist::Zilla::Role::FilePruner'; use namespace::autoclean; sub mvp_multivalue_args { qw(filenames matches) } sub mvp_aliases { return { filename => 'filenames', match => 'matches' } } has filenames => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); has matches => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); sub prune_files { my ($self) = @_; # never match (at least the filename characters) my $matches_regex = qr/\000/; $matches_regex = qr/$matches_regex|$_/ for ($self->matches->flatten); # \A\Q$_\E should also handle the `eq` check $matches_regex = qr/$matches_regex|\A\Q$_\E/ for ($self->filenames->flatten); for my $file ($self->zilla->files->flatten) { next unless $file->name =~ $matches_regex; $self->log_debug([ 'pruning %s', $file->name ]); $self->zilla->prune_file($file); } return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::PruneFiles - prune arbitrary files from the dist =head1 VERSION version 5.008 =head1 SYNOPSIS This plugin allows you to explicitly prune some files from your distribution. You can either specify the exact set of files (with the "filenames" parameter) or provide the regular expressions to check (using "match"). This is useful if another plugin (maybe a FileGatherer) adds a bunch of files, and you only want a subset of them. In your F: [PruneFiles] filename = xt/release/pod-coverage.t ; pod coverage tests are for jerks filename = todo-list.txt ; keep our secret plans to ourselves match = ^test_data/* match = ^test.cvs$ =head1 ATTRIBUTES =head2 filenames This is an arrayref of filenames to be pruned from the distribution. =head2 matches This is an arrayref of regular expressions and files matching any of them, will be pruned from the distribution. =head1 SEE ALSO Dist::Zilla plugins: L, L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut AfterRelease.pm100644000766000024 150212257437015 21341 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::AfterRelease; { $Dist::Zilla::Role::AfterRelease::VERSION = '5.008'; } # ABSTRACT: something that runs after release is mostly complete use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'after_release'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::AfterRelease - something that runs after release is mostly complete =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called once the release is done. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ConfigDumper.pm100644000766000024 130012257437015 21355 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::ConfigDumper; { $Dist::Zilla::Role::ConfigDumper::VERSION = '5.008'; } # ABSTRACT: something that can dump its (public, simplified) configuration use Moose::Role; use namespace::autoclean; sub dump_config { return {}; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::ConfigDumper - something that can dump its (public, simplified) configuration =head1 VERSION version 5.008 =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut FileGatherer.pm100644000766000024 221512257437015 21342 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileGatherer; { $Dist::Zilla::Role::FileGatherer::VERSION = '5.008'; } # ABSTRACT: something that gathers files into the distribution use Moose::Role; with qw/Dist::Zilla::Role::Plugin Dist::Zilla::Role::FileInjector/; use namespace::autoclean; use Moose::Autobox; requires 'gather_files'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::FileGatherer - something that gathers files into the distribution =head1 VERSION version 5.008 =head1 DESCRIPTION A FileGatherer plugin is a special sort of L that runs early in the build cycle, finding files to include in the distribution. It is expected to call its C method to add one or more files to inclusion. Plugins implementing FileGatherer must provide a C method, which will be called during the build process. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut FileInjector.pm100644000766000024 247312257437015 21364 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileInjector; { $Dist::Zilla::Role::FileInjector::VERSION = '5.008'; } # ABSTRACT: something that can add files to the distribution use Moose::Role; use namespace::autoclean; use Moose::Autobox; sub add_file { my ($self, $file) = @_; my ($pkg, undef, $line) = caller; $file->_set_added_by( sprintf("%s (%s line %s)", $self->plugin_name, $pkg, $line), ); $self->log_debug([ 'adding file %s', $file->name ]); $self->zilla->files->push($file); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::FileInjector - something that can add files to the distribution =head1 VERSION version 5.008 =head1 DESCRIPTION This role should be implemented by any plugin that plans to add files into the distribution. It provides one method (C>, documented below), which adds a file to the distribution, noting the place of addition. =head1 METHODS =head2 add_file $plugin->add_file($dzil_file); This adds a file to the distribution, setting the file's C attribute as it does so. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MetaProvider.pm100644000766000024 231712257437015 21405 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::MetaProvider; { $Dist::Zilla::Role::MetaProvider::VERSION = '5.008'; } # ABSTRACT: something that provides metadata (for META.yml/json) use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'metadata'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::MetaProvider - something that provides metadata (for META.yml/json) =head1 VERSION version 5.008 =head1 DESCRIPTION This role provides data to merge into the distribution metadata. =head1 METHODS =head2 metadata This method (which must be provided by classes implementing this role) returns a hashref of data to be (deeply) merged together with pre-existing metadata. =head1 SEE ALSO Core Dist::Zilla plugins implementing this role: L. L. Dist::Zilla plugins on the CPAN: L... =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut NameProvider.pm100644000766000024 171312257437015 21376 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::NameProvider; { $Dist::Zilla::Role::NameProvider::VERSION = '5.008'; } # ABSTRACT: something that provides a name for the dist use Moose::Role; with 'Dist::Zilla::Role::Plugin'; requires 'provide_name'; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::NameProvider - something that provides a name for the dist =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role must provide a C method that will be called when setting the dist's name. If a NameProvider offers a name but one has already been set, an exception will be raised. If C returns undef, it will be ignored. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PluginBundle.pm100644000766000024 211712257437015 21372 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::PluginBundle; { $Dist::Zilla::Role::PluginBundle::VERSION = '5.008'; } # ABSTRACT: something that bundles a bunch of plugins use Moose::Role; use namespace::autoclean; sub register_component { my ($class, $name, $arg, $self) = @_; # ... we should register a placeholder so MetaConfig can tell us about the # pluginbundle that was loaded } requires 'bundle_config'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::PluginBundle - something that bundles a bunch of plugins =head1 VERSION version 5.008 =head1 DESCRIPTION When loading configuration, if the config reader encounters a PluginBundle, it will replace its place in the plugin list with the result of calling its C method, which will be passed a Config::MVP::Section to configure the bundle. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PrereqSource.pm100644000766000024 146712257437015 21430 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::PrereqSource; { $Dist::Zilla::Role::PrereqSource::VERSION = '5.008'; } # ABSTRACT: something that registers prerequisites use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'register_prereqs'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::PrereqSource - something that registers prerequisites =head1 VERSION version 5.008 =head1 DESCRIPTION PrereqSource plugins have a C method that should register prereqs with the Dist::Zilla object. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut TextTemplate.pm100644000766000024 436712257437015 21433 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::TextTemplate; { $Dist::Zilla::Role::TextTemplate::VERSION = '5.008'; } # ABSTRACT: something that renders a Text::Template template string use Moose::Role; use namespace::autoclean; use Text::Template; # XXX: Later, add a way to set this in config. -- rjbs, 2008-06-02 has delim => ( is => 'ro', isa => 'ArrayRef', lazy => 1, init_arg => undef, default => sub { [ qw( {{ }} ) ] }, ); sub fill_in_string { my ($self, $string, $stash, $arg) = @_; $self->log_fatal("Cannot use undef as a template string") unless defined $string; my $tmpl = Text::Template->new( TYPE => 'STRING', SOURCE => $string, DELIMITERS => $self->delim, BROKEN => sub { my %hash = @_; die $hash{error}; }, %$arg, ); $self->log_fatal("Could not create a Text::Template object from:\n$string") unless $tmpl; my $content = $tmpl->fill_in(HASH => $stash); $self->log_fatal("Filling in the template returned undef for:\n$string") unless defined $content; return $content; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::TextTemplate - something that renders a Text::Template template string =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing TextTemplate may call their own C> method to render templates using L. =head1 ATTRIBUTES =head2 delim This attribute (which can't easily be set!) is a two-element array reference returning the Text::Template delimiters to use. It defaults to C<{{> and C<}}>. =head1 METHODS =head2 fill_in_string my $rendered = $plugin->fill_in_string($template, \%stash, \%arg); This uses Text::Template to fill in the given template using the variables given in the C<%stash>. The stash becomes the HASH argument to Text::Template, so scalars must be scalar references rather than plain scalars. C<%arg> is dereferenced and passed in as extra arguments to Text::Template's C routine. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut AutoPrereqs.pm100644000766000024 1332312257437015 21632 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::AutoPrereqs; { $Dist::Zilla::Plugin::AutoPrereqs::VERSION = '5.008'; } use Moose; with( 'Dist::Zilla::Role::PrereqSource', 'Dist::Zilla::Role::FileFinderUser' => { default_finders => [ ':InstallModules', ':ExecFiles' ], }, 'Dist::Zilla::Role::FileFinderUser' => { method => 'found_test_files', finder_arg_names => [ 'test_finder' ], default_finders => [ ':TestFiles' ], }, 'Dist::Zilla::Role::FileFinderUser' => { method => 'found_configure_files', finder_arg_names => [ 'configure_finder' ], default_finders => [], }, ); use namespace::autoclean; # ABSTRACT: automatically extract prereqs from your modules use List::AllUtils 'uniq'; use Moose::Autobox; use Perl::PrereqScanner 1.016; # don't skip "lib" use PPI; use CPAN::Meta::Requirements; use version; sub mvp_multivalue_args { qw(extra_scanners scanners skips) } sub mvp_aliases { return { extra_scanner => 'extra_scanners', scanner => 'scanners', skip => 'skips' } } has extra_scanners => ( is => 'ro', isa => 'ArrayRef[Str]', default => sub { [] }, ); has scanners => ( is => 'ro', isa => 'ArrayRef[Str]', predicate => 'has_scanners', ); has skips => ( is => 'ro', isa => 'ArrayRef[Str]', ); sub register_prereqs { my $self = shift; my @modules; my $scanner = Perl::PrereqScanner->new( ($self->has_scanners ? (scanners => $self->scanners) : ()), extra_scanners => $self->extra_scanners, ); my @sets = ( [ configure => 'found_configure_files' ], # must come before runtime [ runtime => 'found_files' ], [ test => 'found_test_files' ], ); my %runtime_final; for my $fileset (@sets) { my ($phase, $method) = @$fileset; my $req = CPAN::Meta::Requirements->new; my $files = $self->$method; foreach my $file (@$files) { # skip binary files next if $file->is_bytes; # parse only perl files next unless $file->name =~ /\.(?:pm|pl|t|psgi)$/i || $file->content =~ /^#!(?:.*)perl(?:$|\s)/; # RT#76305 skip extra tests produced by ExtraTests plugin next if $file->name =~ m{^t/(?:author|release)-[^/]*\.t$}; # store module name, to trim it from require list later on my @this_thing = $file->name; if ($this_thing[0] =~ /^t/) { push @this_thing, ($this_thing[0]) x 2; $this_thing[1] =~ s{^t/}{}; $this_thing[2] =~ s{^t/lib/}{}; } else { $this_thing[0] =~ s{^lib/}{}; } @this_thing = uniq @this_thing; s{\.pm$}{} for @this_thing; s{/}{::}g for @this_thing; push @modules, @this_thing; # parse a file, and merge with existing prereqs my $file_req = $scanner->scan_string($file->content); $req->add_requirements($file_req); } # remove prereqs shipped with current dist $req->clear_requirement($_) for @modules; $req->clear_requirement($_) for qw(Config Errno); # never indexed # remove prereqs from skiplist for my $skip (($self->skips || [])->flatten) { my $re = qr/$skip/; foreach my $k ($req->required_modules) { $req->clear_requirement($k) if $k =~ $re; } } # we're done, return what we've found my %got = %{ $req->as_string_hash }; if ($phase eq 'runtime') { %runtime_final = %got; } else { delete $got{$_} for grep { exists $got{$_} and $runtime_final{$_} ge $got{$_} } keys %runtime_final; } $self->zilla->register_prereqs({ phase => $phase }, %got); } } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::AutoPrereqs - automatically extract prereqs from your modules =head1 VERSION version 5.008 =head1 SYNOPSIS In your F: [AutoPrereqs] skip = ^Foo|Bar$ skip = ^Other::Dist =head1 DESCRIPTION This plugin will extract loosely your distribution prerequisites from your files using L. If some prereqs are not found, you can still add them manually with the L plugin. This plugin will skip the modules shipped within your dist. =head1 ATTRIBUTES =head2 finder This is the name of a L whose files will be scanned to determine runtime prerequisites. It may be specified multiple times. The default value is C<:InstallModules> and C<:ExecFiles>. =head2 test_finder Just like C, but for test-phase prerequisites. The default value is C<:TestFiles>. =head2 configure_finder Just like C, but for configure-phase prerequisites. There is no default value; AutoPrereqs will not determine configure-phase prerequisites unless you set configure_finder. =head2 extra_scanners This is an arrayref of scanner names (as expected by Perl::PrereqScanner). It will be passed as the C parameter to Perl::PrereqScanner. =head2 scanners This is an arrayref of scanner names (as expected by Perl::PrereqScanner). If present, it will be passed as the C parameter to Perl::PrereqScanner, which means that it will replace the default list of scanners. =head2 skips This is an arrayref of regular expressions, derived from all the 'skip' lines in the configuration. Any module names matching any of these regexes will not be registered as prerequisites. =head1 SEE ALSO L, L. =head1 CREDITS This plugin was originally contributed by Jerome Quelin. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut AutoVersion.pm100644000766000024 532712257437015 21623 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::AutoVersion; { $Dist::Zilla::Plugin::AutoVersion::VERSION = '5.008'; } # ABSTRACT: take care of numbering versions so you don't have to use Moose; with( 'Dist::Zilla::Role::VersionProvider', 'Dist::Zilla::Role::TextTemplate', ); use namespace::autoclean; use DateTime 0.44 (); # CLDR fixes has major => ( is => 'ro', isa => 'Int', required => 1, default => 1, ); has time_zone => ( is => 'ro', isa => 'Str', required => 1, default => 'GMT', ); has format => ( is => 'ro', isa => 'Str', required => 1, default => q<{{ $major }}.{{ cldr('yyDDD') }}> . q<{{ sprintf('%01u', ($ENV{N} || 0)) }}> . q<{{$ENV{DEV} ? (sprintf '_%03u', $ENV{DEV}) : ''}}> ); sub provide_version { my ($self) = @_; my $now = DateTime->now(time_zone => $self->time_zone); my $version = $self->fill_in_string( $self->format, { major => \( $self->major ), cldr => sub { $now->format_cldr($_[0]) }, }, ); $self->log_debug([ 'providing version %s', $version ]); return $version; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::AutoVersion - take care of numbering versions so you don't have to =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin automatically produces a version string, generally based on the current time. By default, it will be in the format: 1.yyDDDn =head1 ATTRIBUTES =head2 major The C attribute is just an integer that is meant to store the major version number. If no value is specified in configuration, it will default to 1. This attribute's value can be referred to in the autoversion format template. =head2 format The format is a L string that will be rendered to form the version. It is meant to access to one variable, C<$major>, and one subroutine, C, which will format the current time (in GMT) using CLDR patterns (for which consult the L documentation). The default value is: {{ $major }}.{{ cldr('yyDDD') }} {{ sprintf('%01u', ($ENV{N} || 0)) }} {{$ENV{DEV} ? (sprintf '_%03u', $ENV{DEV}) : ''}} =head1 SEE ALSO Core Dist::Zilla plugins: L, L, L. Dist::Zilla roles: L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut BumpVersion.pm100644000766000024 351412257437015 21612 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::BumpVersion; { $Dist::Zilla::Plugin::BumpVersion::VERSION = '5.008'; } # ABSTRACT: (DEPRECATED) bump the version number by one before building use Moose; with 'Dist::Zilla::Role::BeforeBuild'; use namespace::autoclean; sub before_build { my ($self) = @_; require Perl::Version; my $version = Perl::Version->new( $self->zilla->version ); my ($r, $v, $s, $a) = map { scalar $version->$_ } qw(revision version subversion alpha); my $method = $a > 0 ? 'inc_alpha' : defined $s ? 'inc_subversion' : defined $v ? 'inc_version' : 'inc_revision'; $version->$method; $self->zilla->version("$version"); } before register_component => sub { die "Dist::Zilla::Plugin::BumpVersion is incompatible with Dist::Zilla >= v5\n" if Dist::Zilla->VERSION >= 5; warn "!!! $_[0] will be removed in Dist::Zilla v5; remove it from your config\n"; }; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::BumpVersion - (DEPRECATED) bump the version number by one before building =head1 VERSION version 5.008 =head1 SYNOPSIS B This plugin is deprecated and will be removed. It is generally useless. It does not do what you think it does. If loaded, this plugin will ensure that the distribution's version number is bumped up by one (in the smallest already-defined version units) before building begins. In other words, if F's version reads C<0.002> then the newly built dist will be C<0.003>. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut FakeRelease.pm100644000766000024 410712257437015 21507 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::FakeRelease; { $Dist::Zilla::Plugin::FakeRelease::VERSION = '5.008'; } # ABSTRACT: fake plugin to test release use Moose; with 'Dist::Zilla::Role::Releaser'; use namespace::autoclean; has user => ( is => 'ro', isa => 'Str', required => 1, default => 'AUTHORID', ); sub release { my $self = shift; for my $env ( 'DIST_ZILLA_FAKERELEASE_FAIL', # old 'DZIL_FAKERELEASE_FAIL', # new ) { $self->log_fatal("$env set, aborting") if $ENV{$env}; } $self->log('Fake release happening (nothing was really done)'); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::FakeRelease - fake plugin to test release =head1 VERSION version 5.008 =head1 SYNOPSIS [FakeRelease] user = CPANAUTHORID ; # optional. =head1 DESCRIPTION This plugin is a L that does nothing. It is directed to plugin authors, who may need a dumb release plugin to test their shiny plugin implementing L and L. When this plugin does the release, it will just log a message and finish. If you set the environment variable C to a true value, the plugin will die instead of doing nothing. This can be useful for authors wanting to test reliably that release failed. You can optionally provide the 'user' parameter, which defaults to 'AUTHORID', which will allow things that depend on this metadata ( Sometimes provided by L ) to still work. ( For example: L ) =head1 SEE ALSO Core Dist::Zilla plugins: L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut InlineFiles.pm100644000766000024 315612257437015 21544 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::InlineFiles; { $Dist::Zilla::Plugin::InlineFiles::VERSION = '5.008'; } # ABSTRACT: files in a data section use Moose; use Moose::Autobox; with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; use Sub::Exporter::ForMethods; use Data::Section 0.200002 # encoding and bytes { installer => Sub::Exporter::ForMethods::method_installer }, '-setup' => { encoding => 'bytes' }; use Dist::Zilla::File::InMemory; sub gather_files { my ($self) = @_; my $data = $self->merged_section_data; return unless $data and %$data; for my $name (keys %$data) { $self->add_file( Dist::Zilla::File::InMemory->new({ name => $name, content => ${ $data->{$name} }, }), ); } return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::InlineFiles - files in a data section =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin exists only to be extended, and gathers all files contained in its data section and those of its ancestors. For more information, see L. =head1 SEE ALSO Core Dist::Zilla plugins inheriting from L: L, L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MetaNoIndex.pm100644000766000024 546412257437015 21522 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaNoIndex; { $Dist::Zilla::Plugin::MetaNoIndex::VERSION = '5.008'; } # ABSTRACT: Stop CPAN from indexing stuff use Moose; with 'Dist::Zilla::Role::MetaProvider'; use namespace::autoclean; my %ATTR_ALIAS = ( directories => [ qw(directory dir folder) ], files => [ qw(file) ], packages => [ qw(package class module) ], namespaces => [ qw(namespace) ], ); sub mvp_aliases { my %alias_for; for my $key (keys %ATTR_ALIAS) { $alias_for{ $_ } = $key for @{ $ATTR_ALIAS{$key} }; } return \%alias_for; } sub mvp_multivalue_args { return keys %ATTR_ALIAS } for my $attr (keys %ATTR_ALIAS) { has $attr => ( is => 'ro', isa => 'ArrayRef[Str]', init_arg => $attr, predicate => "_has_$attr", ); } sub metadata { my $self = shift; return { no_index => { map {; my $reader = $_->[0]; ($_->[1] => $self->$reader) } grep {; my $pred = "_has_$_->[0]"; $self->$pred } map {; [ $_ => $ATTR_ALIAS{$_}[0] ] } keys %ATTR_ALIAS } }; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaNoIndex - Stop CPAN from indexing stuff =head1 VERSION version 5.008 =head1 SYNOPSIS In your F: [MetaNoIndex] directory = t/author directory = examples file = lib/Foo.pm package = My::Module namespace = My::Module =head1 DESCRIPTION This plugin allows you to prevent PAUSE/CPAN from indexing files you don't want indexed. This is useful if you build test classes or example classes that are used for those purposes only, and are not part of the distribution. It does this by adding a C block to your F (or F) file in your distribution. =head1 ATTRIBUTES =head2 directories Exclude folders and everything in them, for example: F Aliases: C, C, C =head2 files Exclude a specific file, for example: F Alias: C =head2 packages Exclude by package name, for example: C Aliases: C, C, C =head2 namespaces Exclude everything under a specific namespace, for example: C Alias: C B This will not exclude the package C, only everything under it like C. =head1 METHODS =head2 metadata Returns a reference to a hash containing the distribution's no_index metadata. =for Pod::Coverage mvp_aliases mvp_multivalue_args =head1 SEE ALSO Dist::Zilla roles: L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ModuleBuild.pm100644000766000024 1365712257437015 21577 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ModuleBuild; { $Dist::Zilla::Plugin::ModuleBuild::VERSION = '5.008'; } # ABSTRACT: build a Build.PL that uses Module::Build use List::MoreUtils qw(any uniq); use Moose; use Moose::Autobox; with ( 'Dist::Zilla::Role::BuildPL', 'Dist::Zilla::Role::PrereqSource', 'Dist::Zilla::Role::TextTemplate', ); use namespace::autoclean; use CPAN::Meta::Requirements 2.121; # requirements_for_module use Dist::Zilla::File::InMemory; use List::MoreUtils qw(any uniq); use Data::Dumper; has 'mb_version' => ( isa => 'Str', is => 'rw', default => '0.3601', ); has 'mb_class' => ( isa => 'Str', is => 'rw', default => 'Module::Build', ); has 'mb_lib' => ( isa => 'Str', is => 'rw', default => 'inc' ); my $template = q| # This file was automatically generated by {{ $generated_by }}. use strict; use warnings; use Module::Build {{ $plugin->mb_version }}; {{ $plugin->_use_custom_class }} my {{ $module_build_args }} my {{ $fallback_build_prereqs }} unless ( eval { Module::Build->VERSION(0.4004) } ) { delete $module_build_args{test_requires}; $module_build_args{build_requires} = \%fallback_build_requires; } my $build = {{ $plugin->mb_class }}->new(%module_build_args); $build->create_build_script; |; sub _use_custom_class { my ($self) = @_; my $class = $self->mb_class; if ( $class eq 'Module::Build' ) { return ""; } else { return sprintf "use lib qw{%s}; use $class;", join ' ', split ',', $self->mb_lib; } } sub _dump_as { my ($self, $ref, $name) = @_; require Data::Dumper; my $dumper = Data::Dumper->new( [ $ref ], [ $name ] ); $dumper->Sortkeys( 1 ); $dumper->Indent( 1 ); $dumper->Useqq( 1 ); return $dumper->Dump; } sub register_prereqs { my ($self) = @_; $self->zilla->register_prereqs( { phase => 'configure' }, 'Module::Build' => $self->mb_version, ); $self->zilla->register_prereqs( { phase => 'build' }, 'Module::Build' => $self->mb_version, ); } sub module_build_args { my ($self) = @_; my @exe_files = $self->zilla->find_files(':ExecFiles')->map(sub { $_->name })->flatten; $self->log_fatal("can't install files with whitespace in their names") if grep { /\s/ } @exe_files; my $prereqs = $self->zilla->prereqs; my %prereqs = ( configure_requires => $prereqs->requirements_for(qw(configure requires)), build_requires => $prereqs->requirements_for(qw(build requires)), test_requires => $prereqs->requirements_for(qw(test requires)), requires => $prereqs->requirements_for(qw(runtime requires)), recommends => $prereqs->requirements_for(qw(runtime recommends)), ); (my $name = $self->zilla->name) =~ s/-/::/g; return { module_name => $name, license => $self->zilla->license->meta_yml_name, dist_abstract => $self->zilla->abstract, dist_name => $self->zilla->name, dist_version => $self->zilla->version, dist_author => [ $self->zilla->authors->flatten ], script_files => \@exe_files, ( keys %{$self->zilla->_share_dir_map} ? (share_dir => $self->zilla->_share_dir_map) : ()), (map {; $_ => $prereqs{$_}->as_string_hash } keys %prereqs), recursive_test_files => 1, }; } sub fallback_build_requires { my $self = shift; my $prereqs = $self->zilla->prereqs; my $merged = CPAN::Meta::Requirements->new; for my $phase ( qw/build test/ ) { my $req = $prereqs->requirements_for($phase, 'requires'); $merged->add_requirements( $req ); }; return $self->_dump_as( $merged->as_string_hash, '*fallback_build_requires' ); } sub setup_installer { my ($self, $arg) = @_; $self->log_fatal("can't build Build.PL; license has no known META.yml value") unless $self->zilla->license->meta_yml_name; my $module_build_args = $self->module_build_args; $self->__module_build_args($module_build_args); my $dumped_args = $self->_dump_as($module_build_args, '*module_build_args'); my $fallback_build_requires = $self->fallback_build_requires; my $content = $self->fill_in_string( $template, { plugin => \$self, module_build_args => \$dumped_args, fallback_build_prereqs => \$fallback_build_requires, generated_by => \sprintf("%s v%s", ref($self), $self->VERSION || '(dev)'), }, ); my $file = Dist::Zilla::File::InMemory->new({ name => 'Build.PL', content => $content, }); $self->add_file($file); return; } # XXX: Just here to facilitate testing. -- rjbs, 2010-03-20 has __module_build_args => ( is => 'rw', isa => 'HashRef', ); __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::ModuleBuild - build a Build.PL that uses Module::Build =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin will create a F for installing the dist using L. =head1 ATTRIBUTES =head2 mb_version B Specify the minimum version of L to depend on. Defaults to 0.3601 =head2 mb_class B Specify the class to use to create the build object. Defaults to C itself. If another class is specified, then the value of mb_lib will be used to generate a line like C to be added to the generated Build.PL file. =head2 mb_lib B Specify the list of directories to be passed to lib when using mb_class. Defaults to C. =head1 SEE ALSO Core Dist::Zilla plugins: L<@Basic|Dist::Zilla::PluginBundle::Basic>, L<@Filter|Dist::Zilla::PluginBundle::Filter>, L, L. Dist::Zilla roles: L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut NextRelease.pm100644000766000024 1507312257437015 21603 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::NextRelease; { $Dist::Zilla::Plugin::NextRelease::VERSION = '5.008'; } # ABSTRACT: update the next release number in your changelog use namespace::autoclean; use Moose; with ( 'Dist::Zilla::Role::FileMunger', 'Dist::Zilla::Role::TextTemplate', 'Dist::Zilla::Role::AfterRelease', ); use DateTime 0.44; # CLDR fixes use Path::Tiny; use Moose::Util::TypeConstraints; use String::Formatter 0.100680 stringf => { -as => '_format_version', input_processor => 'require_single_input', string_replacer => 'method_replace', codes => { v => sub { $_[0]->zilla->version }, d => sub { DateTime->from_epoch(epoch => $^T, time_zone => $_[0]->time_zone) ->format_cldr($_[1]), }, t => sub { "\t" }, n => sub { "\n" }, E => sub { $_[0]->_user_info('email') }, U => sub { $_[0]->_user_info('name') }, T => sub { $_[0]->zilla->is_trial ? (defined $_[1] ? $_[1] : '-TRIAL') : '' }, V => sub { $_[0]->zilla->version . ($_[0]->zilla->is_trial ? (defined $_[1] ? $_[1] : '-TRIAL') : '') }, }, }; has time_zone => ( is => 'ro', isa => 'Str', # should be more validated later -- apocal default => 'local', ); has format => ( is => 'ro', isa => 'Str', # should be more validated Later -- rjbs, 2008-06-05 default => '%-9v %{yyyy-MM-dd HH:mm:ss VVVV}d%{ (TRIAL RELEASE)}T', ); has filename => ( is => 'ro', isa => 'Str', default => 'Changes', ); has update_filename => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { $_[0]->filename }, ); has user_stash => ( is => 'ro', isa => 'Str', default => '%User' ); has _user_stash_obj => ( is => 'ro', isa => maybe_type( class_type('Dist::Zilla::Stash::User') ), lazy => 1, init_arg => undef, default => sub { $_[0]->zilla->stash_named( $_[0]->user_stash ) }, ); sub _user_info { my ($self, $field) = @_; my $stash = $self->_user_stash_obj; $self->log_fatal([ "You must enter your %s in the [%s] section in ~/.dzil/config.ini", $field, $self->user_stash ]) unless $stash and defined(my $value = $stash->$field); return $value; } sub section_header { my ($self) = @_; return _format_version($self->format, $self); } sub munge_files { my ($self) = @_; my ($file) = grep { $_->name eq $self->filename } @{ $self->zilla->files }; return unless $file; my $content = $self->fill_in_string( $file->content, { dist => \($self->zilla), version => \($self->zilla->version), NEXT => \($self->section_header), }, ); $self->log_debug([ 'updating contents of %s in memory', $file->name ]); $file->content($content); } # new release is part of distribution history, let's record that. sub after_release { my ($self) = @_; my $filename = $self->filename; my ($gathered_file) = grep { $_->name eq $filename } @{ $self->zilla->files }; my $iolayer = sprintf(":raw:encoding(%s)", $gathered_file->encoding); # read original changelog my $content = path($filename)->slurp({ binmode => $iolayer}); # add the version and date to file content my $delim = $self->delim; my $header = $self->section_header; $content =~ s{ (\Q$delim->[0]\E \s*) \$NEXT (\s* \Q$delim->[1]\E) } {$1\$NEXT$2\n\n$header}xs; my $update_fn = $self->update_filename; $self->log_debug([ 'updating contents of %s on disk', $update_fn ]); # and finally rewrite the changelog on disk path($update_fn)->spew({binmode => $iolayer}, $content); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::NextRelease - update the next release number in your changelog =head1 VERSION version 5.008 =head1 SYNOPSIS In your F: [NextRelease] In your F file: {{$NEXT}} =head1 DESCRIPTION Tired of having to update your F file by hand with the new version and release date / time each time you release your distribution? Well, this plugin is for you. Add this plugin to your F, and the following to your F file: {{$NEXT}} The C plugin will then do 2 things: =over 4 =item * At build time, this special marker will be replaced with the version and the build date, to form a standard changelog header. This will be done to the in-memory file - the original F file won't be updated. =item * After release (when running C), since the version and build date are now part of your dist's history, the real F file (not the in-memory one) will be updated with this piece of information. =back The module accepts the following options in its F section: =over 4 =item filename the name of your changelog file; defaults to F =item update_filename the file to which to write an updated changelog to; defaults to the C =item format sprintf-like string used to compute the next value of C<{{$NEXT}}>; defaults to C<%-9v %{yyyy-MM-dd HH:mm:ss VVVV}d> =item time_zone the timezone to use when generating the date; defaults to I =item user_stash the name of the stash where the user's name and email address can be found; defaults to C<%User> =back The module allows the following sprintf-like format codes in the C: =over 4 =item C<%v> The distribution version =item C<%{-TRIAL}T> Expands to -TRIAL (or any other supplied string) if this is a trial release, or the empty string if not. A bare C<%T> means C<%{-TRIAL}T>. =item C<%{-TRIAL}V> Equivalent to C<%v%{-TRIAL}T>, to allow for the application of modifiers such as space padding to the entire version string produced. =item C<%{CLDR format}d> The date of the release. You can use any CLDR format supported by L. You must specify the format; there is no default. =item C<%U> The name of the user making this release (from C). =item C<%E> The email address of the user making this release (from C). =item C<%n> A newline =item C<%t> A tab =back =head1 SEE ALSO Core Dist::Zilla plugins: L, L, L. Dist::Zilla roles: L, L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut TestRelease.pm100644000766000024 414012257437015 21555 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::TestRelease; { $Dist::Zilla::Plugin::TestRelease::VERSION = '5.008'; } use Moose; with 'Dist::Zilla::Role::BeforeRelease'; # ABSTRACT: extract archive and run tests before releasing the dist use namespace::autoclean; use File::pushd (); use Moose::Autobox; use Path::Class (); sub before_release { my ($self, $tgz) = @_; $tgz = $tgz->absolute; my $build_root = $self->zilla->root->subdir('.build'); $build_root->mkpath unless -d $build_root; my $tmpdir = Path::Class::dir( File::Temp::tempdir(DIR => $build_root) ); $self->log("Extracting $tgz to $tmpdir"); require Archive::Tar; my @files = do { my $wd = File::pushd::pushd($tmpdir); Archive::Tar->extract_archive("$tgz"); }; $self->log_fatal([ "Failed to extract archive: %s", Archive::Tar->error ]) unless @files; # Run tests on the extracted tarball: my $target = $tmpdir->subdir( $self->zilla->dist_basename ); local $ENV{RELEASE_TESTING} = 1; local $ENV{AUTHOR_TESTING} = 1; $self->zilla->run_tests_in($target); $self->log("all's well; removing $tmpdir"); $tmpdir->rmtree; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::TestRelease - extract archive and run tests before releasing the dist =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin runs before a release happens. It will extract the to-be-released archive into a temporary directory and use the TestRunner plugins to run its tests. If the tests fail, the release is aborted and the temporary directory is left in place. If the tests pass, the temporary directory is cleaned up and the release process continues. This will set the RELEASE_TESTING and AUTHOR_TESTING env vars while running the test suite. =head1 CREDITS This plugin was originally contributed by Christopher J. Madsen. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PluginBundle000755000766000024 012257437015 17772 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/ZillaBasic.pm100644000766000024 414612257437015 21516 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/PluginBundlepackage Dist::Zilla::PluginBundle::Basic; { $Dist::Zilla::PluginBundle::Basic::VERSION = '5.008'; } # ABSTRACT: the basic plugins to maintain and release CPAN dists use Moose; with 'Dist::Zilla::Role::PluginBundle::Easy'; use namespace::autoclean; sub configure { my ($self) = @_; $self->add_plugins(qw( GatherDir PruneCruft ManifestSkip MetaYAML License Readme ExtraTests ExecDir ShareDir MakeMaker Manifest TestRelease ConfirmRelease UploadToCPAN )); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::PluginBundle::Basic - the basic plugins to maintain and release CPAN dists =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin is meant to be a basic "first step" bundle for using Dist::Zilla. It won't munge any of your code, but will generate a F and allows easy, reliable releasing of distributions. It includes the following plugins with their default configuration: =over 4 =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =back =head1 SEE ALSO Core Dist::Zilla plugins: L<@Filter|Dist::Zilla::PluginBundle::Filter>. Dist::Zilla roles: L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut BeforeArchive.pm100644000766000024 152312257437015 21506 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BeforeArchive; { $Dist::Zilla::Role::BeforeArchive::VERSION = '5.008'; } # ABSTRACT: something that runs before the archive file is built use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'before_archive'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::BeforeArchive - something that runs before the archive file is built =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called before the archive is actually built. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut BeforeRelease.pm100644000766000024 151212257437015 21503 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BeforeRelease; { $Dist::Zilla::Role::BeforeRelease::VERSION = '5.008'; } # ABSTRACT: something that runs before release really begins use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'before_release'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::BeforeRelease - something that runs before release really begins =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role have their C method called before the release is actually done. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Authors.pm100644000766000024 152412257437015 21512 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Role/Stashpackage Dist::Zilla::Role::Stash::Authors; { $Dist::Zilla::Role::Stash::Authors::VERSION = '5.008'; } use Moose::Role; with 'Dist::Zilla::Role::Stash'; # ABSTRACT: a stash that provides a list of author strings use namespace::autoclean; requires 'authors'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::Stash::Authors - a stash that provides a list of author strings =head1 VERSION version 5.008 =head1 OVERVIEW An Authors stash must provide an C method that returns an arrayref of author strings, generally in the form "Name ". =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut install.pm100644000766000024 307012257437015 21644 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::install; { $Dist::Zilla::App::Command::install::VERSION = '5.008'; } # ABSTRACT: install your dist use Dist::Zilla::App -command; sub abstract { 'install your dist' } sub opt_spec { [ 'install-command=s', 'command to run to install (e.g. "cpan .")' ], [ 'keep-build-dir|keep' => 'keep the build directory even after a success' ], } sub execute { my ($self, $opt, $arg) = @_; $self->zilla->install({ $opt->install_command ? (install_command => [ $opt->install_command ]) : (), $opt->keep_build_dir ? (keep_build_dir => 1) : (), }); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::install - install your dist =head1 VERSION version 5.008 =head1 SYNOPSIS Installs your distribution using a specified command. dzil install [--install-command="cmd"] =head1 EXAMPLE $ dzil install $ dzil install --install-command="cpan ." =head1 OPTIONS =head2 --install-command This defines what command to run after building the dist in the dist dir. Any value that works with L|perlfunc/system> is accepted. If not specified, calls (roughly): cpanm . For more information, look at the L method in Dist::Zilla. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut release.pm100644000766000024 231212257437015 21614 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::release; { $Dist::Zilla::App::Command::release::VERSION = '5.008'; } # ABSTRACT: release your dist to the CPAN use Dist::Zilla::App -command; sub abstract { 'release your dist' } sub opt_spec { [ 'trial' => 'build a trial release that PAUSE will not index' ], } sub execute { my ($self, $opt, $arg) = @_; my $zilla = $self->zilla; $zilla->is_trial(1) if $opt->trial; $self->zilla->release; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::release - release your dist to the CPAN =head1 VERSION version 5.008 =head1 SYNOPSIS dzil release dzil release --trial This command is a very, very thin wrapper around the C> method on the Dist::Zilla object. It will build, archive, and release your distribution using your Releaser plugins. The only option, C<--trial>, will cause it to build a trial build. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut version.pm100644000766000024 163312257437015 21666 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::version; { $Dist::Zilla::App::Command::version::VERSION = '5.008'; } use Dist::Zilla::App -command; use Moose; extends 'App::Cmd::Command::version'; # ABSTRACT: display dzil's version sub version_for_display { my $version_pkg = $_[0]->version_package; my $version = ( $version_pkg->VERSION ? $version_pkg->VERSION : 'dev' ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::version - display dzil's version =head1 VERSION version 5.008 =head1 SYNOPSIS Print dzil version $ dzil --version or $dzil version =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Assembler000755000766000024 012257437015 17761 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/MVPZilla.pm100644000766000024 422312257437015 21533 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/MVP/Assemblerpackage Dist::Zilla::MVP::Assembler::Zilla; { $Dist::Zilla::MVP::Assembler::Zilla::VERSION = '5.008'; } use Moose; extends 'Dist::Zilla::MVP::Assembler'; # ABSTRACT: Dist::Zilla::MVP::Assembler for the Dist::Zilla object use namespace::autoclean; use MooseX::Types::Perl qw(PackageName); use Dist::Zilla::MVP::RootSection; sub BUILD { my ($self) = @_; my $root = Dist::Zilla::MVP::RootSection->new; $self->sequence->add_section($root); } has zilla_class => ( is => 'ro', isa => PackageName, required => 1 ); sub zilla { my ($self) = @_; $self->sequence->section_named('_')->zilla; } sub register_stash { my ($self, $name, $object) = @_; $self->log_fatal("tried to register $name stash entry twice") if $self->zilla->_local_stashes->{ $name }; $self->zilla->_local_stashes->{ $name } = $object; return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::MVP::Assembler::Zilla - Dist::Zilla::MVP::Assembler for the Dist::Zilla object =head1 VERSION version 5.008 =head1 OVERVIEW This is a subclass of L used when assembling the Dist::Zilla object. It has a C attribute, which is used to determine what class of Dist::Zilla object to create. (This isn't very useful now, but will be in the future when minting and building use different subclasses of Dist::Zilla.) Upon construction, the assembler will create a L as the initial section. =head1 METHODS =head2 zilla This method is a shortcut for retrieving the C from the root section. If called before that section has been finalized, it will result in an exception. =head2 register_stash $assembler->register_stash($name => $stash_object); This adds a stash to the assembler's zilla's stash registry -- unless the name is already taken, in which case an exception is raised. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut GenerateFile.pm100644000766000024 715412257437015 21677 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::GenerateFile; { $Dist::Zilla::Plugin::GenerateFile::VERSION = '5.008'; } # ABSTRACT: build a custom file from only the plugin configuration use Moose; use Moose::Autobox; with ( 'Dist::Zilla::Role::FileGatherer', 'Dist::Zilla::Role::TextTemplate', ); use namespace::autoclean; use Dist::Zilla::File::InMemory; sub mvp_aliases { +{ is_template => 'content_is_template' } } sub mvp_multivalue_args { qw(content) } has filename => ( is => 'ro', isa => 'Str', required => 1, ); has content => ( is => 'ro', isa => 'ArrayRef', ); has content_is_template => ( is => 'ro', isa => 'Bool', default => 0, ); has name_is_template => ( is => 'ro', isa => 'Bool', default => 0, ); sub gather_files { my ($self, $arg) = @_; my $file = Dist::Zilla::File::InMemory->new({ name => $self->_filename, content => $self->_content, }); $self->add_file($file); return; } sub _content { my $self = shift; my $content = join "\n", $self->content->flatten; $content .= qq{\n}; if ($self->content_is_template) { $content = $self->fill_in_string( $content, { dist => \($self->zilla), plugin => \($self), }, ); } return $content; } sub _filename { my $self = shift; my $filename = $self->filename; if ($self->name_is_template) { $filename = $self->fill_in_string( $filename, { dist => \($self->zilla), plugin => \($self), }, ); } return $filename; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::GenerateFile - build a custom file from only the plugin configuration =head1 VERSION version 5.008 =head1 SYNOPSIS In your F: [GenerateFile] filename = todo/{{ $dist->name }}-master-plan.txt name_is_template = 1 content_is_template = 1 content = # Outlines the plan for world domination by {{$dist->name}} content = content = Item 1: Think of an idea! content = Item 2: ? content = Item 3: Profit! =head1 DESCRIPTION This plugin adds a file to the distribution. You can specify the content, as a sequence of lines, in your configuration. The specified filename and content might be literals or might be Text::Template templates. =head2 Templating of the content If you provide C (or C) parameter of "1", the content will be run through Text::Template. The variables C<$plugin> and C<$dist> will be provided, set to the GenerateFile plugin and the Dist::Zilla object respectively. If you provide a C parameter of "1", the filename will be run through Text::Template. The variables C<$plugin> and C<$dist> will be provided, set to the GenerateFile plugin and the Dist::Zilla object respectively. =head1 ATTRIBUTES =head2 filename This attribute names the file you want to generate. It is required. =head2 content The C attribute is an arrayref of lines that will be joined together with newlines to form the file content. =head2 content_is_template, is_template This attribute is a bool indicating whether or not the content should be treated as a Text::Template template. By default, it is false. =head2 name_is_template This attribute is a bool indicating whether or not the filename should be treated as a Text::Template template. By default, it is false. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ManifestSkip.pm100644000766000024 477412257437015 21747 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ManifestSkip; { $Dist::Zilla::Plugin::ManifestSkip::VERSION = '5.008'; } # ABSTRACT: decline to build files that appear in a MANIFEST.SKIP-like file use Moose; with 'Dist::Zilla::Role::FilePruner'; use namespace::autoclean; use Moose::Autobox; has skipfile => (is => 'ro', required => 1, default => 'MANIFEST.SKIP'); sub prune_files { my ($self) = @_; my $files = $self->zilla->files; my $skipfile_name = $self->skipfile; my ($skipfile) = grep { $_->name eq $skipfile_name } $files->flatten; unless (defined $skipfile) { $self->log_debug([ 'file %s not found', $skipfile_name ]); return; } my $content = $skipfile->content; # If the content has been generated in memory or changed from disk, # create a temp file with the content. # (Unfortunately maniskip can't read from a string ref) my $fh; if (! -f $skipfile_name || (-s $skipfile_name) != length($content)) { $fh = File::Temp->new; $skipfile_name = $fh->filename; $self->log_debug([ 'create temporary %s', $skipfile_name ]); print $fh $content; close $fh; } require ExtUtils::Manifest; ExtUtils::Manifest->VERSION('1.54'); my $skip = ExtUtils::Manifest::maniskip($skipfile_name); for my $file ($files->flatten) { next unless $skip->($file->name); $self->log_debug([ 'pruning %s', $file->name ]); $self->zilla->prune_file($file); } return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::ManifestSkip - decline to build files that appear in a MANIFEST.SKIP-like file =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin reads a MANIFEST.SKIP-like file, as used by L and L, and prunes any files that it declares should be skipped. This plugin is included in the L<@Basic|Dist::Zilla::PluginBundle::Basic> bundle. =head1 ATTRIBUTES =head2 skipfile This is the name of the file to read for MANIFEST.SKIP-like content. It defaults, unsurprisingly, to F. =head1 SEE ALSO Dist::Zilla core plugins: L<@Basic|Dist::Zilla::PluginBundle::Basic>, L, L. Other modules: L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut UploadToCPAN.pm100644000766000024 1242012257437015 21546 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::UploadToCPAN; { $Dist::Zilla::Plugin::UploadToCPAN::VERSION = '5.008'; } # ABSTRACT: upload the dist to CPAN use Moose; with qw(Dist::Zilla::Role::BeforeRelease Dist::Zilla::Role::Releaser); use File::HomeDir; use File::Spec; use Moose::Util::TypeConstraints; use Scalar::Util qw(weaken); use Try::Tiny; use namespace::autoclean; { package Dist::Zilla::Plugin::UploadToCPAN::_Uploader; # CPAN::Uploader will be loaded later if used our @ISA = 'CPAN::Uploader'; # Report CPAN::Uploader's version, not ours: sub _ua_string { CPAN::Uploader->_ua_string } sub log { my $self = shift; $self->{'Dist::Zilla'}{plugin}->log(@_); } } has credentials_stash => ( is => 'ro', isa => 'Str', default => '%PAUSE' ); has _credentials_stash_obj => ( is => 'ro', isa => maybe_type( class_type('Dist::Zilla::Stash::PAUSE') ), lazy => 1, init_arg => undef, default => sub { $_[0]->zilla->stash_named( $_[0]->credentials_stash ) }, ); sub _credential { my ($self, $name) = @_; return unless my $stash = $self->_credentials_stash_obj; return $stash->$name; } sub mvp_aliases { return { user => 'username' }; } has username => ( is => 'ro', isa => 'Str', lazy => 1, required => 1, default => sub { my ($self) = @_; return $self->_credential('username') || $self->pause_cfg->{user} || $self->zilla->chrome->prompt_str("PAUSE username: "); }, ); has password => ( is => 'ro', isa => 'Str', lazy => 1, required => 1, default => sub { my ($self) = @_; return $self->_credential('password') || $self->pause_cfg->{password} || $self->zilla->chrome->prompt_str('PAUSE password: ', { noecho => 1 }); }, ); has pause_cfg_file => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { File::Spec->catfile(File::HomeDir->my_home, '.pause'); }, ); has pause_cfg => ( is => 'ro', isa => 'HashRef[Str]', lazy => 1, default => sub { my $self = shift; require CPAN::Uploader; my $cfg = try { CPAN::Uploader->read_config_file( $self->pause_cfg_file ); } catch { {}; }; return $cfg; }, ); has subdir => ( is => 'ro', isa => 'Str', predicate => 'has_subdir', ); has upload_uri => ( is => 'ro', isa => 'Str', predicate => 'has_upload_uri', ); has uploader => ( is => 'ro', isa => 'CPAN::Uploader', lazy => 1, default => sub { my ($self) = @_; # Load the module lazily require CPAN::Uploader; CPAN::Uploader->VERSION('0.103004'); # require HTTPS my $uploader = Dist::Zilla::Plugin::UploadToCPAN::_Uploader->new({ user => $self->username, password => $self->password, ($self->has_subdir ? (subdir => $self->subdir) : ()), ($self->has_upload_uri ? (upload_uri => $self->upload_uri) : ()), }); $uploader->{'Dist::Zilla'}{plugin} = $self; weaken $uploader->{'Dist::Zilla'}{plugin}; return $uploader; } ); sub before_release { my $self = shift; my $problem; try { for my $attr (qw(username password)) { $problem = $attr; die unless length $self->$attr; } undef $problem; }; $self->log_fatal(['You need to supply a %s', $problem]) if $problem; } sub release { my ($self, $archive) = @_; $self->uploader->upload_file("$archive"); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::UploadToCPAN - upload the dist to CPAN =head1 VERSION version 5.008 =head1 SYNOPSIS If loaded, this plugin will allow the F command to upload to the CPAN. =head1 DESCRIPTION This plugin looks for configuration in your C or (more likely) C<~/.dzil/config.ini>: [%PAUSE] username = YOUR-PAUSE-ID password = YOUR-PAUSE-PASSWORD If this configuration does not exist, it can read the configuration from C<~/.pause>, in the same format that L requires: user YOUR-PAUSE-ID password YOUR-PAUSE-PASSWORD If neither configuration exists, it will prompt you to enter your username and password during the BeforeRelease phase. Entering a blank username or password will abort the release. =head1 ATTRIBUTES =head2 username This option supplies the user's PAUSE username. If not supplied, it will be looked for in the user's PAUSE configuration. =head2 password This option supplies the user's PAUSE password. If not supplied, it will be looked for in the user's PAUSE configuration. =head2 pause_cfg This is a hashref of defaults loaded from F<~/.pause> -- this attribute is subject to removal in future versions, as the config-loading behavior in CPAN::Uploader is improved. =head2 subdir If given, this specifies a subdirectory under the user's home directory to which to upload. Using this option is not recommended. =head2 upload_uri If given, this specifies an alternate URI for the PAUSE upload form. By default, the default supplied by L is used. Using this option is not recommended in most cases. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Filter.pm100644000766000024 544512257437015 21725 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/PluginBundlepackage Dist::Zilla::PluginBundle::Filter; { $Dist::Zilla::PluginBundle::Filter::VERSION = '5.008'; } # ABSTRACT: use another bundle, with some plugins removed use Moose; use Moose::Autobox; with 'Dist::Zilla::Role::PluginBundle'; use namespace::autoclean; use Class::Load qw(try_load_class); use Dist::Zilla::Util; sub mvp_multivalue_args { qw(remove -remove) } sub bundle_config { my ($self, $section) = @_; my $class = (ref $self) || $self; my $config = {}; my $has_filter_args = $section->{payload}->keys->grep(sub { /^-/ })->length; for my $key ($section->{payload}->keys->flatten) { my $val = $section->{payload}->{$key}; my $target = $has_filter_args && ($key !~ /^-/) ? 'bundle' : 'filter'; $key =~ s/^-// if $target eq 'filter'; $config->{$target}->{$key} = $val; } Carp::croak("no bundle given for bundle filter") unless my $bundle = $config->{filter}->{bundle}; my $pkg = Dist::Zilla::Util->expand_config_package_name($bundle); my $load_opts = {}; if( my $v = $config->{filter}->{version} ){ $load_opts->{'-version'} = $v; } unless (try_load_class($pkg, $load_opts)) { # XXX Naughty! -- rjbs, 2013-07-23 Config::MVP::Section->missing_package($pkg, $bundle); } my @plugins = $pkg->bundle_config({ name => $section->{name}, # not 100% sure about this -- rjbs, 2010-03-06 package => $pkg, payload => $config->{bundle} || {}, }); return @plugins unless my $remove = $config->{filter}->{remove}; require List::MoreUtils; for my $i (reverse 0 .. $#plugins) { splice @plugins, $i, 1 if List::MoreUtils::any(sub { $plugins[$i][1] eq Dist::Zilla::Util->expand_config_package_name($_) }, @$remove); } return @plugins; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::PluginBundle::Filter - use another bundle, with some plugins removed =head1 VERSION version 5.008 =head1 SYNOPSIS In your F: [@Filter] -bundle = @Basic -remove = ShareDir -remove = UploadToCPAN option = for_basic =head1 DESCRIPTION This plugin bundle actually wraps and modifies another plugin bundle. It includes all the configuration for the bundle named in the C<-bundle> attribute, but removes all the entries whose package is given in the C<-remove> attributes. Options not prefixed with C<-> will be passed to the bundle to be filtered. =head1 SEE ALSO Core Dist::Zilla plugins: L<@Basic|Dist::Zilla::PluginBundle::Basic>. Dist::Zilla roles: L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut FileFinderUser.pm100644000766000024 725112257437015 21654 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileFinderUser; { $Dist::Zilla::Role::FileFinderUser::VERSION = '5.008'; } # ABSTRACT: something that uses FileFinder plugins use MooseX::Role::Parameterized; use namespace::autoclean; parameter finder_arg_names => ( isa => 'ArrayRef', default => sub { [ 'finder' ] }, ); parameter default_finders => ( isa => 'ArrayRef', required => 1, ); parameter method => ( isa => 'Str', default => 'found_files', ); role { my ($p) = @_; my ($finder_arg, @finder_arg_aliases) = @{ $p->finder_arg_names }; confess "no finder arg names given!" unless $finder_arg; around mvp_multivalue_args => sub { my ($orig, $self) = @_; my @start = $self->$orig; return (@start, $finder_arg); }; if (@finder_arg_aliases) { around mvp_aliases => sub { my ($orig, $self) = @_; my $start = $self->$orig; for my $alias (@finder_arg_aliases) { confess "$alias is already an alias to $start->{$alias}" if exists $start->{$alias} and $orig->{$alias} ne $finder_arg; $start->{ $alias } = $finder_arg; } return $start; }; } has $finder_arg => ( is => 'ro', isa => 'ArrayRef[Str]', default => sub { [ @{ $p->default_finders } ] }, ); method $p->method => sub { my ($self) = @_; my @filesets = map {; $self->zilla->find_files($_) } @{ $self->$finder_arg }; my %by_name = map {; $_->name, $_ } map { @$_ } @filesets; return [ values %by_name ]; }; }; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::FileFinderUser - something that uses FileFinder plugins =head1 VERSION version 5.008 =head1 DESCRIPTION This role enables you to search for files in the dist. This makes it easy to find specific files and have the code factored out to common methods. Here's an example of a finder: ( taken from AutoPrereqs ) with 'Dist::Zilla::Role::FileFinderUser' => { default_finders => [ ':InstallModules', ':ExecFiles' ], }; Then you use it in your code like this: foreach my $file ( $self->found_files ) { # $file is an object! Look at L } =head1 ATTRIBUTES =head2 finder_arg_names Define the name of the attribute which will hold this finder. Be sure to specify different names if you have multiple finders! This is an ArrayRef. Default: [ qw( finder ) ] =head2 default_finders This attribute is an arrayref of plugin names for the default plugins the consuming plugin will use as finders. Example: C<< [ qw( :InstallModules :ExecFiles ) ] >> The default finders are: =over 4 =item :InstallModules Searches your lib/ directory for pm/pod files =item :IncModules Searches your inc/ directory for pm files =item :MainModule Finds the C of your dist =item :TestFiles Searches your t/ directory and lists the files in it. =item :ExecFiles Searches your distribution for executable files. Hint: Use the L plugin to mark those files as executables. =item :ShareFiles Searches your ShareDir directory and lists the files in it. Hint: Use the L plugin to set up the sharedir. =item :All Returns all files in the distribution. =item :None Returns nothing. =back =head2 method This will be the name of the subroutine installed in your package for this finder. Be sure to specify different names if you have multiple finders! Default: found_files =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MintingProfile.pm100644000766000024 251012257437015 21725 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::MintingProfile; { $Dist::Zilla::Role::MintingProfile::VERSION = '5.008'; } # ABSTRACT: something that can find a minting profile dir use Moose::Role; use namespace::autoclean; use File::ShareDir; use Path::Class; requires 'profile_dir'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::MintingProfile - something that can find a minting profile dir =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role should provide C method, which, given a minting profile name, returns its directory. The minting profile is a directory, containing arbitrary files used during creation of new distribution. Among other things notably, it should contain the 'profile.ini' file, listing the plugins used for minter initialization. The default implementation C looks in the module's L. After installing your profile, users will be able to start a new distribution, based on your profile with the: $ dzil new -P Provider -p profile_name Distribution::Name =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut listdeps.pm100644000766000024 767012257437015 22037 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::listdeps; { $Dist::Zilla::App::Command::listdeps::VERSION = '5.008'; } use Dist::Zilla::App -command; # ABSTRACT: print your distribution's prerequisites use Try::Tiny; sub abstract { "print your distribution's prerequisites" } sub opt_spec { [ 'author', 'include author dependencies' ], [ 'missing', 'list only the missing dependencies' ], [ 'versions', 'include required version numbers in listing' ], [ 'json', 'list dependencies by phase, in JSON format' ], } sub prereqs { my ($self, $zilla) = @_; $_->before_build for @{ $zilla->plugins_with(-BeforeBuild) }; $_->gather_files for @{ $zilla->plugins_with(-FileGatherer) }; $_->set_file_encodings for @{ $zilla->plugins_with(-EncodingProvider) }; $_->prune_files for @{ $zilla->plugins_with(-FilePruner) }; $_->munge_files for @{ $zilla->plugins_with(-FileMunger) }; $_->register_prereqs for @{ $zilla->plugins_with(-PrereqSource) }; my $prereqs = $zilla->prereqs; } sub extract_dependencies { my ($self, $zilla, $phases, $missing) = @_; my $prereqs = $self->prereqs($zilla); require CPAN::Meta::Requirements; my $req = CPAN::Meta::Requirements->new; for my $phase (@$phases) { $req->add_requirements( $prereqs->requirements_for($phase, 'requires') ); $req->add_requirements( $prereqs->requirements_for($phase, 'recommends') ); } require Class::Load; my @required = grep { $_ ne 'perl' } $req->required_modules; if ($missing) { my $is_required = sub { my $mod = shift; # it is required if it's not already installed return 1 unless Class::Load::try_load_class($mod); # guard against libs with -1 in $VERSION and other insanity my $version; return unless try { $version = $mod->VERSION; 1; }; return !$req->accepts_module($mod => $version); }; @required = grep { $is_required->($_) } @required; } my $versions = $req->as_string_hash; return map { $_ => $versions->{$_} } @required; } sub execute { my ($self, $opt, $arg) = @_; $self->app->chrome->logger->mute; my @phases = qw(build test configure runtime); push @phases, 'develop' if $opt->author; if($opt->json) { my $prereqs = $self->prereqs($self->zilla); my $output = $prereqs->as_string_hash; require JSON; JSON->VERSION(2); print JSON->new->ascii(1)->canonical(1)->pretty->encode($output), "\n"; return 1; } my %modules = $self->extract_dependencies($self->zilla, \@phases, $opt->missing); if($opt->versions) { for(sort { lc $a cmp lc $b } keys %modules) { print "$_ = ".$modules{$_}."\n"; } } else { print "$_\n" for sort { lc $a cmp lc $b } keys(%modules); } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::listdeps - print your distribution's prerequisites =head1 VERSION version 5.008 =head1 SYNOPSIS $ dzil listdeps | cpan =head1 DESCRIPTION This is a command plugin for L. It provides the C command, which prints your distribution's prerequisites. You could pipe that list to a CPAN client like L to install all of the dependencies in one quick go. =head1 OPTIONS =head2 --author Include author dependencies (those listed under C). =head2 --missing List only dependencies which are unsatisfied. =head2 --versions Also display the required versions of listed modules. =head2 --json Lists all prerequisites in JSON format, as they would appear in META.json (broken out into phases and types) =head1 ACKNOWLEDGEMENTS This code was originally more or less a direct copy of Marcel Gruenauer (hanekomu) Dist::Zilla::App::Command::prereqs, updated to work with the Dist::Zilla v2 API. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut MetaResources.pm100644000766000024 441712257437015 22125 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaResources; { $Dist::Zilla::Plugin::MetaResources::VERSION = '5.008'; } # ABSTRACT: provide arbitrary "resources" for distribution metadata use Moose; with 'Dist::Zilla::Role::MetaProvider'; use namespace::autoclean; has resources => ( is => 'ro', isa => 'HashRef', required => 1, ); sub BUILDARGS { my ($class, @arg) = @_; my %copy = ref $arg[0] ? %{ $arg[0] } : @arg; my $zilla = delete $copy{zilla}; my $name = delete $copy{plugin_name}; if (exists $copy{license} && ref($copy{license}) ne 'ARRAY') { $copy{license} = [ $copy{license} ]; } if (exists $copy{bugtracker}) { my $tracker = delete $copy{bugtracker}; $copy{bugtracker}{web} = $tracker; } if (exists $copy{repository}) { my $repo = delete $copy{repository}; $copy{repository}{url} = $repo; } for my $multi (qw( bugtracker repository )) { for my $key (grep { /^\Q$multi\E\./ } keys %copy) { my $subkey = (split /\./, $key, 2)[1]; $copy{$multi}{$subkey} = delete $copy{$key}; } } return { zilla => $zilla, plugin_name => $name, resources => \%copy, }; } sub metadata { my ($self) = @_; return { resources => $self->resources }; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaResources - provide arbitrary "resources" for distribution metadata =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin adds resources entries to the distribution's metadata. [MetaResources] homepage = http://example.com/~dude/project.asp bugtracker.web = http://rt.cpan.org/NoAuth/Bugs.html?Dist=Project bugtracker.mailto = bug-project@rt.cpan.org repository.url = git://github.com/dude/project.git repository.web = http://github.com/dude/project repository.type = git =head1 SEE ALSO Dist::Zilla roles: L. Dist::Zilla plugins on the CPAN: L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut RemovePrereqs.pm100644000766000024 371012257437015 22136 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::RemovePrereqs; { $Dist::Zilla::Plugin::RemovePrereqs::VERSION = '5.008'; } # ABSTRACT: a plugin to remove gathered prereqs use Moose; with 'Dist::Zilla::Role::PrereqSource'; use namespace::autoclean; use Moose::Autobox; use MooseX::Types::Moose qw(ArrayRef); use MooseX::Types::Perl qw(ModuleName); sub mvp_multivalue_args { qw(modules_to_remove) } sub mvp_aliases { return { remove => 'modules_to_remove' } } has modules_to_remove => ( is => 'ro', isa => ArrayRef[ ModuleName ], required => 1, ); around dump_config => sub { my ($orig, $self) = @_; my $config = $self->$orig; my $this_config = { modules_to_remove => $self->modules_to_remove, }; $config->{'' . __PACKAGE__} = $this_config; return $config; }; my @phases = qw(configure build test runtime develop); my @types = qw(requires recommends suggests conflicts); sub register_prereqs { my ($self) = @_; my $prereqs = $self->zilla->prereqs; for my $p (@phases) { for my $t (@types) { for my $m ($self->modules_to_remove->flatten) { $prereqs->requirements_for($p, $t)->clear_requirement($m); } } } } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::RemovePrereqs - a plugin to remove gathered prereqs =head1 VERSION version 5.008 =head1 SYNOPSIS In your F: [RemovePrereqs] remove = Foo::Bar remove = MRO::Compat This will remove any prerequisite of any type from any prereq phase. This is useful for eliminating incorrectly detected prereqs. =head1 SEE ALSO Dist::Zilla plugins: L, L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Classic.pm100644000766000024 460412257437015 22055 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/PluginBundlepackage Dist::Zilla::PluginBundle::Classic; { $Dist::Zilla::PluginBundle::Classic::VERSION = '5.008'; } # ABSTRACT: the classic (old) default configuration for Dist::Zilla use Moose; with 'Dist::Zilla::Role::PluginBundle::Easy'; use namespace::autoclean; sub configure { my ($self) = @_; $self->add_plugins(qw( GatherDir PruneCruft ManifestSkip MetaYAML License Readme PkgVersion PodVersion PodCoverageTests PodSyntaxTests ExtraTests ExecDir ShareDir MakeMaker Manifest ConfirmRelease UploadToCPAN )); } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::PluginBundle::Classic - the classic (old) default configuration for Dist::Zilla =head1 VERSION version 5.008 =head1 DESCRIPTION This bundle is more or less the original configuration bundled with Dist::Zilla. More than likely, you'd rather be using L<@Basic|Dist::Zilla::PluginBundle::Basic> or a more complex bundle. This one will muck around with your code by adding C<$VERSION> declarations and will mess with you Pod by adding a C<=head1 VERSION> section, but it won't get you a lot of more useful features like autoversioning, autoprereqs, or Pod::Weaver. It includes the following plugins with their default configuration: =over 4 =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =back =head1 SEE ALSO L<@Basic|Dist::Zilla::PluginBundle::Basic> =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut LicenseProvider.pm100644000766000024 246012257437015 22100 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::LicenseProvider; { $Dist::Zilla::Role::LicenseProvider::VERSION = '5.008'; } # ABSTRACT: something that provides a license for the dist use Moose::Role; with 'Dist::Zilla::Role::Plugin'; requires 'provide_license'; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::LicenseProvider - something that provides a license for the dist =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role must provide a C method that will be called when setting the dist's license. If a LicenseProvider offers a license but one has already been set, an exception will be raised. If C returns undef, it will be ignored. =head1 REQUIRED METHODS =head2 C<< provide_license($copyright_holder, $copyright_year) >> Generate license object. Returned object should be an instance of L. Plugins are responsible for injecting C<$copyright_holder> and C<$copyright_year> arguments into the license if these arguments are defined. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut VersionProvider.pm100644000766000024 217212257437015 22143 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::VersionProvider; { $Dist::Zilla::Role::VersionProvider::VERSION = '5.008'; } # ABSTRACT: something that provides a version number for the dist use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; requires 'provide_version'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::VersionProvider - something that provides a version number for the dist =head1 VERSION version 5.008 =head1 DESCRIPTION Plugins implementing this role must provide a C method that will be called when setting the dist's version. If a VersionProvider offers a version but one has already been set, an exception will be raised. If C returns undef, it will be ignored. =head1 SEE ALSO Core Dist::Zilla plugins implementing this role: L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut DZT000755000766000024 012257437015 17735 5ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT_NoPm/libSample.pod100644000766000024 20312257437015 21775 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/corpus/dist/DZT_NoPm/lib/DZTuse strict; use warnings; package DZT::Sample; sub return_arrayref_of_values_passed { my $invocant = shift; return \@_; } 1; ConfirmRelease.pm100644000766000024 317212257437015 22237 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ConfirmRelease; { $Dist::Zilla::Plugin::ConfirmRelease::VERSION = '5.008'; } use Moose; with 'Dist::Zilla::Role::BeforeRelease'; # ABSTRACT: prompt for confirmation before releasing use namespace::autoclean; use Moose::Autobox; sub before_release { my ($self, $tgz) = @_; my $releasers = join q{, }, map {; $_->plugin_name } $self->zilla->plugins_with(-Releaser)->flatten; $self->log("*** Preparing to release $tgz with $releasers ***"); my $prompt = "Do you want to continue the release process?"; my $default = exists $ENV{DZIL_CONFIRMRELEASE_DEFAULT} ? $ENV{DZIL_CONFIRMRELEASE_DEFAULT} : 0; my $confirmed = $self->zilla->chrome->prompt_yn( $prompt, { default => $default } ); $self->log_fatal("Aborting release") unless $confirmed; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::ConfirmRelease - prompt for confirmation before releasing =head1 VERSION version 5.008 =head1 DESCRIPTION This plugin prompts the author whether or not to continue before releasing the distribution to CPAN. It gives authors a chance to abort before they upload. The default is "no", but you can set the environment variable C to "yes" if you just want to hit enter to release. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut PodSyntaxTests.pm100644000766000024 275612257437015 22324 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PodSyntaxTests; { $Dist::Zilla::Plugin::PodSyntaxTests::VERSION = '5.008'; } # ABSTRACT: a release test for Pod syntax use Moose; extends 'Dist::Zilla::Plugin::InlineFiles'; with 'Dist::Zilla::Role::PrereqSource'; use namespace::autoclean; # Register the release test prereq as a "develop requires" # so it will be listed in "dzil listdeps --author" sub register_prereqs { my ($self) = @_; $self->zilla->register_prereqs( { type => 'requires', phase => 'develop', }, 'Test::Pod' => '1.41', ); } __PACKAGE__->meta->make_immutable; 1; =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::PodSyntaxTests - a release test for Pod syntax =head1 VERSION version 5.008 =head1 DESCRIPTION This is an extension of L, providing the following files: xt/release/pod-syntax.t - a standard Test::Pod test L C<1.41> will be added as a C dependency. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __DATA__ ___[ xt/release/pod-syntax.t ]___ #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); TemplateModule.pm100644000766000024 570612257437015 22267 0ustar00rjbsstaff000000000000Dist-Zilla-5.008/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::TemplateModule; { $Dist::Zilla::Plugin::TemplateModule::VERSION = '5.008'; } # ABSTRACT: a simple module-from-template plugin use Moose; with qw(Dist::Zilla::Role::ModuleMaker Dist::Zilla::Role::TextTemplate); use Path::Tiny; use namespace::autoclean; use autodie; use Sub::Exporter::ForMethods; use Data::Section 0.200002 # encoding and bytes { installer => Sub::Exporter::ForMethods::method_installer }, '-setup'; use Dist::Zilla::File::InMemory; has template => ( is => 'ro', isa => 'Str', predicate => 'has_template', ); sub make_module { my ($self, $arg) = @_; my $template; if ($self->has_template) { $template = path( $self->template )->slurp_utf8; } else { $template = ${ $self->section_data('Module.pm') }; } my $content = $self->fill_in_string( $template, { dist => \($self->zilla), name => $arg->{name}, }, ); (my $filename = $arg->{name}) =~ s{::}{/}g; my $file = Dist::Zilla::File::InMemory->new({ name => "lib/$filename.pm", content => $content, }); $self->add_file($file); } __PACKAGE__->meta->make_immutable; 1; =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::TemplateModule - a simple module-from-template plugin =head1 VERSION version 5.008 =head1 DESCRIPTION This is a L used for creating new Perl modules files when minting a new dist with C. It uses L (via L) to render a template into a Perl module. The template is given two variables for use in rendering: C<$name>, the module name; and C<$dist>, the Dist::Zilla object. The module is always created as a file under F<./lib>. By default, the template looks something like this: use strict; use warnings; package {{ $name }}; 1; =head1 ATTRIBUTES =head2 template The C