Dist-Zilla-6.010000755000767000024 013130677627 12736 5ustar00rjbsstaff000000000000README100644000767000024 57613130677627 13667 0ustar00rjbsstaff000000000000Dist-Zilla-6.010 This archive contains the distribution Dist-Zilla, version 6.010: distribution builder; installer not included! This software is copyright (c) 2017 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 v6.009. Changes100644000767000024 17202013130677627 14354 0ustar00rjbsstaff000000000000Dist-Zilla-6.010Revision history for Dist-Zilla 6.010 2017-07-10 09:22:16-04:00 America/New_York - a few documentation improvements (thanks, Chase Whitener, Mary Ehlers, and Jonas B. Nielsen) - improve behavior under a noninteractive terminal - empty file finders should now consistently return [] 6.009 2017-03-04 11:16:37-05:00 America/New_York - update DateTime::TimeZone prereq on Win32 to improve workingness (thanks, Schwern!) - add --recommends and --requires and --suggests to listdeps - improve testing of listdeps (thanks, Mickey Nasriachi!) - Module::Runtime is now considered 'internal' for the purpose of carping (thanks, Karen Etheridge!) - ./tmp is now pruned by PruneCruft (thanks, Karen Etheridge!) - authordeps now picks up :version for the root section (thanks, Karen!) - the config loading of the "perl" config loader is more reliable, but still please don't use it (thanks, Karen!) - introducing a new plugin, [GatherFile], to support adding individual files to the distribution (thanks, Karen!) 6.008 2016-10-05 21:35:23-04:00 America/New_York - fix the skip message from ExtraTests (thanks, Roy Ivy Ⅲ!) - cope with error changes in latest Moose (thanks, Karen Etheridge and Dave Rolsky) - always stringify $] in MetaConfig to avoid losing trailing zeroes through numification (thanks, Karen Etheridge!) 6.007 2016-08-06 14:04:39-04:00 America/New_York - restrict [MetaYAML] to metaspec v1.4, [MetaJSON] to v2.0+, as other version combinations are not well-supported by the toolchain 6.006 2016-07-04 10:56:36-04:00 America/New_York - add some documentation to Dist::Zilla::App::Tester (thanks, Alberto Simões!) - optimizations to regex munging (thanks, Olivier Mengué!) - add x_serialization_backend to META.* files (thanks, Karen Etheridge!) - metadata plugins are called before metadata defaults are built (thanks, Karen Etheridge!) - don't use ExtraTests plugin, but if you do, its generated test files are a bit faster when unused 6.005 2016-05-23 08:08:15-04:00 America/New_York - NextRelease now dies if there's no changelog file found (thanks, Karen Etheridge) - Module::Runtime replaces Class::Load (thanks Olivier Mengué) 6.004 2016-05-14 09:14:19-04:00 America/New_York (TRIAL RELEASE) - stop listing Path::Class as a prereq (thanks, Karen Etheridge) - update docs on path types (thanks, Graham Ollis) 6.003 2016-04-24 19:23:46+01:00 Europe/London (TRIAL RELEASE) - leading BOM (FEFF) is stripped on UTF-8 content - PPI now handles characters, not bytes, fixing non-ASCII non-comments in your source 6.002 2016-04-23 17:50:26+01:00 Europe/London (TRIAL RELEASE) - tweaks to Dist::Zilla::Path to keep plugins from v5 era working 6.001 2016-04-23 13:21:56+01:00 Europe/London [THIS RELEASE MIGHT BREAK YOUR BUILD] - Using a Dist::Zilla::Path like a Path::Class object now issues a deprecation warning ("this will be removed") once per call site. 6.000 2016-04-23 11:35:28+01:00 Europe/London (TRIAL RELEASE) [THIS RELEASE MIGHT BREAK YOUR BUILD] - Path::Class has been excised in favor of Path::Tiny, exposed as Dist::Zilla::Path; it will still respond to ->subdir and ->file, but only until Dist::Zilla v7 -- fix your plugins by then! - The --verbose switch to dzil is now strictly on/off. To set verbosity on a per-plugin basis, use the -V switch. Unfortunately, per-plugin verbosity seems to have been broken for some time, anyway. - The plugins [Prereq] and [AutoPrereq] and [BumpVersion] have been removed. These were long deprecated. (Don't confuse Prereq, for example, with the plural Prereqs, which is the correct plugin.) - [PkgVersion] now supports a use_package argument which will put the version in the package statement. (Remember that this syntax was introduced in perl v5.12.0.) - Dist::Zilla now requires perl v5.14.0. It will still happily build dists that run on whatever version of perl you like. 5.047 2016-04-23 16:20:13+01:00 Europe/London - cast things to Path::Class as needed, for now, for v6 backcompat (don't expect more commits like this) 5.046 2016-04-22 15:50:27+01:00 Europe/London - avoid using syntax that is called ambiguous on older perls 5.045 2016-04-22 11:37:13+01:00 Europe/London - add 'relationship' option to AutoPrereqs plugin (Karen Etheridge) - PrereqScanner role abstracts much of the AutoPrereqs behavior (thanks, Olivier Mengué!) - remove duplicates from the results of the :ExecFiles filefinder - [MakeMaker] now rejects version ranges in prereqs if eumm_version is not specified to be high enough (7.1101) to guarantee it can be handled (Karen Etheridge) - allow comments in an authordep specification with a version - make FakeReleaser a bit more of a drop-in for UploadToCPAN (Erik Carlsson) - make PkgDist preserve blank line after 'package' for PkgVersion (Chisel Wright) - add rename option to [GatherDir::Template] (Alastair McGowan-Douglas) - META.json is now emitted in ASCII (using \u... for non-ASCII characters) to avoid a bug in older versions of JSON::PP on older versions of perl - "dzil build --in ." no longer allows you to blow away your cwd 5.044 2016-04-06 20:32:14-04:00 America/New_York - require a newer List::Util to avoid a dumb bug caused by relying on side effects of loading Moose (thanks, Karen Etheridge!) 5.043 2016-01-04 22:54:56-05:00 America/New_York - dzil test now supports --extended to set EXTENDED_TESTING (thanks, Philippe Bruhat) 5.042 2015-11-26 09:05:37-05:00 America/New_York - try to avoid testing errors when the local time zone can't be determined (https://github.com/rjbs/Dist-Zilla/issues/497) 5.041 2015-10-27 22:07:54-04:00 America/New_York - add 'static_attribution' attribution to MakeMaker plugin - fix prereqs for App::Cmd and Config::MVP::Reader::INI 5.040 2015-10-13 11:42:25-04:00 America/New_York - the distribution tarball name no longer includes -TRIAL if the version contains an underscore - [PkgVersion] adds "$VERSION = $VERSION_SANS_UNDERSCORES" when version contains an underscore - made the PodCoverageTests and PodSyntaxTests plugins generate author tests, not release tests. These are tests you want passing on every commit, not just before a release (Dave Rolsky) 5.039 2015-08-10 09:03:08-04:00 America/New_York - update required version of MooseX::Role::Parameterized; older versions work, but can cause a bunch of unwanted warnings 5.038 2015-08-07 22:16:50-04:00 America/New_York - [License] can be given a filename option to use instead of LICENSE - dzil listdeps --develop now exists as an alias for dzil listdeps --author (Karen Etheridge) - dzil authordeps now lists the Software::License class needed (thanks, David Zurborg) - PkgVersion now skips .pod files (thanks, David Golden) - build_element support added for [ModuleBuild] (thanks, David Wheeler!) - new native filefinder :ExtraTestFiles (thanks, Karen Etheridge) - [AutoPrereqs] now looks for develop prerequisites in xt/ (thanks, Karen Etheridge) - new file finder ':PerlExecFiles' (thanks, Karen Etheridge) - try harder to notice failure to set up build root, especially on Win32 (thanks, Christian Walde) - better errors when a global config package isn't available (thanks, Karen Etheridge) - added the "ignore" option to [Encoding] (thanks, Yanick Champoux) - allow ; authordep specifications to contain version ranges (thanks, Karen Etheridge) - better error when PAUSE credentials can't be loaded (thanks, David Golden) - fix documentation for the LicenseProvider role - improve errors when PPI failes to parse (thanks, Nick Tonkin) - sort list of executable files in Makefile.PL, for deterministic builds (thanks, Karen Etheridge) - omit configure-requires prerequisites from [MakeMaker]'s fallback prerequisites (used by older ExtUtils::MakeMaker) 5.037 2015-06-04 21:46:38-04:00 America/New_York - issue a warning when version ranges are passed through to ExtUtils::MakeMaker, which cannot parse them and treats them as '0' https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/215 - added %P formatter code to [NextRelease] for the releaser's PAUSE id 5.036 2015-05-02 11:08:51-04:00 America/New_York - BUGFIX: detection of trial status via underscore in version was accidentally lost in v5.035; restored now! 5.035 2015-04-16 15:43:26+02:00 Europe/Berlin - BREAKING CHANGE: is_trial is now read-only - release_status is a new Dist::Zilla attribute and ReleaseStatusProvider plugin role 5.034 2015-03-20 10:57:07-04:00 America/New_York - require new Config::MVP for better exceptions (that we rely on) - point to IRC in dist metadata 5.033 2015-03-17 07:45:36-04:00 America/New_York - NextRelease now bases the new file on disk on the original file on disk, skipping any munging that happened in between - improve error message when a plugin can't be loaded - added "use_begin" option to PkgVersion 5.032 2015-02-21 09:36:00-05:00 America/New_York - when :version is in plugin config, it's now enforced as soon as it's seen - add more documentation about bytes/text files - PruneCruft also prunes _eumm/* now 5.031 2015-01-08 22:04:30-05:00 America/New_York - correct a test to avoid testing symlinks on Win32 5.030 2015-01-04 22:31:38-05:00 America/New_York - fixed [GatherDir]'s handling of symlinks to directories - [AutoPrereqs] now filters out all namespaces found in contained modules, not just the one corresponding to the module filename 5.029 2014-12-14 14:44:44-05:00 America/New_York - fix new error in [PkgVersion] when a module had no package statements - further rip out use of JSON.pm 5.028 2014-12-12 19:06:23-05:00 America/New_York - fix regression in [PkgVersion] that made false-positive identifications for pre-existing assignments to $VERSION - try avoid cases in which plugin code directly modifies file list - switch, tentatively, to JSON::MaybeXS 5.027 2014-12-09 09:30:30-05:00 America/New_York - fix regression in Plugin->plugin_from_config which started passing a list of pairs rather than a hashref 5.026 2014-12-08 21:33:55-05:00 America/New_York - eliminate use of Moose::Autobox - various small performance optimizations - add "use_our" option to PkgVersion 5.025 2014-11-10 21:12:14-05:00 America/New_York - fix file.t failures with perl v5.14 and v5.16's Carp 5.024 2014-11-05 23:08:07-05:00 America/New_York - add the %Mint stash for minting defaults - quiet down some low-priority log lines - teeny tiny optimization by building dist prereqs structure lazily - avoid ever requiring v0 of ExtUtils::MakeMaker - fix a module-loading ordering issue in `dzil setup` 5.023 2014-10-30 22:56:42-04:00 America/New_York - optimizations to loading of heavyweight libraries in cmd line app - some tests are now skipped on Win32 to avoid filename insanity - files' added_by data should be more informative - conflicts with installed code is now detected and/or advertised 5.022 2014-10-27 22:55:53-04:00 America/New_York - several optimizations to how PPI is used - handle an empty ABSTRACT better - now properly merging distmeta fragments together without loss, using new CPAN::Meta::Merge - create Makefile.PL and Build.PL files earlier, so they're in the file list "the whole time" 5.021 2014-10-20 22:43:52-04:00 America/New_York - improve authordeps' ability to cope with version requirements and non-default plugin names - a few improvements to help given by "dzil help COMMAND" - fixes a situation where exclusion-regexp-building in GatherDir could mangle the given regexps - now properly merging distmeta fragments together without loss, using new CPAN::Meta::Merge (Karen Etheridge) - [PkgVersion] now properly skips over $VERSION assignments in comments (Karen Etheridge, github #322) - the building of manpages is supressed in [MakeMaker]-driven builds - lazily load quite a few more modules - avoid using user's ~/.dzil even more - while building dists for testing, don't bother building man pages - try harder to notice minimum required perl version - try harder to delete temporarily directory at the end of testing - don't treat $VERSION assignments in comments as $VERSION assignments - listdeps now takes --omit-core to skip core modules - don't try to use terminal encoding on locale-free systems - suggest the use of PPI::XS - speed up and debug behavior of GatherDir 5.020 2014-07-28 20:56:25-04:00 America/New_York - the default required version for ExtUtils::MakeMaker in [MakeMaker] has been removed - load DateTime lazily - the default required version for Module::Build in [ModuleBuild] has been lowered 5.019 2014-05-20 21:11:47-04:00 America/New_York - remove a very brief-lived attempt to double-decode 5.018 2014-05-20 21:07:04-04:00 America/New_York - attempt to return abstract-from-file as a string, rather than bytes, which can lead to weirdness (github issue #303) 5.017 2014-05-17 08:35:33-04:00 America/New_York - dotfiles and dot-directories are now included in sharedirs - ModuleBuild and MakeMake should not re-build if it isn't needed - authordeps now better understands "perl" dep - munging of README is delayed to prevent unneeded work and complication - MANIFEST is now treated as a binary file - 'dzil setup' now warns that credentials are stored in the clear - MakeMaker should include fewer empty and useless hashrefs - Makefile.old is now pruned as cruft 5.016 2014-05-05 22:27:06-04:00 America/New_York - hint about [Encoding] plugin in encoding error message (David Golden) 5.015 2014-03-30 21:55:36-04:00 America/New_York - make it easier to have multiple PAUSE configs using UploadToCPAN's pause_cfg_dir option (thanks, David Golden) 5.014 2014-03-16 16:47:07+01:00 Europe/Paris - Added 'jobs' argument for 'dzil test' for parallel testing (thanks, David Golden!) - add default_jobs attribute to TestRunner role - fix the behavior of 'dzil add' with more than one file (thanks, Leon Timmermans!) 5.013 2014-02-08 17:08:16-05:00 America/New_York - META.json is now a UTF-8 file, rather than ASCII - document the use of filefinders in [PkgVersion], and remove filtering out of .t, .pod files; do skip non-text files, though - always load modules in "extra tests" like pod-coverage.t - PruneCruft also prunes ./fatlib - avoid being tricked by statements in __END__ section when looking for variable assignments - if "dzil install" fails due to exception, it is now propagated - provide a better error when terminal encoding can't be determined 5.012 2014-01-15 09:58:00-05:00 America/New_York - when handling a multi-line abstract, fold the lines on whitespace; previously, the newlines had been left in, which caused downstream warnings 5.011 2014-01-12 16:09:29-05:00 America/New_York - ->VERSION is again defined in the tester forms of Builder and Minter - remove a small obsolete code path from PkgVersion 5.010 2014-01-11 22:06:04-05:00 America/New_York - stop sharing a reference to cached PPI docs, which led to spooky action at a distance - PkgVersion no longer surrounds the new $VERSION assignment with a bare block - if there's a blank line after the package statement (and any number of comment-only lines), PkgVersion will use that for a $VERSION assignment, rather than insert a new line; this can be made mandatory with die_on_line_insertion 5.009 2014-01-07 20:21:17-05:00 America/New_York - include time offset by default in NextRelease - always pass PPI octets, not text 5.008 2013-12-27 21:57:02 America/New_York - fix utterly broken `dzil run` 5.007 2013-12-27 20:50:45-05:00 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 :AllFiles and :NoFiles 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! LICENSE100644000767000024 4366313130677627 14060 0ustar00rjbsstaff000000000000Dist-Zilla-6.010This software is copyright (c) 2017 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) 2017 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, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2017 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 bin000755000767000024 013130677627 13427 5ustar00rjbsstaff000000000000Dist-Zilla-6.010dzil100755000767000024 162013130677627 14456 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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; #pod =head1 OVERVIEW #pod #pod For help with L, start with L or #pod by running C. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME dzil - do stuff with your dist =head1 VERSION version 6.010 =head1 OVERVIEW For help with L, start with L or by running C. =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.ini100644000767000024 470113130677627 14465 0ustar00rjbsstaff000000000000Dist-Zilla-6.010name = Dist-Zilla author = Ricardo SIGNES 😏 license = Perl_5 copyright_holder = Ricardo SIGNES [@RJBS] github_issues = 1 homepage = http://dzil.org/ package_name_version = 1 [ModuleShareDirs] Dist::Zilla::MintingProfile::Default = profiles [MetaNoIndex] dir = corpus dir = misc [MetaResources] x_IRC = irc://irc.perl.org/#distzilla x_MailingList = http://dzil.org/#mailing-list [Prereqs / TestRequires] Test::More = 0.90 [Prereqs / RuntimeRecommends] Term::ReadLine::Gnu = 0 Archive::Tar::Wrapper = 0.15 ; https://github.com/rjbs/Data-OptList/pull/1 Data::OptList = 0.110 [Prereqs / RuntimeSuggests] PPI::XS = 0 [Prereqs] perl = v5.14.0 ; how tempted am I to set this to v5.20? very! parent = 0 ; used by the AutoPrereq test corpus File::ShareDir::Install = 0.03 ; for EUMM Class::Load = 0.17 Config::MVP::Reader::INI = 2.101461 ; allow spaces in plugin name 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 DateTime = 0.44 ; CLDR fixes, used by AutoVersion and NextRelease [OSPrereqs / MSWin32] DateTime::TimeZone = 1.92 [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 remove = Path::Class ; only used in fallback code [CPANFile] [Breaks] Dist::Zilla::Plugin::MakeMaker::Awesome = < 0.22 Dist::Zilla::App::Command::stale = < 0.040 Dist::Zilla::Plugin::TrialVersionComment = <= 0.003 Dist::Zilla::Plugin::Run = <= 0.035 Dist::Zilla::App::Command::update = <= 0.04 Dist::Zilla::Plugin::Author::Plicease::Tests = <= 2.02 Dist::Zilla::Plugin::CopyFilesFromBuild::Filtered = <= 0.001 Dist::Zilla::Plugin::Prereqs::AuthorDeps = <= 0.005 Dist::Zilla::Plugin::Test::Version = <= 1.05 Dist::Zilla::Plugin::CopyFilesFromBuild = < 0.161230 Dist::Zilla::Plugin::ReadmeAnyFromPod = < 0.161170 Dist::Zilla::Plugin::PodWeaver = <= 4.006 Dist::Zilla::Plugin::Test::CheckDeps = <= 0.013 Dist::Zilla::Plugin::Git = <= 2.036 Dist::Zilla::Plugin::Keywords = <= 0.006 Dist::Zilla::Plugin::RepoFileInjector = <= 0.005 Dist::Zilla::App::Command::xtest = < 0.029 Dist::Zilla::Plugin::NameFromDirectory = <= 0.03 [Test::CheckBreaks] :version = 0.017 conflicts_module = Moose::Conflicts conflicts_module = Module::Runtime::Conflicts t000755000767000024 013130677627 13122 5ustar00rjbsstaff000000000000Dist-Zilla-6.010file.t100644000767000024 1346513130677627 14417 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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 Test::DZil; use List::Util 'first'; 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}); my $tzil = Builder->from_config( { dist_root => 't/does_not_exist' }, { add_files => { path(qw(source dist.ini)) => simple_ini( 'GatherDir', ), path(qw(source lib DZT Sample.pm)) => "package DZT::Sample;\n\n1", }, }, ); { # this trickery is so the caller appears to be whatever called new_file() my $gatherdir = first { $_->isa('Dist::Zilla::Plugin::GatherDir') } @{ $tzil->plugins }; my $add_file = $gatherdir->can('add_file'); my $i = 0; sub new_file { my ($objref, $class, @args) = @_; my $obj = $class->new( name => 'foo_' . $i++ . '.txt', @args, ); ok($obj, "created a $class"); $$objref = $obj; # equivalent to: $gatherdir->add_file($obj); @_ = ($gatherdir, $obj); goto &$add_file; } } 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" ); # Match only the first line of the stack trace like( $err, qr/^[^\n]+$source_re/s, "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_file(\$obj, $class, 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_file(\$obj, $class, name => "$tempfile"); ok( $obj->encoding("bytes"), "set encoding to 'bytes'"); test_content_from_bytes($obj, qr/encoded_content added by \S+ \(\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_file(\$obj, $class, name => "$tempfile", encoding => 'latin1'); test_latin1($obj); }; }; subtest "InMemory" => sub { my $class = "Dist::Zilla::File::InMemory"; subtest "UTF-8 string" => sub { my $obj; new_file(\$obj, $class, content => $sample); test_mutable_roundtrip($obj); }; subtest "binary string" => sub { my ($obj, $line); new_file(\$obj, $class, encoded_content => $encoded_sample); $line = __LINE__; ok( $obj->encoding("bytes"), "set encoding to 'bytes'"); test_content_from_bytes($obj, qr/encoded_content added by \S+ \(\S+ line $line\)/); }; subtest "latin1 string" => sub { my $obj; new_file(\$obj, $class, 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_file(\$obj, $class, code => sub { $sample }); is( $obj->content, $sample, "content" ); is( $obj->encoded_content, $encoded_sample, "encoded_content" ); }; subtest "content immutable" => sub { my $obj; new_file(\$obj, $class, 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, $line); new_file(\$obj, $class, code_return_type => 'bytes', code => sub { $encoded_sample }); $line = __LINE__; test_content_from_bytes($obj, qr/bytes from coderef added by \S+ \(main line $line\)/); }; subtest "latin1 string" => sub { my $obj; new_file(\$obj, $class, ( code_return_type => 'bytes', code => sub { $latin1_dolmen }, encoding => 'latin1', ) ); test_latin1($obj); }; }; done_testing; util.t100644000767000024 141613130677627 14426 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.yml100644000767000024 5066413130677627 14323 0ustar00rjbsstaff000000000000Dist-Zilla-6.010--- abstract: 'distribution builder; installer not included!' author: - 'Ricardo SIGNES 😏 ' build_requires: CPAN::Meta::Check: '0.011' CPAN::Meta::Requirements: '2.121' ExtUtils::MakeMaker: '0' ExtUtils::Manifest: '1.66' File::Spec: '0' Software::License::None: '0' Test::FailWarnings: '0' Test::Fatal: '0' Test::File::ShareDir: '0' Test::More: '0.96' lib: '0' configure_requires: ExtUtils::MakeMaker: '0' File::ShareDir::Install: '0.06' dynamic_config: 1 generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150005' 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' Data::OptList: '0.110' Term::ReadLine::Gnu: '0' requires: App::Cmd::Command::version: '0' App::Cmd::Setup: '0.330' App::Cmd::Tester: '0.306' App::Cmd::Tester::CaptureExternal: '0' Archive::Tar: '0' CPAN::Meta::Converter: '2.101550' CPAN::Meta::Merge: '0' 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: '2.200010' Config::MVP::Reader: '2.101540' Config::MVP::Reader::Findable::ByExtension: '0' Config::MVP::Reader::Finder: '0' Config::MVP::Reader::INI: '2.101461' Config::MVP::Section: '2.200009' Data::Dumper: '0' Data::Section: '0.200002' DateTime: '0.44' Digest::MD5: '0' Encode: '0' ExtUtils::Manifest: '1.66' 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' JSON::MaybeXS: '0' List::Util: '1.45' Log::Dispatchouli: '1.102220' Mixin::Linewise::Readers: '0.100' Module::CoreList: '0' Module::Runtime: '0' Moose: '0.92' Moose::Role: '0' Moose::Util::TypeConstraints: '0' MooseX::LazyRequire: '0' MooseX::Role::Parameterized: '1.01' MooseX::SetOnce: '0' MooseX::Types: '0' MooseX::Types::Moose: '0' MooseX::Types::Perl: '0' PPI::Document: '0' Params::Util: '0' Path::Tiny: '0.052' Perl::PrereqScanner: '1.016' Pod::Eventual: '0.091480' Scalar::Util: '0' Software::License: '0.101370' Software::LicenseUtils: '0' String::Formatter: '0.100680' String::RewritePrefix: '0.006' 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' autodie: '0' namespace::autoclean: '0' parent: '0' perl: v5.14.0 strict: '0' utf8: '0' version: '0' warnings: '0' resources: IRC: irc://irc.perl.org/#distzilla MailingList: http://dzil.org/#mailing-list bugtracker: https://github.com/rjbs/Dist-Zilla/issues homepage: http://dzil.org/ repository: https://github.com/rjbs/Dist-Zilla.git version: '6.010' x_Dist_Zilla: perl: version: '5.024000' plugins: - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@RJBS/Git::GatherDir' version: '2.042' - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RJBS/CheckPrereqsIndexed' version: '0.020' - class: Dist::Zilla::Plugin::CheckExtraTests name: '@RJBS/CheckExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::RJBS phase: build run_under_travis: 0 skip: [] name: '@RJBS/RJBS-Outdated' version: '0.053' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 0 modules: [] phase: release run_under_travis: 0 skip: [] name: '@RJBS/CPAN-Outdated' version: '0.053' - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Filter/PruneCruft' version: '6.009' - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Filter/ManifestSkip' version: '6.009' - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Filter/MetaYAML' version: '6.009' - class: Dist::Zilla::Plugin::License name: '@RJBS/@Filter/License' version: '6.009' - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Filter/Readme' version: '6.009' - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Filter/ExecDir' version: '6.009' - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Filter/ShareDir' version: '6.009' - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Filter/Manifest' version: '6.009' - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Filter/TestRelease' version: '6.009' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Filter/ConfirmRelease' version: '6.009' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Filter/UploadToCPAN' version: '6.009' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@RJBS/MakeMaker' version: '6.009' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' version: '6.009' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.001' version_by_branch: 1 version_regexp: (?^:^([0-9]+\.[0-9]+)$) Dist::Zilla::Role::Git::Repo: git_version: 2.13.0 repo_root: . name: '@RJBS/Git::NextVersion' version: '2.042' - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' version: '6.009' - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' version: '6.009' - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' version: '6.009' - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' version: '6.009' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@RJBS/Test::ChangesHasContent' version: '0.010' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' version: '6.009' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@RJBS/Test::ReportPrereqs' version: '0.027' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@RJBS/TestMoreWithSubtests' version: '6.009' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@RJBS' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.015' - class: Pod::Weaver::Plugin::SingleEncoding name: '@RJBS/SingleEncoding' version: '4.015' - class: Pod::Weaver::Section::Name name: '@RJBS/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@RJBS/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@RJBS/Prelude' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@RJBS/Synopsis' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@RJBS/Description' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@RJBS/Overview' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@RJBS/Stability' version: '4.015' - class: Pod::Weaver::Section::Collect name: Attributes version: '4.015' - class: Pod::Weaver::Section::Collect name: Methods version: '4.015' - class: Pod::Weaver::Section::Collect name: Functions version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@RJBS/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@RJBS/postlude' version: '4.015' - class: Pod::Weaver::Section::Authors name: '@RJBS/Authors' version: '4.015' - class: Pod::Weaver::Section::Contributors name: '@RJBS/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@RJBS/Legal' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@RJBS/List' version: '4.015' name: '@RJBS/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::GithubMeta name: '@RJBS/GithubMeta' version: '0.54' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.13.0 repo_root: . name: '@RJBS/@Git/Check' version: '2.042' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%v%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.13.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RJBS/@Git/Commit' version: '2.042' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: '6.010' tag_format: '%v' tag_message: v%v Dist::Zilla::Role::Git::Repo: git_version: 2.13.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RJBS/@Git/Tag' version: '2.042' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - 'rjbs :' - 'github :' remotes_must_exist: 0 Dist::Zilla::Role::Git::Repo: git_version: 2.13.0 repo_root: . name: '@RJBS/@Git/Push' version: '2.042' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.13.0 include_authors: 0 include_releaser: 1 order_by: name paths: [] name: '@RJBS/Git::Contributors' version: '0.030' - class: Dist::Zilla::Plugin::ModuleShareDirs name: ModuleShareDirs version: '6.009' - class: Dist::Zilla::Plugin::MetaNoIndex name: MetaNoIndex version: '6.009' - class: Dist::Zilla::Plugin::MetaResources name: MetaResources version: '6.009' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: TestRequires version: '6.009' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: recommends name: RuntimeRecommends version: '6.009' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: suggests name: RuntimeSuggests version: '6.009' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: '6.009' - class: Dist::Zilla::Plugin::OSPrereqs config: Dist::Zilla::Plugin::OSPrereqs: os: MSWin32 name: MSWin32 version: '0.008' - class: Dist::Zilla::Plugin::RemovePrereqs config: Dist::Zilla::Plugin::RemovePrereqs: modules_to_remove: - Config - Dist::Zilla::Tester::_Role - Path::Class - Some::Package::That::Does::Not::Exist::Due::To::A::Typo name: RemovePrereqs version: '6.009' - class: Dist::Zilla::Plugin::CPANFile name: CPANFile version: '6.009' - class: Dist::Zilla::Plugin::Breaks name: Breaks version: '0.004' - class: Dist::Zilla::Plugin::Test::CheckBreaks config: Dist::Zilla::Plugin::Test::CheckBreaks: conflicts_module: - Module::Runtime::Conflicts - Moose::Conflicts no_forced_deps: 0 Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000031' version: '0.004' name: Test::CheckBreaks version: '0.018' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.009' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.009' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.009' x_breaks: Dist::Zilla::App::Command::stale: '< 0.040' Dist::Zilla::App::Command::update: '<= 0.04' Dist::Zilla::App::Command::xtest: '< 0.029' Dist::Zilla::Plugin::Author::Plicease::Tests: '<= 2.02' Dist::Zilla::Plugin::CopyFilesFromBuild: '< 0.161230' Dist::Zilla::Plugin::CopyFilesFromBuild::Filtered: '<= 0.001' Dist::Zilla::Plugin::Git: '<= 2.036' Dist::Zilla::Plugin::Keywords: '<= 0.006' Dist::Zilla::Plugin::MakeMaker::Awesome: '< 0.22' Dist::Zilla::Plugin::NameFromDirectory: '<= 0.03' Dist::Zilla::Plugin::PodWeaver: '<= 4.006' Dist::Zilla::Plugin::Prereqs::AuthorDeps: '<= 0.005' Dist::Zilla::Plugin::ReadmeAnyFromPod: '< 0.161170' Dist::Zilla::Plugin::RepoFileInjector: '<= 0.005' Dist::Zilla::Plugin::Run: '<= 0.035' Dist::Zilla::Plugin::Test::CheckDeps: '<= 0.013' Dist::Zilla::Plugin::Test::Version: '<= 1.05' Dist::Zilla::Plugin::TrialVersionComment: '<= 0.003' x_contributors: - 'Ævar Arnfjörð Bjarmason ' - 'Alastair McGowan-Douglas ' - 'Alexei Znamensky ' - 'Alex Vandiver ' - 'ambs ' - 'Andrew Rodland ' - 'Andy Jack ' - 'Apocalypse ' - 'ben hengst ' - 'Bernardo Rechea ' - 'Brian Fraser ' - 'Caleb Cushing ' - 'Chase Whitener ' - 'Chisel ' - 'Christian Walde ' - 'Christopher J. Madsen ' - 'Chris Weyl ' - 'Cory G Watson ' - 'csjewell ' - 'Curtis Brandt ' - 'Dagfinn Ilmari Mannsåker ' - 'Damien KRotkine ' - 'Danijel Tasov ' - "Dave O'Neill " - 'Dave Rolsky ' - 'David E. Wheeler ' - 'David Golden ' - 'David H. Adler ' - 'David Steinbrunner ' - 'David Zurborg ' - 'Davor Cubranic ' - 'Dimitar Petrov ' - 'Doug Bell ' - 'Erik Carlsson ' - 'Fayland Lam ' - 'Florian Ragwitz ' - 'Fred Moyer ' - 'fREW Schmidt ' - 'gardnerm ' - 'Gianni Ceccarelli ' - 'Graham Barr ' - 'Graham Knop ' - 'Graham Ollis ' - 'Graham Ollis ' - 'Grzegorz Rożniecki ' - 'Hans Dieter Pearcey ' - 'Hunter McMillen ' - 'Ivan Bessarabov ' - 'Jakob Voss ' - 'jantore ' - 'Jérôme Quelin ' - 'Jesse Luehrs ' - 'Jesse Vincent ' - 'John Napiorkowski ' - 'jonasbn ' - 'Jonathan C. Otsuka ' - 'Jonathan Rockway ' - 'Jonathan Scott Duff ' - 'Jonathan Yu ' - 'Karen Etheridge ' - 'Kent Fredric ' - 'Leon Timmermans ' - 'Lucas Theisen ' - 'Luc St-Louis ' - 'Marcel Gruenauer ' - 'Martin McGrath ' - 'Mary Ehlers ' - 'Mateu X Hunter ' - 'mauke ' - 'Michael G. Schwern ' - 'Michael Jemmeson ' - 'Mickey Nasriachi ' - 'Mike Doherty ' - 'Mohammad S Anwar ' - 'Moritz Onken ' - 'Neil Bowers ' - 'Nickolay Platonov ' - 'Nick Tonkin <1nickt@users.noreply.github.com>' - 'nperez ' - 'Olivier Mengué ' - 'Paul Cochrane ' - 'Pedro Melo ' - 'Philippe Bruhat (BooK) ' - 'Randy Stauner ' - 'robertkrimen ' - 'Rob Hoelz ' - 'Robin Smidsrød ' - 'Roy Ivy III ' - 'Shawn M Moore ' - 'Smylers ' - 'Steffen Schwigon ' - 'Steven Haryanto ' - 'Tatsuhiko Miyagawa ' - 'Upasana Shukla ' - 'Vyacheslav Matjukhin ' - 'Yanick Champoux ' - 'Yuval Kogman ' x_serialization_backend: 'YAML::Tiny version 1.70' MANIFEST100644000767000024 1732513130677627 14200 0ustar00rjbsstaff000000000000Dist-Zilla-6.010# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.009. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README bin/dzil corpus/README corpus/dist/AuthorDeps/dist.ini 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/another_perl_script corpus/dist/DZT_Bin/test.bash 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/Path.pm lib/Dist/Zilla/Plugin/AutoPrereqs.pm lib/Dist/Zilla/Plugin/AutoVersion.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/GatherFile.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/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/PrereqScanner.pm lib/Dist/Zilla/Role/PrereqSource.pm lib/Dist/Zilla/Role/ReleaseStatusProvider.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/Mint.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/00-report-prereqs.dd t/00-report-prereqs.t t/commands/authordeps.t t/commands/listdeps.t t/compile.t t/diagnostics/main-module.t t/diagnostics/plugin-fail.t t/empty-abstract.t t/file-addedby.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/MungerThatPrunesPodFiles.pm t/lib/Dist/Zilla/Plugin/TestAutoLicense.pm t/lib/Dist/Zilla/Plugin/TestAutoName.pm t/lib/Dist/Zilla/Plugin/TestReleaseProvider.pm t/lib/Dist/Zilla/Plugin/Versioned.pm t/lib/Dist/Zilla/Stash/Heap.pm t/load_config.t 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-merge.t t/plugins/distmeta.t t/plugins/encoding.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/gatherfile.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/munger-that-prunes.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/release_status.t t/plugins/testrelease.t t/plugins/uploadtocpan.t t/tester-demo.t t/tester-local-plugins.t t/tester-sort.t t/tester.t t/util.t t/zzz-check-breaks.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/author/pod-syntax.t xt/release/changes_has_content.t cpanfile100644000767000024 751113130677627 14527 0ustar00rjbsstaff000000000000Dist-Zilla-6.010requires "App::Cmd::Command::version" => "0"; requires "App::Cmd::Setup" => "0.330"; 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::Merge" => "0"; 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" => "2.200010"; 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.101461"; requires "Config::MVP::Section" => "2.200009"; requires "Data::Dumper" => "0"; requires "Data::Section" => "0.200002"; requires "DateTime" => "0.44"; requires "Digest::MD5" => "0"; requires "Encode" => "0"; requires "ExtUtils::Manifest" => "1.66"; 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 "JSON::MaybeXS" => "0"; requires "List::Util" => "1.45"; requires "Log::Dispatchouli" => "1.102220"; requires "Mixin::Linewise::Readers" => "0.100"; requires "Module::CoreList" => "0"; requires "Module::Runtime" => "0"; requires "Moose" => "0.92"; requires "Moose::Role" => "0"; requires "Moose::Util::TypeConstraints" => "0"; requires "MooseX::LazyRequire" => "0"; requires "MooseX::Role::Parameterized" => "1.01"; requires "MooseX::SetOnce" => "0"; requires "MooseX::Types" => "0"; requires "MooseX::Types::Moose" => "0"; requires "MooseX::Types::Perl" => "0"; requires "PPI::Document" => "0"; requires "Params::Util" => "0"; requires "Path::Tiny" => "0.052"; requires "Perl::PrereqScanner" => "1.016"; 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.006"; 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 "autodie" => "0"; requires "namespace::autoclean" => "0"; requires "parent" => "0"; requires "perl" => "v5.14.0"; requires "strict" => "0"; requires "utf8" => "0"; requires "version" => "0"; requires "warnings" => "0"; recommends "Archive::Tar::Wrapper" => "0.15"; recommends "Data::OptList" => "0.110"; recommends "Term::ReadLine::Gnu" => "0"; suggests "PPI::XS" => "0"; on 'test' => sub { requires "CPAN::Meta::Check" => "0.011"; requires "CPAN::Meta::Requirements" => "2.121"; requires "ExtUtils::MakeMaker" => "0"; requires "ExtUtils::Manifest" => "1.66"; requires "File::Spec" => "0"; 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"; }; on 'test' => sub { recommends "CPAN::Meta" => "2.120900"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; requires "File::ShareDir::Install" => "0.06"; }; on 'develop' => sub { requires "Test::More" => "0"; requires "Test::Pod" => "1.41"; }; META.json100644000767000024 7360113130677627 14467 0ustar00rjbsstaff000000000000Dist-Zilla-6.010{ "abstract" : "distribution builder; installer not included!", "author" : [ "Ricardo SIGNES \ud83d\ude0f " ], "dynamic_config" : 1, "generated_by" : "Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150005", "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" : "0", "File::ShareDir::Install" : "0.06" } }, "develop" : { "requires" : { "Test::More" : "0", "Test::Pod" : "1.41" } }, "runtime" : { "recommends" : { "Archive::Tar::Wrapper" : "0.15", "Data::OptList" : "0.110", "Term::ReadLine::Gnu" : "0" }, "requires" : { "App::Cmd::Command::version" : "0", "App::Cmd::Setup" : "0.330", "App::Cmd::Tester" : "0.306", "App::Cmd::Tester::CaptureExternal" : "0", "Archive::Tar" : "0", "CPAN::Meta::Converter" : "2.101550", "CPAN::Meta::Merge" : "0", "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" : "2.200010", "Config::MVP::Reader" : "2.101540", "Config::MVP::Reader::Findable::ByExtension" : "0", "Config::MVP::Reader::Finder" : "0", "Config::MVP::Reader::INI" : "2.101461", "Config::MVP::Section" : "2.200009", "Data::Dumper" : "0", "Data::Section" : "0.200002", "DateTime" : "0.44", "Digest::MD5" : "0", "Encode" : "0", "ExtUtils::Manifest" : "1.66", "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", "JSON::MaybeXS" : "0", "List::Util" : "1.45", "Log::Dispatchouli" : "1.102220", "Mixin::Linewise::Readers" : "0.100", "Module::CoreList" : "0", "Module::Runtime" : "0", "Moose" : "0.92", "Moose::Role" : "0", "Moose::Util::TypeConstraints" : "0", "MooseX::LazyRequire" : "0", "MooseX::Role::Parameterized" : "1.01", "MooseX::SetOnce" : "0", "MooseX::Types" : "0", "MooseX::Types::Moose" : "0", "MooseX::Types::Perl" : "0", "PPI::Document" : "0", "Params::Util" : "0", "Path::Tiny" : "0.052", "Perl::PrereqScanner" : "1.016", "Pod::Eventual" : "0.091480", "Scalar::Util" : "0", "Software::License" : "0.101370", "Software::LicenseUtils" : "0", "String::Formatter" : "0.100680", "String::RewritePrefix" : "0.006", "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", "autodie" : "0", "namespace::autoclean" : "0", "parent" : "0", "perl" : "v5.14.0", "strict" : "0", "utf8" : "0", "version" : "0", "warnings" : "0" }, "suggests" : { "PPI::XS" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "CPAN::Meta::Check" : "0.011", "CPAN::Meta::Requirements" : "2.121", "ExtUtils::MakeMaker" : "0", "ExtUtils::Manifest" : "1.66", "File::Spec" : "0", "Software::License::None" : "0", "Test::FailWarnings" : "0", "Test::Fatal" : "0", "Test::File::ShareDir" : "0", "Test::More" : "0.96", "lib" : "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_IRC" : "irc://irc.perl.org/#distzilla", "x_MailingList" : "http://dzil.org/#mailing-list" }, "version" : "6.010", "x_Dist_Zilla" : { "perl" : { "version" : "5.024000" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@RJBS/Git::GatherDir", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RJBS/CheckPrereqsIndexed", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@RJBS/CheckExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::RJBS" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@RJBS/RJBS-Outdated", "version" : "0.053" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 0, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [] } }, "name" : "@RJBS/CPAN-Outdated", "version" : "0.053" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Filter/PruneCruft", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Filter/ManifestSkip", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Filter/MetaYAML", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Filter/License", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Filter/Readme", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Filter/ExecDir", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Filter/ShareDir", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Filter/Manifest", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Filter/TestRelease", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Filter/ConfirmRelease", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Filter/UploadToCPAN", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@RJBS/MakeMaker", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.001", "version_by_branch" : 1, "version_regexp" : "(?^:^([0-9]+\\.[0-9]+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.13.0", "repo_root" : "." } }, "name" : "@RJBS/Git::NextVersion", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@RJBS/Test::ChangesHasContent", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@RJBS/Test::ReportPrereqs", "version" : "0.027" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@RJBS/TestMoreWithSubtests", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@RJBS" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@RJBS/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@RJBS/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@RJBS/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/Prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Synopsis", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Description", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Overview", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Stability", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Attributes", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Methods", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Functions", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@RJBS/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@RJBS/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@RJBS/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@RJBS/Legal", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@RJBS/List", "version" : "4.015" } ] } }, "name" : "@RJBS/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@RJBS/GithubMeta", "version" : "0.54" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.13.0", "repo_root" : "." } }, "name" : "@RJBS/@Git/Check", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%v%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.13.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RJBS/@Git/Commit", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "6.010", "tag_format" : "%v", "tag_message" : "v%v" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.13.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RJBS/@Git/Tag", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "rjbs :", "github :" ], "remotes_must_exist" : 0 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.13.0", "repo_root" : "." } }, "name" : "@RJBS/@Git/Push", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.13.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", "paths" : [] } }, "name" : "@RJBS/Git::Contributors", "version" : "0.030" }, { "class" : "Dist::Zilla::Plugin::ModuleShareDirs", "name" : "ModuleShareDirs", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "MetaNoIndex", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "TestRequires", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "recommends" } }, "name" : "RuntimeRecommends", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "suggests" } }, "name" : "RuntimeSuggests", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::OSPrereqs", "config" : { "Dist::Zilla::Plugin::OSPrereqs" : { "os" : "MSWin32" } }, "name" : "MSWin32", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::RemovePrereqs", "config" : { "Dist::Zilla::Plugin::RemovePrereqs" : { "modules_to_remove" : [ "Config", "Dist::Zilla::Tester::_Role", "Path::Class", "Some::Package::That::Does::Not::Exist::Due::To::A::Typo" ] } }, "name" : "RemovePrereqs", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::CPANFile", "name" : "CPANFile", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::Breaks", "name" : "Breaks", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::Test::CheckBreaks", "config" : { "Dist::Zilla::Plugin::Test::CheckBreaks" : { "conflicts_module" : [ "Module::Runtime::Conflicts", "Moose::Conflicts" ], "no_forced_deps" : 0 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000031", "version" : "0.004" } }, "name" : "Test::CheckBreaks", "version" : "0.018" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.009" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "6.009" } }, "x_breaks" : { "Dist::Zilla::App::Command::stale" : "< 0.040", "Dist::Zilla::App::Command::update" : "<= 0.04", "Dist::Zilla::App::Command::xtest" : "< 0.029", "Dist::Zilla::Plugin::Author::Plicease::Tests" : "<= 2.02", "Dist::Zilla::Plugin::CopyFilesFromBuild" : "< 0.161230", "Dist::Zilla::Plugin::CopyFilesFromBuild::Filtered" : "<= 0.001", "Dist::Zilla::Plugin::Git" : "<= 2.036", "Dist::Zilla::Plugin::Keywords" : "<= 0.006", "Dist::Zilla::Plugin::MakeMaker::Awesome" : "< 0.22", "Dist::Zilla::Plugin::NameFromDirectory" : "<= 0.03", "Dist::Zilla::Plugin::PodWeaver" : "<= 4.006", "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "<= 0.005", "Dist::Zilla::Plugin::ReadmeAnyFromPod" : "< 0.161170", "Dist::Zilla::Plugin::RepoFileInjector" : "<= 0.005", "Dist::Zilla::Plugin::Run" : "<= 0.035", "Dist::Zilla::Plugin::Test::CheckDeps" : "<= 0.013", "Dist::Zilla::Plugin::Test::Version" : "<= 1.05", "Dist::Zilla::Plugin::TrialVersionComment" : "<= 0.003" }, "x_contributors" : [ "\u00c6var Arnfj\u00f6r\u00f0 Bjarmason ", "Alastair McGowan-Douglas ", "Alexei Znamensky ", "Alex Vandiver ", "ambs ", "Andrew Rodland ", "Andy Jack ", "Apocalypse ", "ben hengst ", "Bernardo Rechea ", "Brian Fraser ", "Caleb Cushing ", "Chase Whitener ", "Chisel ", "Christian Walde ", "Christopher J. Madsen ", "Chris Weyl ", "Cory G Watson ", "csjewell ", "Curtis Brandt ", "Dagfinn Ilmari Manns\u00e5ker ", "Damien KRotkine ", "Danijel Tasov ", "Dave O'Neill ", "Dave Rolsky ", "David E. Wheeler ", "David Golden ", "David H. Adler ", "David Steinbrunner ", "David Zurborg ", "Davor Cubranic ", "Dimitar Petrov ", "Doug Bell ", "Erik Carlsson ", "Fayland Lam ", "Florian Ragwitz ", "Fred Moyer ", "fREW Schmidt ", "gardnerm ", "Gianni Ceccarelli ", "Graham Barr ", "Graham Knop ", "Graham Ollis ", "Graham Ollis ", "Grzegorz Ro\u017cniecki ", "Hans Dieter Pearcey ", "Hunter McMillen ", "Ivan Bessarabov ", "Jakob Voss ", "jantore ", "J\u00e9r\u00f4me Quelin ", "Jesse Luehrs ", "Jesse Vincent ", "John Napiorkowski ", "jonasbn ", "Jonathan C. Otsuka ", "Jonathan Rockway ", "Jonathan Scott Duff ", "Jonathan Yu ", "Karen Etheridge ", "Kent Fredric ", "Leon Timmermans ", "Lucas Theisen ", "Luc St-Louis ", "Marcel Gruenauer ", "Martin McGrath ", "Mary Ehlers ", "Mateu X Hunter ", "mauke ", "Michael G. Schwern ", "Michael Jemmeson ", "Mickey Nasriachi ", "Mike Doherty ", "Mohammad S Anwar ", "Moritz Onken ", "Neil Bowers ", "Nickolay Platonov ", "Nick Tonkin <1nickt@users.noreply.github.com>", "nperez ", "Olivier Mengu\u00e9 ", "Paul Cochrane ", "Pedro Melo ", "Philippe Bruhat (BooK) ", "Randy Stauner ", "robertkrimen ", "Rob Hoelz ", "Robin Smidsr\u00f8d ", "Roy Ivy III ", "Shawn M Moore ", "Smylers ", "Steffen Schwigon ", "Steven Haryanto ", "Tatsuhiko Miyagawa ", "Upasana Shukla ", "Vyacheslav Matjukhin ", "Yanick Champoux ", "Yuval Kogman " ], "x_serialization_backend" : "Cpanel::JSON::XS version 3.0231" } minter.t100644000767000024 207413130677627 14750 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/tuse strict; use warnings; use Test::More 0.88; use File::pushd qw/pushd/; use Dist::Zilla::Path; 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 => 'corpus/global' }, ); $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->child('mint')->absolute, [qw(add Foo::Bar)] ); ok(!$result->{exit_code}) || diag($result->{error}); my $pm = path($result->{tempdir})->child('source/lib/Foo/Bar.pm')->slurp; like( $pm, qr/package Foo::Bar;/, "our second module has the package declaration we want", ); } done_testing; tester.t100644000767000024 277213130677627 14765 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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; is($tzil->VERSION, Dist::Zilla->VERSION, "zilla tester VERSION"); my $basename = $tzil->dist_basename; my $tarball = $tzil->archive_filename; $tarball = $tzil->built_in->parent->child('source')->child($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.t100644000767000024 41213130677627 15054 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.PL100644000767000024 1530213130677627 15012 0ustar00rjbsstaff000000000000Dist-Zilla-6.010# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.009. use strict; use warnings; use 5.014000; use ExtUtils::MakeMaker; use File::ShareDir::Install; $File::ShareDir::Install::INCLUDE_DOTFILES = 1; $File::ShareDir::Install::INCLUDE_DOTDIRS = 1; install_share module => "Dist::Zilla::MintingProfile::Default", "profiles"; my %WriteMakefileArgs = ( "ABSTRACT" => "distribution builder; installer not included!", "AUTHOR" => "Ricardo SIGNES \x{1f60f} ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::ShareDir::Install" => "0.06" }, "DISTNAME" => "Dist-Zilla", "EXE_FILES" => [ "bin/dzil" ], "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.014000", "NAME" => "Dist::Zilla", "PREREQ_PM" => { "App::Cmd::Command::version" => 0, "App::Cmd::Setup" => "0.330", "App::Cmd::Tester" => "0.306", "App::Cmd::Tester::CaptureExternal" => 0, "Archive::Tar" => 0, "CPAN::Meta::Converter" => "2.101550", "CPAN::Meta::Merge" => 0, "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" => "2.200010", "Config::MVP::Reader" => "2.101540", "Config::MVP::Reader::Findable::ByExtension" => 0, "Config::MVP::Reader::Finder" => 0, "Config::MVP::Reader::INI" => "2.101461", "Config::MVP::Section" => "2.200009", "Data::Dumper" => 0, "Data::Section" => "0.200002", "DateTime" => "0.44", "Digest::MD5" => 0, "Encode" => 0, "ExtUtils::Manifest" => "1.66", "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, "JSON::MaybeXS" => 0, "List::Util" => "1.45", "Log::Dispatchouli" => "1.102220", "Mixin::Linewise::Readers" => "0.100", "Module::CoreList" => 0, "Module::Runtime" => 0, "Moose" => "0.92", "Moose::Role" => 0, "Moose::Util::TypeConstraints" => 0, "MooseX::LazyRequire" => 0, "MooseX::Role::Parameterized" => "1.01", "MooseX::SetOnce" => 0, "MooseX::Types" => 0, "MooseX::Types::Moose" => 0, "MooseX::Types::Perl" => 0, "PPI::Document" => 0, "Params::Util" => 0, "Path::Tiny" => "0.052", "Perl::PrereqScanner" => "1.016", "Pod::Eventual" => "0.091480", "Scalar::Util" => 0, "Software::License" => "0.101370", "Software::LicenseUtils" => 0, "String::Formatter" => "0.100680", "String::RewritePrefix" => "0.006", "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, "autodie" => 0, "namespace::autoclean" => 0, "parent" => 0, "strict" => 0, "utf8" => 0, "version" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "CPAN::Meta::Check" => "0.011", "CPAN::Meta::Requirements" => "2.121", "ExtUtils::MakeMaker" => 0, "ExtUtils::Manifest" => "1.66", "File::Spec" => 0, "Software::License::None" => 0, "Test::FailWarnings" => 0, "Test::Fatal" => 0, "Test::File::ShareDir" => 0, "Test::More" => "0.96", "lib" => 0 }, "VERSION" => "6.010", "test" => { "TESTS" => "t/*.t t/commands/*.t t/diagnostics/*.t t/plugins/*.t" } ); my %FallbackPrereqs = ( "App::Cmd::Command::version" => 0, "App::Cmd::Setup" => "0.330", "App::Cmd::Tester" => "0.306", "App::Cmd::Tester::CaptureExternal" => 0, "Archive::Tar" => 0, "CPAN::Meta::Check" => "0.011", "CPAN::Meta::Converter" => "2.101550", "CPAN::Meta::Merge" => 0, "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" => "2.200010", "Config::MVP::Reader" => "2.101540", "Config::MVP::Reader::Findable::ByExtension" => 0, "Config::MVP::Reader::Finder" => 0, "Config::MVP::Reader::INI" => "2.101461", "Config::MVP::Section" => "2.200009", "Data::Dumper" => 0, "Data::Section" => "0.200002", "DateTime" => "0.44", "Digest::MD5" => 0, "Encode" => 0, "ExtUtils::MakeMaker" => 0, "ExtUtils::Manifest" => "1.66", "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, "JSON::MaybeXS" => 0, "List::Util" => "1.45", "Log::Dispatchouli" => "1.102220", "Mixin::Linewise::Readers" => "0.100", "Module::CoreList" => 0, "Module::Runtime" => 0, "Moose" => "0.92", "Moose::Role" => 0, "Moose::Util::TypeConstraints" => 0, "MooseX::LazyRequire" => 0, "MooseX::Role::Parameterized" => "1.01", "MooseX::SetOnce" => 0, "MooseX::Types" => 0, "MooseX::Types::Moose" => 0, "MooseX::Types::Perl" => 0, "PPI::Document" => 0, "Params::Util" => 0, "Path::Tiny" => "0.052", "Perl::PrereqScanner" => "1.016", "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.006", "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, "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) }; if ( $^O eq 'MSWin32' ) { $WriteMakefileArgs{PREREQ_PM}{'DateTime::TimeZone'} = '1.92'; } WriteMakefile(%WriteMakefileArgs); { package MY; use File::ShareDir::Install qw(postamble); } corpus000755000767000024 013130677627 14172 5ustar00rjbsstaff000000000000Dist-Zilla-6.010README100644000767000024 32713130677627 15174 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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. load_config.t100644000767000024 346713130677627 15725 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/tuse strict; use warnings; use Test::More; use Test::DZil; use Test::Fatal; { package Dist::Zilla::PluginBundle::Bunk; use Moose; with 'Dist::Zilla::Role::PluginBundle::Easy'; sub configure { my $self = shift; $self->add_plugins('DoesNotExist'); } } like( exception { Builder->from_config( { dist_root => 't/does-not-exist' }, { add_files => { 'source/dist.ini' => simple_ini( 'DoesNotExist', ), }, }, ); }, qr/Required plugin Dist::Zilla::Plugin::DoesNotExist isn't installed\.\n\n/, 'missing plugin is detected properly', ); like( exception { Builder->from_config( { dist_root => 't/does-not-exist' }, { add_files => { 'source/dist.ini' => simple_ini( '@DoesNotExist', ), }, }, ); }, qr/Required plugin bundle Dist::Zilla::PluginBundle::DoesNotExist isn't installed\.\n\n/, 'missing plugin bundle is detected properly', ); like( exception { Builder->from_config( { dist_root => 't/does-not-exist' }, { add_files => { 'source/dist.ini' => simple_ini( '@Bunk', ), }, }, ); }, # with Config::MVP 2.200009, we get: # 'Can't locate object method "section_name" via package "Moose::Meta::Class::__ANON__::SERIAL::17" at lib/Dist/Zilla/Dist/Builder.pm line 269. qr/Required plugin Dist::Zilla::Plugin::DoesNotExist isn't installed\.\n\n/, 'missing plugin within a bundle is detected properly', ); done_testing; tester-demo.t100644000767000024 202213130677627 15673 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/tuse strict; use warnings; use Test::More 0.88; 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 require Dist::Zilla::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->child('META.yml')); my $meta = $yaml->[0]; like($meta->{generated_by}, qr{Dist::Zilla}, "powered by... ROBOT DINOSAUR"); done_testing; tester-sort.t100644000767000024 37513130677627 15727 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/tuse strict; use warnings; use Test::More 0.88; use Test::DZil; my @pass_one = split /\n/, simple_ini(); my @pass_two = split /\n/, simple_ini(); is_deeply(\@pass_one, \@pass_two, "Multiple calls to simple_ini are in the same order"); done_testing; Test000755000767000024 013130677627 14344 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/libDZil.pm100644000767000024 2106013130677627 15723 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Testuse strict; use warnings; package Test::DZil 6.010; # ABSTRACT: tools for testing Dist::Zilla plugins use Params::Util qw(_HASH0); use JSON::MaybeXS; 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) ] ], }; #pod =head1 DESCRIPTION #pod #pod Test::DZil provides routines for writing tests for Dist::Zilla plugins. #pod #pod =cut #pod =func Builder #pod #pod =func Minter #pod #pod my $tzil = Builder->from_config(...); #pod #pod These return class names that subclass L or #pod L, respectively, with the L #pod behavior added. #pod #pod =cut sub Builder { require Dist::Zilla::Tester; Dist::Zilla::Tester::builder(); } sub Minter { require Dist::Zilla::Tester; Dist::Zilla::Tester::minter(); } #pod =func is_filelist #pod #pod is_filelist( \@files_we_have, \@files_we_want, $desc ); #pod #pod This test assertion compares two arrayrefs of filenames, taking care of slash #pod normalization and sorting. C<@files_we_have> may also contain objects that #pod do L. #pod #pod =cut sub is_filelist { my ($have, $want, $comment) = @_; my @want = @$want; my @have = 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::Deep::cmp_bag(\@have, \@want, $comment); } #pod =func is_yaml #pod #pod is_yaml( $yaml_string, $want_struct, $comment ); #pod #pod This test assertion deserializes the given YAML string and does a #pod C>. #pod #pod =cut 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); } #pod =func is_json #pod #pod is_json( $json_string, $want_struct, $comment ); #pod #pod This test assertion deserializes the given JSON string and does a #pod C>. #pod #pod =cut sub is_json { my ($json, $want, $comment) = @_; my $have = JSON::MaybeXS->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 (sort 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 (sort keys %$payload) { my @values = ref $payload->{ $key } ? @{ $payload->{ $key } } : $payload->{ $key }; $config .= "$key = $_\n" for grep {defined} @values; } $config .= "\n"; } return $config; } } #pod =func dist_ini #pod #pod my $ini_text = dist_ini(\%root_config, @plugins); #pod #pod This routine returns a string that could be used to populate a simple #pod F file. The C<%root_config> gives data for the "root" section of the #pod configuration. To provide a line multiple times, provide an arrayref. For #pod example, the root section could read: #pod #pod { #pod name => 'Dist-Sample', #pod author => [ #pod 'J. Smith ', #pod 'Q. Smith ', #pod ], #pod } #pod #pod The root section is optional. #pod #pod Plugins can be given in a few ways: #pod #pod =begin :list #pod #pod = C<"PluginMoniker"> #pod #pod = C<[ "PluginMoniker" ]> #pod #pod These become C<[PluginMoniker]> #pod #pod = C<[ "PluginMoniker", "PluginName" ]> #pod #pod This becomes C<[PluginMoniker / PluginName]> #pod #pod = C<[ "PluginMoniker", { ... } ]> #pod #pod = C<[ "PluginMoniker", "PluginName", { ... } ]> #pod #pod These use the given hashref as the parameters inside the section, with the same #pod semantics as the root section. #pod #pod =end :list #pod #pod =cut sub _dist_ini { _build_ini_builder; } #pod =func simple_ini #pod #pod This behaves exactly like C, but it merges any given root config into #pod a starter config, which means that you can often skip any explicit root config. #pod The starter config may change slightly over time, but is something like this: #pod #pod { #pod name => 'DZT-Sample', #pod abstract => 'Sample DZ Dist', #pod version => '0.001', #pod author => 'E. Xavier Ample ', #pod license => 'Perl_5', #pod copyright_holder => 'E. Xavier Ample', #pod } #pod #pod =cut 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 6.010 =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) 2017 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 file-addedby.t100644000767000024 422413130677627 15762 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/tuse strict; use warnings; use Test::More; use Test::DZil; use Test::Deep; use Test::Fatal; use Path::Tiny; use List::Util 'first'; my $tzil = Builder->from_config( { dist_root => 't/does_not_exist' }, { add_files => { path(qw(source dist.ini)) => simple_ini( 'GatherDir', # a file gatherer (adds OnDisk file) 'PodSyntaxTests', # a file gatherer (adds InMemory file) 'Manifest', # a file gatherer (adds FromCode file) # a file munger that changes content [ PkgVersion => { finder => ':AllFiles' } ], 'ExtraTests', # a file munger that changes filename ), path(qw(source lib DZT Sample.pm)) => "package DZT::Sample;\n\n1", }, }, ); $tzil->chrome->logger->set_debug(1); is( exception { $tzil->build }, undef, 'build proceeds normally', ) or diag 'saw log messages: ', explain $tzil->log_messages; my $module = first { $_->name eq path(qw(lib DZT Sample.pm)) } @{ $tzil->files }; cmp_deeply( $module, methods( added_by => all( re(qr/\bencoded_content added by GatherDir \(Dist::Zilla::Plugin::GatherDir line \d+\)(;|$)/), re(qr/\bcontent set by PkgVersion \(Dist::Zilla::Plugin::PkgVersion line \d+\)(;|$)/), ), ), 'OnDisk file added by GatherDir, set by PkgVersion has correct properties', ); my $test = first { $_->name eq path(qw(t author-pod-syntax.t)) } @{ $tzil->files }; cmp_deeply( $test, methods( added_by => all( re(qr/^content added by PodSyntaxTests \(Dist::Zilla::Plugin::InlineFiles line \d+\)(;|$)/), re(qr/\bcontent set by ExtraTests \(Dist::Zilla::Plugin::ExtraTests line \d+\)(;|$)/), re(qr/\bfilename set by ExtraTests \(Dist::Zilla::Plugin::ExtraTests line \d+\)(;|$)/), ), ), 'InMemory file altered by all of PodSyntaxTests, PkgVersion and ExtraTests has correct properties', ); my $manifest = first { $_->name eq path('MANIFEST') } @{ $tzil->files }; cmp_deeply( $manifest, methods( added_by => re(qr/^bytes from coderef added by Manifest \(Dist::Zilla::Plugin::Manifest line \d+\)$/), ), 'FromCode file added by Manifest has correct properties', ); done_testing; Dist000755000767000024 013130677627 14330 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/libZilla.pm100644000767000024 11061613130677627 16146 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Distpackage Dist::Zilla 6.010; # ABSTRACT: distribution builder; installer not included! use Moose 0.92; # role composition fixes with 'Dist::Zilla::Role::ConfigDumper'; # This comment has fün̈n̈ÿ characters. use MooseX::Types::Moose qw(ArrayRef Bool HashRef Object Str); use MooseX::Types::Perl qw(DistName LaxVersionStr); use Moose::Util::TypeConstraints; use Dist::Zilla::Types qw(Path License ReleaseStatus); use Log::Dispatchouli 1.100712; # proxy_loggers, quiet_fatal use Dist::Zilla::Path; use List::Util 1.33 qw(first none); 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; #pod =head1 DESCRIPTION #pod #pod Dist::Zilla builds distributions of code to be uploaded to the CPAN. In this #pod respect, it is like L, L, or #pod L. Unlike those tools, however, it is not also a system for #pod installing code that has been downloaded from the CPAN. Since it's only run by #pod authors, and is meant to be run on a repository checkout rather than on #pod published, released code, it can do much more than those tools, and is free to #pod make much more ludicrous demands in terms of prerequisites. #pod #pod If you have access to the web, you can learn more and find an interactive #pod tutorial at B>. If not, try #pod L. #pod #pod =cut has chrome => ( is => 'rw', isa => role_type('Dist::Zilla::Role::Chrome'), required => 1, ); #pod =attr name #pod #pod The name attribute (which is required) gives the name of the distribution to be #pod built. This is usually the name of the distribution's main module, with the #pod double colons (C<::>) replaced with dashes. For example: C. #pod #pod =cut has name => ( is => 'ro', isa => DistName, lazy => 1, builder => '_build_name', ); #pod =attr version #pod #pod This is the version of the distribution to be created. #pod #pod =cut 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) }) { 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) }) { 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; } #pod =attr release_status #pod #pod This attribute sets the release status to one of the #pod L #pod values: 'stable', 'testing' or 'unstable'. #pod #pod If the C<$ENV{RELEASE_STATUS}> environment variable exists, its value will #pod be used as the release status. #pod #pod For backwards compatibility, if C<$ENV{RELEASE_STATUS}> does not exist and #pod the C<$ENV{TRIAL}> variable is true, the release status will be 'testing'. #pod #pod Otherwise, the release status will be set from a #pod L, if one #pod has been configured. #pod #pod For backwards compatibility, setting C true in F is #pod equivalent to using a C. If C is false, #pod it has no effect. #pod #pod Only B C may be used. #pod #pod If no providers are used, the release status defaults to 'stable' unless there #pod is an "_" character in the version, in which case, it defaults to 'testing'. #pod #pod =cut # release status must be lazy, after files are gathered has release_status => ( is => 'ro', isa => ReleaseStatus, lazy => 1, builder => '_build_release_status', ); sub _build_release_status { my ($self) = @_; # environment variables override completely return $self->_release_status_from_env if $self->_release_status_from_env; # other ways of setting status must not conflict my $status; # dist.ini is equivalent to a release provider if is_trial is true. # If false, though, we want other providers to run or fall back to # the version $status = 'testing' if $self->_override_is_trial; for my $plugin (@{ $self->plugins_with(-ReleaseStatusProvider) }) { next unless defined(my $this_status = $plugin->provide_release_status); $self->log_fatal('attempted to set release status twice') if defined $status; $status = $this_status; } return $status || ( $self->version =~ /_/ ? 'testing' : 'stable' ); } # captures environment variables early during Zilla object construction has _release_status_from_env => ( is => 'ro', isa => Str, builder => '_build_release_status_from_env', ); sub _build_release_status_from_env { my ($self) = @_; return $ENV{RELEASE_STATUS} if $ENV{RELEASE_STATUS}; return $ENV{TRIAL} ? 'testing' : ''; } #pod =attr abstract #pod #pod This is a one-line summary of the distribution. If none is given, one will be #pod looked for in the L of the dist. #pod #pod =cut 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_debug("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; } ); #pod =attr main_module #pod #pod This is the module where Dist::Zilla might look for various defaults, like #pod the distribution abstract. By default, it's derived from the distribution #pod name. If your distribution is Foo-Bar, and F exists, #pod that's the main_module. Otherwise, it's the shortest-named module in the #pod distribution. This may change! #pod #pod You can override the default by specifying the file path explicitly, #pod ie: #pod #pod main_module = lib/Foo/Bar.pm #pod #pod =cut 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 $guess; if ( $self->_has_main_module_override ) { $file = first { $_->name eq $self->_main_module_override } @{ $self->files }; } else { # We're having to guess $guess = $self->name =~ s{-}{/}gr; $guess = "lib/$guess.pm"; $file = (first { $_->name eq $guess } @{ $self->files }) || (sort { length $a->name <=> length $b->name } grep { $_->name =~ m{\.pm\z} and $_->name =~ m{\Alib/} } @{ $self->files })[0]; $self->log("guessing dist's main_module is " . ($file ? $file->name : $guess)); } 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 }) { push @errorlines, "Upon further inspection we didn't find any files in your dist, did you add any?"; } elsif ( none { $_->name =~ m{^lib/.+\.pm\z} } @{ $self->files } ){ 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_debug("dist's main_module is " . $file->name); return $file; }, ); #pod =attr license #pod #pod This is the L object for this dist's #pod license and copyright. #pod #pod It will be created automatically, if possible, with the #pod C and C attributes. If necessary, it will #pod try to guess the license from the POD of the dist's main module. #pod #pod A better option is to set the C name in the dist's config to something #pod understandable, like C. #pod #pod =cut 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) }) { 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. ", "Perhaps you need to set up a 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]"); } unless (Class::Load::try_load_class($license_class)) { $self->log_fatal( "could not load class $license_class for license " . $self->_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 => 'Str', 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( $year // (localtime)[5] + 1900 ); } ); #pod =attr authors #pod #pod This is an arrayref of author strings, like this: #pod #pod [ #pod 'Ricardo Signes ', #pod 'X. Ample, Jr ', #pod ] #pod #pod This is likely to change at some point in the near future. #pod #pod =cut 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 length $author; $self->log_fatal( "No %User stash and no copyright holder;", "can't determine dist author; configure author or a %User section", ); }, ); #pod =attr files #pod #pod This is an arrayref of objects implementing L that #pod will, if left in this arrayref, be built into the dist. #pod #pod Non-core code should avoid altering this arrayref, but sometimes there is not #pod other way to change the list of files. In the future, the representation used #pod for storing files B. #pod #pod =cut 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; } #pod =attr root #pod #pod This is the root directory of the dist, as a L. It will #pod nearly always be the current working directory in which C was run. #pod #pod =cut has root => ( is => 'ro', isa => Path, coerce => 1, required => 1, ); #pod =attr is_trial #pod #pod This attribute tells us whether or not the dist will be a trial release, #pod i.e. whether it has C 'testing' or 'unstable'. #pod #pod Do not set this directly, it will be derived from C. #pod #pod =cut has is_trial => ( is => 'ro', isa => Bool, init_arg => undef, lazy => 1, builder => '_build_is_trial', ); has _override_is_trial => ( is => 'ro', isa => Bool, init_arg => 'is_trial', default => 0, ); sub _build_is_trial { my ($self) = @_; return $self->release_status =~ /\A(?:testing|unstable)\z/ ? 1 : 0; } #pod =attr plugins #pod #pod This is an arrayref of plugins that have been plugged into this Dist::Zilla #pod object. #pod #pod Non-core code B alter this arrayref. Public access to this attribute #pod B in the future. #pod #pod =cut has plugins => ( is => 'ro', isa => 'ArrayRef[Dist::Zilla::Role::Plugin]', init_arg => undef, default => sub { [ ] }, ); #pod =attr distmeta #pod #pod This is a hashref containing the metadata about this distribution that will be #pod stored in META.yml or META.json. You should not alter the metadata in this #pod hash; use a MetaProvider plugin instead. #pod #pod =cut has distmeta => ( is => 'ro', isa => 'HashRef', init_arg => undef, lazy => 1, builder => '_build_distmeta', ); sub _build_distmeta { my ($self) = @_; require CPAN::Meta::Merge; my $meta_merge = CPAN::Meta::Merge->new(default_version => 2); my $meta = {}; for (@{ $self->plugins_with(-MetaProvider) }) { $meta = $meta_merge->merge($meta, $_->metadata); } $meta = $meta_merge->merge($meta, { 'meta-spec' => { version => 2, url => 'https://metacpan.org/pod/CPAN::Meta::Spec', }, name => $self->name, version => $self->version, abstract => $self->abstract, author => $self->authors, license => [ $self->license->meta2_name ], release_status => $self->release_status, dynamic_config => 0, # problematic, I bet -- rjbs, 2010-06-04 generated_by => $self->_metadata_generator_id . ' version ' . ($self->VERSION // '(undef)'), }); return $meta; } sub _metadata_generator_id { 'Dist::Zilla' } #pod =attr prereqs #pod #pod This is a L object, which is a thin layer atop #pod L, and describes the distribution's prerequisites. #pod #pod =method register_prereqs #pod #pod Allows registration of prerequisites; delegates to #pod L via our L attribute. #pod #pod =cut has prereqs => ( is => 'ro', isa => 'Dist::Zilla::Prereqs', init_arg => undef, lazy => 1, default => sub { Dist::Zilla::Prereqs->new }, handles => [ qw(register_prereqs) ], ); #pod =method plugin_named #pod #pod my $plugin = $zilla->plugin_named( $plugin_name ); #pod #pod =cut sub plugin_named { my ($self, $name) = @_; my $plugin = first { $_->plugin_name eq $name } @{ $self->plugins }; return $plugin if $plugin; return; } #pod =method plugins_with #pod #pod my $roles = $zilla->plugins_with( -SomeRole ); #pod #pod This method returns an arrayref containing all the Dist::Zilla object's plugins #pod that perform the named role. If the given role name begins with a dash, the #pod dash is replaced with "Dist::Zilla::Role::" #pod #pod =cut sub plugins_with { my ($self, $role) = @_; $role =~ s/^-/Dist::Zilla::Role::/; my $plugins = [ grep { $_->does($role) } @{ $self->plugins } ]; return $plugins; } #pod =method find_files #pod #pod my $files = $zilla->find_files( $finder_name ); #pod #pod This method will look for a #pod L-performing plugin with the given #pod name and return the result of calling C on it. If no plugin can be #pod found, an exception will be raised. #pod #pod =cut 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; my @dupes; for my $file (@{ $self->files }) { my $filename = $file->name; if (my $seen = $files_named{ $filename }) { push @{ $seen }, $file; push @dupes, $filename if @{ $seen } == 2; } else { $files_named{ $filename } = [ $file ]; } } return unless @dupes; 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 = path($file->name); my $to_dir = path($build_root)->child( $file_path->parent ); my $to = $to_dir->child( $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: $!"; } #pod =attr logger #pod #pod This attribute stores a L object, used to log #pod messages. By default, a proxy to the dist's L is #pod taken. #pod #pod The following methods are delegated from the Dist::Zilla object to the logger: #pod #pod =for :list #pod * log #pod * log_debug #pod * log_fatal #pod #pod =cut 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 { {} }, ); #pod =method stash_named #pod #pod my $stash = $zilla->stash_named( $name ); #pod #pod This method will return the stash with the given name, or undef if none exists. #pod It looks for a local stash (for this dist) first, then falls back to a global #pod stash (from the user's global configuration). #pod #pod =cut 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; #pod =head1 STABILITY PROMISE #pod #pod None. #pod #pod I will try not to break things within any major release. Minor releases are #pod not extensively tested before release. In major releases, anything goes, #pod although I will try to publish a complete list of known breaking changes in any #pod major release. #pod #pod If Dist::Zilla was a tool, it would have yellow and black stripes and there #pod would be no L
    on it. #pod It is nasty, brutish, and large. #pod #pod =head1 SUPPORT #pod #pod There are usually people on C in C<#distzilla>, even if they're #pod idling. #pod #pod The L has several valuable resources for #pod learning to use Dist::Zilla. #pod #pod There is a mailing list to discuss Dist::Zilla. You can L or L. #pod #pod =head1 SEE ALSO #pod #pod =over 4 #pod #pod =item * #pod #pod In the Dist::Zilla distribution: #pod #pod =over 4 #pod #pod =item * #pod #pod Plugin bundles: #pod L<@Basic|Dist::Zilla::PluginBundle::Basic>, #pod L<@Filter|Dist::Zilla::PluginBundle::Filter>. #pod #pod =item * #pod #pod Major plugins: #pod L, #pod L, #pod L, #pod L, #pod L, #pod ... #pod #pod =back #pod #pod =item * #pod #pod On the CPAN: #pod #pod =over 4 #pod #pod =item * #pod #pod Search for plugins: L #pod #pod =item * #pod #pod Search for plugin bundles: L #pod #pod =back #pod #pod =back __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla - distribution builder; installer not included! =head1 VERSION version 6.010 =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 release_status This attribute sets the release status to one of the L values: 'stable', 'testing' or 'unstable'. If the C<$ENV{RELEASE_STATUS}> environment variable exists, its value will be used as the release status. For backwards compatibility, if C<$ENV{RELEASE_STATUS}> does not exist and the C<$ENV{TRIAL}> variable is true, the release status will be 'testing'. Otherwise, the release status will be set from a L, if one has been configured. For backwards compatibility, setting C true in F is equivalent to using a C. If C is false, it has no effect. Only B C may be used. If no providers are used, the release status defaults to 'stable' unless there is an "_" character in the version, in which case, it defaults to 'testing'. =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, i.e. whether it has C 'testing' or 'unstable'. Do not set this directly, it will be derived from C. =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 register_prereqs Allows registration of prerequisites; delegates to L via our L attribute. =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 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 STABILITY PROMISE None. I will try not to break things within any major release. Minor releases are not extensively tested before release. In major releases, anything goes, although I will try to publish a complete list of known breaking changes in any major release. If Dist::Zilla was a tool, it would have yellow and black stripes and there would be no L
      on it. It is nasty, brutish, and large. =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 CONTRIBUTORS =for stopwords Ævar Arnfjörð Bjarmason Alastair McGowan-Douglas Alexei Znamensky Alex Vandiver ambs Andrew Rodland Andy Jack Apocalypse ben hengst Bernardo Rechea Brian Fraser Caleb Cushing Chase Whitener Chisel Christian Walde Christopher J. Madsen Chris Weyl Cory G Watson csjewell Curtis Brandt Dagfinn Ilmari Mannsåker Damien KRotkine Danijel Tasov Dave O'Neill Rolsky David E. Wheeler Golden H. Adler Steinbrunner Zurborg Davor Cubranic Dimitar Petrov Doug Bell Erik Carlsson Fayland Lam Florian Ragwitz Fred Moyer fREW Schmidt gardnerm Gianni Ceccarelli Graham Barr Knop Ollis Grzegorz Rożniecki Hans Dieter Pearcey Hunter McMillen Ivan Bessarabov Jakob Voss jantore Jérôme Quelin Jesse Luehrs Vincent John Napiorkowski jonasbn Jonathan C. Otsuka Rockway Scott Duff Yu Karen Etheridge Kent Fredric Leon Timmermans Lucas Theisen Luc St-Louis Marcel Gruenauer Martin McGrath Mary Ehlers Mateu X mauke Michael G. Schwern Jemmeson Mickey Nasriachi Mike Doherty Mohammad S Anwar Moritz Onken Neil Bowers Nickolay Platonov Nick Tonkin nperez Olivier Mengué Paul Cochrane Pedro Melo Philippe Bruhat (BooK) Randy Stauner robertkrimen Rob Hoelz Robin Smidsrød Roy Ivy III Shawn M Moore Smylers Steffen Schwigon Steven Haryanto Tatsuhiko Miyagawa Upasana Shukla Vyacheslav Matjukhin Yanick Champoux Yuval Kogman =over 4 =item * Ævar Arnfjörð Bjarmason =item * Alastair McGowan-Douglas =item * Alexei Znamensky =item * Alex Vandiver =item * ambs =item * Andrew Rodland =item * Andy Jack =item * Apocalypse =item * ben hengst =item * Bernardo Rechea =item * Brian Fraser =item * Caleb Cushing =item * Chase Whitener =item * Chisel =item * Christian Walde =item * Christopher J. Madsen =item * Chris Weyl =item * Cory G Watson =item * csjewell =item * Curtis Brandt =item * Dagfinn Ilmari Mannsåker =item * Damien KRotkine =item * Danijel Tasov =item * Dave O'Neill =item * Dave Rolsky =item * David E. Wheeler =item * David Golden =item * David H. Adler =item * David Steinbrunner =item * David Zurborg =item * Davor Cubranic =item * Dimitar Petrov =item * Doug Bell =item * Erik Carlsson =item * Fayland Lam =item * Florian Ragwitz =item * Fred Moyer =item * fREW Schmidt =item * gardnerm =item * Gianni Ceccarelli =item * Graham Barr =item * Graham Knop =item * Graham Ollis =item * Graham Ollis =item * Grzegorz Rożniecki =item * Hans Dieter Pearcey =item * Hunter McMillen =item * Ivan Bessarabov =item * Jakob Voss =item * jantore =item * Jérôme Quelin =item * Jesse Luehrs =item * Jesse Vincent =item * John Napiorkowski =item * jonasbn =item * Jonathan C. Otsuka =item * Jonathan Rockway =item * Jonathan Scott Duff =item * Jonathan Yu =item * Karen Etheridge =item * Kent Fredric =item * Leon Timmermans =item * Lucas Theisen =item * Luc St-Louis =item * Marcel Gruenauer =item * Martin McGrath =item * Mary Ehlers =item * Mateu X Hunter =item * mauke =item * Michael G. Schwern =item * Michael Jemmeson =item * Mickey Nasriachi =item * Mike Doherty =item * Mohammad S Anwar =item * Moritz Onken =item * Neil Bowers =item * Nickolay Platonov =item * Nick Tonkin <1nickt@users.noreply.github.com> =item * nperez =item * Olivier Mengué =item * Paul Cochrane =item * Pedro Melo =item * Philippe Bruhat (BooK) =item * Randy Stauner =item * robertkrimen =item * Rob Hoelz =item * Robin Smidsrød =item * Roy Ivy III =item * Shawn M Moore =item * Smylers =item * Steffen Schwigon =item * Steven Haryanto =item * Tatsuhiko Miyagawa =item * Upasana Shukla =item * Vyacheslav Matjukhin =item * Yanick Champoux =item * Yuval Kogman =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 empty-abstract.t100644000767000024 205613130677627 16411 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/tuse strict; use warnings; use Test::More; use Test::DZil; use Test::Fatal; use Path::Tiny; use List::Util 'first'; my $tzil = Builder->from_config( { dist_root => 't/does_not_exist' }, { add_files => { path(qw(source dist.ini)) => simple_ini( 'GatherDir', ), path(qw(source lib DZT Sample.pm)) => <> here, and an empty ABSTRACT comment. The empty ABSTRACT comment should be skipped, and the NAME one used. =cut MODULE }, }, ); is( exception { $tzil->build }, undef, 'build proceeds normally', ); is( Dist::Zilla::Util->abstract_from_file(first { $_->name eq 'lib/DZT/Sample.pm' } @{$tzil->files}), 'a sample module for testing handling of empty ABSTRACT comment', 'We should see the abstract from the =head NAME section in pod', ); done_testing; plugins000755000767000024 013130677627 14603 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/tprunes.t100644000767000024 1277213130677627 16475 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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...", ); } { 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'), # Make sure there are multiple files to be pruned. 'source/DZT-Sample-1/foo' => "foo from previous build\n", 'source/DZT-Sample-1/bar' => "bar from previous build\n", 'source/DZT-Sample-1/baz' => "baz from previous build\n", 'source/DZT-Sampler-1/stays' => "file stays\n", }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw(dist.ini lib/DZT/Sample.pm t/basic.t DZT-Sampler-1/stays) ], "all files from previous build removed", ); } 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)", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', [ PruneFiles => { match => '^dist.ini|\.t$' } ], ), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw(lib/DZT/Sample.pm) ], "prune multiple files with 'match'", ); } done_testing; readme.t100644000767000024 166113130677627 16371 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; 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; misc000755000767000024 013130677627 13612 5ustar00rjbsstaff000000000000Dist-Zilla-6.010dzil_bootstrap100644000767000024 212713130677627 16736 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.t100644000767000024 177213130677627 16561 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; 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.t100644000767000024 661613130677627 16606 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use autodie; use Test::DZil; my $with_dist = ' package DZT::WDist; our $DIST = \'DZT-Blort\'; 1; '; my $with_dist_fully_qualified = ' package DZT::WDistFullyQualified; $DZT::WDistFullyQualified::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/WDist.pm' => $with_dist, 'source/lib/DZT/WDistFullyQualified.pm' => $with_dist_fully_qualified, 'source/lib/DZT/R1.pm' => $repeated_packages, 'source/lib/DZT/Monkey.pm' => $monkey_patched, 'source/bin/script_pkg.pl' => $script_pkg, 'source/bin/script_dist.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 \$DIST 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 \$DIST to DZT::TP1", ); like( $dzt_tp1, qr{^\s*\$\QDZT::TP2::DIST = 'DZT-Sample';\E\s*$}m, "added \$DIST to DZT::TP2", ); my $dzt_wdist = $tzil->slurp_file('build/lib/DZT/WDist.pm'); unlike( $dzt_wdist, qr{^\s*\$\QDZT::WDist::DIST = 'DZT-Sample';\E\s*$}m, "*not* added to DZT::WDist; we have one already", ); my $dzt_wdist_fully_qualified = $tzil->slurp_file('build/lib/DZT/WDistFullyQualified.pm'); unlike( $dzt_wdist_fully_qualified, qr{^\s*\$\QDZT::WDistFullyQualified::DIST = 'DZT-Sample';\E\s*$}m, "*not* added to DZT::WDist; 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 \$DIST 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 \$DIST to plain script", ); }; my $script_wdist = $tzil->slurp_file('build/bin/script_dist.pl'); unlike( $script_wdist, qr{^\s*\$\QDZT::WDist::DIST = 'DZT-Sample';\E\s*$}m, "*not* added \$DIST to DZT::Script; we have one already", ); ok( grep({ m(skipping lib/DZT/WDist\.pm: assigns to \$DIST) } @{ $tzil->log_messages }), "we report the reason for no updating WDist", ); 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 \$DIST 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.t100644000767000024 1245013130677627 16633 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Fatal qw(exception); use Test::Deep; use Test::DZil; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ 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; cmp_deeply( $tzil->distmeta,, superhashof({ 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 => ], [ 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; is_deeply( $tzil->distmeta->{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 => ], [ 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; cmp_deeply( $tzil->distmeta, superhashof( { 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 => ], [ 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; cmp_deeply( $tzil->distmeta, superhashof( { 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.t100644000767000024 70213130677627 16720 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.t100644000767000024 1121013130677627 16755 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Deep; use utf8; use Test::DZil; use JSON::MaybeXS; 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', 'MetaConfig', ), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; my %meta; my $json = $tzil->slurp_file('build/META.json'); $meta{json} = JSON::MaybeXS->new(utf8 => 0)->decode($json); $meta{json}{x_serialization_backend} = 'ignore'; $meta{original} = $tzil->distmeta; $meta{original}{x_serialization_backend} = 'ignore'; cmp_deeply( $meta{json}, { %{ $meta{original} }, generated_by => $meta{original}{generated_by} . ', CPAN::Meta::Converter version ' . CPAN::Meta::Converter->VERSION, }, "META.json data is identical to original distmeta", ); for my $type (qw(json original)) { 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', ); cmp_deeply( $meta, superhashof(\%want), "2.0 $type data", ); } } { # 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' } ], 'MetaYAML', 'MetaConfig', ), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; my %meta; my $yaml = $tzil->slurp_file('build/META.yml'); $meta{yaml} = YAML::Tiny->new->read_string($yaml)->[0]; $meta{yaml}{x_serialization_backend} = 'ignore'; #cmp_deeply($meta{json}, $meta{yaml}, "META.json data is identical to META.yml"); for my $type (qw(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', ); cmp_deeply( $meta, superhashof(\%want), "1.4 $type data", ); } } { # 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::MaybeXS->new(utf8 => 0)->decode($json); $meta{json}{x_serialization_backend} = 'ignore'; my $yaml = $tzil->slurp_file('build/META.yml'); $meta{yaml} = YAML::Tiny->new->read_string($yaml)->[0]; $meta{yaml}{x_serialization_backend} = 'ignore'; for my $type (qw(json yaml)) { cmp_deeply( $meta{$type}{author}, [ 'Olivier Mengué ', '김도형 ' ], "authors ($type) are set as expected, decode properly", ); } } done_testing; encoding.t100644000767000024 107713130677627 16723 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; use autodie; use Test::DZil; my $ini = <<'END_INI'; license = Perl_5 author = E. Xavier Ample abstract = Sample DZ Dist name = DZT-Sample copyright_holder = E. Xavier Ample version = 0.001 [GatherDir] [Encoding / general] encoding=utf8 match=^ ignore=^t/ [Encoding / subset] encoding=bytes match=^t/ END_INI my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => $ini }, }, ); $tzil->build; pass; done_testing; ffbyname.t100644000767000024 1301213130677627 16734 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/plugins# 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.t100644000767000024 167213130677627 16642 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.t100644000767000024 327113130677627 16741 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Deep; use ExtUtils::Manifest 1.66; # or maniread can't cope with quoting properly 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-ticks.txt'} => "baz\n", 'source/dist.ini' => simple_ini( 'GatherDir', 'Manifest', ), $^O =~ /^(MSWin32|cygwin)$/ ? () : ( q{source/file\\with some\\whacks.txt} => "bar\n", q{source/file'with'quotes\\or\\backslash.txt} => "quux\n", q{source/dir\\with some\\/whacks.txt} => "mar\n", ), }, }, ); $tzil->build; my $manihash = ExtUtils::Manifest::maniread($tzil->built_in->child('MANIFEST')); cmp_deeply( [ keys %$manihash ], bag( 'MANIFEST', q{file with spaces.txt}, q{'file-with-ticks.txt'}, 'dist.ini', 'lib/DZT/Sample.pm', 't/basic.t', $^O =~ /^(MSWin32|cygwin)$/ ? () : ( q{file\\with some\\whacks.txt}, q{file'with'quotes\\or\\backslash.txt}, q{dir\\with some\\/whacks.txt}, ), ), 'manifest quotes files with spaces' ); my @manilines = grep { ! /^#/ } split /\n/, $tzil->slurp_file('build/MANIFEST'); chomp @manilines; cmp_deeply( \@manilines, bag( 'MANIFEST', q{'file with spaces.txt'}, q{'\\'file-with-ticks.txt\\''}, 'dist.ini', 'lib/DZT/Sample.pm', 't/basic.t', $^O =~ /^(MSWin32|cygwin)$/ ? () : ( q{'file\\\\with some\\\\whacks.txt'}, q{'file\\'with\\'quotes\\\\or\\\\backslash.txt'}, q{'dir\\\\with some\\\\/whacks.txt'}, ), ), 'manifest quotes files with spaces' ); done_testing; zzz-check-breaks.t100644000767000024 423113130677627 16624 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/tuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CheckBreaks 0.018 use Test::More tests => 3; SKIP: { eval 'require Module::Runtime::Conflicts; Module::Runtime::Conflicts->check_conflicts'; skip('no Module::Runtime::Conflicts module found', 1) if not $INC{'Module/Runtime/Conflicts.pm'}; diag $@ if $@; pass 'conflicts checked via Module::Runtime::Conflicts'; } SKIP: { eval 'require Moose::Conflicts; Moose::Conflicts->check_conflicts'; skip('no Moose::Conflicts module found', 1) if not $INC{'Moose/Conflicts.pm'}; diag $@ if $@; pass 'conflicts checked via Moose::Conflicts'; } # this data duplicates x_breaks in META.json my $breaks = { "Dist::Zilla::App::Command::stale" => "< 0.040", "Dist::Zilla::App::Command::update" => "<= 0.04", "Dist::Zilla::App::Command::xtest" => "< 0.029", "Dist::Zilla::Plugin::Author::Plicease::Tests" => "<= 2.02", "Dist::Zilla::Plugin::CopyFilesFromBuild" => "< 0.161230", "Dist::Zilla::Plugin::CopyFilesFromBuild::Filtered" => "<= 0.001", "Dist::Zilla::Plugin::Git" => "<= 2.036", "Dist::Zilla::Plugin::Keywords" => "<= 0.006", "Dist::Zilla::Plugin::MakeMaker::Awesome" => "< 0.22", "Dist::Zilla::Plugin::NameFromDirectory" => "<= 0.03", "Dist::Zilla::Plugin::PodWeaver" => "<= 4.006", "Dist::Zilla::Plugin::Prereqs::AuthorDeps" => "<= 0.005", "Dist::Zilla::Plugin::ReadmeAnyFromPod" => "< 0.161170", "Dist::Zilla::Plugin::RepoFileInjector" => "<= 0.005", "Dist::Zilla::Plugin::Run" => "<= 0.035", "Dist::Zilla::Plugin::Test::CheckDeps" => "<= 0.013", "Dist::Zilla::Plugin::Test::Version" => "<= 1.05", "Dist::Zilla::Plugin::TrialVersionComment" => "<= 0.003" }; use CPAN::Meta::Requirements; use CPAN::Meta::Check 0.011; my $reqs = CPAN::Meta::Requirements->new; $reqs->add_string_requirement($_, $breaks->{$_}) foreach keys %$breaks; our $result = CPAN::Meta::Check::check_requirements($reqs, 'conflicts'); if (my @breaks = grep { defined $result->{$_} } keys %$result) { diag 'Breakages found with Dist-Zilla:'; diag "$result->{$_}" for sort @breaks; diag "\n", 'You should now update these modules!'; } pass 'checked x_breaks data'; Zilla000755000767000024 013130677627 15403 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/DistApp.pm100644000767000024 1212513130677627 16642 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zillause strict; use warnings; package Dist::Zilla::App 6.010; # ABSTRACT: Dist::Zilla's App::Cmd use App::Cmd::Setup 0.330 -app; # better compilation error detection use Carp (); use Try::Tiny; $Carp::Internal{'Module::Runtime'} = 1; sub global_opt_spec { my ($self) = @_; return ( [ "verbose|v", "log additional output" ], [ "verbose-plugin|V=s@", "log additional output from some plugins only" ], [ "lib-inc|I=s@", "additional \@INC dirs", { callbacks => { 'always fine' => sub { unshift @INC, @{$_[0]}; } } } ], $self->SUPER::global_opt_spec, ); } 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__} = {}; require Dist::Zilla::Util; my $config_dir = Dist::Zilla::Util->_global_config_root; my $config_base = $config_dir->child('config'); require Dist::Zilla::MVP::Reader::Finder; 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 { my $e = $_; if (eval { $e->isa('Config::MVP::Error') and $e->ident eq 'package not installed' }) { my $package = $e->package; my $bundle = $package =~ /^@/ ? ' bundle' : ''; die <<"END_DIE"; Required plugin$bundle $package isn't installed. Remedy with: cpanm $package END_DIE } else { 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; } #pod =method zilla #pod #pod This returns the Dist::Zilla object in use by the command. If none has yet #pod been constructed, one will be by calling C<< Dist::Zilla->from_config >>. #pod #pod =cut 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_plugin ? grep { length } @{ $self->global_options->verbose_plugin } : (); my $verbose = $self->global_options->verbose; $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_plugin ? grep { length } @{ $self->global_options->verbose_plugin } : (); my $verbose = $self->global_options->verbose; $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 }; $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 6.010 =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) 2017 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 commands000755000767000024 013130677627 14723 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/tlistdeps.t100644000767000024 644713130677627 17112 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/commandsuse strict; use warnings; use Test::More 0.88; use Test::Deep; use Dist::Zilla::App::Tester; # see also t/plugins/autoprereqs.t my %prereqs = ( requires => { # 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, }, recommends => { 'Term::ReadLine::Gnu' => 0, 'Archive::Tar::Wrapper' => 0.15 }, suggests => { 'PPI::XS' => 1.23 } ); my %versions = ('String::Formatter' => 0); for my $type (keys %prereqs) { @versions{ keys %{$prereqs{$type}} } = values %{$prereqs{$type}}; } my @default_prereqs = ( keys %{$prereqs{requires}}, keys %{$prereqs{recommends}} ); for my $how ( [ [ ], sub {$_} ], # normal [ [ '--versions' ], sub { "$_ = $versions{$_}" } ], [ [ '--cpanm-versions' ], sub { qq{$_~"$versions{$_}"} } ], ) { my @opt = @{ $how->[0] }; my $map = $how->[1]; my $desc = @opt ? "@opt" : "default"; my $make_bag = sub { bag(map {; $map->() } grep {; $_ ne 'perl' } @_) }; subtest "$desc output" => sub { { my $output = test_dzil( 'corpus/dist/AutoPrereqs', [ qw(listdeps), @opt ] )->output; cmp_deeply( [ split("\n", $output) ], $make_bag->(@default_prereqs), "all prereqs listed as output", ); } { my $output = test_dzil( 'corpus/dist/AutoPrereqs', [ qw(listdeps --no-requires), @opt ] )->output; cmp_deeply( [ split("\n", $output) ], $make_bag->(keys %{$prereqs{recommends}}), "no recommended prereqs listed as output, --no-requires", ); } { my $output = test_dzil( 'corpus/dist/AutoPrereqs', [ qw(listdeps --no-recommends), @opt ] )->output; cmp_deeply( [ split("\n", $output) ], $make_bag->(keys %{$prereqs{requires}}), 'no recommended prereqs listed as output, --no-recommends', ); } { my $output = test_dzil( 'corpus/dist/AutoPrereqs', [ qw(listdeps --suggests), @opt ] )->output; cmp_deeply( [ split("\n", $output) ], $make_bag->(@default_prereqs, keys %{$prereqs{suggests}}), 'no recommended prereqs listed as output, --suggests', ); } foreach my $arg (qw(--author --develop)) { my $output = test_dzil( 'corpus/dist/AutoPrereqs', [ 'listdeps', $arg, @opt ] )->output; cmp_deeply( [ split("\n", $output) ], $make_bag->('String::Formatter', @default_prereqs), 'develop prereqs included in output for ' . $arg, ); } }; } done_testing; gatherdir.t100644000767000024 1017613130677627 17126 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use ExtUtils::Manifest 'maniread'; use Test::DZil; use Path::Tiny; 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', 'subdir/index.html' ], } ], [ GatherDir => SelectiveMatch => { root => '../corpus/extra', prefix => 'xmatch', exclude_match => [ 'notme\.*', '^subdir/index\.html$' ], } ], [ GatherDir => Symlinks => { root => '../corpus/extra', follow_symlinks => 1, prefix => 'links', } ], [ GatherDir => PruneDirectory => { root => '../corpus/extra', prefix => 'pruned', prune_directory => '^subdir$', } ], 'Manifest', 'MetaConfig', ), 'source/.profile' => "Bogus dotfile.\n", 'corpus/extra/.dotfile' => "Bogus dotfile.\n", 'corpus/extra/notme.txt' => "A file to exclude.\n", 'source/.dotdir/extra/notme.txt' => "Another file to exclude.\n", 'source/extra/.dotdir/notme.txt' => "Another file to exclude.\n", }, also_copy => { 'corpus/extra' => 'corpus/extra', 'corpus/global' => 'corpus/global' }, }, ); my $corpus_dir = path($tzil->tempdir)->child('corpus'); if ($^O ne 'MSWin32') { symlink $corpus_dir->child('extra', 'vader.txt'), $corpus_dir->child('extra', 'vader_link.txt') or note "could not create link: $!"; # link must be to something that is not otherwise being gathered, or we get duplicate errors symlink $corpus_dir->child('global'), $corpus_dir->child('extra', 'global_link') or note "could not create link: $!"; } $tzil->chrome->logger->set_debug(1); $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/vader.txt xmatch/vader.txt links/vader.txt links/subdir/index.html links/notme.txt pruned/notme.txt pruned/vader.txt dist.ini lib/DZT/Sample.pm t/basic.t MANIFEST ), ($^O ne 'MSWin32' ? ('links/global_link/config.ini') : ()), ($^O ne 'MSWin32' ? (map { $_ . '/vader_link.txt' } qw(bonus dotty some xmatch links pruned)) : ()), ], "GatherDir gathers all files in the source dir", ); my $manifest = maniread($tzil->tempdir->child('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"); diag 'got log messages: ', explain $tzil->log_messages if not Test::Builder->new->is_passing; my @to_remove; TODO: { todo_skip('MSWin32 - skipping symlink test', 1) if $^O eq 'MSWin32'; # tmp/tmp -> tmp/private/tmp my $real_tmp = path('tmp', 'private', 'tmp'); mkpath $real_tmp; my $link_tmp = path('tmp', 'tmp'); symlink 'private/tmp', 'tmp/tmp'; push @to_remove, [ $real_tmp, $link_tmp ]; my $tzil = Builder->from_config( { dist_root => 'corpus/dist' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => { root => 'DZ1' } ], ), }, tempdir_root => 'tmp/tmp', }, ); $tzil->chrome->logger->set_debug(1); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw(dist.ini lib/DZ1.pm) ], "GatherDir gathers all files in the source dir (canonically corpus/dist/DZ1)", ); diag 'got log messages: ', explain $tzil->log_messages if not Test::Builder->new->is_passing; } for my $pair (@to_remove) { $pair->[0]->remove_tree; $pair->[1]->remove; } done_testing; makemaker.t100644000767000024 776513130677627 17104 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Deep; use Test::Fatal; 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', Baz => '1.2.3', Buzz => 'v1.2' } ], [ Prereqs => BuildRequires => { 'Builder::Bob' => '9.901' } ], [ Prereqs => TestRequires => { 'Test::Deet' => '7', perl => '5.008' } ], [ Prereqs => ConfigureRequires => { perl => '5.010' } ], ), }, }, ); $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', MIN_PERL_VERSION => '5.010', test => { TESTS => 't/*.t' }, PREREQ_PM => { 'Foo::Bar' => '1.20', 'Baz' => '1.2.3', 'Buzz' => '1.2.0', }, BUILD_REQUIRES => { 'Builder::Bob' => '9.901', }, TEST_REQUIRES => { 'Test::Deet' => '7', }, CONFIGURE_REQUIRES => { 'ExtUtils::MakeMaker' => '0' }, test => { TESTS => 't/*.t' }, ); cmp_deeply( $makemaker->__write_makefile_args, \%want, 'correct makemaker args generated', ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', 'MakeMaker', [ Prereqs => { perl => '5.8.1' } ], [ Prereqs => BuildRequires => { 'Builder::Bob' => 0 } ], [ Prereqs => TestRequires => { 'Tester::Bob' => 0 } ], [ Prereqs => RuntimeRequires => { 'Runner::Bob' => 0 } ], ), }, }, ); $tzil->build; my $content = $tzil->slurp_file('build/Makefile.PL'); like($content, qr/^use 5\.008001;\s*$/m, "normalized the perl version needed"); $content =~ m'^my %FallbackPrereqs = \(\n([^;]+)^\);$'mg; like($1, qr'"Builder::Bob" => ', 'build-requires prereqs made it into %FallbackPrereqs'); like($1, qr'"Tester::Bob" => ', 'test-requires prereqs made it into %FallbackPrereqs'); like($1, qr'"Runner::Bob" => ', 'runtime-requires prereqs made it into %FallbackPrereqs'); } { my $tzil = Builder->from_config( { dist_root => 'does-not-exist' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', 'MakeMaker', [ Prereqs => { 'External::Module' => '<= 1.23' } ], ), 'source/lib/Foo.pm' => "package Foo;\n1\n", }, }, ); like( exception { $tzil->build }, qr/\Q[MakeMaker] found version range in runtime prerequisites, which ExtUtils::MakeMaker cannot parse (must specify eumm_version of at least 7.1101): External::Module <= 1.23\E/, 'build does not permit passing unparsable version range', ); diag 'got log messages: ', explain $tzil->log_messages if not Test::Builder->new->is_passing; } { my $tzil = Builder->from_config( { dist_root => 'does-not-exist' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', [ 'MakeMaker' => { eumm_version => '7.12' } ], [ Prereqs => { 'External::Module' => '<= 1.23' } ], ), 'source/lib/Foo.pm' => "package Foo;\n1\n", }, }, ); $tzil->chrome->logger->set_debug(1); is( exception { $tzil->build }, undef, 'build proceeds normally', ); ok( !(grep { m'[MakeMaker] found version range' } @{ $tzil->log_messages }), 'got no warning about probably-unparsable version range', ); diag 'got log messages: ', explain $tzil->log_messages if not Test::Builder->new->is_passing; } done_testing; misctests.t100644000767000024 231313130677627 17145 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Deep; use autodie; 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) ), }, }, ); $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/author/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/author/pod-coverage.t'); like($pod_c_test, qr{all_pod_coverage_ok}, "we have a pod-coverage test"); cmp_deeply( $tzil->distmeta, superhashof( { 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; 00-report-prereqs.t100644000767000024 1342613130677627 16704 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: extra000755000767000024 013130677627 15315 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpusvader.txt100644000767000024 2513130677627 17254 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/extra (breathing sounds) Path.pm100644000767000024 331513130677627 16777 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zillause strict; use warnings; use utf8; package Dist::Zilla::Path 6.010; # ABSTRACT: a helper to get Path::Tiny objects use parent 'Path::Tiny'; use Path::Tiny 0.052 qw(); # issue 427 use Scalar::Util qw( blessed ); use Sub::Exporter -setup => { exports => [ qw( path ) ], groups => { default => [ qw( path ) ] }, }; sub path { my ($thing, @rest) = @_; if (@rest == 0 && blessed $thing) { return $thing if $thing->isa(__PACKAGE__); return bless(Path::Tiny::path("$thing"), __PACKAGE__) if $thing->isa('Path::Class::Entity') || $thing->isa('Path::Tiny'); } return bless(Path::Tiny::path($thing, @rest), __PACKAGE__); } my %warned; sub file { my ($self, @file) = @_; my ($package, $pmfile, $line) = caller; unless ($warned{ $pmfile, $line }++) { Carp::carp("->file called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class"); } require Path::Class; Path::Class::dir($self)->file(@file); } sub subdir { my ($self, @subdir) = @_; Carp::carp("->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class"); require Path::Class; Path::Class::dir($self)->subdir(@subdir); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Path - a helper to get Path::Tiny objects =head1 VERSION version 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 Util.pm100644000767000024 1061613130677627 17042 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zillause strict; use warnings; package Dist::Zilla::Util 6.010; # ABSTRACT: random snippets of code that Dist::Zilla wants use Carp (); use Encode (); { 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:[ \t]*(\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; $self->{abstract} =~ s/\s+/\x20/g; } } } #pod =method abstract_from_file #pod #pod This method, I, tries to guess the #pod abstract of a given file, assuming that it's Perl code. It looks for a POD #pod C<=head1> section called "NAME" or a comment beginning with C. #pod #pod =cut sub abstract_from_file { my ($self, $file) = @_; my $e = Dist::Zilla::Util::PEA->_new; my $chars = $file->content; my $bytes = Encode::encode('UTF-8', $chars, Encode::FB_CROAK); $e->read_string($bytes); return $e->{abstract}; } #pod =method expand_config_package_name #pod #pod my $pkg_name = Dist::Zilla::Util->expand_config_package_name($string); #pod #pod This method, I, rewrites the given string #pod into a package name. #pod #pod Prefixes are rewritten as follows: #pod #pod =for :list #pod * C<=> becomes nothing #pod * C<@> becomes C #pod * C<%> becomes C #pod * otherwise, C is prepended #pod #pod =cut use String::RewritePrefix 0.006 rewrite => { -as => '_expand_config_package_name', prefixes => { '=' => '', '@' => 'Dist::Zilla::PluginBundle::', '%' => 'Dist::Zilla::Stash::', '' => 'Dist::Zilla::Plugin::', }, }; sub expand_config_package_name { shift; goto &_expand_config_package_name } sub _global_config_root { require Dist::Zilla::Path; return Dist::Zilla::Path::path($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 Dist::Zilla::Path::path($homedir)->child('.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) does not match required version: %s\n", $pkg, $have_version // 'undef', $version, ); } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Util - random snippets of code that Dist::Zilla wants =head1 VERSION version 6.010 =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 = Dist::Zilla::Util->expand_config_package_name($string); This method, I, rewrites the given string into a package name. Prefixes are rewritten as follows: =over 4 =item * C<=> becomes nothing =item * C<@> becomes C =item * C<%> becomes C =item * otherwise, C is prepended =back =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.t100644000767000024 347113130677627 17343 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; 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 }; cmp_deeply( \@files, bag(qw( 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", ); } cmp_deeply( $tzil->distmeta, 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) }, }, develop => { requires => { # remaining xt/ files were moved aside and not scanned 'Foo::blort' => '392', 'Test::More' => '0.88', }, }, }, }), 'dependencies ok', ) or diag $tzil->distmeta; done_testing; gatherfile.t100644000767000024 561313130677627 17247 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::DZil; use Test::Fatal; use Path::Tiny; { my $tzil = Builder->from_config( { dist_root => 'does-not-exist' }, { add_files => { path(qw(source dist.ini)) => simple_ini( [ 'GatherFile' => { filename => 'lib/DZT/Sample.pm', }], ), path(qw(source lib DZT Sample.pm)) => "package DZT::Sample;\n1", }, }, ); $tzil->chrome->logger->set_debug(1); is( exception { $tzil->build }, undef, 'build proceeds normally', ); my $build_dir = path($tzil->tempdir)->child('build'); ok(-e $build_dir->child(qw(lib DZT Sample.pm)), 'file was gathered correctly'); diag 'got log messages: ', explain $tzil->log_messages if not Test::Builder->new->is_passing; } { my $tzil = Builder->from_config( { dist_root => 'does-not-exist' }, { add_files => { path(qw(source dist.ini)) => simple_ini( [ 'GatherFile' => { filename => 'lib/DZT/Sample.pm', }], ), # no source/lib/DZT/Sample.pm }, }, ); $tzil->chrome->logger->set_debug(1); like( exception { $tzil->build }, qr{lib/DZT/Sample.pm does not exist!}, 'missing file is detected', ); diag 'got log messages: ', explain $tzil->log_messages if not Test::Builder->new->is_passing; } { my $tzil = Builder->from_config( { dist_root => 'does-not-exist' }, { add_files => { path(qw(source dist.ini)) => simple_ini( [ 'GatherFile' => { filename => 'subdir/index.html', root => 'corpus/extra', }], ), }, also_copy => { 'corpus/extra' => 'source/corpus/extra' }, }, ); $tzil->chrome->logger->set_debug(1); is( exception { $tzil->build }, undef, 'build proceeds normally', ); my $build_dir = path($tzil->tempdir)->child('build'); ok(-e $build_dir->child(qw(subdir index.html)), 'file was gathered correctly from a different root'); diag 'got log messages: ', explain $tzil->log_messages if not Test::Builder->new->is_passing; } { my $tzil = Builder->from_config( { dist_root => 'does-not-exist' }, { add_files => { path(qw(source dist.ini)) => simple_ini( [ 'GatherFile' => { filename => 'lib/DZT/Sample.pm', prefix => 'stuff', }], ), path(qw(source lib DZT Sample.pm)) => "package DZT::Sample;\n1", }, }, ); $tzil->chrome->logger->set_debug(1); is( exception { $tzil->build }, undef, 'build proceeds normally', ); my $build_dir = path($tzil->tempdir)->child('build'); ok(-e $build_dir->child(qw(stuff lib DZT Sample.pm)), 'file was gathered correctly into the prefix dir'); diag 'got log messages: ', explain $tzil->log_messages if not Test::Builder->new->is_passing; } done_testing; pkgversion.t100644000767000024 2721313130677627 17344 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use autodie; use utf8; use Test::DZil; use Test::Fatal; 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 $with_version_fully_qualified = ' package DZT::WVerFullyQualified; $DZT::WVerFullyQualified::VERSION = 1.234; 1; '; my $use_our = ' package DZT::UseOur; { our $VERSION = \'1.234\'; } 1; '; my $in_a_string_escaped = ' package DZT::WStrEscaped; print "\$VERSION = 1.234;" 1; '; my $xsloader_version = ' package DZT::XSLoader; use XSLoader; XSLoader::load __PACKAGE__, $DZT::XSLoader::VERSION; 1; '; my $in_comment = ' package DZT::WInComment; # our $VERSION = 1.234; 1; '; my $in_comment_in_sub = ' package DZT::WInCommentInSub; sub foo { # our $VERSION = 1.234; } 1; '; my $in_pod_stm = ' package DZT::WInPODStm; 1; END our $VERSION = 1.234; =for bug # Because we have an END up there PPI considers this a statement our $VERSION = 1.234; =cut '; $in_pod_stm =~ s/END/__END__/g; 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 $pod_with_pkg = ' package DZT::PodWithPackage; =pod =cut '; my $pod_with_utf8 = ' package DZT::PodWithUTF8; our $π = atan2(1,1) * 4; =pod =cut '; my $pod_no_pkg = ' =pod =cut '; { 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/WVerFullyQualified.pm' => $with_version_fully_qualified, 'source/lib/DZT/UseOur.pm' => $use_our, 'source/lib/DZT/WStrEscaped.pm' => $in_a_string_escaped, 'source/lib/DZT/XSLoader.pm' => $xsloader_version, 'source/lib/DZT/WInComment.pm' => $in_comment, 'source/lib/DZT/WInCommentInSub.pm' => $in_comment_in_sub, 'source/lib/DZT/WInPODStm.pm' => $in_pod_stm, 'source/lib/DZT/R1.pm' => $repeated_packages, 'source/lib/DZT/Monkey.pm' => $monkey_patched, 'source/lib/DZT/HideMe.pm' => $hide_me_comment, 'source/lib/DZT/PodWithPackage.pm' => $pod_with_pkg, 'source/lib/DZT/PodNoPackage.pm' => $pod_no_pkg, 'source/lib/DZT/PodWithUTF8.pm' => $pod_with_utf8, '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_fully_qualified = $tzil->slurp_file('build/lib/DZT/WVerFullyQualified.pm'); unlike( $dzt_wver_fully_qualified, qr{^\s*\$\QDZT::WVerFullyQualified::VERSION = '0.001';\E\s*$}m, "*not* added to DZT::WVerFullyQualified; we have one already", ); my $dzt_use_our = $tzil->slurp_file('build/lib/DZT/UseOur.pm'); unlike( $dzt_use_our, qr{^\s*\$\QDZT::UseOur::VERSION = '0.001';\E\s*$}m, "*not* added to DZT::UseOur; we have one already", ); my $dzt_xsloader = $tzil->slurp_file('build/lib/DZT/XSLoader.pm'); like( $dzt_xsloader, qr{^\s*\$\QDZT::XSLoader::VERSION = '0.001';\E\s*$}m, "added version to DZT::XSLoader", ); my $dzt_wver_in_comment = $tzil->slurp_file('build/lib/DZT/WInComment.pm'); like( $dzt_wver_in_comment, qr{^\s*\$\QDZT::WInComment::VERSION = '0.001';\E\s*$}m, "added to DZT::WInComment; the one we have is in a comment", ); my $dzt_wver_in_comment_in_sub = $tzil->slurp_file('build/lib/DZT/WInCommentInSub.pm'); like( $dzt_wver_in_comment_in_sub, qr{^\s*\$\QDZT::WInCommentInSub::VERSION = '0.001';\E\s*$}m, "added to DZT::WInCommentInSub; the one we have is in a comment", ); my $dzt_wver_in_pod_stm = $tzil->slurp_file('build/lib/DZT/WInPODStm.pm'); like( $dzt_wver_in_pod_stm, qr{^\s*\$\QDZT::WInPODStm::VERSION = '0.001';\E\s*$}m, "added to DZT::WInPODStm; the one we have is in some POD", ); 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", ); my $dzt_utf8 = $tzil->slurp_file('build/lib/DZT/PodWithUTF8.pm'); like( $dzt_utf8, qr{^\s*\$\QDZT::PodWithUTF8::VERSION = '0.001';\E\s*$}m, "added version to DZT::PodWithUTF8", ); 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" ); my $dzt_podwithpackage = $tzil->slurp_file('build/lib/DZT/PodWithPackage.pm'); like( $dzt_podwithpackage, qr{^\s*\$\QDZT::PodWithPackage::VERSION = '0.001';\E\s*$}m, "added version to DZT::PodWithPackage", ); my $dzt_podnopackage = $tzil->slurp_file('build/lib/DZT/PodNoPackage.pm'); unlike( $dzt_podnopackage, qr{VERSION}, "no version for pod files with no package declaration" ); } { 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'); my $assignments = () = $dzt_sample_trial =~ /(DZT::Sample::VERSION =)/g; is($assignments, 1, "we only add 1 VERSION assignment"); like( $dzt_sample_trial, qr{^\s*\$\QDZT::Sample::VERSION = '0.001'; # TRIAL\E\s*$}m, "added version with 'TRIAL' comment when \$ENV{TRIAL}=1", ); } my $two_packages_weird = <<'END'; package DZT::TPW1; {package DZT::TPW2; sub tmp} END { my $tzil2 = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/lib/DZT/TPW.pm' => $two_packages_weird, 'source/dist.ini' => simple_ini( 'GatherDir', [ 'PkgVersion' => { die_on_line_insertion => 1, use_our => 1 } ], ), }, }, ); $tzil2->build; my $dzt_tpw = $tzil2->slurp_file('build/lib/DZT/TPW.pm'); like( $dzt_tpw, qr{^\s*\{ our \$VERSION = '0\.001'; \}\s*$}m, "added 'our' version to DZT::TPW1", ); like( $dzt_tpw, qr{^\s*\{ our \$VERSION = '0\.001'; \}\s*$}m, "added 'our' version to DZT::TPW2", ); } { my $tzil3 = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', [ 'PkgVersion' => 'first' ], [ 'PkgVersion' => 'second' => { die_on_existing_version => 1 } ], ), }, }, ); like( exception { $tzil3->build }, qr/\[second\] existing assignment to \$VERSION in /, '$VERSION inserted by the first plugin is detected by the second', ); } { my $tzil4 = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/lib/DZT/TPW.pm' => $two_packages_weird, 'source/dist.ini' => simple_ini( 'GatherDir', [ 'PkgVersion' => { use_begin => 1 } ], ), }, }, ); $tzil4->build; my $dzt_tpw4 = $tzil4->slurp_file('build/lib/DZT/TPW.pm'); like( $dzt_tpw4, qr{^\s*BEGIN\s*\{ \$DZT::TPW1::VERSION = '0\.001'; \}\s*$}m, "added 'begin' version to DZT::TPW1", ); } subtest "use_package" => sub { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/lib/DZT/TPW.pm' => $two_packages_weird, 'source/dist.ini' => simple_ini( 'GatherDir', [ 'PkgVersion' => { use_package => 1 } ], ), }, }, ); $tzil->build; my $dzt_tpw = $tzil->slurp_file('build/lib/DZT/TPW.pm'); like( $dzt_tpw, qr{^package DZT::TPW1 0.001;$}m, 'we added "package NAME VERSION;" to code', ); like( $two_packages_weird, qr{^package DZT::TPW1;$}m, 'input document had "package NAME;" to begin with', ); unlike( $dzt_tpw, qr{^package DZT::TPW1;$}m, "...but it's gone", ); }; foreach my $use_our (0, 1) { my $tzil_trial = Builder->from_config( { dist_root => 'does-not-exist' }, { add_files => { 'source/dist.ini' => simple_ini( { # merge into root section version => '0.004_002', }, [ GatherDir => ], [ PkgVersion => { use_our => $use_our } ], ), 'source/lib/DZT/Sample.pm' => "package DZT::Sample;\n1;\n", }, }, ); $tzil_trial->build; my $dzt_sample_trial = $tzil_trial->slurp_file('build/lib/DZT/Sample.pm'); is( $dzt_sample_trial, $use_our ? <<'MODULE' package DZT::Sample; { our $VERSION = '0.004_002'; } # TRIAL $VERSION = '0.004002'; 1; MODULE : <<'MODULE' package DZT::Sample; $DZT::Sample::VERSION = '0.004_002'; # TRIAL $DZT::Sample::VERSION = '0.004002'; 1; MODULE , "use_our = $use_our: added version with 'TRIAL' comment and eval line when using an underscore trial version", ); } done_testing; podversion.t100644000767000024 364513130677627 17330 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; 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; author000755000767000024 013130677627 14614 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/xtpod-syntax.t100644000767000024 25213130677627 17226 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/xt/author#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); 00-report-prereqs.dd100644000767000024 1636613130677627 17036 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/tdo { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::ShareDir::Install' => '0.06' } }, 'develop' => { 'requires' => { 'Test::More' => '0', 'Test::Pod' => '1.41' } }, 'runtime' => { 'recommends' => { 'Archive::Tar::Wrapper' => '0.15', 'Data::OptList' => '0.110', 'Term::ReadLine::Gnu' => '0' }, 'requires' => { 'App::Cmd::Command::version' => '0', 'App::Cmd::Setup' => '0.330', 'App::Cmd::Tester' => '0.306', 'App::Cmd::Tester::CaptureExternal' => '0', 'Archive::Tar' => '0', 'CPAN::Meta::Converter' => '2.101550', 'CPAN::Meta::Merge' => '0', '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' => '2.200010', 'Config::MVP::Reader' => '2.101540', 'Config::MVP::Reader::Findable::ByExtension' => '0', 'Config::MVP::Reader::Finder' => '0', 'Config::MVP::Reader::INI' => '2.101461', 'Config::MVP::Section' => '2.200009', 'Data::Dumper' => '0', 'Data::Section' => '0.200002', 'DateTime' => '0.44', 'Digest::MD5' => '0', 'Encode' => '0', 'ExtUtils::Manifest' => '1.66', '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', 'JSON::MaybeXS' => '0', 'List::Util' => '1.45', 'Log::Dispatchouli' => '1.102220', 'Mixin::Linewise::Readers' => '0.100', 'Module::CoreList' => '0', 'Module::Runtime' => '0', 'Moose' => '0.92', 'Moose::Role' => '0', 'Moose::Util::TypeConstraints' => '0', 'MooseX::LazyRequire' => '0', 'MooseX::Role::Parameterized' => '1.01', 'MooseX::SetOnce' => '0', 'MooseX::Types' => '0', 'MooseX::Types::Moose' => '0', 'MooseX::Types::Perl' => '0', 'PPI::Document' => '0', 'Params::Util' => '0', 'Path::Tiny' => '0.052', 'Perl::PrereqScanner' => '1.016', 'Pod::Eventual' => '0.091480', 'Scalar::Util' => '0', 'Software::License' => '0.101370', 'Software::LicenseUtils' => '0', 'String::Formatter' => '0.100680', 'String::RewritePrefix' => '0.006', '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', 'autodie' => '0', 'namespace::autoclean' => '0', 'parent' => '0', 'perl' => 'v5.14.0', 'strict' => '0', 'utf8' => '0', 'version' => '0', 'warnings' => '0' }, 'suggests' => { 'PPI::XS' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'CPAN::Meta::Check' => '0.011', 'CPAN::Meta::Requirements' => '2.121', 'ExtUtils::MakeMaker' => '0', 'ExtUtils::Manifest' => '1.66', 'File::Spec' => '0', 'Software::License::None' => '0', 'Test::FailWarnings' => '0', 'Test::Fatal' => '0', 'Test::File::ShareDir' => '0', 'Test::More' => '0.96', 'lib' => '0' } } }; $x; }DZ2000755000767000024 013130677627 15534 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/distdist.pl100644000767000024 25013130677627 17151 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZ2name => 'DZ2', version => '0.001', author => 'E. Xavier Ample ', license => 'Perl_5', copyright_holder => 'E. Xavier Ample', [ '@Classic', ] Types.pm100644000767000024 411513130677627 17206 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zillapackage Dist::Zilla::Types 6.010; # ABSTRACT: dzil-specific type library use namespace::autoclean; #pod =head1 OVERVIEW #pod #pod This library provides L types for use by Dist::Zilla. These #pod types are not (yet?) for public consumption, and you should not rely on them. #pod #pod Dist::Zilla uses a number of types found in L. Maybe #pod that's what you want. #pod #pod =cut use MooseX::Types -declare => [qw( License OneZero YesNoStr ReleaseStatus Path ArrayRefOfPaths _Filename )]; use MooseX::Types::Moose qw(Str Int Defined ArrayRef); use Path::Tiny; subtype License, as class_type('Software::License'); subtype Path, as class_type('Path::Tiny'); coerce Path, from Defined, via { require Dist::Zilla::Path; Dist::Zilla::Path::path($_); }; subtype ArrayRefOfPaths, as ArrayRef[Path]; coerce ArrayRefOfPaths, from ArrayRef[Defined], via { require Dist::Zilla::Path; [ map { Dist::Zilla::Path::path($_) } @$_ ]; }; 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 }; subtype ReleaseStatus, as Str, where { /\A(?:stable|testing|unstable)\z/ }; coerce OneZero, from YesNoStr, via { /\Ay/i ? 1 : 0 }; subtype _Filename, as Str, where { $_ !~ qr/(?:\x{0a}|\x{0b}|\x{0c}|\x{0d}|\x{85}|\x{2028}|\x{2029})/ }, message { "Filename not a Str, or contains a newline or other vertical whitespace" }; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Types - dzil-specific type library =head1 VERSION version 6.010 =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) 2017 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 authordeps.t100644000767000024 132113130677627 17423 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/commandsuse strict; use warnings; use Test::More 0.88 tests => 1; use Test::Deep; use autodie; use Dist::Zilla::Util::AuthorDeps; my $authordeps = Dist::Zilla::Util::AuthorDeps::extract_author_deps( 'corpus/dist/AuthorDeps', 0 ); cmp_deeply( $authordeps, [ +{ perl => '5.005' }, +{ 'List::MoreUtils'=> '!= 0.407' }, +{ 'Foo::Bar' => '1.23' }, +{ 'Dist::Zilla' => '5.001' }, ( map { +{"Dist::Zilla::Plugin::$_" => '5.0'} } qw ), ( map { +{"Dist::Zilla::Plugin::$_" => 0} } qw ), +{ 'Software::License::Perl_5' => '0' }, ], "authordeps in corpus/dist/AuthorDeps" ) or diag explain $authordeps; done_testing; autolicense.t100644000767000024 115413130677627 17444 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.t100644000767000024 1326013130677627 17524 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Deep; use Test::DZil; use YAML::Tiny; sub build_meta { my $tzil = shift; $tzil->build; $tzil->distmeta; } my $tzil = Builder->from_config( { dist_root => 'corpus/dist/AutoPrereqs' }, { }, ); # check found prereqs my $meta = build_meta($tzil); my %want_runtime = ( # 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}, \%want_runtime, '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' } ], ), '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}, \%want_runtime, 'configure_finder did not change runtime 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 tests added to the dist: $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' } ], ), 'source/inc/DZPA.pm' => "use DZPA::NotInDist;\n use DZPA::Configure;\n", 'source/t/basic.t' => "use Test::Foo;\n", }, }, ); # check found prereqs $meta = build_meta($tzil); my %want_test = ( 'Test::Foo' => '0', ); cmp_deeply( $meta, superhashof({ prereqs => { runtime => { requires => \%want_runtime }, configure => { requires => \%want_configure }, test => { requires => \%want_test }, }, }), 'test_finder did not change runtime, configure requires; test requires is correct', ); # Try again with extra tests added to the dist: $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' } ], ), 'source/inc/DZPA.pm' => "use DZPA::NotInDist;\n use DZPA::Configure;\n", 'source/t/basic.t' => "use Test::Foo;\n", 'source/xt/author/more1.t' => "use Test::Bar;\n", 'source/xt/smoke/more2.t' => "use Test::Baz;\n", 'source/xt/release/more3.t' => "use Test::Qux;\n", 'source/xt/more4.t' => "use Test::Norf;\n", }, }, ); # check found prereqs $meta = build_meta($tzil); my %want_develop = ( 'Test::Bar' => '0', 'Test::Baz' => '0', 'Test::Qux' => '0', 'Test::Norf' => '0', ); cmp_deeply( $meta, superhashof({ prereqs => { runtime => { requires => \%want_runtime }, configure => { requires => \%want_configure }, test => { requires => \%want_test }, develop => { requires => \%want_develop }, }, }), 'develop_finder did not change runtime, configure, test requires; develop 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' } ], ), 'source/lib/DZPA/Aliased.pm' => "use aliased 'Long::Class::Name';\n", }, }, ); # check found prereqs $meta = build_meta($tzil); { my %want_runtime = %want_runtime; # Moose-style prereqs should not be recognized this time: delete $want_runtime{'DZPA::Base::Moose1'}; delete $want_runtime{'DZPA::Base::Moose2'}; delete $want_runtime{'DZPA::Role'}; $want_runtime{'DZPA::Skip::Blah'} = 0; # not skipping anymore $want_runtime{'DZPA::Skip::Foo'} = 0; $want_runtime{'aliased'} = 0; $want_runtime{'Long::Class::Name'} = 0; is_deeply( $meta->{prereqs}{runtime}{requires}, \%want_runtime, 'custom scanner list', ); } # Try again with a non-default prereq type: $tzil = Builder->from_config( { dist_root => 'corpus/dist/AutoPrereqs' }, { add_files => { 'source/dist.ini' => simple_ini( qw(GatherDir ExecDir), [ AutoPrereqs => { skip => '^DZPA::Skip', type => 'suggests' } ], ), 'source/t/basic.t' => "use Test::Foo;\n", }, }, ); # check found prereqs $meta = build_meta($tzil); cmp_deeply( $meta, superhashof({ prereqs => { runtime => { suggests => \%want_runtime }, test => { suggests => \%want_test }, }, }), 'all prereqs were added with the "suggests" relationship', ); done_testing; autoversion.t100644000767000024 171613130677627 17513 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; 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)"); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( { version => undef }, 'GatherDir', [ AutoVersion => { major => 7, format => q<{{$major}}.{{ cldr('y') }}> } ], ), }, }, ); $tzil->build; like($tzil->version, qr/^7\.20[1-9][0-9]$/, "dist version is set using CLDR"); } done_testing; fakerelease.t100644000767000024 244113130677627 17400 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; 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.t100644000767000024 651113130677627 17425 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use ExtUtils::Manifest 'maniread'; use Test::DZil; my $generic_test = <<'END_TEST'; use strict; use warnings; use Test::More 0.88; ok(0, "stop building me!"); done_testing; END_TEST 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', ), (map {; "source/xt${_}more.t" => $generic_test } qw(/author/ /smoke/ /release/ /)), }, 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 xt/author/more.t xt/smoke/more.t xt/release/more.t xt/more.t MANIFEST inc/Foo.pm inc/Foo/Bar.pm bin/another_perl_script bin/test.bash bin/test.pl ) ], "GatherDir gathers all files in the source dir", ); my $manifest = maniread($tzil->tempdir->child('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(':ExtraTestFiles'); is_filelist( [ map {; $_->name } @$files ], [ qw( xt/author/more.t xt/smoke/more.t xt/release/more.t xt/more.t ) ], "ExtraTestFiles finds all files in xt", ); $files = $tzil->find_files(':ExecFiles'); is_filelist( [ map {; $_->name } @$files ], [ qw( bin/another_perl_script bin/test.bash bin/test.pl ) ], "ExecFiles finds all files", ); $files = $tzil->find_files(':PerlExecFiles'); is_filelist( [ map {; $_->name } @$files ], [ qw( bin/another_perl_script bin/test.pl ) ], "PerlExecFiles finds exec files that are perl", ); $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.t100644000767000024 1665413130677627 17514 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; 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'); ok( !exists $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'); ok( !exists $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.t100644000767000024 310013130677627 17435 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse 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( [ 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; cmp_deeply( $tzil->distmeta, 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.t100644000767000024 560613130677627 17444 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Deep; 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.28', }, test_requires => { 'Test::Deet' => '7', }, 'configure_requires' => { 'Module::Build' => '0.28', }, 'recursive_test_files' => ignore, ); cmp_deeply( $have, \%want, 'module_build_args', ); 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', build_element => [qw(js sql)], } ] ), }, }, ); $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' ); is( $modulebuild->_add_build_elements, '$build->add_build_element($_) for qw(js sql);', 'adds build elements' ); my $build = $tzil->slurp_file('build/Build.PL'); like($build, qr/\QFoo::Build->new/, 'Build.PL calls ->new on Foo::Build'); like($build, qr/\$build->add_build_element\(\$_\) for qw\(js sql\);/, 'Build.PL calls add_build_element for all elements'); } done_testing; nextrelease.t100644000767000024 1701613130677627 17474 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; 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 { package inc::TrashChanges; use Moose; with 'Dist::Zilla::Role::AfterRelease'; sub after_release { Path::Tiny::path('Changes')->spew('OHHAI'); } } { my $tzil = Builder->from_config( { dist_root => 'does/not/exist' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini(qw(GatherDir =inc::TrashChanges NextRelease FakeRelease)), }, }, ); $tzil->build; like( $tzil->slurp_file('build/Changes'), qr{0\.001}, "new version appears in build Changes file", ); unlike( $tzil->slurp_file('build/Changes'), qr/\{\{\$NEXT\}\}/, "template variable does not appear 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{\{\{\$NEXT\}\}\s+0\.001}, "new version appears in source Changes file after release, below template variable", ); 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", } ], ), }, }, ); $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', } ], ), }, }, ); $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) ), }, }, ); $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 RELEASE) 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", } ], ), }, }, ); $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", } ], ), }, }, ); $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", } ], ), }, }, ); 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>", } ], [ '%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' } ], [ '%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", ); } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Changes' => $changes, 'source/dist.ini' => simple_ini( 'GatherDir', [ NextRelease => { format => '%v %P' } ], [ '%PAUSE' => { username => 'NOBODY', password => 'ohhai' } ], [ FakeRelease => { user => 'NOBODY' } ], ), }, }, ); is( exception { $tzil->build }, undef, 'build successfully with %PAUSE stash', ); like( $tzil->slurp_file('build/Changes'), qr{^0\.001 NOBODY}m, 'added cpanid from %PAUSE username', ); } done_testing; testrelease.t100644000767000024 145413130677627 17454 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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; todo000755000767000024 013130677627 13624 5ustar00rjbsstaff000000000000Dist-Zilla-6.010vfs-for-files.mkdn100644000767000024 75713130677627 17312 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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. DZ1000755000767000024 013130677627 15533 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/distdist.ini100644000767000024 21613130677627 17316 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZ1name = DZ1 version = 0.001 author = E. Xavier Ample license = Perl_5 copyright_holder = E. Xavier Ample [@Classic] global000755000767000024 013130677627 15432 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpusconfig.ini100644000767000024 17113130677627 17517 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/global [%User] name = E. Xavier Ample email = ea@example.com [%Rights] license_class = BSD copyright_holder = A. U. Thor Tester.pm100644000767000024 2221113130677627 17365 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zillapackage Dist::Zilla::Tester 6.010; # ABSTRACT: a testing-enabling stand-in for Dist::Zilla use Moose; extends 'Dist::Zilla::Dist::Builder'; # 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 Dist::Zilla::Path; 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) = @_; # The only thing using a local time zone should be NextRelease. Normally it # defaults to "local," but since some users won't have an automatically # determinable time zone, we'll switch to not-local times for testing. # -- rjbs, 2015-11-26 local $Dist::Zilla::Plugin::NextRelease::DEFAULT_TIME_ZONE = 'GMT'; return $self->builder->from_config(@arg); } sub builder { 'Dist::Zilla::Tester::_Builder' } sub minter { 'Dist::Zilla::Tester::_Minter' } { package Dist::Zilla::Tester::_Role; use Moose::Role; has tempdir_root => ( is => 'rw', isa => 'Str|Undef', writer => '_set_tempdir_root', ); has tempdir_obj => ( is => 'ro', isa => 'File::Temp::Dir', clearer => '_clear_tempdir_obj', writer => '_set_tempdir_obj', ); sub DEMOLISH {} around DEMOLISH => sub { my $orig = shift; my $self = shift; # File::Temp deletes the directory when it goes out of scope $self->_clear_tempdir_obj; rmdir $self->tempdir_root if $self->tempdir_root; return $self->$orig(@_); }; 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) = @_; Dist::Zilla::Path::path( $self->tempdir->child($filename) )->slurp_utf8; } sub slurp_file_raw { my ($self, $filename) = @_; Dist::Zilla::Path::path( $self->tempdir->child($filename) )->slurp_raw; } sub _metadata_generator_id { 'Dist::Zilla::Tester' } no Moose::Role; } { package Dist::Zilla::Tester::_Builder 6.010; use Moose; extends 'Dist::Zilla::Dist::Builder'; with 'Dist::Zilla::Tester::_Role'; use File::Copy::Recursive qw(dircopy); use Dist::Zilla::Path; our $Log_Events = []; sub most_recent_log_events { return @{ $Log_Events } } 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_obj = File::Temp->newdir( CLEANUP => 1, (defined $tempdir_root ? (DIR => $tempdir_root) : ()), ); my $tempdir = path( path($tempdir_obj)->absolute) ; my $root = $tempdir->child('source'); $root->mkpath; dircopy($source, $root); if ($tester_arg->{also_copy}) { while (my ($src, $dest) = each %{ $tester_arg->{also_copy} }) { dircopy($src, $tempdir->child($dest)); } } if (my $files = $tester_arg->{add_files}) { while (my ($name, $content) = each %$files) { die "Unix path '$name' does not seem to be portable to the current OS" if !unix_path_seems_portable($name); my $fn = $tempdir->child($name); $fn->parent->mkpath; Dist::Zilla::Path::path($fn)->spew_utf8($content); } } local $arg->{dist_root} = "$root"; local $arg->{chrome} = Dist::Zilla::Chrome::Test->new; $Log_Events = $arg->{chrome}->logger->events; local @INC = @INC; my $had_dot; if ($INC[-1] eq '.') { $had_dot = 1; pop @INC; } @INC = map {; ref($_) ? $_ : File::Spec->rel2abs($_) } @INC; push @INC, '.' if $had_dot; # We do this so that . in @INC will find plugins like [=inc::YourFace] # -- rjbs, 2016-04-24 my $wd = File::pushd::pushd($arg->{dist_root}); local $ENV{DZIL_GLOBAL_CONFIG_ROOT}; $ENV{DZIL_GLOBAL_CONFIG_ROOT} = $tester_arg->{global_config_root} if defined $tester_arg->{global_config_root}; my $zilla = $self->$orig($arg); $zilla->_set_tempdir_root($tempdir_root); $zilla->_set_tempdir_obj($tempdir_obj); $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 = path($self->tempdir)->child('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; sub unix_path_seems_portable { return 1 if $^O eq "linux"; # this check only makes sense on non-unixes my ($unix_path) = @_; # split the $unix_path into 3 strings: $volume, $directories, $file; with: my @native_parts = File::Spec->splitpath($unix_path); # current OS rules my @unix_parts = File::Spec::Unix->splitpath($unix_path); # unix rules return unless join(qq{\0}, @native_parts) eq join(qq{\0}, @unix_parts); # split the $directories string into a list of the sub-directories; with: my @native_dirs = File::Spec->splitdir($native_parts[1]); # current OS rules my @unix_dirs = File::Spec::Unix->splitdir($unix_parts[1]); # unix rules return unless join(qq{\0}, @native_dirs) eq join(qq{\0}, @unix_dirs); return 1; } } { package Dist::Zilla::Tester::_Minter 6.010; use Moose; extends 'Dist::Zilla::Dist::Minter'; with 'Dist::Zilla::Tester::_Role'; use File::Copy::Recursive qw(dircopy); use Dist::Zilla::Path; our $Log_Events = []; sub most_recent_log_events { return @{ $Log_Events } } sub _mint_target_dir { my ($self) = @_; my $name = $self->name; my $dir = $self->tempdir->child('mint')->absolute; $self->log_fatal("$dir already exists") if -e $dir; return $dir; } sub _setup_global_config { my ($self, $dir, $arg) = @_; my $config_base = path($dir)->child('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_obj = File::Temp->newdir( CLEANUP => 1, (defined $tempdir_root ? (DIR => $tempdir_root) : ()), ); my $tempdir = path($tempdir_obj)->absolute; local $arg->{chrome} = Dist::Zilla::Chrome::Test->new; $Log_Events = $arg->{chrome}->logger->events; local @INC = map {; ref($_) ? $_ : File::Spec->rel2abs($_) } @INC; my $global_config_root = path($tester_arg->{global_config_root})->absolute; local $ENV{DZIL_GLOBAL_CONFIG_ROOT} = $global_config_root; my $global_stashes = $self->_setup_global_config( $global_config_root, { chrome => $arg->{chrome} }, ); local $arg->{_global_stashes} = $global_stashes; my $zilla = $self->$orig($profile_data, $arg); $zilla->_set_tempdir_root($tempdir_root); $zilla->_set_tempdir_obj($tempdir_obj); $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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.t100644000767000024 567113130677627 17573 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use utf8; 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.t100644000767000024 1046613130677627 17650 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88 tests => 17; 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 ($zilla, $username, $pw) = @_; $zilla->chrome->set_response_for('PAUSE username: ', $username); $zilla->chrome->set_response_for("PAUSE password for $username: ", $pw); } #--------------------------------------------------------------------- # 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" ); } # Config from dist.ini { my $tzil = build_tzil( 'FakeRelease', [ UploadToCPAN => { %safety_first, username => 'me', password => 'ohhai', } ], ); like( exception { $tzil->release }, qr/You need to supply a password/, "password set in dist.ini is ignored"); } tester-local-plugins.t100644000767000024 136113130677627 17525 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/tuse strict; use warnings; use Test::More 0.88; use Dist::Zilla::Tester; use Test::DZil; use Test::Fatal; my $tzil; is( exception { $tzil = Builder->from_config( { dist_root => 'does-not-exist' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ MetaJSON => ], [ '=inc::MyMetadata' ], ), 'source/inc/MyMetadata.pm' => <chrome->logger->set_debug(1); $tzil->build; }, undef, q{config does not blow up with "Required plugin inc::MyMetadata isn't installed."}, ); done_testing; xs-improvement.mkdn100644000767000024 16113130677627 17612 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/todo # XS AUTHORING First order of business: ask the XS authors what would help beyond the now-released `dzil run`. t000755000767000024 013130677627 16041 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZTbasic.t100644000767000024 34413130677627 17430 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.pm100644000767000024 1263113130677627 17545 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zillapackage Dist::Zilla::Prereqs 6.010; # ABSTRACT: the prerequisites of a Dist::Zilla distribution use Moose; use MooseX::Types::Moose qw(Bool HashRef); use CPAN::Meta::Prereqs 2.120630; # add_string_requirement use String::RewritePrefix; use CPAN::Meta::Requirements 2.121; # requirements_for_module use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Dist::Zilla::Prereqs is a subcomponent of Dist::Zilla. The C #pod attribute on your Dist::Zilla object is a Dist::Zilla::Prereqs object, and is #pod responsible for keeping track of the distribution's prerequisites. #pod #pod In fact, a Dist::Zilla::Prereqs object is just a thin layer over a #pod L object, stored in the C attribute. #pod #pod Almost everything this object does is proxied to the CPAN::Meta::Prereqs #pod object, so you should really read how I works. #pod #pod Dist::Zilla::Prereqs proxies the following methods to the CPAN::Meta::Prereqs #pod object: #pod #pod =for :list #pod * finalize #pod * is_finalized #pod * requirements_for #pod * as_string_hash #pod #pod =cut 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 # This does *not* contain configure requires, as MakeMaker explicitly should # not have it in its fallback prereqs. has merged_requires => ( is => 'ro', isa => 'CPAN::Meta::Requirements', init_arg => undef, default => sub { CPAN::Meta::Requirements->new }, ); #pod =method register_prereqs #pod #pod $prereqs->register_prereqs(%prereqs); #pod #pod $prereqs->register_prereqs(\%arg, %prereqs); #pod #pod This method adds new minimums to the prereqs object. If a hashref is the first #pod arg, it may have entries for C and C to indicate what kind of #pod prereqs are being registered. (For more information on phase and type, see #pod L.) For example, you might say: #pod #pod $prereqs->register_prereqs( #pod { phase => 'test', type => 'recommends' }, #pod 'Test::Foo' => '1.23', #pod 'XML::YZZY' => '2.01', #pod ); #pod #pod If not given, phase and type default to runtime and requires, respectively. #pod #pod =cut 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 6.010 =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) 2017 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_completion100644000767000024 60013130677627 17757 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.t100644000767000024 1240713130677627 20035 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; 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 $serialization_yaml = 'YAML::Tiny version ' . YAML::Tiny->VERSION; my $json_backend = JSON::MaybeXS::JSON(); my $serialization_json = $json_backend . ' version ' . $json_backend->VERSION; { 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', x_serialization_backend => $serialization_yaml, }, '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 => re(qr/^http.*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', x_serialization_backend => $serialization_json, }, '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', x_serialization_backend => $serialization_yaml, }, '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 => re(qr/^http.*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', x_serialization_backend => $serialization_json, }, 'META.json was 2.0 output' ); } done_testing; command-plugins.mkdn100644000767000024 51213130677627 17712 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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] lib000755000767000024 013130677627 16301 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZ1DZ1.pm100644000767000024 20313130677627 17350 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZ1/libuse strict; use warnings; package DZ1; # ABSTRACT: this is a sample package for testing Dist::Zilla; sub main { return 1; } 1; lib000755000767000024 013130677627 16302 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZ2DZ1.pm100644000767000024 47413130677627 17363 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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_Inc000755000767000024 013130677627 16367 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/distFoo.pm100644000767000024 6713130677627 17553 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_Inc#!/usr/bin/perl package Foo; sub baz { 'baz'; } 1; Role000755000767000024 013130677627 16304 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaPPI.pm100644000767000024 1100113130677627 17443 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::PPI 6.010; # ABSTRACT: a role for plugins which use PPI use Moose::Role; use Digest::MD5 qw(md5); use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This role provides some common utilities for plugins which use L. #pod #pod =method ppi_document_for_file #pod #pod my $document = $self->ppi_document_for_file($file); #pod #pod Given a dzil file object (anything that does L), this #pod method returns a new L for that file's content. #pod #pod Internally, this method caches these documents. If multiple plugins want a #pod document for the same file, this avoids reparsing it. #pod #pod =cut my %CACHE; sub ppi_document_for_file { my ($self, $file) = @_; 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, making our document invalid. my $md5 = md5($encoded_content); return $CACHE{$md5}->clone if $CACHE{$md5}; my $content = $file->content; require PPI::Document; my $document = PPI::Document->new(\$content) or Carp::croak(PPI::Document->errstr . ' while processing file ' . $file->name); return ($CACHE{$md5} = $document)->clone; } #pod =method save_ppi_document_to_file #pod #pod my $document = $self->save_ppi_document_to_file($document,$file); #pod #pod Given a L and a dzil file object (anything that does #pod L), this method saves the serialized document in the #pod file. #pod #pod It also updates the internal PPI document cache with the new document. #pod #pod =cut sub save_ppi_document_to_file { my ($self, $document, $file) = @_; my $new_content = $document->serialize; $file->content($new_content); my $encoded = $file->encoded_content; $CACHE{ md5($encoded) } = $document->clone; } #pod =method document_assigns_to_variable #pod #pod if( $self->document_assigns_to_variable($document, '$FOO')) { ... } #pod #pod This method returns true if the document assigns to the given variable (the #pod sigil must be included). #pod #pod =cut sub document_assigns_to_variable { my ($self, $document, $variable) = @_; my $package_stmts = $document->find('PPI::Statement::Package'); my @namespaces = map { $_->namespace } @{ $package_stmts || []}; my ($sigil, $varname) = ($variable =~ m'^([$@%*])(.+)$'); my $package; my $finder = sub { my $node = $_[1]; if ($node->isa('PPI::Statement') && !$node->isa('PPI::Statement::End') && !$node->isa('PPI::Statement::Data')) { if ($node->isa('PPI::Statement::Variable')) { return (grep { $_ eq $variable } $node->variables) ? 1 : undef; } return 1 if grep { my $child = $_; $child->isa('PPI::Token::Symbol') and grep { $child->canonical eq "${sigil}${_}::${varname}" and $node->content =~ /\Q${sigil}${_}::${varname}\E.*=/ } @namespaces } $node->children; } return 0; # not found }; my $rv = $document->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 6.010 =head1 DESCRIPTION This role provides some common utilities for plugins which use L. =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->document_assigns_to_variable($document, '$FOO')) { ... } This method returns true if the document assigns to the given variable (the sigil must be included). =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 2532213130677627 17730 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zillause strict; use warnings; package Dist::Zilla::Tutorial 6.010; # ABSTRACT: how to use this "Dist::Zilla" thing use Carp (); Carp::confess "you're not meant to use the tutorial, just read it!"; 1; #pod =head1 SYNOPSIS #pod #pod B: Maybe you should be looking at the web-based #pod tutorial instead. It's more complete. L #pod #pod Dist::Zilla builds distributions to be uploaded to the CPAN. That means that #pod the first thing you'll need is some code. #pod #pod Once you've got that, you'll need to configure Dist::Zilla. Here's a simple #pod F: #pod #pod name = Carbon-Dating #pod version = 0.003 #pod author = Alan Smithee #pod license = Perl_5 #pod copyright_holder = Alan Smithee #pod #pod [@Basic] #pod #pod [Prereqs] #pod App::Cmd = 0.013 #pod Number::Nary = 0 #pod Sub::Exporter = 0.981 #pod #pod The topmost section configures Dist::Zilla itself. Here are some of the #pod entries it expects: #pod #pod name - (required) the name of the dist being built #pod version - (required) the version of the dist #pod abstract - (required) a short description of the dist #pod author - (optional) the dist author (you may have multiple entries for this) #pod license - (required) the dist license; must be a Software::License::* name #pod #pod copyright_holder - (required) the entity holding copyright on the dist #pod #pod Some of the required values above may actually be provided by means other than #pod the top-level section of the config. For example, #pod L plugins can #pod set the version, and a line like this in the "main module" of the dist will set #pod the abstract: #pod #pod # ABSTRACT: a totally cool way to do totally great stuff #pod #pod The main modules is the module that shares the same name as the dist, in #pod general. #pod #pod Named sections load plugins, with the following rules: #pod #pod If a section name begins with an equals sign (C<=>), the rest of the section #pod name is left intact and not expanded. If the section name begins with an at #pod sign (C<@>), it is prepended with C. Otherwise, #pod it is prepended with C. #pod #pod The values inside a section are given as configuration to the plugin. Consult #pod each plugin's documentation for more information. #pod #pod The "Basic" bundle, seen above, builds a fairly normal distribution. It #pod rewrites tests from F<./xt>, adds some information to POD, and builds a #pod F. For more information, you can look at the docs for #pod L<@Basic|Dist::Zilla::PluginBundle::Basic> and see the plugins it includes. #pod #pod =head1 BUILDING YOUR DIST #pod #pod Maybe we're getting ahead of ourselves, here. Configuring a bunch of plugins #pod won't do you a lot of good unless you know how to use them to build your dist. #pod #pod Dist::Zilla ships with a command called F that will get installed by #pod default. While it can be extended to offer more commands, there are two really #pod useful ones: #pod #pod $ dzil build #pod #pod The C command will build the distribution. Say you're using the #pod configuration in the SYNOPSIS above. You'll end up with a file called #pod F. As long as you've done everything right, it #pod will be suitable for uploading to the CPAN. #pod #pod Of course, you should really test it out first. You can test the dist you'd be #pod building by running another F command: #pod #pod $ dzil test #pod #pod This will build a new copy of your distribution and run its tests, so you'll #pod know whether the dist that C would build is worth releasing! #pod #pod =head1 HOW BUILDS GET BUILT #pod #pod This is really more of a sketchy overview than a spec. #pod #pod First, all the plugins that perform the #pod L perform their C #pod tasks. #pod #pod The build root (where the dist is being built) is made. #pod #pod The Ls gather and inject files #pod into the distribution, then the Ls #pod remove some of them. #pod #pod All the Ls get a chance to muck about #pod with each file, possibly changing its name, content, or installability. #pod #pod Now that the distribution is basically set up, it needs an install tool, like a #pod F. All the #pod L-performing plugins are used to #pod do whatever is needed to make the dist installable. #pod #pod Everything is just about done. The files are all written out to disk and the #pod L plugins do their thing. #pod #pod =head1 RELEASING YOUR DIST #pod #pod By running C, you'll test your #pod distribution, build a tarball of it, and upload it to the CPAN. Plugins are #pod able to do things like check your version control system to make sure you're #pod releasing a new version and that you tag the version you've just uploaded. It #pod can also update your Changelog file, too, making sure that you don't need to #pod know what your next version number will be before releasing. #pod #pod The final CPAN release process is implemented by the #pod L plugin. However you can #pod replace it by your own to match your own (company?) process. #pod #pod =head1 SEE ALSO #pod #pod L #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Tutorial - how to use this "Dist::Zilla" thing =head1 VERSION version 6.010 =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) 2017 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.t100644000767000024 465213130677627 20135 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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; distmeta-merge.t100644000767000024 260513130677627 20042 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::DZil; use Test::Deep; { package Keywords; # see also Dist::Zilla::Plugin::Keywords ;) use Moose; with 'Dist::Zilla::Role::MetaProvider'; sub mvp_multivalue_args { qw(keywords) } has keywords => ( is => 'ro', isa => 'ArrayRef[Str]', lazy => 1, default => sub { [] }, ); sub metadata { my $self = shift; my $keywords = $self->keywords; return { @$keywords ? ( keywords => $keywords ) : () }; } } { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ '=Keywords' => 'plugin 1' => { keywords => [ qw(foo bar) ] } ], [ '=Keywords' => 'plugin 2' => { keywords => [ qw(dog cat) ] } ], ), }, }, ); cmp_deeply( $tzil->distmeta, { abstract => 'Sample DZ Dist', author => ['E. Xavier Ample '], dynamic_config => 0, generated_by => ignore, license => [ 'perl_5' ], 'meta-spec' => { url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', version => 2 }, name => 'DZT-Sample', release_status => 'stable', version => '0.001', keywords => [ qw(foo bar dog cat) ], }, 'metadata is correctly merged together', ); } done_testing; podsyntaxtests.t100644000767000024 131113130677627 20240 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Deep; use Test::DZil; { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( [ GatherDir => ], [ PodSyntaxTests => ], ), }, }, ); $tzil->build; cmp_deeply( $tzil->distmeta, superhashof( { prereqs => { develop => { requires => { 'Test::Pod' => '1.41' } }, }, } ), 'PodSyntaxTests develop prereqs' ); like( $tzil->slurp_file('build/xt/author/pod-syntax.t'), qr/\Quse Test::Pod 1.41/, 'xt/release/pod-syntax.t content' ); } done_testing; release_status.t100644000767000024 1053313130677627 20175 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use Test::Fatal; use lib 't/lib'; use Test::DZil; use JSON::MaybeXS; # protect from dzil's own release environment local $ENV{RELEASE_STATUS}; local $ENV{TRIAL}; # TestReleaseProvider sets 'unstable' subtest "TestReleaseProvider" => sub { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', 'MetaJSON', 'TestReleaseProvider', ), }, }, ); $tzil->build; is($tzil->release_status, 'unstable', "release status set from provider"); ok($tzil->is_trial, "is_trial is true"); like($tzil->archive_filename, qr/-TRIAL/, "-TRIAL in archive filename"); my $json = $tzil->slurp_file('build/META.json'); my $meta = JSON::MaybeXS->new(utf8 => 0)->decode($json); is( $meta->{release_status}, 'unstable', "release status set in META" ); }; for my $c ( qw/true false/ ) { subtest "is_trial in dist.ini $c" => sub { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( { is_trial => $c eq 'true' ? '1' : '0' }, 'GatherDir', ), }, }, ); $tzil->build; my $expect = $c eq 'true' ? 'testing' : 'stable'; my $is_trial = $expect eq 'testing' ? 1 : 0; is($tzil->release_status, $expect, "release status set from is_trial"); if ( $is_trial ) { is($tzil->is_trial, 1, "is_trial is true, represented as 1"); like($tzil->archive_filename, qr/-TRIAL/, "-TRIAL in archive filename"); } else { is($tzil->is_trial, 0, "is_trial is not true, represented as 0"); unlike($tzil->archive_filename, qr/-TRIAL/, "-TRIAL not in archive filename"); } }; } subtest "RELEASE_STATUS" => sub { local $ENV{RELEASE_STATUS} = 'stable'; local $ENV{TRIAL} = 1; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', 'TestReleaseProvider', ), }, }, ); $tzil->build; is($tzil->release_status, 'stable', "release status set from environment"); ok(! $tzil->is_trial, "is_trial is not true"); unlike($tzil->archive_filename, qr/-TRIAL/, "-TRIAL not in archive filename"); }; subtest "TRIAL" => sub { local $ENV{TRIAL} = 1; my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( 'GatherDir', 'TestReleaseProvider', ), }, }, ); $tzil->build; is($tzil->release_status, 'testing', "release status set from environment"); ok($tzil->is_trial, "is_trial is true"); like($tzil->archive_filename, qr/-TRIAL/, "-TRIAL in archive filename"); }; subtest "too many providers" => sub { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( { is_trial => '1' }, 'GatherDir', 'TestReleaseProvider', ), }, }, ); like( exception { $tzil->build }, qr/attempted to set release status twice/, "setting too many times is fatal", ); }; subtest "from version (stable)" => sub { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( { version => 1.23 }, 'GatherDir', ), }, }, ); $tzil->build; is($tzil->release_status, 'stable', "release status set from version (stable)"); ok(!$tzil->is_trial, "is_trial is false"); unlike($tzil->archive_filename, qr/-TRIAL/, "no -TRIAL in archive filename"); }; subtest "from version (testing)" => sub { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/dist.ini' => simple_ini( { version => "1.23_45" }, 'GatherDir', ), }, }, ); $tzil->build; is($tzil->release_status, 'testing', "release status set from version (testing)"); ok($tzil->is_trial, "is_trial is true"); unlike($tzil->archive_filename, qr/-TRIAL/, "no -TRIAL in archive filename"); }; done_testing; delay-core-attrs.mkdn100644000767000024 107313130677627 20017 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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_Bin000755000767000024 013130677627 16366 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/disttest.pl100644000767000024 5613130677627 20003 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_Bin#!/usr/bin/perl print "Hello World!\n"; exit; File.pm100644000767000024 1252313130677627 17704 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::File 6.010; # ABSTRACT: something that can act like a file use Moose::Role; use Dist::Zilla::Types qw(_Filename); use Moose::Util::TypeConstraints; use Try::Tiny; use namespace::autoclean; with 'Dist::Zilla::Role::StubBuild'; #pod =head1 DESCRIPTION #pod #pod This role describes a file that may be written into the shipped distribution. #pod #pod =attr name #pod #pod This is the name of the file to be written out. #pod #pod =cut has name => ( is => 'rw', isa => _Filename, required => 1, ); #pod =attr added_by #pod #pod This is a list of strings describing when and why the file was added #pod to the distribution and when it was updated (its content, filename, or other attributes). It will #pod generally be updated by a plugin implementing the #pod L role. Its accessor will return #pod the list of strings, concatenated with C<'; '>. #pod #pod =cut has added_by => ( isa => 'ArrayRef[Str]', lazy => 1, default => sub { [] }, traits => ['Array'], init_arg => undef, handles => { _push_added_by => 'push', added_by => [ join => '; ' ], }, ); around name => sub { my $orig = shift; my $self = shift; if (@_) { my ($pkg, $line) = $self->_caller_of('name'); $self->_push_added_by(sprintf("filename set by %s (%s line %s)", $self->_caller_plugin_name, $pkg, $line)); } return $self->$orig(@_); }; sub _caller_of { my ($self, $function) = @_; for (my $level = 1; $level < 50; ++$level) { my @frame = caller($level); last if not defined $frame[0]; return ( (caller($level))[0,2] ) if $frame[3] =~ m/::${function}$/; } return 'unknown', '0'; } sub _caller_plugin_name { my $self = shift; for (my $level = 1; $level < 50; ++$level) { my @frame = caller($level); last if not defined $frame[0]; return $1 if $frame[0] =~ m/^Dist::Zilla::Plugin::(.+)$/; } return 'unknown'; } #pod =attr mode #pod #pod This is the mode with which the file should be written out. It's an integer #pod with the usual C semantics. It defaults to 0644. #pod #pod =cut 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'; #pod =method is_bytes #pod #pod Returns true if the C is bytes. When true, accessing #pod C will be an error. #pod #pod =cut 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" => $_) }; # Okay, look, buddy… If you're using a BOM on UTF-8, that's fine. You can # use it. You're just not going to get it back. If we don't do this, the # sequence of events will be: # * read file from UTF-8-BOM file on disk # * end up with FEFF as first character of file # * pass file content to PPI # * PPI blows up # # I'm not going to try to account for the BOM and add it back. It's awful! # # Meanwhile, if you're using UTF-16, you can get the BOM handled by picking # the right encoding type, I think. -- rjbs, 2016-04-24 $enc =~ /^utf-?8$/i && $text =~ s/\A\x{FEFF}//; 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; maybe you need the [Encoding] plugin to specify an encoding" ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::File - something that can act like a file =head1 VERSION version 6.010 =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 list of strings describing when and why the file was added to the distribution and when it was updated (its content, filename, or other attributes). It will generally be updated by a plugin implementing the L role. Its accessor will return the list of strings, concatenated with C<'; '>. =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) 2017 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 diagnostics000755000767000024 013130677627 15431 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/tmain-module.t100644000767000024 604313130677627 20170 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/diagnosticsuse strict; use warnings; use Test::More 0.88; use Test::DZil; use Test::Fatal; 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 ); } subtest "no main_module + No Gatherdir + Legit Filesystem" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module }; ok( $error, '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' ); }; subtest "no main_module + gatherdir + legit filesystem" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', 'GatherDir', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module }; ok( !$error, 'should not fail with main_module' ); }; subtest "no main_module + gatherdir + bogus filesystem" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT_NoPm', 'GatherDir', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module }; ok( $error, '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' ); }; subtest "bad main_module, no gatherdir, legit filesystem" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', { main_module => 'lib/Bogus/Adventure.pm' }, [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module; }; ok( $error, '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' ); }; subtest "bad main_module, gatherdir, legit filesystem" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', { main_module => 'lib/Bogus/Adventure.pm' }, 'GatherDir', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module; }; ok( $error, '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' ); }; subtest "bad main_module, gatherdir, bogus filesystem" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT_NoPm', { main_module => 'lib/Bogus/Adventure.pm' }, 'GatherDir', [ Prereqs => { 'Test::Simple' => 0.88 } ] )->main_module; }; ok( $error, '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.t100644000767000024 506213130677627 20170 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/diagnosticsuse strict; use warnings; use Test::More 0.88; use Test::DZil; use Test::Fatal; use lib 't/lib'; sub mkconfig { my $root = shift; my $t = Builder->from_config( { dist_root => $root }, { add_files => { 'source/dist.ini' => simple_ini(@_) } } ); $t->build; return $t; } subtest "BrokenPlugin" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', [ 'BrokenPlugin' => {} ] ) }; ok( $error, "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" ); }; subtest "BrokenPlugin2" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', [ 'BrokenPlugin2' => {} ] ) }; ok( $error, "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" ); }; subtest "BrokenPlugin3" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', [ 'BrokenPlugin3' => {} ] ) }; ok( $error, "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" ); }; subtest "BrokenPlugin4" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', [ 'BrokenPlugin4' => {} ] ) }; ok( $error, "Failure occurs when a plugin is broken" ); like( $error, qr{Some(/|::)Package(/|::)That(/|::)Does(/|::)Not(/|::)Exist}, "Exception reports the original problem" ); }; subtest "Not::A::Plugin" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', [ 'Not::A::Plugin' => {} ] ) }; ok( $error, "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" ); }; subtest ":version, good" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', [ 'Versioned' => { ':version' => '1.0' } ] ) }; ok(!$error, 'plugin satisfies requested version'); }; subtest ":version, bad" => sub { my $error = exception { mkconfig( 'corpus/dist/DZT', [ 'Versioned' => { ':version' => '1.4' } ] ) }; ok($error, 'plugin does not satisfy requested version'); like($error, qr/\QDist::Zilla::Plugin::Versioned version (1.234) does not match required version: 1.4\E/, 'exception tells us why'); }; done_testing; CHECKLIST-testing.mkdn100644000767000024 225713130677627 17631 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.mkdn100644000767000024 221213130677627 20143 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.mkdn100644000767000024 37713130677627 20226 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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. App000755000767000024 013130677627 16123 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaTester.pm100644000767000024 735513130677627 20101 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Appuse strict; use warnings; package Dist::Zilla::App::Tester 6.010; # ABSTRACT: testing library for Dist::Zilla::App use parent 'App::Cmd::Tester::CaptureExternal'; use App::Cmd::Tester 0.306 (); # result_class, ->app use Dist::Zilla::App; use File::Copy::Recursive qw(dircopy); use File::pushd (); use File::Spec; use File::Temp; use Dist::Zilla::Path; 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 {; ref($_) ? $_ : File::Spec->rel2abs($_) } @INC; my $tmpdir = $arg->{tempdir} || File::Temp::tempdir(CLEANUP => 1); my $root = path($tmpdir)->child('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 6.010; 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 } ]; } } #pod =head1 DESCRIPTION #pod #pod This module exports only one function, C. #pod #pod =head2 C #pod #pod This function is used to test L. #pod It receives two mandatory options. The first is the path to a Dist::Zilla-based #pod distribution. The second, an array reference to a list of arguments. #pod #pod The third optional argument is a hash reference, with further options. At the moment #pod the only supported option is c. #pod #pod It returns a L, that inherits from #pod L. Typical methods called from this result are: #pod #pod =over 4 #pod #pod =item C #pod #pod The output of running dzil; #pod #pod =item C #pod #pod The folder used for temporary files. #pod #pod =item C #pod #pod The folder where the distribution was built. #pod #pod =back #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Tester - testing library for Dist::Zilla::App =head1 VERSION version 6.010 =head1 DESCRIPTION This module exports only one function, C. =head2 C This function is used to test L. It receives two mandatory options. The first is the path to a Dist::Zilla-based distribution. The second, an array reference to a list of arguments. The third optional argument is a hash reference, with further options. At the moment the only supported option is c. It returns a L, that inherits from L. Typical methods called from this result are: =over 4 =item C The output of running dzil; =item C The folder used for temporary files. =item C The folder where the distribution was built. =back =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 175513130677627 20074 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::Stash 6.010; # 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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 Stash000755000767000024 013130677627 16465 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaMint.pm100644000767000024 150013130677627 20066 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Stashpackage Dist::Zilla::Stash::Mint 6.010; # ABSTRACT: a stash of your default minting provider/profile use Moose; with 'Dist::Zilla::Role::Stash'; use namespace::autoclean; has provider => ( is => 'ro', isa => 'Str', required => 0, default => 'Default', ); has profile => ( is => 'ro', isa => 'Str', required => 0, default => 'default', ); __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Stash::Mint - a stash of your default minting provider/profile =head1 VERSION version 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 User.pm100644000767000024 151613130677627 20104 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Stashpackage Dist::Zilla::Stash::User 6.010; # ABSTRACT: a stash of user name and email use Moose; 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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 default000755000767000024 013130677627 16126 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/profilesprofile.ini100644000767000024 5013130677627 20362 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/profiles/default [DistINI] append_file = extra-dist.ini external-core-attr.mkdn100644000767000024 153113130677627 20357 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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. test.bash100644000767000024 4513130677627 20303 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_Bin#!/usr/bin/bash echo 'Hello World!' Command.pm100644000767000024 251313130677627 20200 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Appuse strict; use warnings; package Dist::Zilla::App::Command 6.010; # ABSTRACT: base class for dzil commands use App::Cmd::Setup -command; #pod =method zilla #pod #pod This returns the Dist::Zilla object in use by the command. If none has yet #pod been constructed, one will be by calling C<< Dist::Zilla->from_config >>. #pod #pod (This method just delegates to the Dist::Zilla::App object!) #pod #pod =cut sub zilla { return $_[0]->app->zilla; } #pod =method log #pod #pod This method calls the C method of the application's chrome. #pod #pod =cut 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 6.010 =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) 2017 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 Chrome000755000767000024 013130677627 16620 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaTerm.pm100644000767000024 755113130677627 20235 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Chromepackage Dist::Zilla::Chrome::Term 6.010; # ABSTRACT: chrome used for terminal-based interaction use Moose; #pod =head1 OVERVIEW #pod #pod This class provides a L implementation for use in a #pod terminal environment. It's the default chrome used by L. #pod #pod =cut use Dist::Zilla::Types qw(OneZero); use Encode (); use Log::Dispatchouli 1.102220; use namespace::autoclean; has logger => ( is => 'ro', isa => 'Log::Dispatchouli', init_arg => undef, writer => '_set_logger', lazy => 1, builder => '_build_logger', ); sub _build_logger { my $self = shift; my $enc = $self->term_enc; if ($enc && Encode::resolve_alias($enc)) { my $layer = sprintf(":encoding(%s)", $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', 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; my $encode = $term_enc ? sub { Encode::encode($term_enc, shift, Encode::FB_CROAK()) } : sub { shift }; my $decode = $term_enc ? sub { Encode::decode($term_enc, shift, Encode::FB_CROAK()) } : sub { shift }; if ($arg->{noecho}) { require Term::ReadKey; Term::ReadKey::ReadMode('noecho'); } my $input_bytes = $self->term_ui->get_reply( prompt => $encode->($prompt), allow => $check || sub { length $_[0] }, (defined $default ? (default => $encode->($default)) : () ), ); 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 = $decode->($input_bytes); chomp $input; return $input; } sub prompt_yn { my ($self, $prompt, $arg) = @_; $arg ||= {}; my $default = $arg->{default}; if (! $self->_isa_tty) { if (defined $default) { return OneZero->coerce($default); } $self->logger->log_fatal( "want interactive input, but terminal doesn't appear interactive" ); } my $input = $self->term_ui->ask_yn( prompt => $prompt, (defined $default ? (default => OneZero->coerce($default)) : ()), ); return $input; } sub _isa_tty { my $isa_tty = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); return $isa_tty; } sub prompt_any_key { my ($self, $prompt) = @_; $prompt ||= 'press any key to continue'; my $isa_tty = $self->_isa_tty; 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 6.010 =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) 2017 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.pm100644000767000024 614313130677627 20241 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Chromepackage Dist::Zilla::Chrome::Test 6.010; # ABSTRACT: the chrome used by Dist::Zilla::Tester use Moose; 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, }); } ); #pod =attr response_for #pod #pod The response_for attribute (which exists only in the Test chrome) is a #pod hashref that lets you specify the answer to questions asked by #pod C or C. The key is the prompt string. If the #pod value is a string, it is returned every time that question is asked. #pod If the value is an arrayref, the first element is shifted off and #pod returned every time the question is asked. If the arrayref is empty #pod (or the prompt is not listed in the hash), the default answer (if any) #pod is returned. #pod #pod Since you can't pass arguments to the Chrome constructor, response_for #pod is initialized to an empty hash, and you can add entries after #pod construction with the C method: #pod #pod $chrome->set_response_for($prompt => $response); #pod #pod =cut 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 6.010 =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) 2017 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 Dist000755000767000024 013130677627 16306 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaMinter.pm100644000767000024 770113130677627 20247 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Distpackage Dist::Zilla::Dist::Minter 6.010; # ABSTRACT: distribution builder; installer not included! use Moose 0.92; # role composition fixes extends 'Dist::Zilla'; use File::pushd (); use Dist::Zilla::Path; 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, }); push @{ $self->plugins }, $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]); warn "expected a string or Path::Tiny but got a Path::Class from $module\n" if ref $profile_dir && $profile_dir->isa('Path::Class'); $profile_dir = path($profile_dir); $assembler->sequence->section_named('_')->add_value(root => $profile_dir); my $seq = $config_class->read_config( $profile_dir->child('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 = path($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 = ( { name => $name =~ s/-/::/gr } ); $self->log("making target dir $dir"); $dir->mkpath; my $wd = File::pushd::pushd($self->root); $_->before_mint for @{ $self->plugins_with(-BeforeMint) }; 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) }; $_->set_file_encodings for @{ $self->plugins_with(-EncodingProvider) }; $_->prune_files for @{ $self->plugins_with(-FilePruner) }; $_->munge_files for @{ $self->plugins_with(-FileMunger) }; $self->_check_dupe_files; $self->log("writing files to $dir"); for my $file (@{ $self->files }) { $self->_write_out_file($file, $dir); } $_->after_mint({ mint_root => $dir }) for @{ $self->plugins_with(-AfterMint) }; $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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 File000755000767000024 013130677627 16262 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaOnDisk.pm100644000767000024 314313130677627 20150 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Filepackage Dist::Zilla::File::OnDisk 6.010; # ABSTRACT: a file that comes from your filesystem use Moose; use Dist::Zilla::Path; use namespace::autoclean; with 'Dist::Zilla::Role::MutableFile', 'Dist::Zilla::Role::StubBuild'; #pod =head1 DESCRIPTION #pod #pod This represents a file stored on disk. Its C attribute is read from #pod the originally given file name when first read, but is then kept in memory and #pod may be altered by plugins. #pod #pod =cut 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 6.010 =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) 2017 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 MVP000755000767000024 013130677627 16045 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaSection.pm100644000767000024 241413130677627 20150 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/MVPpackage Dist::Zilla::MVP::Section 6.010; # ABSTRACT: a standard section in Dist::Zilla's configuration sequence use Moose; extends 'Config::MVP::Section'; use namespace::autoclean; use Config::MVP::Section 2.200009; # not-installed error with section_name around add_value => sub { my ($orig, $self, $name, $value) = @_; if ($name =~ s/\A://) { if ($name eq 'version') { Dist::Zilla::Util->_assert_loaded_class_version_ok( $self->package, $value, ); } return; } $self->$orig($name, $value); }; after finalize => sub { my ($self) = @_; my ($name, $plugin_class, $arg) = ( $self->name, $self->package, $self->payload, ); my %payload = %{ $self->payload }; $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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 126613130677627 20224 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::Chrome 6.010; # 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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 554013130677627 20244 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::Plugin 6.010; # ABSTRACT: something that gets plugged in to Dist::Zilla use Moose::Role; with 'Dist::Zilla::Role::ConfigDumper'; use Params::Util qw(_HASHLIKE); use Moose::Util::TypeConstraints 'class_type'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod The Plugin role should be applied to all plugin classes. It provides a few key #pod methods and attributes that all plugins will need. #pod #pod =attr plugin_name #pod #pod The plugin name is generally determined when configuration is read. #pod #pod =cut has plugin_name => ( is => 'ro', isa => 'Str', required => 1, ); #pod =attr zilla #pod #pod This attribute contains the Dist::Zilla object into which the plugin was #pod plugged. #pod #pod =cut has zilla => ( is => 'ro', isa => class_type('Dist::Zilla'), required => 1, weak_ref => 1, ); #pod =method log #pod #pod The plugin's C method delegates to the Dist::Zilla object's #pod L method after including a bit of argument-munging. #pod #pod =cut 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, 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 ]); push @{ $self->zilla->plugins }, $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 6.010 =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) 2017 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.pm100644000767000024 211613130677627 20040 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Stashpackage Dist::Zilla::Stash::PAUSE 6.010; # ABSTRACT: a stash of your PAUSE credentials use Moose; use namespace::autoclean; #pod =head1 OVERVIEW #pod #pod The PAUSE stash is a L stash generally #pod used for uploading to PAUSE. #pod #pod =cut 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 6.010 =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) 2017 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 Foo000755000767000024 013130677627 17112 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_IncBar.pm100644000767000024 7413130677627 20255 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_Inc/Foo#!/usr/bin/perl package Foo::Bar; sub baz { 'bar'; } 1; t000755000767000024 013130677627 16772 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_NoPmbasic.t100644000767000024 34413130677627 20361 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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; subdir000755000767000024 013130677627 16605 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/extraindex.html100644000767000024 7013130677627 20677 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/extra/subdir

      SUPPLIES

      Builder.pm100644000767000024 6732613130677627 20430 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Distpackage Dist::Zilla::Dist::Builder 6.010; # ABSTRACT: dist zilla subclass for building dists use Moose 0.92; # role composition fixes extends 'Dist::Zilla'; use MooseX::Types::Moose qw(HashRef); use Dist::Zilla::Types qw(Path); use File::pushd (); use Dist::Zilla::Path; # because more Path::* is better, eh? use Try::Tiny; use List::Util 1.45 'uniq'; use namespace::autoclean; #pod =method from_config #pod #pod my $zilla = Dist::Zilla->from_config(\%arg); #pod #pod This routine returns a new Zilla from the configuration in the current working #pod directory. #pod #pod This method should not be relied upon, yet. Its semantics are B to #pod change. #pod #pod Valid arguments are: #pod #pod config_class - the class to use to read the config #pod default: Dist::Zilla::MVP::Reader::Finder #pod #pod =cut sub from_config { my ($class, $arg) = @_; $arg ||= {}; my $root = path($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; }, }); push @{ $self->plugins }, $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; }, }); push @{ $self->plugins }, $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/} }, }); push @{ $self->plugins }, $plugin; } unless ($self->plugin_named(':ExtraTestFiles')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':ExtraTestFiles', zilla => $self, style => 'grep', code => sub { local $_ = $_->name; m{\Axt/} }, }); push @{ $self->plugins }, $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 = uniq map {; @{ $_->find_files } } @$plugins; return \@files; }, }); push @{ $self->plugins }, $plugin; } unless ($self->plugin_named(':PerlExecFiles')) { require Dist::Zilla::Plugin::FinderCode; my $plugin = Dist::Zilla::Plugin::FinderCode->new({ plugin_name => ':PerlExecFiles', zilla => $self, style => 'list', code => sub { my $parent_plugin = $self->plugin_named(':ExecFiles'); my @files = grep { $_->name =~ m{\.pl$} or $_->content =~ m{^\s*\#\!.*perl\b}; } @{ $parent_plugin->find_files }; return \@files; }, }); push @{ $self->plugins }, $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, grep {; $_->name =~ m{\A\Q$map->{dist}\E/} } @{ $self->zilla->files }; } if ( my $mod_map = $map->{module} ) { for my $mod ( keys %$mod_map ) { push @files, grep { $_->name =~ m{\A\Q$mod_map->{$mod}\E/} } @{ $self->zilla->files }; } } return \@files; }, }); push @{ $self->plugins }, $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; }, }); push @{ $self->plugins }, $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 }, }); push @{ $self->plugins }, $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 { [] }, }); push @{ $self->plugins }, $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) }) { 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->child('dist'), { assembler => $assembler }, ); } catch { die $_ unless try { $_->isa('Config::MVP::Error') and $_->ident eq 'package not installed' }; my $package = $_->package; my $bundle = $_->section_name =~ m{^@(?!.*/)} ? ' 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; } #pod =method build_in #pod #pod $zilla->build_in($root); #pod #pod This method builds the distribution in the given directory. If no directory #pod name is given, it defaults to DistName-Version. If the distribution has #pod already been built, an exception will be thrown. #pod #pod =method build #pod #pod This method just calls C with no arguments. It gets you the default #pod behavior without the weird-looking formulation of C with no object #pod for the preposition! #pod #pod =cut 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) }; $self->log("beginning to build " . $self->name); $_->gather_files for @{ $self->plugins_with(-FileGatherer) }; $_->set_file_encodings for @{ $self->plugins_with(-EncodingProvider) }; $_->prune_files for @{ $self->plugins_with(-FilePruner) }; $self->version; # instantiate this lazy attribute now that files are gathered $_->munge_files for @{ $self->plugins_with(-FileMunger) }; $_->register_prereqs for @{ $self->plugins_with(-PrereqSource) }; $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) }; $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 }) { $self->_write_out_file($file, $build_root); } $_->after_build({ build_root => $build_root }) for @{ $self->plugins_with(-AfterBuild) }; $self->built_in($build_root); } #pod =attr built_in #pod #pod This is the L, if any, in which the dist has been built. #pod #pod =cut has built_in => ( is => 'rw', isa => Path, init_arg => undef, coerce => 1, ); #pod =method ensure_built_in #pod #pod $zilla->ensure_built_in($root); #pod #pod This method behaves like C>, but if the dist is already built in #pod C<$root> (or the default root, if no root is given), no exception is raised. #pod #pod =method ensure_built #pod #pod This method just calls C with no arguments. It gets you the #pod default behavior without the weird-looking formulation of C #pod with no object for the preposition! #pod #pod =cut 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); } #pod =method dist_basename #pod #pod my $basename = $zilla->dist_basename; #pod #pod This method will return the dist's basename (e.g. C. #pod The basename is used as the top-level directory in the tarball. It #pod does not include C<-TRIAL>, even if building a trial dist. #pod #pod =cut sub dist_basename { my ($self) = @_; return join(q{}, $self->name, '-', $self->version, ); } #pod =method archive_filename #pod #pod my $tarball = $zilla->archive_filename; #pod #pod This method will return the filename (e.g. C) #pod of the tarball of this distribution. It will include C<-TRIAL> if building a #pod trial distribution, unless the version contains an underscore. The tarball #pod might not exist. #pod #pod =cut sub archive_filename { my ($self) = @_; return join(q{}, $self->dist_basename, ( $self->is_trial && $self->version !~ /_/ ? '-TRIAL' : '' ), '.tar.gz' ); } #pod =method build_archive #pod #pod $zilla->build_archive; #pod #pod This method will ensure that the dist has been built, and will then build a #pod tarball of the build directory in the current directory. #pod #pod =cut sub build_archive { my ($self) = @_; my $built_in = $self->ensure_built; my $basename = $self->dist_basename; my $basedir = path($basename); $_->before_archive for @{ $self->plugins_with(-BeforeArchive) }; 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 = path($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 } ) { my $in = path($distfile->name)->parent; unless ($seen_dir{ $in }++) { $archive->add_data( $basedir->child($in), '', { type => Archive::Tar::Constant::DIR(), mode => 0755 }, ) } my $filename = $built_in->child( $distfile->name ); $archive->add_data( $basedir->child( $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 } ) { my $in = path($distfile->name)->parent; my $filename = $built_in->child( $distfile->name ); $archive->add( $basedir->child( $distfile->name )->stringify, $filename->stringify, { perm => (stat $filename)[2] & ~022 }, ); } return $archive; } sub _prep_build_root { my ($self, $build_root) = @_; $build_root = path($build_root || $self->dist_basename); $build_root->mkpath unless -d $build_root; my $dist_root = $self->root; return $build_root if !-d $build_root; my $ok = eval { $build_root->remove_tree({ safe => 0 }); 1 }; die "unable to delete '$build_root' in preparation of build: $@" unless $ok; # the following is done only on windows, and only if the deletion failed, # yet rmtree reported success, because currently rmdir is non-blocking as per: # https://rt.perl.org/Ticket/Display.html?id=123958 if ( $^O eq 'MSWin32' and -d $build_root ) { $self->log("spinning for at least one second to allow other processes to release locks on $build_root"); my $timeout = time + 2; while(time != $timeout and -d $build_root) { } die "unable to delete '$build_root' in preparation of build because some process has a lock on it" if -d $build_root; } return $build_root; } #pod =method release #pod #pod $zilla->release; #pod #pod This method releases the distribution, probably by uploading it to the CPAN. #pod The actual effects of this method (as with most of the methods) is determined #pod by the loaded plugins. #pod #pod =cut sub release { my $self = shift; Carp::croak("you can't release without any Releaser plugins") unless my @releasers = @{ $self->plugins_with(-Releaser) }; $ENV{DZIL_RELEASING} = 1; my $tgz = $self->build_archive; # call all plugins implementing BeforeRelease role $_->before_release($tgz) for @{ $self->plugins_with(-BeforeRelease) }; # do the actual release $_->release($tgz) for @releasers; # call all plugins implementing AfterRelease role $_->after_release($tgz) for @{ $self->plugins_with(-AfterRelease) }; } #pod =method clean #pod #pod This method removes temporary files and directories suspected to have been #pod produced by the Dist::Zilla build process. Specifically, it deletes the #pod F<.build> directory and any entity that starts with the dist name and a hyphen, #pod like matching the glob C. #pod #pod =cut 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); } }; } #pod =method ensure_built_in_tmpdir #pod #pod $zilla->ensure_built_in_tmpdir; #pod #pod This method will consistently build the distribution in a temporary #pod subdirectory. It will return the path for the temporary build location. #pod #pod =cut sub ensure_built_in_tmpdir { my $self = shift; require File::Temp; my $build_root = path('.build'); $build_root->mkpath unless -d $build_root; my $target = path( 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 = path( $build_root, 'previous' ); $latest = path( $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); } #pod =method install #pod #pod $zilla->install( \%arg ); #pod #pod This method installs the distribution locally. The distribution will be built #pod in a temporary subdirectory, then the process will change directory to that #pod subdir and an installer will be run. #pod #pod Valid arguments are: #pod #pod keep_build_dir - if true, don't rmtree the build dir, even if everything #pod seemed to work #pod install_command - the command to run in the subdir to install the dist #pod default (roughly): $^X -MCPAN -einstall . #pod #pod this argument should be an arrayref #pod #pod =cut sub install { my ($self, $arg) = @_; $arg ||= {}; my ($target, $latest) = $self->ensure_built_in_tmpdir; my $ok = 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 ]); 1; }; unless ($ok) { my $error = $@ || '(exception clobered)'; $self->log("install failed, left failed dist in place at $target"); die $error; } 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->remove_tree({ safe => 0 }); $latest->remove if $latest; } return; } #pod =method test #pod #pod $zilla->test(\%arg); #pod #pod This method builds a new copy of the distribution and tests it using #pod C>. #pod #pod C<\%arg> may be omitted. Otherwise, valid arguments are: #pod #pod keep_build_dir - if true, don't rmtree the build dir, even if everything #pod seemed to work #pod #pod =cut sub test { my ($self, $arg) = @_; Carp::croak("you can't test without any TestRunner plugins") unless my @testers = @{ $self->plugins_with(-TestRunner) }; my ($target, $latest) = $self->ensure_built_in_tmpdir; my $error = $self->run_tests_in($target, $arg); 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->remove_tree({ safe => 0 }); $latest->remove if $latest; } #pod =method run_tests_in #pod #pod my $error = $zilla->run_tests_in($directory, $arg); #pod #pod This method runs the tests in $directory (a Path::Tiny), which must contain an #pod already-built copy of the distribution. It will throw an exception if there #pod are test failures. #pod #pod It does I set any of the C<*_TESTING> environment variables, nor #pod does it clean up C<$directory> afterwards. #pod #pod =cut sub run_tests_in { my ($self, $target, $arg) = @_; Carp::croak("you can't test without any TestRunner plugins") unless my @testers = @{ $self->plugins_with(-TestRunner) }; for my $tester (@testers) { my $wd = File::pushd::pushd($target); $tester->test( $target, $arg ); } } #pod =method run_in_build #pod #pod $zilla->run_in_build( \@cmd ); #pod #pod This method makes a temporary directory, builds the distribution there, #pod executes all the dist's Ls #pod (unless directed not to, via C<< $arg->{build} = 0 >>), and #pod then runs the given command in the build directory. If the command exits #pod non-zero, the directory will be left in place. #pod #pod =cut sub run_in_build { my ($self, $cmd, $arg) = @_; $self->log_fatal("you can't build without any BuildRunner plugins") unless ($arg and exists $arg->{build} and ! $arg->{build}) or @{ $self->plugins_with(-BuildRunner) }; 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; } $self->_ensure_blib; local $ENV{PERL5LIB} = join $Config::Config{path_sep}, (map { $abstarget->child('blib', $_) } qw(arch lib)), (defined $ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()); local $ENV{PATH} = join $Config::Config{path_sep}, (map { $abstarget->child('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->remove_tree({ safe => 0 }); $latest->remove if $latest; } else { my $error = $@ || '(unknown error)'; $self->log($error); $self->log_fatal("left failed dist in place at $target"); } } # Ensures that a F directory exists in the build, by invoking all # C<-BuildRunner> plugins to generate it. Useful for commands that operate on # F, such as C or C. sub _ensure_blib { my ($self) = @_; unless ( -d 'blib' ) { my @builders = @{ $self->plugins_with( -BuildRunner ) }; $self->log_fatal("no BuildRunner plugins specified") unless @builders; $_->build for @builders; $self->log_fatal("no blib; failed to build properly?") unless -d 'blib'; } } __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 6.010 =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 distribution. It will include C<-TRIAL> if building a trial distribution, unless the version contains an underscore. 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, $arg); This method runs the tests in $directory (a Path::Tiny), 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 all the dist's Ls (unless directed not to, via C<< $arg->{build} = 0 >>), 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) 2017 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.pm100644000767000024 425413130677627 20302 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BuildPL 6.010; # ABSTRACT: Common ground for Build.PL based builders use Moose::Role; with qw( Dist::Zilla::Role::InstallTool Dist::Zilla::Role::BuildRunner Dist::Zilla::Role::TestRunner ); use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This role is a helper for Build.PL based installers. It implements the #pod L and L #pod roles, and requires you to implement the L #pod and L roles yourself. #pod #pod =cut sub build { my $self = shift; return if -e 'Build' and (stat 'Build.PL')[9] <= (stat 'Build')[9]; $self->log_debug("running $^X Build.PL"); system $^X, 'Build.PL' and die "error with Build.PL\n"; $self->log_debug("running $^X Build"); system $^X, 'Build' and die "error running $^X Build\n"; return; } sub test { my ($self, $target, $arg) = @_; $self->build; my $job_count = $arg && exists $arg->{jobs} ? $arg->{jobs} : $self->default_jobs; my $jobs = "j$job_count"; my $ho = "HARNESS_OPTIONS"; local $ENV{$ho} = $ENV{$ho} ? "$ENV{$ho}:$jobs" : $jobs; my @testing = $self->zilla->logger->get_debug || $arg->{test_verbose} ? '--verbose' : (); $self->log_debug('running ' . join(' ', $^X, 'Build', 'test', @testing)); system $^X, 'Build', 'test', @testing and die "error running $^X Build test\n"; return; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::BuildPL - Common ground for Build.PL based builders =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 151313130677627 20423 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Stashpackage Dist::Zilla::Stash::Rights 6.010; # ABSTRACT: a stash of your default licensing terms use Moose; with 'Dist::Zilla::Role::Stash'; 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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 Stash000755000767000024 013130677627 16730 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/lib/Dist/ZillaHeap.pm100644000767000024 64613130677627 20271 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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; munger-that-prunes.t100644000767000024 173413130677627 20702 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/pluginsuse strict; use warnings; use Test::More 0.88; use lib 't/lib'; use Test::DZil; use YAML::Tiny; # In the future, pruning during munging may become impossible by design. Until # that time, it should not cause weird-o action at a distance. -- rjbs, # 2016-01-31 { my $tzil = Builder->from_config( { dist_root => 'corpus/dist/DZT' }, { add_files => { 'source/Build.pod' => "This file is cruft.\n", 'source/Build2.pod' => "This other file is cruft.\n", 'source/Build3.pod' => "This third file is cruft.\n", 'source/dist.ini' => simple_ini( 'GatherDir', 'MungerThatPrunesPodFiles', ), }, }, ); $tzil->build; my @files = map {; $_->name } @{ $tzil->files }; is_filelist( [ @files ], [ qw(lib/DZT/Sample.pm t/basic.t dist.ini) ], 'munge_file that call prunes does not mangle $self->zilla->files', ); } done_testing; AuthorDeps000755000767000024 013130677627 17213 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/distdist.ini100644000767000024 71513130677627 21002 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/AuthorDepsname = Foo version = 1.23 author = foobar license = Perl_5 copyright_holder = foobar copyright_year = 2009 ; authordep perl = 5.005 ; authordep List::MoreUtils = != 0.407 ; authordep Foo::Bar = 1.23 ; this is an explanation for this dep :version = 5.001 [GatherDir] [ExecDir/BadlyPaddedName] :version = 5.0 [AutoPrereqs] :version = 5.0 skip = ^DZPA::Skip [MetaYAML] [Encoding / WithDescription] :version = 5.0 encoding = bytes filename = t/data.bin DZ-NonAscii000755000767000024 013130677627 17153 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/distChanges100644000767000024 12413130677627 20563 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZ-NonAsciiRevision history for {{$dist->name}} {{$NEXT}} - Olivier Mengué was here! FromCode.pm100644000767000024 552013130677627 20460 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Filepackage Dist::Zilla::File::FromCode 6.010; # ABSTRACT: a file whose content is (re-)built on demand use Moose; use Moose::Util::TypeConstraints; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This represents a file whose contents will be generated on demand from a #pod callback or method name. #pod #pod It has one attribute, C, which may be a method name (string) or a #pod coderef. When the file's C method is called, the code is used to #pod generate the content. This content is I cached. It is recomputed every #pod time the content is requested. #pod #pod =cut with 'Dist::Zilla::Role::File'; has code => ( is => 'rw', isa => 'CodeRef|Str', required => 1, ); #pod =attr code_return_type #pod #pod 'text' or 'bytes' #pod #pod =cut has code_return_type => ( is => 'ro', isa => enum([ qw(text bytes) ]), default => 'text', ); #pod =attr encoding #pod #pod =cut 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'; } #pod =attr content #pod #pod =cut 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); } } #pod =attr encoded_content #pod #pod =cut 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); } } sub _set_added_by { my ($self, $value) = @_; return $self->_push_added_by(sprintf("%s from coderef added by %s", $self->code_return_type, $value)); }; __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 6.010 =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) 2017 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.pm100644000767000024 331013130677627 20514 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Filepackage Dist::Zilla::File::InMemory 6.010; # ABSTRACT: a file that you build entirely in memory use Moose; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This represents a file created in memory -- it's not much more than a glorified #pod string. #pod #pod See L for details. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 630013130677627 20457 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/MVPpackage Dist::Zilla::MVP::Assembler 6.010; # ABSTRACT: Dist::Zilla-specific subclass of Config::MVP::Assembler use Moose; extends 'Config::MVP::Assembler'; with 'Config::MVP::Assembler::WithBundles' => { -version => '2.200010' }; use namespace::autoclean; use Dist::Zilla::Util; #pod =head1 DESCRIPTION #pod #pod B If you don't understand how L #pod works, reading about how the Dist::Zilla-specific Assembler works is not going #pod to be useful. #pod #pod Dist::Zilla::MVP::Assembler extends L and composes #pod L. For potential plugin bundles (things #pod composing L) #pod #pod The Assembler has chrome, so it can log and will (eventually) be able to get #pod input from the user. #pod #pod The Assembler's C method delegates to Dist::Zilla::Util's #pod L #pod method. #pod #pod The Assembler will throw an exception if it is instructed to add a value for #pod C or C. #pod #pod =cut 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 6.010 =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) 2017 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 Plugin000755000767000024 013130677627 16641 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaReadme.pm100644000767000024 374613130677627 20546 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Readme 6.010; # ABSTRACT: build a README file use Moose; with qw/Dist::Zilla::Role::FileGatherer Dist::Zilla::Role::TextTemplate Dist::Zilla::Role::FileMunger/; use Moose::Util::TypeConstraints; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin adds a very simple F file to the distribution, citing the #pod dist's name, version, abstract, and license. It may be more useful or #pod informative in the future. #pod #pod =cut has _file_obj => ( is => 'rw', isa => role_type('Dist::Zilla::Role::File'), ); 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 }}. |; $self->add_file( $self->_file_obj( Dist::Zilla::File::InMemory->new( name => 'README', content => $template, ) ) ); return; } sub munge_files { my $self = shift; my $file = $self->_file_obj; $file->content( $self->fill_in_string( $file->content, { dist => \($self->zilla), generated_by => \sprintf("%s v%s", ref($self), $self->VERSION || '(dev)'), } ) ); return; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::Readme - build a README file =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 172613130677627 20552 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::Releaser 6.010; # ABSTRACT: something that makes a release of the dist use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method called when #pod releasing. It's passed the distribution tarball to be released. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 166313130677627 20511 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::ShareDir 6.010; # 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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.ini100644000767000024 3213130677627 21006 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/profiles/defaultversion = 0.001 [@Basic] AutoPrereqs000755000767000024 013130677627 17407 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/distdist.ini100644000767000024 65113130677627 21175 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/AutoPrereqsname = Foo version = 1.23 author = foobar license = Perl_5 copyright_holder = foobar copyright_year = 2009 ; authordep perl = 5.005 [GatherDir] [ExecDir] [AutoPrereqs] skip = ^DZPA::Skip [Encoding] encoding = bytes filename = t/data.bin [Prereqs / DevelopRequires] String::Formatter = 0 [Prereqs / RuntimeRecommends] Term::ReadLine::Gnu = 0 Archive::Tar::Wrapper = 0.15 [Prereqs / RuntimeSuggests] PPI::XS = 1.23 dist.ini100644000767000024 36113130677627 20737 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZ-NonAsciiname = DZ-NonAscii version = 0.001 author = Olivier Mengué author = 김도형 license = Perl_5 copyright_holder = ภูมิพลอดุลยเดช [@Classic] [MetaJSON] [NextRelease] DistINI.pm100644000767000024 771213130677627 20611 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::DistINI 6.010; # 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 MooseX::Types::Moose qw(ArrayRef Str); use Dist::Zilla::Path; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugins produces a F file in a new dist, specifying the required #pod core attributes from the dist being minted. #pod #pod This plugin is dead simple and pretty stupid, but should get better as dist #pod minting facilities improve. For example, it will not specify any plugins. #pod #pod In the meantime, you may be happier with a F template. #pod #pod =attr append_file #pod #pod This parameter may be a filename in the profile's directory to append to the #pod generated F with things like plugins. In other words, if your make #pod this file, called F: #pod #pod [@Basic] #pod [NextRelease] #pod [@Git] #pod #pod ...and your F includes: #pod #pod [DistINI] #pod append_file = plugins.ini #pod #pod ...then the generated C in a newly-minted dist will look something #pod like this: #pod #pod name = My-New-Dist #pod author = E. Xavier Ample #pod license = Perl_5 #pod copyright_holder = E. Xavier Ample #pod copyright_year = 2010 #pod #pod [@Basic] #pod [NextRelease] #pod [@Git] #pod #pod =cut 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 = ''; for (@{ $self->append_file }) { my $fn = $self->zilla->root->child($_); $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 6.010 =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) 2017 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.pm100644000767000024 221213130677627 20657 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ExecDir 6.010; # ABSTRACT: install a directory's contents as executables use Moose; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod In your F: #pod #pod [ExecDir] #pod dir = scripts #pod #pod If no C is provided, the default is F. #pod #pod =cut has dir => ( is => 'ro', isa => 'Str', default => 'bin', ); sub find_files { my ($self) = @_; my $dir = $self->dir; my $files = [ grep { index($_->name, "$dir/") == 0 } @{ $self->zilla->files } ]; } 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 6.010 =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) 2017 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.pm100644000767000024 434713130677627 20731 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::License 6.010; # ABSTRACT: output a LICENSE file use Moose; with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin adds a F file containing the full text of the #pod distribution's license, as produced by the C method of the #pod dist's L object. #pod #pod =attr filename #pod #pod This attribute can be used to specify a name other than F to be used. #pod #pod =cut use Dist::Zilla::File::InMemory; has filename => ( is => 'ro', isa => 'Str', default => 'LICENSE', ); sub gather_files { my ($self, $arg) = @_; my $file = Dist::Zilla::File::InMemory->new({ name => $self->filename, content => $self->zilla->license->fulltext, }); $self->add_file($file); return; } __PACKAGE__->meta->make_immutable; 1; #pod =head1 SEE ALSO #pod #pod =over 4 #pod #pod =item * #pod #pod the C attribute of the L object to select the license #pod to use. #pod #pod =item * #pod #pod Dist::Zilla roles: #pod L. #pod #pod =item * #pod #pod Other modules: #pod L, #pod L. #pod #pod =back #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::License - output a LICENSE file =head1 VERSION version 6.010 =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 ATTRIBUTES =head2 filename This attribute can be used to specify a name other than F to be used. =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) 2017 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.pm100644000767000024 1010113130677627 20715 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PkgDist 6.010; # 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; #pod =head1 DESCRIPTION #pod #pod This plugin will add a line like the following to each package in each Perl #pod module or program (more or less) within the distribution: #pod #pod { our $DIST = 'My-CPAN-Dist'; } # where 'My-CPAN-Dist' is your dist name #pod #pod It will skip any package declaration that includes a newline between the #pod C keyword and the package name, like: #pod #pod package #pod Foo::Bar; #pod #pod This sort of declaration is also ignored by the CPAN toolchain, and is #pod typically used when doing monkey patching or other tricky things. #pod #pod =cut 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); return unless my $package_stmts = $document->find('PPI::Statement::Package'); if ($self->document_assigns_to_variable($document, '$DIST')) { $self->log([ 'skipping %s: assigns to $DIST', $file->name ]); return; } 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, ]); # the extra whitespace element ensures we don't swallow up any blanks # lines after 'package ...' in the source file that PkgVersion warns about # if it's missing. Carp::carp('error inserting $DIST in ' . $file->name) unless $stmt->add_element( PPI::Token::Whitespace->new("\n") ) and $stmt->insert_after($children[0]->clone) and $stmt->insert_after( PPI::Token::Whitespace->new("\n") ); } # the document is no longer correct; it must be reparsed before it can be used again $file->content($document->serialize); } __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 6.010 =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) 2017 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.pm100644000767000024 1662613130677627 21013 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Prereqs 6.010; # ABSTRACT: list simple prerequisites use Moose; with 'Dist::Zilla::Role::PrereqSource'; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod In your F: #pod #pod [Prereqs] #pod Foo::Bar = 1.002 #pod MRO::Compat = 10 #pod Sub::Exporter = 0 #pod #pod You can specify requirements for different phases and relationships with: #pod #pod [Prereqs] #pod -phase = test #pod -relationship = recommends #pod #pod Fitz::Fotz = 1.23 #pod Text::SoundEx = 3 #pod #pod Remember that if you load two Prereqs plugins, each will needs its own name, #pod added like this: #pod #pod [Prereqs / PluginName] #pod -phase = test #pod -relationship = recommends #pod #pod Fitz::Fotz = 1.23 #pod Text::SoundEx = 3 #pod #pod If the name is the CamelCase concatenation of a phase and relationship #pod (or just a relationship), it will set those parameters implicitly. If #pod you use a custom name, but it does not specify the relationship, and #pod you didn't specify either C<-phase> or C<-relationship>, it throws the #pod error C. This is to prevent a #pod typo that makes the name meaningless from slipping by unnoticed. #pod #pod The example below is equivalent to the example above, except for the name of #pod the resulting plugin: #pod #pod [Prereqs / TestRecommends] #pod Fitz::Fotz = 1.23 #pod Text::SoundEx = 3 #pod #pod =head1 DESCRIPTION #pod #pod This module adds "fixed" prerequisites to your distribution. These are prereqs #pod with a known, fixed minimum version that doesn't change based on platform or #pod other conditions. #pod #pod You can specify prerequisites for different phases and kinds of relationships. #pod In C, the phase is Runtime and the relationship is Requires. #pod These are described in more detail in the L. #pod #pod The phases are: #pod #pod =for :list #pod * configure #pod * build #pod * test #pod * runtime #pod * develop #pod #pod The relationship types are: #pod #pod =for :list #pod * requires #pod * recommends #pod * suggests #pod * conflicts #pod #pod If the phase is omitted, it will default to I; thus, specifying #pod "Prereqs / Recommends" in your dist.ini is equivalent to I. #pod #pod Not all of these phases are useful for all tools, especially tools that only #pod understand version 1.x CPAN::Meta files. #pod #pod =cut 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' } } around BUILDARGS => sub { my $orig = shift; my ($class, @arg) = @_; my $args = $class->$orig(@arg); my %copy = %{ $args }; 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/^-//r; $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}) # plugin comes from a bundle 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; #pod =head1 SEE ALSO #pod #pod =over 4 #pod #pod =item * #pod #pod Core Dist::Zilla plugins: #pod L<@Basic|Dist::Zilla::PluginBundle::Basic>, #pod L. #pod #pod =item * #pod #pod The CPAN Meta specification: L. #pod #pod =back #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::Prereqs - list simple prerequisites =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 224113130677627 20672 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::AfterMint 6.010; # ABSTRACT: something that runs after minting is mostly complete use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method called once all #pod the files have been written out. It is passed a hashref with the following #pod data: #pod #pod mint_root - the directory in which the dist was minted #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 145513130677627 20656 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::ExecFiles 6.010; # 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 = [ grep { index($_->name, "$dir/") == 0 } @{ $self->zilla->files } ]; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::ExecFiles - something that finds files to install as executables =head1 VERSION version 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 104013130677627 20672 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::StubBuild 6.010; # 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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 release000755000767000024 013130677627 14732 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/xtchanges_has_content.t100644000767000024 201113130677627 21246 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/xt/release#!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '6.010'; 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; } DZT000755000767000024 013130677627 17005 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT/libSample.pm100644000767000024 20313130677627 20677 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT/lib/DZTuse strict; use warnings; package DZT::Sample; sub return_arrayref_of_values_passed { my $invocant = shift; return \@_; } 1; DZT_Share000755000767000024 013130677627 16720 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/distmy_data.dat100644000767000024 5213130677627 21125 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_Sharesome random data that should be shared... Command000755000767000024 013130677627 17501 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Appadd.pm100644000767000024 477013130677627 20737 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::add 6.010; # ABSTRACT: add a module to a dist use Dist::Zilla::App -command; use Dist::Zilla::Path; #pod =head1 SYNOPSIS #pod #pod Adds a new module to a Dist::Zilla-based distribution #pod #pod $ dzil add Some::New::Module #pod #pod There are two arguments, C<-p> and C<-P>. C<-P> specify the minting profile #pod provider and C<-p> - the profile name. These work just like C. #pod #pod =cut 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 File::pushd; 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 = path($zilla->root)->absolute; my $wd = File::pushd::pushd($minter->root); my $factory = $minter->plugin_named(':DefaultModuleMaker'); for my $name ( @$arg ) { $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 6.010 =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) 2017 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.pm100644000767000024 1013613130677627 21011 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::new 6.010; # ABSTRACT: mint a new dist use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod Creates a new Dist-Zilla based distribution under the current directory. #pod #pod $ dzil new Main::Module::Name #pod #pod There are two arguments, C<-p> and C<-P>. C<-P> specify the minting profile #pod provider and C<-p> - the profile name. #pod #pod The default profile provider first looks in the #pod F<~/.dzil/profiles/$profile_name> and then among standard profiles, shipped #pod with Dist::Zilla. For example: #pod #pod $ dzil new -p work Corporate::Library #pod #pod This command would instruct C to look in F<~/.dzil/profiles/work> for a #pod F (or other "profile" config file). If no profile name is given, #pod C will look for the C profile. If no F directory #pod exists, it will use a very simple configuration shipped with Dist::Zilla. #pod #pod $ dzil new -P Foo Corporate::Library #pod #pod This command would instruct C to consult the Foo provider about the #pod directory of 'default' profile. #pod #pod Furthermore, it is possible to specify the default minting provider and profile #pod in the F<~/.dzil/config.ini> file, for example: #pod #pod [%Mint] #pod provider = FooCorp #pod profile = work #pod #pod =cut 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 $stash = $self->app->_build_global_stashes; my $minter = Dist::Zilla::Dist::Minter->_new_from_profile( ( exists $stash->{'%Mint'} ? [ $stash->{'%Mint'}->provider, $stash->{'%Mint'}->profile ] : [ $opt->provider, $opt->profile ] ), { chrome => $self->app->chrome, name => $dist, _global_stashes => $stash, }, ); $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 6.010 =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. Furthermore, it is possible to specify the default minting provider and profile in the F<~/.dzil/config.ini> file, for example: [%Mint] provider = FooCorp profile = work =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 261313130677627 20775 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::nop 6.010; # ABSTRACT: initialize dzil, then exit use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod This command does nothing. It initializes Dist::Zilla, then exits. This is #pod useful to see the logging output of plugin initialization. #pod #pod dzil nop -v #pod #pod Seriously, this command is almost entirely for diagnostic purposes. Don't #pod overthink it, okay? #pod #pod =cut sub abstract { 'do nothing: initialize dzil, then exit' } sub description { "This command does nothing but initialize Dist::Zilla and exit.\n" . "It is sometimes useful for diagnostic purposes." } 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 6.010 =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) 2017 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.pm100644000767000024 714613130677627 21013 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::run 6.010; # ABSTRACT: run stuff in a dir where your dist is built use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod $ dzil run ./bin/myscript #pod $ dzil run prove -bv t/mytest.t #pod $ dzil run bash #pod #pod =head1 DESCRIPTION #pod #pod This command will build your dist with Dist::Zilla, then build the #pod distribution and then run a command in the build directory. It's something #pod like doing this: #pod #pod dzil build #pod rsync -avp My-Project-version/ .build/ #pod cd .build #pod perl Makefile.PL # or perl Build.PL #pod make # or ./Build #pod export PERL5LIB=$PWD/blib/lib:$PWD/blib/arch #pod #pod #pod Except for the fact it's built directly in a subdir of .build (like #pod F<.build/69105y2>). #pod #pod A command returning with an non-zero error code will left the build directory #pod behind for analysis, and C will exit with a non-zero status. Otherwise, #pod the build directory will be removed and dzil will exit with status zero. #pod #pod If no run command is provided, a new default shell is invoked. This can be #pod useful for testing your distribution as if it were installed. #pod #pod =cut 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 } ], [ 'trial' => 'build a trial release that PAUSE will not index' ], } sub description { "This will build your dist and run the given 'command' in the build dir.\n" . "If no command was specified, your shell will be run there instead." } sub usage_desc { return '%c run %o [ 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, trial => $opt->trial }); } 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 6.010 =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) 2017 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 Reader000755000767000024 013130677627 17247 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/MVPPerl.pm100644000767000024 340213130677627 20646 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/MVP/Readerpackage Dist::Zilla::MVP::Reader::Perl 6.010; # ABSTRACT: the reader for dist.pl files use Moose; extends 'Config::MVP::Reader'; with qw(Config::MVP::Reader::Findable::ByExtension); use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Dist::Zilla::Config reads in the F file for a distribution. #pod #pod =cut sub default_extension { 'pl' } sub read_into_assembler { my ($self, $location, $asm) = @_; my @input = do File::Spec->rel2abs($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 6.010 =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) 2017 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.pm100644000767000024 504213130677627 21014 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/MVPpackage Dist::Zilla::MVP::RootSection 6.010; # ABSTRACT: a standard section in Dist::Zilla's configuration sequence use Moose; extends 'Config::MVP::Section'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This is a subclass of L, used as the starting section by #pod L. It has a number of useful defaults, as #pod well as a C attribute which will, after section finalization, contain a #pod Dist::Zilla object with which subsequent plugin sections may register. #pod #pod Those useful defaults are: #pod #pod =for :list #pod * name defaults to _ #pod * aliases defaults to { author => 'authors' } #pod * multivalue_args defaults to [ 'authors' ] #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 527313130677627 20667 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::CPANFile 6.010; # ABSTRACT: produce a cpanfile prereqs file use Moose; with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; use Dist::Zilla::File::FromCode; #pod =head1 SYNOPSIS #pod #pod # dist.ini #pod [CPANfile] #pod #pod =head1 DESCRIPTION #pod #pod This plugin will add a F file to the distribution. #pod #pod =attr filename #pod #pod If given, parameter allows you to specify an alternate name for the generated #pod file. It defaults, of course, to F. #pod #pod # dist.ini #pod [CPANfile] #pod filename = dzil-generated-cpanfile #pod #pod =cut 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 6.010 =head1 SYNOPSIS # dist.ini [CPANfile] =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. # dist.ini [CPANfile] filename = dzil-generated-cpanfile =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 772113130677627 21074 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Encoding 6.010; # ABSTRACT: set the encoding of arbitrary files use Moose; with 'Dist::Zilla::Role::EncodingProvider'; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod This plugin allows you to explicitly set the encoding on some files in your #pod distribution. You can either specify the exact set of files (with the #pod "filenames" parameter) or provide the regular expressions to check (using #pod "match"). #pod #pod In your F: #pod #pod [Encoding] #pod encoding = Latin-3 #pod #pod filename = t/esperanto.t ; this file is Esperanto #pod match = ^t/urkish/ ; these are all Turkish #pod #pod =cut sub mvp_multivalue_args { qw(filenames matches ignore) } sub mvp_aliases { return { filename => 'filenames', match => 'matches' } } #pod =attr encoding #pod #pod This is the encoding to set on the selected files. The special value "bytes" #pod can be used to indicate raw files that should not be encoded. #pod #pod =cut has encoding => ( is => 'ro', isa => 'Str', required => 1, ); #pod =attr filenames #pod #pod This is an arrayref of filenames to have their encoding set. #pod #pod =cut has filenames => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); #pod =attr matches #pod #pod This is an arrayref of regular expressions. Any file whose name matches one of #pod these regex will have its encoding set. #pod #pod =cut has matches => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); #pod =attr ignore #pod #pod This is an arrayref of regular expressions. Any file whose name matches one of #pod these regex will B have its encoding set. Useful to ignore a few files #pod that would otherwise be selected by C. #pod #pod =cut has ignore => ( 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}; my( $ignore_regex ) = map { $_ && qr/$_/ } join '|', @{ $self->ignore }; for my $file (@{$self->zilla->files}) { next unless $file->name =~ $matches_regex; next if $ignore_regex and $file->name =~ $ignore_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 6.010 =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. The special value "bytes" can be used to indicate raw files that should not be encoded. =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. =head2 ignore This is an arrayref of regular expressions. Any file whose name matches one of these regex will B have its encoding set. Useful to ignore a few files that would otherwise be selected by C. =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 445213130677627 21112 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Manifest 6.010; # ABSTRACT: build a MANIFEST file use Moose; with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; use Dist::Zilla::File::FromCode; #pod =head1 DESCRIPTION #pod #pod If included, this plugin will produce a F file for the distribution, #pod listing all of the files it contains. For obvious reasons, it should be #pod included as close to last as possible. #pod #pod This plugin is included in the L<@Basic|Dist::Zilla::PluginBundle::Basic> #pod bundle. #pod #pod =head1 SEE ALSO #pod #pod Dist::Zilla core plugins: #pod L<@Basic|Dist::Zilla::PluginBundle::Manifest>, #pod L. #pod #pod Other modules: L. #pod #pod =cut 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_return_type => 'bytes', code => sub { my $generated_by = sprintf "%s v%s", ref($self), $self->VERSION || '(dev)'; return "# This file was automatically generated by $generated_by.\n" . join("\n", map { __fix_filename($_) } sort map { $_->name } @{ $zilla->files }) . "\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 6.010 =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) 2017 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.pm100644000767000024 1001713130677627 20736 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaJSON 6.010; # ABSTRACT: produce a META.json use Moose; with 'Dist::Zilla::Role::FileGatherer'; use Moose::Util::TypeConstraints; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin will add a F file to the distribution. #pod #pod This file is meant to replace the old-style F. For more information #pod on this file, see L and L. #pod #pod =attr filename #pod #pod If given, parameter allows you to specify an alternate name for the generated #pod file. It defaults, of course, to F. #pod #pod =cut has filename => ( is => 'ro', isa => 'Str', default => 'META.json', ); #pod =attr version #pod #pod This parameter lets you pick what version of the spec to use when generating #pod the output. It defaults to 2 at present, but may be updated to new specs as #pod they are released and adopted. #pod #pod If you want a fixed version, specify it. #pod #pod =cut my $version_type = subtype( as 'Num', where { $_ >= 2 }, message { "MetaJSON version must be 2 or greater" }, ); has version => ( is => 'ro', isa => $version_type, default => '2', ); sub gather_files { my ($self, $arg) = @_; my $zilla = $self->zilla; require JSON::MaybeXS; require Dist::Zilla::File::FromCode; 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, encoding => 'ascii', 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 $backend = JSON::MaybeXS::JSON(); $output->{x_serialization_backend} = sprintf '%s version %s', $backend, $backend->VERSION; JSON::MaybeXS->new(canonical => 1, pretty => 1, ascii => 1)->encode($output) . "\n"; }, }); $self->add_file($file); return; } __PACKAGE__->meta->make_immutable; 1; #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L<@Basic|Dist::Zilla::PluginBundle::Basic>, #pod L. #pod #pod Dist::Zilla roles: #pod L. #pod #pod Other modules: #pod L, #pod L, L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaJSON - produce a META.json =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 625513130677627 20720 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaYAML 6.010; # ABSTRACT: produce a META.yml use Moose; with 'Dist::Zilla::Role::FileGatherer'; use Try::Tiny; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin will add a F file to the distribution. #pod #pod For more information on this file, see L and L. #pod #pod =attr filename #pod #pod If given, parameter allows you to specify an alternate name for the generated #pod file. It defaults, of course, to F. #pod #pod =cut has filename => ( is => 'ro', isa => 'Str', default => 'META.yml', ); 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 => '1.4'); $output->{x_serialization_backend} = sprintf '%s version %s', 'YAML::Tiny', YAML::Tiny->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; #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L<@Basic|Dist::Zilla::PluginBundle::Basic>, #pod L. #pod #pod Dist::Zilla roles: #pod L. #pod #pod Other modules: #pod L, #pod L, L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaYAML - produce a META.yml =head1 VERSION version 6.010 =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. =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) 2017 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.pm100644000767000024 245113130677627 21042 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ShareDir 6.010; # ABSTRACT: install a directory's contents as "ShareDir" content use Moose; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod In your F: #pod #pod [ShareDir] #pod dir = share #pod #pod If no C is provided, the default is F. #pod #pod =cut has dir => ( is => 'ro', isa => 'Str', default => 'share', ); sub find_files { my ($self) = @_; my $dir = $self->dir; my $files = [ grep { index($_->name, "$dir/") == 0 } @{ $self->zilla->files } ]; } 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 6.010 =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) 2017 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.pm100644000767000024 225013130677627 21022 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::AfterBuild 6.010; # ABSTRACT: something that runs after building is mostly complete use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method called once all #pod the files have been written out. It is passed a hashref with the following #pod data: #pod #pod build_root - the directory in which the dist was built #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 166613130677627 21045 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BeforeMint 6.010; # ABSTRACT: something that runs before minting really begins use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method called #pod before any other plugins are consulted. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 552313130677627 21016 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileFinder 6.010; # ABSTRACT: something that finds files within the distribution use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod A FileFinder plugin locates files within the distribution. This role exists so #pod that sets of files can be easily described in one configuration section and #pod then used by one or more other plugin. #pod #pod Plugins implementing this role must provide a C method which will #pod be called with no arguments and must return an arrayref of files. (This #pod arrayref should not be re-used, as it may be altered once returned.) #pod #pod For example, imagine a simple glob-like FileFinder that expects configuration #pod like this: #pod #pod [Glob / RootModules] #pod glob = *.pm #pod #pod This sets up a FileFinder named "RootModules" which will contain all F #pod files in the root directory. #pod #pod Another plugin that knows how to use FileFinder plugins might be configured #pod like this: #pod #pod [ModuleRelocator] #pod finder = RootModules #pod relocate_to = attic #pod #pod Finders may operate on any rules they like, checking file size, content, name, #pod or other properties. They should re-perform their "finding" on each call to #pod C as the files in the distribution may have changed. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 452413130677627 21044 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileMunger 6.010; # ABSTRACT: something that alters a file's destination or content use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod A FileMunger has an opportunity to mess around with each file that will be #pod included in the distribution. Each FileMunger's C method is #pod called once. By default, this method will just call the C method #pod (note the missing terminal 's') once for each file, excluding files with an #pod encoding attribute of 'bytes'. #pod #pod The C method is expected to change attributes about the file before #pod it is written out to the built distribution. #pod #pod If you want to modify all files (including ones with an encoding of 'bytes') or #pod want to select a more limited set of files, you can provide your own #pod C method. #pod #pod =cut sub munge_files { my ($self) = @_; $self->log_fatal("no munge_file behavior implemented!") unless $self->can('munge_file'); my @files = @{ $self->zilla->files }; for my $file ( @files ) { if ($file->is_bytes) { $self->log_debug($file->name . " has 'bytes' encoding, skipping..."); next; } $self->munge_file($file); } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::FileMunger - something that alters a file's destination or content =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 240613130677627 21057 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FilePruner 6.010; # ABSTRACT: something that removes found files from the distribution use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing FilePruner have their C method called once #pod all the L plugins have been #pod called. They are expected to (optionally) remove files from the list of files #pod to be included in the distribution. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 405713130677627 21121 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::TestRunner 6.010; # ABSTRACT: something used as a delegating agent to 'dzil test' use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method called when #pod testing. It's passed the root directory of the build test dir and an #pod optional hash reference of arguments. Valid arguments include: #pod #pod =for :list #pod * jobs -- if parallel testing is supported, this indicates how many to run at once #pod #pod =method test #pod #pod This method should throw an exception on failure. #pod #pod =cut requires 'test'; #pod =attr default_jobs #pod #pod This attribute is the default value that should be used as the C argument #pod to the C method. #pod #pod =cut has default_jobs => ( is => 'ro', isa => 'Int', # non-negative default => 1, ); around dump_config => sub { my ($orig, $self) = @_; my $config = $self->$orig; $config->{'' . __PACKAGE__} = { default_jobs => $self->default_jobs }; return $config; }; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::TestRunner - something used as a delegating agent to 'dzil test' =head1 VERSION version 6.010 =head1 DESCRIPTION Plugins implementing this role have their C method called when testing. It's passed the root directory of the build test dir and an optional hash reference of arguments. Valid arguments include: =over 4 =item * jobs -- if parallel testing is supported, this indicates how many to run at once =back =head1 ATTRIBUTES =head2 default_jobs This attribute is the default value that should be used as the C argument to the C method. =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) 2017 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 Util000755000767000024 013130677627 16320 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaAuthorDeps.pm100644000767000024 1012613130677627 21114 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Utiluse strict; use warnings; package Dist::Zilla::Util::AuthorDeps 6.010; # ABSTRACT: Utils for listing your distribution's author dependencies use Dist::Zilla::Util; use Path::Tiny; use List::Util 1.45 (); 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 = path($root, '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_utf8; require Config::INI::Reader; my $config = Config::INI::Reader->read_handle($fh); require CPAN::Meta::Requirements; my $reqs = CPAN::Meta::Requirements->new; if (defined (my $license = $config->{_}->{license})) { $license = 'Software::License::'.$license; $reqs->add_minimum($license => 0); } for my $section ( sort keys %$config ) { if (q[_] eq $section) { my $version = $config->{_}{':version'}; $reqs->add_minimum('Dist::Zilla' => $version) if $version; next; } my $pack = $section; $pack =~ s{\s*/.*$}{}; # trim optional space and slash-delimited suffix my $version = 0; $version = $config->{$section}->{':version'} if exists $config->{$section}->{':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*/; my $module = $1; my $ver = $2 // "0"; $ver =~ s/\s+$//; # 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, $module; # And added to the requirements so we can use it later $reqs->add_string_requirement($module => $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)); @packages = List::Util::uniq(@packages); if ($missing) { require Module::Runtime; @packages = grep { $_ eq 'perl' ? ! ($vermap->{perl} && eval "use $vermap->{perl}; 1") : do { my $m = $_; ! eval { # This will die if module is missing Module::Runtime::require_module($m); my $v = $vermap->{$m}; # This will die if VERSION is too low !$v || $m->VERSION($v); # Success! 1 } } } @packages; } # Now that we have a sorted list of packages, use that to build an array of # hashrefs for display. [ map { { $_ => $vermap->{$_} } } @packages ] } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Util::AuthorDeps - Utils for listing your distribution's author dependencies =head1 VERSION version 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 bin000755000767000024 013130677627 20157 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/AutoPrereqsfoobar100644000767000024 31313130677627 21467 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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; t000755000767000024 013130677627 17652 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/AutoPrereqsdata.bin100644000767000024 3413130677627 21352 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/AutoPrereqs/tpretend this is binary, OK? lib000755000767000024 013130677627 17721 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZ-NonAsciiDZ1.pm100644000767000024 20313130677627 20770 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/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.pm100644000767000024 1015313130677627 21176 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::test 6.010; # ABSTRACT: test your dist use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod dzil test [ --release ] [ --no-author ] [ --automated ] [ --extended ] [ --all ] #pod #pod =head1 DESCRIPTION #pod #pod This command is a thin wrapper around the L method in #pod Dist::Zilla. It builds your dist and runs the tests with the AUTHOR_TESTING #pod environment variable turned on, so it's like doing this: #pod #pod export AUTHOR_TESTING=1 #pod dzil build --no-tgz #pod cd $BUILD_DIRECTORY #pod perl Makefile.PL #pod make #pod make test #pod #pod A build that fails tests will be left behind for analysis, and F will #pod exit a non-zero value. If the tests are successful, the build directory will #pod be removed and F will exit with status 0. #pod #pod =cut sub opt_spec { [ 'release' => 'enables the RELEASE_TESTING env variable', { default => 0 } ], [ 'automated' => 'enables the AUTOMATED_TESTING env variable', { default => 0 } ], [ 'extended' => 'enables the EXTENDED_TESTING env variable', { default => 0 } ], [ 'author!' => 'enables the AUTHOR_TESTING env variable (default behavior)', { default => 1 } ], [ 'all' => 'enables the RELEASE_TESTING, AUTOMATED_TESTING, EXTENDED_TESTING and AUTHOR_TESTING env variables', { default => 0 } ], [ 'keep-build-dir|keep' => 'keep the build directory even after a success' ], [ 'jobs|j=i' => 'number of parallel test jobs to run' ], [ 'test-verbose' => 'enables verbose testing (TEST_VERBOSE env variable on Makefile.PL, --verbose on Build.PL', { default => 0 } ], } #pod =head1 OPTIONS #pod #pod =head2 --release #pod #pod This will run the test suite with RELEASE_TESTING=1 #pod #pod =head2 --automated #pod #pod This will run the test suite with AUTOMATED_TESTING=1 #pod #pod =head2 --extended #pod #pod This will run the test suite with EXTENDED_TESTING=1 #pod #pod =head2 --no-author #pod #pod This will run the test suite without setting AUTHOR_TESTING #pod #pod =head2 --all #pod #pod Equivalent to --release --automated --extended --author #pod #pod =cut 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; local $ENV{EXTENDED_TESTING} = 1 if $opt->extended or $opt->all; $self->zilla->test({ $opt->keep_build_dir ? (keep_build_dir => 1) : (), $opt->jobs ? (jobs => $opt->jobs) : (), $opt->test_verbose ? (test_verbose => $opt->test_verbose) : (), }); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::test - test your dist =head1 VERSION version 6.010 =head1 SYNOPSIS dzil test [ --release ] [ --no-author ] [ --automated ] [ --extended ] [ --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 --extended This will run the test suite with EXTENDED_TESTING=1 =head2 --no-author This will run the test suite without setting AUTHOR_TESTING =head2 --all Equivalent to --release --automated --extended --author =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 2346113130677627 21236 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::GatherDir 6.010; # ABSTRACT: gather all the files in a directory use Moose; use Dist::Zilla::Types qw(Path); with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This is a very, very simple L #pod plugin. It looks in the directory named in the L attribute and adds all #pod the files it finds there. If the root begins with a tilde, the tilde is #pod replaced with the current user's home directory according to L. #pod #pod Almost every dist will be built with one GatherDir plugin, since it's the #pod easiest way to get files from disk into your dist. Most users just need: #pod #pod [GatherDir] #pod [PruneCruft] #pod #pod ...and this will pick up all the files from the current directory into the #pod dist. (L is needed, here, to drop #pod files that might present as build artifacts, but should not be shipped.) You #pod can use it multiple times, as you can any other plugin, by providing a plugin #pod name. For example, if you want to include external specification files into a #pod subdir of your dist, you might write: #pod #pod [GatherDir] #pod ; this plugin needs no config and gathers most of your files #pod #pod [GatherDir / SpecFiles] #pod ; this plugin gets all the files in the root dir and adds them under ./spec #pod root = ~/projects/my-project/spec #pod prefix = spec #pod #pod =cut use File::Find::Rule; use File::Spec; use Path::Tiny; use List::Util 1.33 'all'; #pod =attr root #pod #pod This is the directory in which to look for files. If not given, it defaults to #pod the dist root -- generally, the place where your F or other #pod configuration file is located. #pod #pod =cut has root => ( is => 'ro', isa => Path, lazy => 1, coerce => 1, required => 1, default => sub { shift->zilla->root }, ); #pod =attr prefix #pod #pod This parameter can be set to place the gathered files under a particular #pod directory. See the L above for an example. #pod #pod =cut has prefix => ( is => 'ro', isa => 'Str', default => '', ); #pod =attr include_dotfiles #pod #pod By default, files will not be included if they begin with a dot. This goes #pod both for files and for directories relative to the C. #pod #pod In almost all cases, the default value (false) is correct. #pod #pod =cut has include_dotfiles => ( is => 'ro', isa => 'Bool', default => 0, ); #pod =attr follow_symlinks #pod #pod By default, symlinks pointing to directories will not be followed; set #pod C<< follow_symlinks = 1 >> to traverse these links as if they were normal #pod directories. #pod #pod In all followed directories, files which are symlinks are B gathered, #pod with the link turning into a normal file. #pod #pod =cut has follow_symlinks => ( is => 'ro', isa => 'Bool', default => 0, ); sub mvp_multivalue_args { qw(exclude_filename exclude_match prune_directory) } #pod =attr exclude_filename #pod #pod To exclude certain files from being gathered, use the C #pod option. The filename is matched exactly, relative to C. #pod This may be used multiple times to specify multiple files to exclude. #pod #pod =cut has exclude_filename => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); #pod =attr exclude_match #pod #pod This is just like C but provides a regular expression #pod pattern. Filenames matching the pattern (relative to C) are not #pod gathered. This may be used #pod multiple times to specify multiple patterns to exclude. #pod #pod =cut has exclude_match => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); #pod =attr prune_directory #pod #pod While traversing, any directory matching the regular expression pattern will #pod not be traversed further. This may be used multiple times to specify multiple #pod directories to skip. #pod #pod =cut has prune_directory => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); around dump_config => sub { my $orig = shift; my $self = shift; my $config = $self->$orig; $config->{+__PACKAGE__} = { prefix => $self->prefix, # only report relative to dist root to avoid leaking private info root => path($self->root)->relative($self->zilla->root), (map { $_ => $self->$_ ? 1 : 0 } qw(include_dotfiles follow_symlinks)), (map { $_ => [ sort @{ $self->$_ } ] } qw(exclude_filename exclude_match prune_directory)), }; return $config; }; sub gather_files { my ($self) = @_; my $exclude_regex = qr/\000/; $exclude_regex = qr/(?:$exclude_regex)|$_/ for @{ $self->exclude_match }; my $repo_root = $self->zilla->root; my $root = "" . $self->root; $root =~ s{^~([\\/])}{require File::HomeDir; File::HomeDir::->my_home . $1}e; $root = path($root)->absolute($repo_root)->stringify if path($root)->is_relative; my $prune_regex = qr/\000/; $prune_regex = qr/$prune_regex|$_/ for ( @{ $self->prune_directory }, $self->include_dotfiles ? () : ( qr/^\.[^.]/ ) ); # build up the rules my $rule = File::Find::Rule->new(); $rule->extras({ follow => $self->follow_symlinks }); $rule->exec(sub { $self->log_debug('considering ' . path($_[-1])->relative($repo_root)); 1 }) if $self->zilla->logger->get_debug; $rule->or( $rule->new->directory->exec(sub { /$prune_regex/ })->prune->discard, $rule->new, ); if ($self->follow_symlinks) { $rule->or( $rule->new->file, # symlinks to files still count as files $rule->new->symlink, # traverse into the linked dir, but screen it out later ); } else { $rule->file; } $rule->not_exec(sub { /^\.[^.]/ }) unless $self->include_dotfiles; # exec passes basename as $_ $rule->exec(sub { my $relative = path($_[-1])->relative($root); $relative !~ $exclude_regex && all { $relative ne $_ } @{ $self->exclude_filename } }); FILE: for my $filename ($rule->in($root)) { next if -d $filename; # _file_from_filename is overloaded in GatherDir::Template my $fileobj = $self->_file_from_filename($filename); # GatherDir::Template may rename the file $filename = $fileobj->name; my $file = path($filename)->relative($root); $file = path($self->prefix, $file) if $self->prefix; $fileobj->name($file->stringify); $self->add_file($fileobj); } return; } sub _file_from_filename { my ($self, $filename) = @_; my @stat = stat $filename or $self->log_fatal("$filename does not exist!"); return Dist::Zilla::File::OnDisk->new({ name => $filename, mode => $stat[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 6.010 =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] [PruneCruft] ...and this will pick up all the files from the current directory into the dist. (L is needed, here, to drop files that might present as build artifacts, but should not be shipped.) 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, symlinks pointing to directories will not be followed; set C<< follow_symlinks = 1 >> to traverse these links as if they were normal directories. In all followed directories, files which are symlinks are B gathered, with the link turning into a normal file. =head2 exclude_filename To exclude certain files from being gathered, use the C option. The filename is matched exactly, relative to C. 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. Filenames matching the pattern (relative to C) are not gathered. This may be used multiple times to specify multiple patterns to exclude. =head2 prune_directory While traversing, any directory matching the regular expression pattern will not be traversed further. This may be used multiple times to specify multiple directories to skip. =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 2722113130677627 21220 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MakeMaker 6.010; # ABSTRACT: build a Makefile.PL that uses ExtUtils::MakeMaker use Moose; use namespace::autoclean; use Config; use CPAN::Meta::Requirements 2.121; # requirements_for_module use List::Util 1.29 qw(first pairs pairgrep); use version; use Dist::Zilla::File::InMemory; use Dist::Zilla::Plugin::MakeMaker::Runner; #pod =head1 DESCRIPTION #pod #pod This plugin will produce an L-powered F for #pod the distribution. If loaded, the L #pod plugin should also be loaded. #pod #pod =cut #pod =attr eumm_version #pod #pod This option declares the version of ExtUtils::MakeMaker required to configure #pod and build the distribution. There is no default, although one may be added if #pod it can be determined that the generated F requires some specific #pod minimum. I #pod #pod =cut has eumm_version => ( isa => 'Str', is => 'rw', ); #pod =attr make_path #pod #pod This option sets the path to F, used to build your dist and run tests. #pod It defaults to the value for C in L, or to C if that isn't #pod set. #pod #pod You probably won't need to set this option. #pod #pod =cut has 'make_path' => ( isa => 'Str', is => 'ro', default => $Config{make} || 'make', ); #pod =attr static_attribution #pod #pod This option omits the version number in the "generated by" #pod comment in the Makefile.PL. For setups that copy the Makefile.PL #pod back to the repo, this avoids churn just from upgrading Dist::Zilla. #pod #pod =cut has 'static_attribution' => ( isa => 'Bool', is => 'ro', ); 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, default_jobs => $self->default_jobs, }); }, ); # 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 do 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::FileGatherer 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{{ defined $eumm_version && 0+$eumm_version ? ' ' . $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 || 0, ); return unless keys %{ $self->zilla->_share_dir_map }; $self->zilla->register_prereqs( { phase => 'configure' }, 'File::ShareDir::Install' => 0.06, ); } sub gather_files { my ($self) = @_; require Dist::Zilla::File::InMemory; my $file = Dist::Zilla::File::InMemory->new({ name => 'Makefile.PL', content => $template, # template evaluated later }); $self->add_file($file); return; } 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 = <<'PREAMBLE'; use File::ShareDir::Install; $File::ShareDir::Install::INCLUDE_DOTFILES = 1; $File::ShareDir::Install::INCLUDE_DOTDIRS = 1; PREAMBLE 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} = "\n" . $preamble . "\n"; $share_dir_code->{postamble} = qq{\n\{\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/-/::/gr; my @exe_files = map { $_->name } @{ $self->zilla->find_files(':ExecFiles') }; $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 }) { next unless $file->name =~ m{\At/.+\.t\z}; my $dir = $file->name =~ s{/[^/]+\.t\z}{/*.t}gr; $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(configure requires))) ->add_requirements($prereqs->requirements_for(qw(build requires))) ->add_requirements($prereqs->requirements_for(qw(test requires))) ->as_string_hash->{perl}; $perl_prereq = version->parse($perl_prereq)->numify if $perl_prereq; my $prereqs_dump = sub { $self->_normalize_eumm_versions( $prereqs->requirements_for(@_) ->clone ->clear_requirement('perl') ->as_string_hash ); }; my %require_prereqs = map { $_ => $prereqs_dump->($_, 'requires'); } qw(configure build test runtime); # EUMM may soon be able to support this, but until we decide to inject a # higher configure-requires version, we should at least warn the user # https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/215 foreach my $phase (qw(configure build test runtime)) { if (my @version_ranges = pairgrep { defined($b) && !version::is_lax($b) } %{ $require_prereqs{$phase} } and ($self->eumm_version || 0) < '7.1101') { $self->log_fatal([ 'found version range in %s prerequisites, which ExtUtils::MakeMaker cannot parse (must specify eumm_version of at least 7.1101): %s %s', $phase, $_->[0], $_->[1] ]) foreach pairs @version_ranges; } } my %write_makefile_args = ( DISTNAME => $self->zilla->name, NAME => $name, AUTHOR => join(q{, }, @{ $self->zilla->authors }), ABSTRACT => $self->zilla->abstract, VERSION => $self->zilla->version, LICENSE => $self->zilla->license->meta_yml_name, @exe_files ? ( EXE_FILES => [ sort @exe_files ] ) : (), CONFIGURE_REQUIRES => $require_prereqs{configure}, keys %{ $require_prereqs{build} } ? ( BUILD_REQUIRES => $require_prereqs{build} ) : (), keys %{ $require_prereqs{test} } ? ( TEST_REQUIRES => $require_prereqs{test} ) : (), PREREQ_PM => $require_prereqs{runtime}, test => { TESTS => join q{ }, sort keys %test_dirs }, ); $write_makefile_args{MIN_PERL_VERSION} = $perl_prereq if $perl_prereq; return \%write_makefile_args; } sub _normalize_eumm_versions { my ($self, $prereqs) = @_; for my $v (values %$prereqs) { if (version::is_strict($v)) { my $version = version->parse($v); if ($version->is_qv) { if ((() = $v =~ /\./g) > 1) { $v =~ s/^v//; } else { $v = $version->numify; } } } } return $prereqs; } 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->_normalize_eumm_versions( $self->zilla->prereqs->merged_requires ->clone ->clear_requirement('perl') ->as_string_hash ); return $self->_dump_as( $fallback, '*FallbackPrereqs' ); } sub setup_installer { my ($self) = @_; my $write_makefile_args = $self->write_makefile_args; $self->__write_makefile_args($write_makefile_args); # save for testing my $perl_prereq = $write_makefile_args->{MIN_PERL_VERSION}; my $dumped_args = $self->_dump_as($write_makefile_args, '*WriteMakefileArgs'); my $file = first { $_->name eq 'Makefile.PL' } @{$self->zilla->files}; $self->log_debug([ 'updating contents of Makefile.PL in memory' ]); my $attribution = $self->static_attribution ? ref($self) : sprintf("%s v%s", ref($self), $self->VERSION || '(dev)'); my $content = $self->fill_in_string( $file->content, { 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 => \$attribution, }, ); $file->content($content); return; } # XXX: Just here to facilitate testing. -- rjbs, 2010-03-20 has __write_makefile_args => ( is => 'rw', isa => 'HashRef', ); __PACKAGE__->meta->make_immutable; 1; #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L<@Basic|Dist::Zilla::PluginBundle::Basic>, #pod L, #pod L. #pod #pod Dist::Zilla roles: #pod L, #pod L, #pod L, #pod L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MakeMaker - build a Makefile.PL that uses ExtUtils::MakeMaker =head1 VERSION version 6.010 =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. There is no default, although one may be added if it can be determined that the generated F requires some specific minimum. 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. =head2 static_attribution This option omits the version number in the "generated by" comment in the Makefile.PL. For setups that copy the Makefile.PL back to the repo, this avoids churn just from upgrading Dist::Zilla. =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) 2017 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.pm100644000767000024 454113130677627 21254 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaTests 6.010; # ABSTRACT: common extra tests for META.yml use Moose; extends 'Dist::Zilla::Plugin::InlineFiles'; with 'Dist::Zilla::Role::PrereqSource'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This is an extension of L, providing the #pod following files: #pod #pod xt/release/meta-yaml.t - a standard Test::CPAN::Meta test #pod #pod L will be added as a C dependency (which #pod can be installed via C<< dzil listdeps --author | cpanm >>). #pod #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L, #pod L, #pod L, #pod L, #pod L. #pod #pod =cut # 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 6.010 =head1 DESCRIPTION This is an extension of L, providing the following files: xt/release/meta-yaml.t - a standard Test::CPAN::Meta test L will be added as a C dependency (which can be installed via C<< dzil listdeps --author | cpanm >>). =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) 2017 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::CPAN::Meta; meta_yaml_ok(); BeforeBuild.pm100644000767000024 167513130677627 21175 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BeforeBuild 6.010; # ABSTRACT: something that runs before building really begins use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method called #pod before any other plugins are consulted. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 230313130677627 21231 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BuildRunner 6.010; # ABSTRACT: something used as a delegating agent during 'dzil run' use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method called during #pod C. It's passed the root directory of the build test dir. #pod #pod =head1 REQUIRED METHODS #pod #pod =head2 build #pod #pod This method will throw an exception on failure. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 306413130677627 21251 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::InstallTool 6.010; # 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; #pod =head1 DESCRIPTION #pod #pod Plugins implementing InstallTool have their C method called to #pod inject files after all other file injection and munging has taken place. #pod They're expected to produce files needed to make the distribution #pod installable, like F or F and add them with the #pod C method provided by L, which is #pod also composed by this role. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 314713130677627 21214 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::ModuleMaker 6.010; # 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; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method called for each #pod module requesting creation by the plugin with this name. It is passed a #pod hashref with the following data: #pod #pod name - the name of the module to make (a MooseX::Types::Perl::ModuleName) #pod #pod Classes composing this role also compose #pod L and are expected to inject a #pod file for the module being created. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 764413130677627 21206 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::MutableFile 6.010; # ABSTRACT: something that can act like a file with changeable contents use Moose::Role; use Moose::Util::TypeConstraints; use MooseX::SetOnce; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This role describes a file whose contents may be modified #pod #pod =attr encoding #pod #pod Default is 'UTF-8'. Can only be set once. #pod #pod =cut with 'Dist::Zilla::Role::File'; sub encoding; has encoding => ( is => 'rw', isa => 'Str', lazy => 1, default => 'UTF-8', traits => [ qw(SetOnce) ], ); #pod =attr content #pod #pod =cut 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, $line) = $self->_caller_of('content'); $self->_content_source('content'); $self->_push_added_by(sprintf("content set by %s (%s line %s)", $self->_caller_plugin_name, $pkg, $line)); $self->clear_encoded_content; return $self->_content(@_); } } #pod =attr encoded_content #pod #pod =cut 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, $line) = $self->_caller_of('encoded_content'); $self->_content_source('encoded_content'); $self->_push_added_by(sprintf("encoded_content set by %s (%s line %s)", $self->_caller_plugin_name, $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 _set_added_by { my ($self, $value) = @_; return $self->_push_added_by(sprintf("%s added by %s", $self->_content_source, $value)); }; # 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 6.010 =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) 2017 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 Stash000755000767000024 013130677627 17366 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/RoleLogin.pm100644000767000024 153013130677627 21133 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Role/Stashpackage Dist::Zilla::Role::Stash::Login 6.010; # ABSTRACT: a stash with username/password credentials use Moose::Role; with 'Dist::Zilla::Role::Stash'; use namespace::autoclean; #pod =head1 OVERVIEW #pod #pod A Login stash must provide a C and C method. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 1373613130677627 21330 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::build 6.010; # ABSTRACT: build your dist use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod dzil build [ --trial ] [ --tgz | --no-tgz ] [ --in /path/to/build/dir ] #pod #pod =head1 DESCRIPTION #pod #pod This command is a very thin layer over the Dist::Zilla C method, which #pod does all the things required to build your distribution. By default, it will #pod also archive your distribution and leave you with a complete, ready-to-release #pod distribution tarball. #pod #pod To go a bit further in depth, the C command will do two things: #pod #pod =over #pod #pod =item #pod #pod Generate a directory containing your module, C. This directory is #pod complete. You could create a gzipped tarball from this directory and upload it #pod directly to C if you so desired. You could C into this directory and #pod test your module on Perl installations where you don't have C, for #pod example. #pod #pod This is a default behavior of the C command. You can alter where it puts #pod the directory with C<--in /path/to/build/dir>. #pod #pod =item #pod #pod Generate a gzipped tarball of your module, C. This file #pod could be uploaded directly to C to make a release of your module if you #pod wanted. Or, you can test your module: C. #pod This is the same thing you would get if you compressed the directory described #pod above. #pod #pod The gzipped tarball is generated by default, but if you don't want it to be #pod generated, you can pass the C<--no-tgz> option. In that case, it would only #pod generate the directory described above. #pod #pod =back #pod #pod Once you're done testing or publishing your build, you can clean up everything #pod with a C. #pod #pod =cut sub abstract { 'build your dist' } #pod =head1 EXAMPLE #pod #pod $ dzil build #pod $ dzil build --no-tgz #pod $ dzil build --in /path/to/build/dir #pod #pod =cut 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' ] } #pod =head1 OPTIONS #pod #pod =head2 --trial #pod #pod This will build a trial distribution. Among other things, it will generally #pod mean that the built tarball's basename ends in F<-TRIAL>. #pod #pod =head2 --tgz | --no-tgz #pod #pod Builds a .tar.gz in your project directory after building the distribution. #pod #pod --tgz behaviour is by default, use --no-tgz to disable building an archive. #pod #pod =head2 --in #pod #pod Specifies the directory into which the distribution should be built. If #pod necessary, the directory will be created. An archive will not be created. #pod #pod =cut sub execute { my ($self, $opt, $args) = @_; if ($opt->in) { require Path::Tiny; die qq{using "--in ." would destroy your working directory!\n} if Path::Tiny::path($opt->in)->absolute eq Path::Tiny::path('.')->absolute; $self->zilla->build_in($opt->in); } else { my $method = $opt->tgz ? 'build_archive' : 'build'; my $zilla; { # isolate changes to RELEASE_STATUS to zilla construction local $ENV{RELEASE_STATUS} = $ENV{RELEASE_STATUS}; $ENV{RELEASE_STATUS} = 'testing' if $opt->trial; $zilla = $self->zilla; } $zilla->$method; } $self->zilla->log('built in ' . $self->zilla->built_in); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::build - build your dist =head1 VERSION version 6.010 =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. To go a bit further in depth, the C command will do two things: =over =item Generate a directory containing your module, C. This directory is complete. You could create a gzipped tarball from this directory and upload it directly to C if you so desired. You could C into this directory and test your module on Perl installations where you don't have C, for example. This is a default behavior of the C command. You can alter where it puts the directory with C<--in /path/to/build/dir>. =item Generate a gzipped tarball of your module, C. This file could be uploaded directly to C to make a release of your module if you wanted. Or, you can test your module: C. This is the same thing you would get if you compressed the directory described above. The gzipped tarball is generated by default, but if you don't want it to be generated, you can pass the C<--no-tgz> option. In that case, it would only generate the directory described above. =back Once you're done testing or publishing your build, you can clean up everything with a C. =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) 2017 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.pm100644000767000024 343113130677627 21262 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::clean 6.010; # ABSTRACT: clean up after build, test, or install use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod dzil clean [ --dry-run|-n ] #pod #pod This command removes some files that are created during build, test, and #pod install. It's a very thin layer over the C> method #pod on the Dist::Zilla object. The documentation for that method gives more #pod information about the files that will be removed. #pod #pod =cut sub opt_spec { [ 'dry-run|n' => 'don\'t actually remove anything, just show what would be done' ], } #pod =head1 OPTIONS #pod #pod =head2 -n, --dry-run #pod #pod Nothing is removed; instead, everything that would be removed will be listed. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 1101613130677627 21356 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::setup 6.010; # ABSTRACT: set up a basic global config file use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod $ dzil setup #pod Enter your name> Ricardo Signes #pod ... #pod #pod Dist::Zilla looks for per-user configuration in F<~/.dzil/config.ini>. This #pod command prompts the user for some basic information that can be used to produce #pod the most commonly needed F sections. #pod #pod B: PAUSE account details are stored within config.ini in plain text. #pod #pod =cut use autodie; sub abstract { 'set up a basic global config file' } sub description { "This command will run through a short interactive process to set up\n" . "a basic Dist::Zilla configuration in ~/.dzil/config.ini" } 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; require Dist::Zilla::Util; 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( ' * WARNING - Your account details will be stored in plain text * 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 { length $_[0] }, noecho => 1, }, ); } $config_root->mkpath unless -d $config_root; $config_root->child('profiles')->mkpath unless -d $config_root->child('profiles'); my $umask = umask; umask( $umask | 077 ); # this file might contain PAUSE pw; make it go-r open my $fh, '>:encoding(UTF-8)', $config_root->child('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 (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 6.010 =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. B: PAUSE account details are stored within config.ini in plain text. =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 620513130677627 21320 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::smoke 6.010; # ABSTRACT: smoke your dist use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod dzil smoke [ --release ] [ --author ] [ --no-automated ] #pod #pod =head1 DESCRIPTION #pod #pod This command builds and tests the distribution in "smoke testing mode." #pod #pod This command is a thin wrapper around the L method in #pod Dist::Zilla. It builds your dist and runs the tests with the AUTOMATED_TESTING #pod environment variable turned on, so it's like doing this: #pod #pod export AUTOMATED_TESTING=1 #pod dzil build --no-tgz #pod cd $BUILD_DIRECTORY #pod perl Makefile.PL #pod make #pod make test #pod #pod A build that fails tests will be left behind for analysis, and F will #pod exit a non-zero value. If the tests are successful, the build directory will #pod be removed and F will exit with status 0. #pod #pod =cut 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 } ] } #pod =head1 OPTIONS #pod #pod =head2 --release #pod #pod This will run the test suite with RELEASE_TESTING=1 #pod #pod =head2 --no-automated #pod #pod This will run the test suite without setting AUTOMATED_TESTING #pod #pod =head2 --author #pod #pod This will run the test suite with AUTHOR_TESTING=1 #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 143313130677627 21155 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/MVP/Readerpackage Dist::Zilla::MVP::Reader::Finder 6.010; # ABSTRACT: the reader for dist.ini files use Moose; use Config::MVP::Reader 2.101540; # if_none extends 'Config::MVP::Reader::Finder'; 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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 516613130677627 21455 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ExtraTests 6.010; # ABSTRACT: rewrite ./xt tests to ./t tests with skips use Moose; with 'Dist::Zilla::Role::FileMunger'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin rewrites tests found in the following directories: #pod #pod ./xt/author - tests for author testing (env AUTHOR_TESTING is true) #pod ./xt/release - tests for pre-release testers (env RELEASE_TESTING is true) #pod ./xt/smoke - tests for automated testers (env AUTOMATED_TESTING is true) #pod #pod The tests are renamed and moved to F<./t>, and they are rewritten to include #pod some simple Perl code to skip all included tests if the correct env vars are #pod not set. #pod #pod =cut 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-}r; $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}) { print qq{1..0 # SKIP these tests are for $msg\\n}; exit } } |; $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 6.010 =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) 2017 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.pm100644000767000024 217713130677627 21350 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::FinderCode 6.010; # ABSTRACT: a callback-based FileFinder plugin use Moose; with 'Dist::Zilla::Role::FileFinder'; use namespace::autoclean; 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 }; 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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 GatherFile.pm100644000767000024 1150313130677627 21371 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::GatherFile 6.010; # ABSTRACT: gather individual file(s) use Moose; use Dist::Zilla::Types qw(Path ArrayRefOfPaths); with 'Dist::Zilla::Role::FileGatherer'; use MooseX::Types::Moose 'ArrayRef'; use Path::Tiny; use Dist::Zilla::File::OnDisk; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod [GatherFile] #pod filename = examples/file.txt #pod #pod =head1 DESCRIPTION #pod #pod This is a very, very simple L #pod plugin. It adds all the files referenced by the C option that are #pod found in the directory named in the L attribute. If the root begins #pod with a tilde, the tilde is replaced with the current user's home directory #pod according to L. #pod #pod Since normally every distribution will use a GatherDir plugin, you would only #pod need to use the GatherFile plugin if the file was already being excluded (e.g. #pod from an C configuration). #pod #pod =cut #pod =attr root #pod #pod This is the directory in which to look for files. If not given, it defaults to #pod the dist root -- generally, the place where your F or other #pod configuration file is located. #pod #pod =cut has root => ( is => 'ro', isa => Path, lazy => 1, coerce => 1, required => 1, default => sub { shift->zilla->root }, ); #pod =attr prefix #pod #pod This parameter can be set to place the gathered files under a particular #pod directory. See the L above for an example. #pod #pod =cut has prefix => ( is => 'ro', isa => 'Str', default => '', ); #pod =attr filename #pod #pod The name of the file to gather, relative to the C. #pod Can be used more than once. #pod #pod =cut has filenames => ( is => 'ro', isa => ArrayRefOfPaths, lazy => 1, coerce => 1, default => sub { [] }, ); sub mvp_aliases { +{ filename => 'filenames' } } sub mvp_multivalue_args { qw(filenames) } around dump_config => sub { my $orig = shift; my $self = shift; my $config = $self->$orig; $config->{+__PACKAGE__} = { prefix => $self->prefix, # only report relative to dist root to avoid leaking private info root => path($self->root)->relative($self->zilla->root), filenames => [ sort @{ $self->filenames } ], }; return $config; }; sub gather_files { my ($self) = @_; my $repo_root = $self->zilla->root; my $root = "" . $self->root; $root =~ s{^~([\\/])}{require File::HomeDir; File::HomeDir::->my_home . $1}e; $root = path($root); $root = $root->absolute($repo_root) if path($root)->is_relative; for my $filename (@{ $self->filenames }) { $filename = $root->child($filename); $self->log_fatal("$filename is a directory! Use [GatherDir] instead?") if -d $filename; my $fileobj = $self->_file_from_filename($filename->stringify); $filename = $fileobj->name; my $file = path($filename)->relative($root); $file = path($self->prefix, $file) if $self->prefix; $fileobj->name($file->stringify); $self->add_file($fileobj); } return; } # as in GatherDir sub _file_from_filename { my ($self, $filename) = @_; my @stat = stat $filename or $self->log_fatal("$filename does not exist!"); return Dist::Zilla::File::OnDisk->new({ name => $filename, mode => $stat[2] & 0755, # kill world-writeability }); } __PACKAGE__->meta->make_immutable; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::GatherFile - gather individual file(s) =head1 VERSION version 6.010 =head1 SYNOPSIS [GatherFile] filename = examples/file.txt =head1 DESCRIPTION This is a very, very simple L plugin. It adds all the files referenced by the C option that are found in the directory named in the L attribute. If the root begins with a tilde, the tilde is replaced with the current user's home directory according to L. Since normally every distribution will use a GatherDir plugin, you would only need to use the GatherFile plugin if the file was already being excluded (e.g. from an C configuration). =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 filename The name of the file to gather, relative to the C. Can be used more than once. =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 500013130677627 21346 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaConfig 6.010; # ABSTRACT: summarize Dist::Zilla configuration into distmeta use Moose; with 'Dist::Zilla::Role::MetaProvider'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin adds a top-level C key to the #pod L for the distribution. It describe the #pod Dist::Zilla version used as well as all the plugins used. Each plugin's name, #pod package, and version will be included. Plugins may augment their #pod implementation of the L role methods to add #pod more data to this dump. #pod #pod More information may be added to the top-level of this metadata as time goes #pod on. #pod #pod =cut 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; #pod =head1 SEE ALSO #pod #pod Dist::Zilla roles: L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaConfig - summarize Dist::Zilla configuration into distmeta =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 3104713130677627 21453 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PkgVersion 6.010; # 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 namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod in dist.ini #pod #pod [PkgVersion] #pod #pod =head1 DESCRIPTION #pod #pod This plugin will add lines like the following to each package in each Perl #pod module or program (more or less) within the distribution: #pod #pod $MyModule::VERSION = '0.001'; #pod #pod or #pod #pod { our $VERSION = '0.001'; } #pod #pod ...where 0.001 is the version of the dist, and MyModule is the name of the #pod package being given a version. (In other words, it always uses fully-qualified #pod names to assign versions.) #pod #pod It will skip any package declaration that includes a newline between the #pod C keyword and the package name, like: #pod #pod package #pod Foo::Bar; #pod #pod This sort of declaration is also ignored by the CPAN toolchain, and is #pod typically used when doing monkey patching or other tricky things. #pod #pod =attr die_on_existing_version #pod #pod If true, then when PkgVersion sees an existing C<$VERSION> assignment, it will #pod throw an exception rather than skip the file. This attribute defaults to #pod false. #pod #pod =attr die_on_line_insertion #pod #pod By default, PkgVersion looks for a blank line after each C statement. #pod If it finds one, it inserts the C<$VERSION> assignment on that line. If it #pod doesn't, it will insert a new line, which means the shipped copy of the module #pod will have different line numbers (off by one) than the source. If #pod C is true, PkgVersion will raise an exception rather #pod than insert a new line. #pod #pod =attr use_package #pod #pod This option, if true, will not insert an assignment to C<$VERSION> but will #pod replace the existing C declaration with one that includes a version #pod like: #pod #pod package Module::Name 0.001; #pod #pod =attr use_our #pod #pod The idea here was to insert C<< { our $VERSION = '0.001'; } >> instead of C<< #pod $Module::Name::VERSION = '0.001'; >>. It turns out that this causes problems #pod with some analyzers. Use of this feature is deprecated. #pod #pod Something else will replace it in the future. #pod #pod =attr use_begin #pod #pod If true, the version assignment is wrapped in a BEGIN block. This may help in #pod rare cases, such as when DynaLoader has to be called at BEGIN time, and #pod requires VERSION. This option should be needed rarely. #pod #pod Also note that assigning to C<$VERSION> before the module has finished #pod compiling can lead to confused behavior with attempts to determine whether a #pod module was successfully loaded on perl v5.8. #pod #pod =attr finder #pod #pod =for stopwords FileFinder #pod #pod This is the name of a L for finding #pod modules to edit. The default value is C<:InstallModules> and C<:ExecFiles>; #pod this option can be used more than once. #pod #pod Other predefined finders are listed in #pod L. #pod You can define your own with the #pod L<[FileFinder::ByName]|Dist::Zilla::Plugin::FileFinder::ByName> and #pod L<[FileFinder::Filter]|Dist::Zilla::Plugin::FileFinder::Filter> plugins. #pod #pod =cut sub BUILD { my ($self) = @_; $self->log("use_our option to PkgVersion is deprecated and will be removed") if $self->use_our; if ($self->use_package && ($self->use_our || $self->use_begin)) { $self->log_fatal("use_package and (use_our or use_begin) are not compatible"); } } sub munge_files { my ($self) = @_; $self->munge_file($_) for @{ $self->found_files }; } sub munge_file { my ($self, $file) = @_; if ($file->is_bytes) { $self->log_debug($file->name . " has 'bytes' encoding, skipping..."); return; } if ($file->name =~ /\.pod$/) { $self->log_debug($file->name . " is a pod file, skipping..."); return; } return $self->munge_perl($file); } has die_on_existing_version => ( is => 'ro', isa => 'Bool', default => 0, ); has die_on_line_insertion => ( is => 'ro', isa => 'Bool', default => 0, ); has use_package => ( is => 'ro', isa => 'Bool', default => 0, ); has use_our => ( is => 'ro', isa => 'Bool', default => 0, ); has use_begin => ( is => 'ro', isa => 'Bool', default => 0, ); sub munge_perl { my ($self, $file) = @_; my $version = $self->zilla->version; require version; Carp::croak("invalid characters in version") unless version::is_lax($version); my $document = $self->ppi_document_for_file($file); my $package_stmts = $document->find('PPI::Statement::Package'); unless ($package_stmts) { $self->log_debug([ 'skipping %s: no package statement found', $file->name ]); return; } 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; } my %seen_pkg; my $munged = 0; STATEMENT: 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; } $self->log("non-ASCII package name is likely to cause problems") if $package =~ /\P{ASCII}/; $self->log("non-ASCII version is likely to cause problems") if $version =~ /\P{ASCII}/; if ($self->use_package) { my $perl = sprintf 'package %s %s;', $package, $version; $perl .= ' # TRIAL' if $self->zilla->is_trial; my $newstmt = PPI::Token::Unknown->new($perl); Carp::carp("error inserting version in " . $file->name) unless $stmt->parent->__replace_child($stmt, $newstmt); $munged = 1; next STATEMENT; } # 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 = $self->use_our ? "{ our \$VERSION\x20=\x20'$version'; }$trial" : "\$$package\::VERSION\x20=\x20'$version';$trial"; $self->use_begin and $perl = "BEGIN { $perl }"; $self->log_debug([ 'adding $VERSION assignment to %s in %s', $package, $file->name, ]); my $blank; { my $curr = $stmt; while (1) { # avoid bogus locations due to insert_after $document->flush_locations if $munged; my $curr_line_number = $curr->line_number + 1; my $find = $document->find(sub { my $line = $_[1]->line_number; return $line > $curr_line_number ? undef : $line == $curr_line_number; }); last unless $find and @$find == 1; if ($find->[0]->isa('PPI::Token::Comment')) { $curr = $find->[0]; next; } if ("$find->[0]" =~ /\A\s*\z/) { $blank = $find->[0]; } last; } } $perl = $blank ? "$perl\n" : "\n$perl"; my $clean_version = $version =~ tr/_//dr; $perl .= ( $self->use_our ? "\n\$VERSION\x20=\x20'$clean_version';" : "\n\$$package\::VERSION\x20=\x20'$clean_version';" ) if $version ne $clean_version; # Why can't I use PPI::Token::Unknown? -- rjbs, 2014-01-11 my $bogus_token = PPI::Token::Comment->new($perl); if ($blank) { Carp::carp("error inserting version in " . $file->name) unless $blank->insert_after($bogus_token); $blank->delete; } else { my $method = $self->die_on_line_insertion ? 'log_fatal' : 'log'; $self->$method([ 'no blank line for $VERSION after package %s statement in %s line %s', $stmt->namespace, $file->name, $stmt->line_number, ]); Carp::carp("error inserting version in " . $file->name) unless $stmt->insert_after($bogus_token); } $munged = 1; } # the document is no longer correct; it must be reparsed before it can be # used again, so we can't just save_ppi_document_to_file # Maybe we want a way to clear the cache for the old form, though... # -- rjbs, 2016-04-24 $file->content($document->serialize) if $munged; return; } __PACKAGE__->meta->make_immutable; 1; #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L, #pod L, #pod L. #pod #pod Other Dist::Zilla plugins: #pod L inserts version #pod numbers using C and without changing line numbers #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::PkgVersion - add a $VERSION to your packages =head1 VERSION version 6.010 =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'; or { our $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. =head2 die_on_line_insertion By default, PkgVersion looks for a blank line after each C statement. If it finds one, it inserts the C<$VERSION> assignment on that line. If it doesn't, it will insert a new line, which means the shipped copy of the module will have different line numbers (off by one) than the source. If C is true, PkgVersion will raise an exception rather than insert a new line. =head2 use_package This option, if true, will not insert an assignment to C<$VERSION> but will replace the existing C declaration with one that includes a version like: package Module::Name 0.001; =head2 use_our The idea here was to insert C<< { our $VERSION = '0.001'; } >> instead of C<< $Module::Name::VERSION = '0.001'; >>. It turns out that this causes problems with some analyzers. Use of this feature is deprecated. Something else will replace it in the future. =head2 use_begin If true, the version assignment is wrapped in a BEGIN block. This may help in rare cases, such as when DynaLoader has to be called at BEGIN time, and requires VERSION. This option should be needed rarely. Also note that assigning to C<$VERSION> before the module has finished compiling can lead to confused behavior with attempts to determine whether a module was successfully loaded on perl v5.8. =head2 finder =for stopwords FileFinder This is the name of a L for finding modules to edit. The default value is C<:InstallModules> and C<:ExecFiles>; this option can be used more than once. Other predefined finders are listed in L. You can define your own with the L<[FileFinder::ByName]|Dist::Zilla::Plugin::FileFinder::ByName> and L<[FileFinder::Filter]|Dist::Zilla::Plugin::FileFinder::Filter> plugins. =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) 2017 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.pm100644000767000024 561313130677627 21434 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PodVersion 6.010; # 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; #pod =head1 DESCRIPTION #pod #pod This plugin adds a C<=head1 VERSION> section to most perl files in the #pod distribution, indicating the version of the dist being built. This section is #pod added after C<=head1 NAME>. If there is no such section, the version section #pod will not be added. #pod #pod =cut 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::Util; List::Util->VERSION('1.33'); if (List::Util::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; #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L, #pod L, #pod L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::PodVersion - add a VERSION head1 to each Perl document =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 737213130677627 21445 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PruneCruft 6.010; # ABSTRACT: prune stuff that you probably don't mean to include use Moose; use Moose::Util::TypeConstraints; with 'Dist::Zilla::Role::FilePruner'; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod This plugin tries to compensate for the stupid crap that turns up in your #pod working copy, removing it before it gets into your dist and screws everything #pod up. #pod #pod In your F: #pod #pod [PruneCruft] #pod #pod If you would like to exclude certain exclusions, use the C option (it #pod can be specified multiple times): #pod #pod [PruneCruft] #pod except = \.gitignore #pod except = t/.*/\.keep$ #pod #pod This plugin is included in the L<@Basic|Dist::Zilla::PluginBundle::Basic> #pod bundle. #pod #pod =head1 SEE ALSO #pod #pod Dist::Zilla plugins: #pod L<@Basic|Dist::Zilla::PluginBundle::Basic>, #pod L, #pod L. #pod #pod =cut { 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 }) { 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 eq 'Makefile.old'; 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'; return 1 if substr($file->name, 0, 6) eq '_eumm/'; # Avoid bundling fatlib/ dir created by App::FatPacker # https://github.com/andk/pause/pull/65 return 1 if substr($file->name, 0, 7) eq 'fatlib/'; return 1 if substr($file->name, 0, 4) eq 'tmp/'; if (my $file = $file->name =~ s/\.c$//r) { for my $other (@{ $self->zilla->files }) { return 1 if $other->name eq "${file}.xs"; } } return; } sub prune_files { my ($self) = @_; # Copy list (break reference) so we can mutate. for my $file ((), @{ $self->zilla->files }) { 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 6.010 =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) 2017 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.pm100644000767000024 720013130677627 21412 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PruneFiles 6.010; # ABSTRACT: prune arbitrary files from the dist use Moose; with 'Dist::Zilla::Role::FilePruner'; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod This plugin allows you to explicitly prune some files from your #pod distribution. You can either specify the exact set of files (with the #pod "filenames" parameter) or provide the regular expressions to #pod check (using "match"). #pod #pod This is useful if another plugin (maybe a FileGatherer) adds a #pod bunch of files, and you only want a subset of them. #pod #pod In your F: #pod #pod [PruneFiles] #pod filename = xt/release/pod-coverage.t ; pod coverage tests are for jerks #pod filename = todo-list.txt ; keep our secret plans to ourselves #pod #pod match = ^test_data/ #pod match = ^test.cvs$ #pod #pod =cut sub mvp_multivalue_args { qw(filenames matches) } sub mvp_aliases { return { filename => 'filenames', match => 'matches' } } #pod =attr filenames #pod #pod This is an arrayref of filenames to be pruned from the distribution. #pod #pod =cut has filenames => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); #pod =attr matches #pod #pod This is an arrayref of regular expressions and files matching any of them, #pod will be pruned from the distribution. #pod #pod =cut 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 }); # \A\Q$_\E should also handle the `eq` check $matches_regex = qr/$matches_regex|\A\Q$_\E/ for (@{ $self->filenames }); # Copy list (break reference) so we can mutate. for my $file ((), @{ $self->zilla->files }) { next unless $file->name =~ $matches_regex; $self->log_debug([ 'pruning %s', $file->name ]); $self->zilla->prune_file($file); } return; } __PACKAGE__->meta->make_immutable; 1; #pod =head1 SEE ALSO #pod #pod Dist::Zilla plugins: #pod L, #pod L, #pod L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::PruneFiles - prune arbitrary files from the dist =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 210113130677627 21336 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::AfterRelease 6.010; # ABSTRACT: something that runs after release is mostly complete use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method called once #pod the release is done. The archive filename, if one was built, is passed as the #pod sole argument. #pod #pod =cut 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 6.010 =head1 DESCRIPTION Plugins implementing this role have their C method called once the release is done. The archive filename, if one was built, is passed as the sole argument. =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 122113130677627 21360 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::ConfigDumper 6.010; # 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 6.010 =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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.pm100644000767000024 302313130677627 21341 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileGatherer 6.010; # ABSTRACT: something that gathers files into the distribution use Moose::Role; with qw/Dist::Zilla::Role::Plugin Dist::Zilla::Role::FileInjector/; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod A FileGatherer plugin is a special sort of #pod L that runs early in the build #pod cycle, finding files to include in the distribution. It is expected to call #pod its C method to add one or more files to inclusion. #pod #pod Plugins implementing FileGatherer must provide a C method, which #pod will be called during the build process. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 331013130677627 21354 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileInjector 6.010; # ABSTRACT: something that can add files to the distribution use Moose::Role; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This role should be implemented by any plugin that plans to add files into the #pod distribution. It provides one method (C>, documented below), #pod which adds a file to the distribution, noting the place of addition. #pod #pod =method add_file #pod #pod $plugin->add_file($dzil_file); #pod #pod This adds a file to the distribution, setting the file's C attribute #pod as it does so. #pod #pod =cut 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 ]); push @{ $self->zilla->files }, $file; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::FileInjector - something that can add files to the distribution =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 341013130677627 21401 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::MetaProvider 6.010; # ABSTRACT: something that provides metadata (for META.yml/json) use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This role provides data to merge into the distribution metadata. #pod #pod =method metadata #pod #pod This method (which must be provided by classes implementing this role) #pod returns a hashref of data to be (deeply) merged together with pre-existing #pod metadata. #pod #pod =cut requires 'metadata'; 1; =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::MetaProvider - something that provides metadata (for META.yml/json) =head1 VERSION version 6.010 =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) 2017 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 __END__ #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins implementing this role: #pod L. #pod L. #pod #pod Dist::Zilla plugins on the CPAN: #pod L... #pod #pod =cut NameProvider.pm100644000767000024 235713130677627 21404 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::NameProvider 6.010; # ABSTRACT: something that provides a name for the dist use Moose::Role; with 'Dist::Zilla::Role::Plugin'; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role must provide a C method that #pod will be called when setting the dist's name. #pod #pod If a NameProvider offers a name but one has already been set, an #pod exception will be raised. If C returns undef, it will be #pod ignored. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 252613130677627 21377 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::PluginBundle 6.010; # ABSTRACT: something that bundles a bunch of plugins use Moose::Role; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod When loading configuration, if the config reader encounters a PluginBundle, it #pod will replace its place in the plugin list with the result of calling its #pod C method, which will be passed a Config::MVP::Section to #pod configure the bundle. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 165713130677627 21432 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::PrereqSource 6.010; # ABSTRACT: something that registers prerequisites use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod PrereqSource plugins have a C method that should register #pod prereqs with the Dist::Zilla object. #pod #pod =cut requires 'register_prereqs'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::PrereqSource - something that registers prerequisites =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 605713130677627 21432 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::TextTemplate 6.010; # ABSTRACT: something that renders a Text::Template template string use Moose::Role; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing TextTemplate may call their own C> #pod method to render templates using L. #pod #pod =cut use Text::Template; #pod =attr delim #pod #pod This attribute (which can't easily be set!) is a two-element array reference #pod returning the Text::Template delimiters to use. It defaults to C<{{> and #pod C<}}>. #pod #pod =cut # 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( {{ }} ) ] }, ); #pod =method fill_in_string #pod #pod my $rendered = $plugin->fill_in_string($template, \%stash, \%arg); #pod #pod This uses Text::Template to fill in the given template using the variables #pod given in the C<%stash>. The stash becomes the HASH argument to Text::Template, #pod so scalars must be scalar references rather than plain scalars. #pod #pod C<%arg> is dereferenced and passed in as extra arguments to Text::Template's #pod C routine. #pod #pod =cut 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(%$arg, 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 6.010 =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) 2017 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.pm100644000767000024 1573713130677627 21646 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::AutoPrereqs 6.010; # ABSTRACT: automatically extract prereqs from your modules use Moose; with( 'Dist::Zilla::Role::PrereqScanner', 'Dist::Zilla::Role::PrereqSource', 'Dist::Zilla::Role::PPI', ); use Moose::Util::TypeConstraints 'enum'; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod In your F: #pod #pod [AutoPrereqs] #pod skip = ^Foo|Bar$ #pod skip = ^Other::Dist #pod #pod =head1 DESCRIPTION #pod #pod This plugin will extract loosely your distribution prerequisites from #pod your files using L. #pod #pod If some prereqs are not found, you can still add them manually with the #pod L plugin. #pod #pod This plugin will skip the modules shipped within your dist. #pod #pod B, if you have any non-Perl files in your C directory or other #pod directories being scanned, be sure to mark those files' encoding as C #pod with the L plugin so they won't be #pod scanned: #pod #pod [Encoding] #pod encoding = bytes #pod match = ^t/data/ #pod #pod =attr finder #pod #pod This is the name of a L #pod whose files will be scanned to determine runtime prerequisites. It #pod may be specified multiple times. The default value is #pod C<:InstallModules> and C<:ExecFiles>. #pod #pod =attr test_finder #pod #pod Just like C, but for test-phase prerequisites. The default #pod value is C<:TestFiles>. #pod #pod =attr configure_finder #pod #pod Just like C, but for configure-phase prerequisites. There is #pod no default value; AutoPrereqs will not determine configure-phase #pod prerequisites unless you set configure_finder. #pod #pod =attr develop_finder #pod #pod Just like C, but for develop-phase prerequisites. The default value #pod is C<:ExtraTestFiles>. #pod #pod =attr skips #pod #pod This is an arrayref of regular expressions, derived from all the 'skip' lines #pod in the configuration. Any module names matching any of these regexes will not #pod be registered as prerequisites. #pod #pod =attr relationship #pod #pod The relationship used for the registered prerequisites. The default value is #pod 'requires'; other options are 'recommends' and 'suggests'. #pod #pod =attr extra_scanners #pod #pod This is an arrayref of scanner names (as expected by L). #pod It will be passed as the C parameter to L. #pod #pod =attr scanners #pod #pod This is an arrayref of scanner names (as expected by L). #pod If present, it will be passed as the C parameter to #pod L, which means that it will replace the default list #pod of scanners. #pod #pod =head1 SEE ALSO #pod #pod L, L. #pod #pod =head1 CREDITS #pod #pod This plugin was originally contributed by Jerome Quelin. #pod #pod =cut sub mvp_multivalue_args { qw(extra_scanners scanners) } sub mvp_aliases { return { extra_scanner => 'extra_scanners', scanner => 'scanners', relationship => 'type' } } has extra_scanners => ( is => 'ro', isa => 'ArrayRef[Str]', default => sub { [] }, ); has scanners => ( is => 'ro', isa => 'ArrayRef[Str]', predicate => 'has_scanners', ); has _scanner => ( is => 'ro', lazy => 1, default => sub { my $self = shift; require Perl::PrereqScanner; Perl::PrereqScanner->VERSION('1.016'); # don't skip "lib" return Perl::PrereqScanner->new( ($self->has_scanners ? (scanners => $self->scanners) : ()), extra_scanners => $self->extra_scanners, ) }, init_arg => undef, ); has type => ( is => 'ro', isa => enum([qw(requires recommends suggests)]), default => 'requires', ); sub scan_file_reqs { my ($self, $file) = @_; return $self->_scanner->scan_ppi_document($self->ppi_document_for_file($file)) } sub register_prereqs { my $self = shift; my $type = $self->type; my $reqs_by_phase = $self->scan_prereqs; while (my ($phase, $reqs) = each %$reqs_by_phase) { $self->zilla->register_prereqs({ phase => $phase, type => $type }, %$reqs); } } __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 6.010 =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. B, if you have any non-Perl files in your C directory or other directories being scanned, be sure to mark those files' encoding as C with the L plugin so they won't be scanned: [Encoding] encoding = bytes match = ^t/data/ =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 develop_finder Just like C, but for develop-phase prerequisites. The default value is C<:ExtraTestFiles>. =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. =head2 relationship The relationship used for the registered prerequisites. The default value is 'requires'; other options are 'recommends' and 'suggests'. =head2 extra_scanners This is an arrayref of scanner names (as expected by L). It will be passed as the C parameter to L. =head2 scanners This is an arrayref of scanner names (as expected by L). If present, it will be passed as the C parameter to L, which means that it will replace the default list of scanners. =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) 2017 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.pm100644000767000024 1040513130677627 21635 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::AutoVersion 6.010; # 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; #pod =head1 DESCRIPTION #pod #pod This plugin automatically produces a version string, generally based on the #pod current time. By default, it will be in the format: 1.yyDDDn #pod #pod =cut #pod =attr major #pod #pod The C attribute is just an integer that is meant to store the major #pod version number. If no value is specified in configuration, it will default to #pod 1. #pod #pod This attribute's value can be referred to in the autoversion format template. #pod #pod =cut has major => ( is => 'ro', isa => 'Int', required => 1, default => 1, ); #pod =attr format #pod #pod The format is a L string that will be rendered to form the #pod version. It is meant to access to one variable, C<$major>, and one subroutine, #pod C, which will format the current time (in GMT) using CLDR patterns (for #pod which consult the L documentation). #pod #pod The default value is: #pod #pod {{ $major }}.{{ cldr('yyDDD') }} #pod {{ sprintf('%01u', ($ENV{N} || 0)) }} #pod {{$ENV{DEV} ? (sprintf '_%03u', $ENV{DEV}) : ''}} #pod #pod =cut 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) = @_; # TODO declare this as a 'develop' prereq as we want it in # `dzil listdeps --author` require DateTime; DateTime->VERSION('0.44'); # CLDR fixes my $now; my $version = $self->fill_in_string( $self->format, { major => \( $self->major ), cldr => sub { $now ||= do { require DateTime; DateTime->VERSION('0.44'); # CLDR fixes DateTime->now(time_zone => $self->time_zone); }; $now->format_cldr($_[0]) }, }, ); $self->log_debug([ 'providing version %s', $version ]); return $version; } __PACKAGE__->meta->make_immutable; 1; #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L, #pod L, #pod L. #pod #pod Dist::Zilla roles: #pod L, #pod L. #pod #pod =cut __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 6.010 =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) 2017 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.pm100644000767000024 636613130677627 21521 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::FakeRelease 6.010; # 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 cpanid { shift->user } 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; #pod =head1 SYNOPSIS #pod #pod [FakeRelease] #pod user = CPANAUTHORID ; # optional. #pod #pod =head1 DESCRIPTION #pod #pod This plugin is a L that does nothing. It #pod is directed to plugin authors, who may need a dumb release plugin to test their #pod shiny plugin implementing L #pod and L. #pod #pod When this plugin does the release, it will just log a message and finish. #pod #pod If you set the environment variable C to a true value, #pod the plugin will die instead of doing nothing. This can be useful for #pod authors wanting to test reliably that release failed. #pod #pod You can optionally provide the 'user' parameter, which defaults to 'AUTHORID', #pod which will allow things that depend on this metadata #pod ( Sometimes provided by L ) to still work. #pod ( For example: L ) #pod #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L, #pod L. #pod __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::FakeRelease - fake plugin to test release =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 405613130677627 21545 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::InlineFiles 6.010; # ABSTRACT: files in a data section use Moose; with 'Dist::Zilla::Role::FileGatherer'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin exists only to be extended, and gathers all files contained in its #pod data section and those of its ancestors. For more information, see #pod L. #pod #pod =cut 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; #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins inheriting from L: #pod L, #pod L, #pod L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::InlineFiles - files in a data section =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 1060413130677627 21533 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaNoIndex 6.010; # ABSTRACT: Stop CPAN from indexing stuff use Moose; with 'Dist::Zilla::Role::MetaProvider'; use namespace::autoclean; #pod =encoding utf8 #pod #pod =head1 SYNOPSIS #pod #pod In your F: #pod #pod [MetaNoIndex] #pod #pod directory = t/author #pod directory = examples #pod #pod file = lib/Foo.pm #pod #pod package = My::Module #pod #pod namespace = My::Module #pod #pod =head1 DESCRIPTION #pod #pod This plugin allows you to prevent PAUSE/CPAN from indexing files you don't #pod want indexed. This is useful if you build test classes or example classes #pod that are used for those purposes only, and are not part of the distribution. #pod It does this by adding a C block to your F (or #pod F) file in your distribution. #pod #pod =for Pod::Coverage mvp_aliases mvp_multivalue_args #pod #pod =cut 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 } #pod =attr directories #pod #pod Exclude folders and everything in them, for example: F #pod #pod Aliases: C, C, C #pod #pod =attr files #pod #pod Exclude a specific file, for example: F #pod #pod Alias: C #pod #pod =attr packages #pod #pod Exclude by package name, for example: C #pod #pod Aliases: C, C, C #pod #pod =attr namespaces #pod #pod Exclude everything under a specific namespace, for example: C #pod #pod Alias: C #pod #pod B This will not exclude the package C, only everything #pod under it like C. #pod #pod =cut for my $attr (keys %ATTR_ALIAS) { has $attr => ( is => 'ro', isa => 'ArrayRef[Str]', init_arg => $attr, predicate => "_has_$attr", ); } #pod =method metadata #pod #pod Returns a reference to a hash containing the distribution's no_index metadata. #pod #pod =cut sub metadata { my $self = shift; return { no_index => { map {; my $reader = $_->[0]; ($_->[1] => [ sort @{ $self->$reader } ]) } grep {; my $pred = "_has_$_->[0]"; $self->$pred } map {; [ $_ => $ATTR_ALIAS{$_}[0] ] } keys %ATTR_ALIAS } }; } __PACKAGE__->meta->make_immutable; 1; #pod =head1 SEE ALSO #pod #pod Dist::Zilla roles: L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaNoIndex - Stop CPAN from indexing stuff =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 2013513130677627 21565 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ModuleBuild 6.010; # ABSTRACT: build a Build.PL that uses Module::Build use Moose; with ( 'Dist::Zilla::Role::BuildPL', 'Dist::Zilla::Role::PrereqSource', 'Dist::Zilla::Role::FileGatherer', 'Dist::Zilla::Role::TextTemplate', ); use namespace::autoclean; use CPAN::Meta::Requirements 2.121; # requirements_for_module use Dist::Zilla::File::InMemory; use List::Util 'first'; use Data::Dumper; #pod =head1 DESCRIPTION #pod #pod This plugin will create a F for installing the dist using #pod L. #pod #pod =cut #pod =attr mb_version #pod #pod B Specify the minimum version of L to depend on. #pod #pod Defaults to 0.3601 if a sharedir is being used, otherwise 0.28. #pod #pod =attr mb_class #pod #pod B Specify the class to use to create the build object. Defaults #pod to C itself. If another class is specified, then the value #pod of mb_lib will be used to generate a line like C to be added #pod to the generated Build.PL file. #pod #pod =attr mb_lib #pod #pod B Specify the list of directories to be passed to lib when using #pod mb_class. Defaults to C. #pod #pod =attr build_element #pod #pod Anything given in a C option will be added as a build element #pod with Module::Build's L method. #pod #pod =cut has 'mb_version' => ( isa => 'Str', is => 'rw', lazy => 1, default => sub { my $self = shift; keys %{$self->zilla->_share_dir_map} ? '0.3601' : '0.28'; }, ); has 'mb_class' => ( isa => 'Str', is => 'rw', default => 'Module::Build', ); has 'mb_lib' => ( isa => 'Str', is => 'rw', default => 'inc' ); has 'build_element' => ( isa => 'ArrayRef[Str]', is => 'rw', default => sub { [] }, ); sub mvp_multivalue_args { return qw(build_element) } 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); {{ $plugin->_add_build_elements }} $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 _add_build_elements { my @elems = @{ shift->build_element } or return ''; return '$build->add_build_element($_) for qw(' . join(' ', @elems) . ');'; } 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 = map { $_->name } @{ $self->zilla->find_files(':ExecFiles') }; $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/-/::/gr; 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 } ], @exe_files ? ( script_files => [ sort @exe_files ] ) : (), ( keys %{$self->zilla->_share_dir_map} ? (share_dir => $self->zilla->_share_dir_map) : ()), (map {; my $modules = $prereqs{$_}->as_string_hash; keys %$modules ? ( $_ => $modules ) : () } 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 gather_files { my ($self) = @_; require Dist::Zilla::File::InMemory; my $file = Dist::Zilla::File::InMemory->new({ name => 'Build.PL', content => $template, # template evaluated later }); $self->add_file($file); return; } sub setup_installer { my ($self) = @_; $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 $file = first { $_->name eq 'Build.PL' } @{$self->zilla->files}; $self->log_debug([ 'updating contents of Build.PL in memory' ]); my $content = $self->fill_in_string( $file->content, { plugin => \$self, module_build_args => \$dumped_args, fallback_build_prereqs => \$fallback_build_requires, generated_by => \sprintf("%s v%s", ref($self), $self->VERSION || '(dev)'), }, ); $file->content($content); return; } # XXX: Just here to facilitate testing. -- rjbs, 2010-03-20 has __module_build_args => ( is => 'rw', isa => 'HashRef', ); __PACKAGE__->meta->make_immutable; 1; #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L<@Basic|Dist::Zilla::PluginBundle::Basic>, #pod L<@Filter|Dist::Zilla::PluginBundle::Filter>, #pod L, #pod L. #pod #pod Dist::Zilla roles: #pod L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::ModuleBuild - build a Build.PL that uses Module::Build =head1 VERSION version 6.010 =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 if a sharedir is being used, otherwise 0.28. =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. =head2 build_element Anything given in a C option will be added as a build element with Module::Build's L method. =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) 2017 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.pm100644000767000024 2505413130677627 21604 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::NextRelease 6.010; # 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 Dist::Zilla::Path; use Moose::Util::TypeConstraints; use List::Util 'first'; 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 { require DateTime; DateTime->VERSION('0.44'); # CLDR fixes 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 ? ($_[1] // '-TRIAL') : '' }, V => sub { $_[0]->zilla->version . ($_[0]->zilla->is_trial ? ($_[1] // '-TRIAL') : '') }, P => sub { my $releaser = first { $_->can('cpanid') } @{ $_[0]->zilla->plugins_with('-Releaser') }; $_[0]->log_fatal('releaser doesn\'t provide cpanid, but %P used') unless $releaser; $releaser->cpanid; }, }, }; our $DEFAULT_TIME_ZONE = 'local'; has time_zone => ( is => 'ro', isa => 'Str', # should be more validated later -- apocal default => $DEFAULT_TIME_ZONE, ); has format => ( is => 'ro', isa => 'Str', # should be more validated Later -- rjbs, 2008-06-05 default => '%-9v %{yyyy-MM-dd HH:mm:ssZZZZZ 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); } has _original_changes_content => ( is => 'rw', isa => 'Str', init_arg => undef, ); sub munge_files { my ($self) = @_; my ($file) = grep { $_->name eq $self->filename } @{ $self->zilla->files }; $self->log_fatal([ 'failed to find %s in the distribution', $self->filename ]) if not $file; # save original unmunged content, for replacing back in the repo later my $content = $self->_original_changes_content($file->content); $content = $self->fill_in_string( $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 }; $self->log_fatal("failed to find $filename in the distribution") if not $gathered_file; my $iolayer = sprintf(":raw:encoding(%s)", $gathered_file->encoding); # read original changelog my $content = $self->_original_changes_content; # 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; #pod =head1 SYNOPSIS #pod #pod In your F: #pod #pod [NextRelease] #pod #pod In your F file: #pod #pod {{$NEXT}} #pod #pod #pod =head1 DESCRIPTION #pod #pod Tired of having to update your F file by hand with the new #pod version and release date / time each time you release your distribution? #pod Well, this plugin is for you. #pod #pod Add this plugin to your F, and the following to your #pod F file: #pod #pod {{$NEXT}} #pod #pod The C plugin will then do 2 things: #pod #pod =over 4 #pod #pod =item * At build time, this special marker will be replaced with the #pod version and the build date, to form a standard changelog header. This #pod will be done to the in-memory file - the original F file won't #pod be updated. #pod #pod =item * After release (when running C), since the version #pod and build date are now part of your dist's history, the real F #pod file (not the in-memory one) will be updated with this piece of #pod information. #pod #pod =back #pod #pod The module accepts the following options in its F section: #pod #pod =begin :list #pod #pod = filename #pod the name of your changelog file; defaults to F #pod #pod = update_filename #pod the file to which to write an updated changelog to; defaults to the C #pod #pod = format #pod sprintf-like string used to compute the next value of C<{{$NEXT}}>; #pod defaults to C<%-9v %{yyyy-MM-dd HH:mm:ss VVVV}d> #pod #pod = time_zone #pod the timezone to use when generating the date; defaults to I #pod #pod = user_stash #pod the name of the stash where the user's name and email address can be found; #pod defaults to C<%User> #pod #pod =end :list #pod #pod The module allows the following sprintf-like format codes in the C: #pod #pod =begin :list #pod #pod = C<%v> #pod The distribution version #pod #pod = C<%{-TRIAL}T> #pod Expands to -TRIAL (or any other supplied string) if this #pod is a trial release, or the empty string if not. A bare C<%T> means #pod C<%{-TRIAL}T>. #pod #pod = C<%{-TRIAL}V> #pod Equivalent to C<%v%{-TRIAL}T>, to allow for the application of modifiers such #pod as space padding to the entire version string produced. #pod #pod = C<%{CLDR format}d> #pod The date of the release. You can use any CLDR format supported by #pod L. You must specify the format; there is no default. #pod #pod = C<%U> #pod The name of the user making this release (from C). #pod #pod = C<%E> #pod The email address of the user making this release (from C). #pod #pod = C<%P> #pod The CPAN (PAUSE) id of the user making this release (from -Releaser plugins; #pod see L<[UploadToCPAN]|Dist::Zilla::Plugin::UploadToCPAN/username>). #pod #pod = C<%n> #pod A newline #pod #pod = C<%t> #pod A tab #pod #pod =end :list #pod #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: #pod L, #pod L, #pod L. #pod #pod Dist::Zilla roles: #pod L, #pod L, #pod L. __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::NextRelease - update the next release number in your changelog =head1 VERSION version 6.010 =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<%P> The CPAN (PAUSE) id of the user making this release (from -Releaser plugins; see L<[UploadToCPAN]|Dist::Zilla::Plugin::UploadToCPAN/username>). =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) 2017 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.pm100644000767000024 522213130677627 21560 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::TestRelease 6.010; # ABSTRACT: extract archive and run tests before releasing the dist use Moose; with 'Dist::Zilla::Role::BeforeRelease'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin runs before a release happens. It will extract the to-be-released #pod archive into a temporary directory and use the TestRunner plugins to run its #pod tests. If the tests fail, the release is aborted and the temporary directory #pod is left in place. If the tests pass, the temporary directory is cleaned up and #pod the release process continues. #pod #pod This will set the RELEASE_TESTING and AUTHOR_TESTING env vars while running the #pod test suite. #pod #pod =head1 CREDITS #pod #pod This plugin was originally contributed by Christopher J. Madsen. #pod #pod =cut use File::pushd (); use Dist::Zilla::Path; sub before_release { my ($self, $tgz) = @_; $tgz = $tgz->absolute; my $build_root = $self->zilla->root->child('.build'); $build_root->mkpath unless -d $build_root; my $tmpdir = path( 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->child( $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->remove_tree({ safe => 0 }); } __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 6.010 =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) 2017 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 PluginBundle000755000767000024 013130677627 17773 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/ZillaBasic.pm100644000767000024 634113130677627 21516 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/PluginBundlepackage Dist::Zilla::PluginBundle::Basic 6.010; # 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; #pod =head1 DESCRIPTION #pod #pod This plugin is meant to be a basic "first step" bundle for using Dist::Zilla. #pod It won't munge any of your code, but will generate a F and allows #pod easy, reliable releasing of distributions. #pod #pod It includes the following plugins with their default configuration: #pod #pod =for :list #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: L<@Filter|Dist::Zilla::PluginBundle::Filter>. #pod #pod Dist::Zilla roles: #pod L, #pod L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::PluginBundle::Basic - the basic plugins to maintain and release CPAN dists =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 171113130677627 21506 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BeforeArchive 6.010; # ABSTRACT: something that runs before the archive file is built use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method #pod called before the archive is actually built. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 167713130677627 21520 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::BeforeRelease 6.010; # ABSTRACT: something that runs before release really begins use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role have their C method #pod called before the release is actually done. #pod #pod =cut 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 6.010 =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) 2017 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 PrereqScanner.pm100644000767000024 1546413130677627 21604 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::PrereqScanner 6.010; # ABSTRACT: automatically extract prereqs from your modules use Moose::Role; with( '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 => [], }, 'Dist::Zilla::Role::FileFinderUser' => { method => 'found_develop_files', finder_arg_names => [ 'develop_finder' ], default_finders => [ ':ExtraTestFiles' ], }, ); use MooseX::Types; #pod =attr finder #pod #pod This is the name of a L #pod whose files will be scanned to determine runtime prerequisites. It #pod may be specified multiple times. The default value is #pod C<:InstallModules> and C<:ExecFiles>. #pod #pod =attr test_finder #pod #pod Just like C, but for test-phase prerequisites. The default #pod value is C<:TestFiles>. #pod #pod =attr configure_finder #pod #pod Just like C, but for configure-phase prerequisites. There is #pod no default value; AutoPrereqs will not determine configure-phase #pod prerequisites unless you set configure_finder. #pod #pod =attr develop_finder #pod #pod Just like , but for develop-phase prerequisites. The default value #pod is C<:ExtraTestFiles>. #pod #pod =attr skips #pod #pod This is an arrayref of regular expressions, derived from all the 'skip' lines #pod in the configuration. Any module names matching any of these regexes will not #pod be registered as prerequisites. #pod #pod =cut has skips => ( is => 'ro', isa => 'ArrayRef[Str]', ); around mvp_multivalue_args => sub { my ($orig, $self) = @_; ($self->$orig, 'skips') }; around mvp_aliases => sub { my ($orig, $self) = @_; my $aliases = $self->$orig; $aliases->{skip} = 'skips'; return $aliases }; requires 'scan_file_reqs'; sub scan_prereqs { my $self = shift; require CPAN::Meta::Requirements; require List::Util; List::Util->VERSION(1.45); # uniq # not a hash, because order is important my @sets = ( # phase => file finder method [ configure => 'found_configure_files' ], # must come before runtime [ runtime => 'found_files' ], [ test => 'found_test_files' ], [ develop => 'found_develop_files' ], ); my %reqs_by_phase; my %runtime_final; my @modules; 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; # t/lib/Foo.pm is treated as providing t::lib::Foo, lib::Foo, and Foo 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/}{}; } s{\.pm$}{} for @this_thing; s{/}{::}g for @this_thing; # this is a bunk heuristic and can still capture strings from pod - the # proper thing to do is grab all packages from Module::Metadata push @this_thing, $file->content =~ /^[^#]*?(?:^|\s)package\s+([^\s;#]+)/mg; push @modules, @this_thing; # parse a file, and merge with existing prereqs $self->log_debug([ 'scanning %s for %s prereqs', $file->name, $phase ]); my $file_req = $self->scan_file_reqs($file); $req->add_requirements($file_req); } # remove prereqs from skiplist for my $skip (@{ $self->skips || [] }) { my $re = qr/$skip/; foreach my $k ($req->required_modules) { $req->clear_requirement($k) if $k =~ $re; } } # remove prereqs shipped with current dist if (@modules) { $self->log_debug([ 'excluding local packages: %s', sub { join(', ', List::Util::uniq(@modules)) } ] ) } $req->clear_requirement($_) for @modules; $req->clear_requirement($_) for qw(Config DB Errno NEXT Pod::Functions); # never indexed # we're done, return what we've found my %got = %{ $req->as_string_hash }; if ($phase eq 'runtime') { %runtime_final = %got; } else { # do not test-require things required for runtime delete $got{$_} for grep { exists $got{$_} and $runtime_final{$_} ge $got{$_} } keys %runtime_final; } $reqs_by_phase{$phase} = \%got; } return \%reqs_by_phase } 1; =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::PrereqScanner - automatically extract prereqs from your modules =head1 VERSION version 6.010 =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 develop_finder Just like , but for develop-phase prerequisites. The default value is C<:ExtraTestFiles>. =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. =head1 CREDITS The role was provided by Olivier Mengué (DOLMEN) and Philippe Bruhat (BOOK) at Perl QA Hackathon 2016 (but it is just a refactor of the AutoPrereqs plugin). =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 __END__ #pod =head1 SEE ALSO #pod #pod L. #pod #pod =head1 CREDITS #pod #pod The role was provided by Olivier Mengué (DOLMEN) and Philippe Bruhat (BOOK) at Perl QA Hackathon 2016 #pod (but it is just a refactor of the AutoPrereqs plugin). #pod #pod =cut Authors.pm100644000767000024 173313130677627 21515 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Role/Stashpackage Dist::Zilla::Role::Stash::Authors 6.010; # ABSTRACT: a stash that provides a list of author strings use Moose::Role; with 'Dist::Zilla::Role::Stash'; use namespace::autoclean; #pod =head1 OVERVIEW #pod #pod An Authors stash must provide an C method that returns an arrayref of #pod author strings, generally in the form "Name ". #pod #pod =cut 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 6.010 =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) 2017 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 Plugin000755000767000024 013130677627 17104 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/lib/Dist/ZillaVersioned.pm100644000767000024 16313130677627 21520 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/t/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::Versioned; use Moose; with 'Dist::Zilla::Role::Plugin'; our $VERSION = '1.234'; 1; install.pm100644000767000024 426313130677627 21652 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::install 6.010; # ABSTRACT: install your dist use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod Installs your distribution using a specified command. #pod #pod dzil install [--install-command="cmd"] #pod #pod =cut sub abstract { 'install your dist' } #pod =head1 EXAMPLE #pod #pod $ dzil install #pod $ dzil install --install-command="cpan ." #pod #pod =cut 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' ], } #pod =head1 OPTIONS #pod #pod =head2 --install-command #pod #pod This defines what command to run after building the dist in the dist dir. #pod #pod Any value that works with L|perlfunc/system> is accepted. #pod #pod If not specified, calls (roughly): #pod #pod cpanm . #pod #pod For more information, look at the L method in #pod Dist::Zilla. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 326713130677627 21627 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::release 6.010; # ABSTRACT: release your dist to the CPAN use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod dzil release #pod #pod dzil release --trial #pod #pod This command is a very, very thin wrapper around the #pod C> method on the Dist::Zilla object. It will #pod build, archive, and release your distribution using your Releaser plugins. The #pod only option, C<--trial>, will cause it to build a trial build. #pod #pod =cut 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; { # isolate changes to RELEASE_STATUS to zilla construction local $ENV{RELEASE_STATUS} = $ENV{RELEASE_STATUS}; $ENV{RELEASE_STATUS} = 'testing' if $opt->trial; $zilla = $self->zilla; } $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 6.010 =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) 2017 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.pm100644000767000024 210713130677627 21664 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::version 6.010; # ABSTRACT: display dzil's version use Dist::Zilla::App -command; use App::Cmd::Command::version; BEGIN { ## parent and base dont work here. ??? -- kentnl 2014-10-31 our @ISA; unshift @ISA, 'App::Cmd::Command::version'; } #pod =head1 SYNOPSIS #pod #pod Print dzil version #pod #pod $ dzil --version or $dzil version #pod #pod =cut 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 6.010 =head1 SYNOPSIS Print dzil version $ dzil --version or $dzil version =head1 AUTHOR Ricardo SIGNES 😏 =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 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 Assembler000755000767000024 013130677627 17762 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/MVPZilla.pm100644000767000024 607513130677627 21543 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/MVP/Assemblerpackage Dist::Zilla::MVP::Assembler::Zilla 6.010; # ABSTRACT: Dist::Zilla::MVP::Assembler for the Dist::Zilla object use Moose; extends 'Dist::Zilla::MVP::Assembler'; use namespace::autoclean; #pod =head1 OVERVIEW #pod #pod This is a subclass of L used when assembling the #pod Dist::Zilla object. #pod #pod It has a C attribute, which is used to determine what class of #pod Dist::Zilla object to create. (This isn't very useful now, but will be in the #pod future when minting and building use different subclasses of Dist::Zilla.) #pod #pod Upon construction, the assembler will create a L #pod as the initial section. #pod #pod =cut 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 ); #pod =method zilla #pod #pod This method is a shortcut for retrieving the C from the root section. #pod If called before that section has been finalized, it will result in an #pod exception. #pod #pod =cut sub zilla { my ($self) = @_; $self->sequence->section_named('_')->zilla; } #pod =method register_stash #pod #pod $assembler->register_stash($name => $stash_object); #pod #pod This adds a stash to the assembler's zilla's stash registry -- unless the name #pod is already taken, in which case an exception is raised. #pod #pod =cut 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 6.010 =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) 2017 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.pm100644000767000024 1277213130677627 21722 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::GenerateFile 6.010; # ABSTRACT: build a custom file from only the plugin configuration use Moose; with ( 'Dist::Zilla::Role::FileGatherer', 'Dist::Zilla::Role::TextTemplate', ); use namespace::autoclean; use Dist::Zilla::File::InMemory; #pod =head1 SYNOPSIS #pod #pod In your F: #pod #pod [GenerateFile] #pod filename = todo/{{ $dist->name }}-master-plan.txt #pod name_is_template = 1 #pod content_is_template = 1 #pod content = # Outlines the plan for world domination by {{$dist->name}} #pod content = #pod content = Item 1: Think of an idea! #pod content = Item 2: ? #pod content = Item 3: Profit! #pod #pod =head1 DESCRIPTION #pod #pod This plugin adds a file to the distribution. #pod #pod You can specify the content, as a sequence of lines, in your configuration. #pod The specified filename and content might be literals or might be L #pod templates. #pod #pod =head2 Templating of the content #pod #pod If you provide C (or C) parameter of C<"1">, the #pod content will be run through L. The variables C<$plugin> and #pod C<$dist> will be provided, set to the [GenerateFile] plugin and the L #pod object respectively. #pod #pod If you provide a C parameter of "1", the filename will be run #pod through L. The variables C<$plugin> and C<$dist> will be #pod provided, set to the [GenerateFile] plugin and the L object #pod respectively. #pod #pod =cut sub mvp_aliases { +{ is_template => 'content_is_template' } } sub mvp_multivalue_args { qw(content) } #pod =attr filename #pod #pod This attribute names the file you want to generate. It is required. #pod #pod =cut has filename => ( is => 'ro', isa => 'Str', required => 1, ); #pod =attr content #pod #pod The C attribute is an arrayref of lines that will be joined together #pod with newlines to form the file content. #pod #pod =cut has content => ( is => 'ro', isa => 'ArrayRef', ); #pod =attr content_is_template, is_template #pod #pod This attribute is a bool indicating whether or not the content should be #pod treated as a Text::Template template. By default, it is false. #pod #pod =cut has content_is_template => ( is => 'ro', isa => 'Bool', default => 0, ); #pod =cut #pod #pod =attr name_is_template #pod #pod This attribute is a bool indicating whether or not the filename should be #pod treated as a Text::Template template. By default, it is false. #pod #pod =cut 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 }; $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 6.010 =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 L templates. =head2 Templating of the content If you provide C (or C) parameter of C<"1">, the content will be run through L. The variables C<$plugin> and C<$dist> will be provided, set to the [GenerateFile] plugin and the L object respectively. If you provide a C parameter of "1", the filename will be run through L. The variables C<$plugin> and C<$dist> will be provided, set to the [GenerateFile] plugin and the L 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) 2017 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.pm100644000767000024 630613130677627 21741 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ManifestSkip 6.010; # ABSTRACT: decline to build files that appear in a MANIFEST.SKIP-like file use Moose; with 'Dist::Zilla::Role::FilePruner'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin reads a MANIFEST.SKIP-like file, as used by L #pod and L, and prunes any files that it declares should be #pod skipped. #pod #pod This plugin is included in the L<@Basic|Dist::Zilla::PluginBundle::Basic> #pod bundle. #pod #pod =attr skipfile #pod #pod This is the name of the file to read for MANIFEST.SKIP-like content. It #pod defaults, unsurprisingly, to F. #pod #pod =head1 SEE ALSO #pod #pod Dist::Zilla core plugins: #pod L<@Basic|Dist::Zilla::PluginBundle::Basic>, #pod L, #pod L. #pod #pod Other modules: L. #pod #pod =cut 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; 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); # Copy list (break reference) so we can mutate. for my $file ((), @{ $files }) { 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 6.010 =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) 2017 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.pm100644000767000024 2160513130677627 21554 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::UploadToCPAN 6.010; # ABSTRACT: upload the dist to CPAN use Moose; with qw(Dist::Zilla::Role::BeforeRelease Dist::Zilla::Role::Releaser); use File::Spec; use Moose::Util::TypeConstraints; use Scalar::Util qw(weaken); use Try::Tiny; use namespace::autoclean; #pod =head1 SYNOPSIS #pod #pod If loaded, this plugin will allow the F command to upload to the CPAN. #pod #pod =head1 DESCRIPTION #pod #pod This plugin looks for configuration in your C or (more #pod likely) C<~/.dzil/config.ini>: #pod #pod [%PAUSE] #pod username = YOUR-PAUSE-ID #pod password = YOUR-PAUSE-PASSWORD #pod #pod If this configuration does not exist, it can read the configuration from #pod C<~/.pause>, in the same format that L requires: #pod #pod user YOUR-PAUSE-ID #pod password YOUR-PAUSE-PASSWORD #pod #pod If neither configuration exists, it will prompt you to enter your #pod username and password during the BeforeRelease phase. Entering a #pod blank username or password will abort the release. #pod #pod You can't put your password in your F. C'mon now! #pod #pod =cut { 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(@_); } } #pod =attr credentials_stash #pod #pod This attribute holds the name of a L #pod that will contain the credentials to be used for the upload. By default, #pod UploadToCPAN will look for a C<%PAUSE> stash. #pod #pod =cut 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' }; } #pod =attr username #pod #pod This option supplies the user's PAUSE username. #pod It will be looked for in the user's PAUSE configuration; if not #pod found, the user will be prompted. #pod #pod =cut has username => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { my ($self) = @_; return $self->_credential('username') || $self->pause_cfg->{user} || $self->zilla->chrome->prompt_str("PAUSE username: "); }, ); sub cpanid { shift->username } #pod =attr password #pod #pod This option supplies the user's PAUSE password. It cannot be provided via #pod F. It will be looked for in the user's PAUSE configuration; if not #pod found, the user will be prompted. #pod #pod =cut has password => ( is => 'ro', isa => 'Str', init_arg => undef, lazy => 1, default => sub { my ($self) = @_; my $pw = $self->_credential('password') || $self->pause_cfg->{password}; unless ($pw){ my $uname = $self->username; $pw = $self->zilla->chrome->prompt_str( "PAUSE password for $uname: ", { noecho => 1 }, ); } return $pw; }, ); #pod =attr pause_cfg_file #pod #pod This is the name of the file containing your pause credentials. It defaults #pod F<.pause>. If you give a relative path, it is taken to be relative to #pod L. #pod #pod =cut has pause_cfg_file => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { '.pause' }, ); #pod =attr pause_cfg_dir #pod #pod This is the directory for resolving a relative L. #pod It defaults to C<< File::HomeDir->my_home >>. #pod #pod =cut has pause_cfg_dir => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { require File::HomeDir; File::HomeDir::->my_home }, ); #pod =attr pause_cfg #pod #pod This is a hashref of defaults loaded from F<~/.pause> -- this attribute is #pod subject to removal in future versions, as the config-loading behavior in #pod CPAN::Uploader is improved. #pod #pod =cut has pause_cfg => ( is => 'ro', isa => 'HashRef[Str]', lazy => 1, default => sub { my $self = shift; require CPAN::Uploader; my $file = $self->pause_cfg_file; $file = File::Spec->catfile($self->pause_cfg_dir, $file) unless File::Spec->file_name_is_absolute($file); return {} unless -e $file && -r _; my $cfg = try { CPAN::Uploader->read_config_file($file) } catch { $self->log("Couldn't load credentials from '$file': $_"); {}; }; return $cfg; }, ); #pod =attr subdir #pod #pod If given, this specifies a subdirectory under the user's home directory to #pod which to upload. Using this option is not recommended. #pod #pod =cut has subdir => ( is => 'ro', isa => 'Str', predicate => 'has_subdir', ); #pod =attr upload_uri #pod #pod If given, this specifies an alternate URI for the PAUSE upload form. By #pod default, the default supplied by L is used. Using this option #pod is not recommended in most cases. #pod #pod =cut 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 6.010 =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. You can't put your password in your F. C'mon now! =head1 ATTRIBUTES =head2 credentials_stash This attribute holds the name of a L that will contain the credentials to be used for the upload. By default, UploadToCPAN will look for a C<%PAUSE> stash. =head2 username This option supplies the user's PAUSE username. It will be looked for in the user's PAUSE configuration; if not found, the user will be prompted. =head2 password This option supplies the user's PAUSE password. It cannot be provided via F. It will be looked for in the user's PAUSE configuration; if not found, the user will be prompted. =head2 pause_cfg_file This is the name of the file containing your pause credentials. It defaults F<.pause>. If you give a relative path, it is taken to be relative to L. =head2 pause_cfg_dir This is the directory for resolving a relative L. It defaults to C<< File::HomeDir->my_home >>. =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) 2017 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.pm100644000767000024 773413130677627 21731 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/PluginBundlepackage Dist::Zilla::PluginBundle::Filter 6.010; # ABSTRACT: use another bundle, with some plugins removed use Moose; with 'Dist::Zilla::Role::PluginBundle'; use namespace::autoclean; use List::Util 1.33 qw(any); use Class::Load qw(try_load_class); use Dist::Zilla::Util; #pod =head1 SYNOPSIS #pod #pod In your F: #pod #pod [@Filter] #pod -bundle = @Basic #pod -version = 5.031 #pod -remove = ShareDir #pod -remove = UploadToCPAN #pod option = for_basic #pod #pod =head1 DESCRIPTION #pod #pod This plugin bundle actually wraps and modifies another plugin bundle. It #pod includes all the configuration for the bundle named in the C<-bundle> attribute, #pod but removes all the entries whose package is given in the C<-remove> attributes. #pod #pod A minimum required version of the bundle can be specified with the C<-version> #pod attribute. #pod #pod Options not prefixed with C<-> will be passed to the bundle to be filtered. #pod #pod B When you filter a bundle you B include it directly in #pod your C file. This plugin will take care of including it for you. #pod #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins: L<@Basic|Dist::Zilla::PluginBundle::Basic>. #pod #pod Dist::Zilla roles: L. #pod #pod =cut sub mvp_multivalue_args { qw(remove -remove) } sub bundle_config { my ($self, $section) = @_; my $class = (ref $self) || $self; my $config = {}; my $has_filter_args = any { /^-/ } keys %{ $section->{payload} }; for my $key (keys %{ $section->{payload} }) { 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}; for my $i (reverse 0 .. $#plugins) { splice @plugins, $i, 1 if 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 6.010 =head1 SYNOPSIS In your F: [@Filter] -bundle = @Basic -version = 5.031 -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. A minimum required version of the bundle can be specified with the C<-version> attribute. Options not prefixed with C<-> will be passed to the bundle to be filtered. B When you filter a bundle you B include it directly in your C file. This plugin will take care of including it for you. =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) 2017 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.pm100644000767000024 1437213130677627 21677 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::FileFinderUser 6.010; # ABSTRACT: something that uses FileFinder plugins use MooseX::Role::Parameterized 1.01; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This role enables you to search for files in the dist. This makes it easy to find specific #pod files and have the code factored out to common methods. #pod #pod Here's an example of a finder: ( taken from AutoPrereqs ) #pod #pod with 'Dist::Zilla::Role::FileFinderUser' => { #pod default_finders => [ ':InstallModules', ':ExecFiles' ], #pod }; #pod #pod Then you use it in your code like this: #pod #pod foreach my $file ( @{ $self->found_files }) { #pod # $file is an object! Look at L #pod } #pod #pod =cut #pod =attr finder_arg_names #pod #pod Define the name of the attribute which will hold this finder. Be sure to specify different names #pod if you have multiple finders! #pod #pod This is an ArrayRef. #pod #pod Default: [ qw( finder ) ] #pod #pod =cut parameter finder_arg_names => ( isa => 'ArrayRef', default => sub { [ 'finder' ] }, ); #pod =attr default_finders #pod #pod This attribute is an arrayref of plugin names for the default plugins the #pod consuming plugin will use as finders. #pod #pod Example: C<< [ qw( :InstallModules :ExecFiles ) ] >> #pod #pod The default finders are: #pod #pod =begin :list #pod #pod = :InstallModules #pod #pod Searches your lib/ directory for pm/pod files #pod #pod = :IncModules #pod #pod Searches your inc/ directory for pm files #pod #pod = :MainModule #pod #pod Finds the C of your dist #pod #pod = :TestFiles #pod #pod Searches your t/ directory and lists the files in it. #pod #pod = :ExtraTestFiles #pod #pod Searches your xt/ directory and lists the files in it. #pod #pod = :ExecFiles #pod #pod Searches your distribution for executable files. Hint: Use the #pod L plugin to mark those files as executables. #pod #pod = :PerlExecFiles #pod #pod A subset of C<:ExecFiles> limited just to perl scripts (those ending with #pod F<.pl>, or with a recognizable perl shebang). #pod #pod = :ShareFiles #pod #pod Searches your ShareDir directory and lists the files in it. #pod Hint: Use the L plugin to set up the sharedir. #pod #pod = :AllFiles #pod #pod Returns all files in the distribution. #pod #pod = :NoFiles #pod #pod Returns nothing. #pod #pod =end :list #pod #pod =cut parameter default_finders => ( isa => 'ArrayRef', required => 1, ); #pod =attr method #pod #pod This will be the name of the subroutine installed in your package for this #pod finder. Be sure to specify different names if you have multiple finders! #pod #pod Default: found_files #pod #pod =cut 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 [ map {; $by_name{$_} } sort keys %by_name ]; }; }; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::FileFinderUser - something that uses FileFinder plugins =head1 VERSION version 6.010 =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 :ExtraTestFiles Searches your xt/ 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 :PerlExecFiles A subset of C<:ExecFiles> limited just to perl scripts (those ending with F<.pl>, or with a recognizable perl shebang). =item :ShareFiles Searches your ShareDir directory and lists the files in it. Hint: Use the L plugin to set up the sharedir. =item :AllFiles Returns all files in the distribution. =item :NoFiles 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) 2017 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.pm100644000767000024 413013130677627 21726 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::MintingProfile 6.010; # ABSTRACT: something that can find a minting profile dir use Moose::Role; use namespace::autoclean; use Dist::Zilla::Path; use File::ShareDir; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role should provide C method, which, #pod given a minting profile name, returns its directory. #pod #pod The minting profile is a directory, containing arbitrary files used during #pod creation of new distribution. Among other things notably, it should contain the #pod 'profile.ini' file, listing the plugins used for minter initialization. #pod #pod The default implementation C looks in the module's #pod L. #pod #pod After installing your profile, users will be able to start a new distribution, #pod based on your profile with the: #pod #pod $ dzil new -P Provider -p profile_name Distribution::Name #pod #pod =cut requires 'profile_dir'; around profile_dir => sub { my ($orig, $self, @args) = @_; path($self->$orig(@args)); }; 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::MintingProfile - something that can find a minting profile dir =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 1655113130677627 22056 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/App/Commanduse strict; use warnings; package Dist::Zilla::App::Command::listdeps 6.010; # ABSTRACT: print your distribution's prerequisites use Dist::Zilla::App -command; #pod =head1 SYNOPSIS #pod #pod $ dzil listdeps | cpan #pod #pod =head1 DESCRIPTION #pod #pod This is a command plugin for L. It provides the C #pod command, which prints your distribution's prerequisites. You could pipe that #pod list to a CPAN client like L to install all of the dependencies in one #pod quick go. #pod #pod =head1 OPTIONS #pod #pod =head2 --author (or --develop) #pod #pod Include author dependencies (those listed under C). #pod #pod =head2 --missing #pod #pod List only dependencies which are unsatisfied. #pod #pod =head2 --requires / --no-requires #pod #pod Add required dependencies to the list (or don't). #pod #pod Default: on. #pod #pod =head2 --recommends / --no-recommends #pod #pod Add recommended dependencies to the list (or don't). #pod #pod Default: on. #pod #pod =head2 --suggests / --no-suggests #pod #pod Add suggested dependencies to the list (or don't). #pod #pod Default: off. #pod #pod =head2 --versions #pod #pod Also display the required versions of listed modules. #pod #pod =head2 --cpanm-versions #pod #pod Also display the required versions of listed modules, but in a format suitable #pod for piping into F. #pod #pod =head2 --json #pod #pod Lists all prerequisites in JSON format, as they would appear in META.json #pod (broken out into phases and types) #pod #pod =head1 ACKNOWLEDGEMENTS #pod #pod This code was originally more or less a direct copy of Marcel Gruenauer (hanekomu) #pod Dist::Zilla::App::Command::prereqs, updated to work with the Dist::Zilla v2 #pod API. #pod #pod =cut sub abstract { "print your distribution's prerequisites" } sub opt_spec { [ 'develop|author', 'include author/develop dependencies' ], [ 'missing', 'list only the missing dependencies' ], [ 'requires!', 'list the required dependencies', { default => 1 } ], [ 'recommends!', 'list the recommended dependencies', { default => 1 } ], [ 'suggests!', 'list the suggested dependencies', {default => 0 } ], [ 'versions', 'include required version numbers in listing' ], [ 'cpanm-versions', 'format versions for consumption by cpanm' ], [ 'json', 'list dependencies by phase, in JSON format' ], [ 'omit-core=s', 'Omit dependencies that are shipped with the specified version of perl' ], } 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; } my @phases = qw/configure build test runtime develop/; my @relationships = qw/requires recommends suggests/; sub filter_core { my ($prereqs, $core_version) = @_; $core_version = sprintf '%7.6f', $core_version if $core_version >= 5.010; $prereqs = $prereqs->clone if $prereqs->is_finalized; require Module::CoreList; for my $phase (@phases) { for my $relation (@relationships) { my $req = $prereqs->requirements_for($phase, $relation); for my $module ($req->required_modules) { next if not exists $Module::CoreList::version{$core_version}{$module}; $req->clear_requirement($module) if $req->accepts_module($module, $Module::CoreList::version{$core_version}{$module}); } } } return $prereqs; } sub extract_dependencies { my ($self, $zilla, $phases, $opt) = @_; my $prereqs = $self->prereqs($zilla); $prereqs = filter_core($prereqs, $opt->omit_core) if $opt->omit_core; require CPAN::Meta::Requirements; my $req = CPAN::Meta::Requirements->new; for my $phase (@$phases) { $req->add_requirements( $prereqs->requirements_for($phase, 'requires') ) if $opt->requires; $req->add_requirements( $prereqs->requirements_for($phase, 'recommends') ) if $opt->recommends; $req->add_requirements( $prereqs->requirements_for($phase, 'suggests') ) if $opt->suggests; } my @required = grep { $_ ne 'perl' } $req->required_modules; if ($opt->missing) { require Module::Runtime; @required = grep { # Keep modules that can't be loaded or that don't have a $VERSION # matching our requirements ! eval { my $m = $_; # Will die if module is not installed Module::Runtime::require_module($m); # Returns true if $VERSION matches, so we will exclude the module $req->accepts_module($m => $m->VERSION) } } @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->develop; my $omit_core = $opt->omit_core; if($opt->json) { my $prereqs = $self->prereqs($self->zilla); $prereqs = filter_core($prereqs, $omit_core) if $omit_core; my $output = $prereqs->as_string_hash; require JSON::MaybeXS; print JSON::MaybeXS->new(ascii => 1, canonical => 1, pretty => 1)->encode($output), "\n"; return 1; } my %modules = $self->extract_dependencies($self->zilla, \@phases, $opt); my @names = sort { lc $a cmp lc $b } keys %modules; if ($opt->versions) { print "$_ = $modules{$_}\n" for @names; } elsif ($opt->cpanm_versions) { print qq{$_~"$modules{$_}"\n} for @names; } else { print "$_\n" for @names; } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::App::Command::listdeps - print your distribution's prerequisites =head1 VERSION version 6.010 =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 (or --develop) Include author dependencies (those listed under C). =head2 --missing List only dependencies which are unsatisfied. =head2 --requires / --no-requires Add required dependencies to the list (or don't). Default: on. =head2 --recommends / --no-recommends Add recommended dependencies to the list (or don't). Default: on. =head2 --suggests / --no-suggests Add suggested dependencies to the list (or don't). Default: off. =head2 --versions Also display the required versions of listed modules. =head2 --cpanm-versions Also display the required versions of listed modules, but in a format suitable for piping into F. =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) 2017 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.pm100644000767000024 571313130677627 22126 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::MetaResources 6.010; # ABSTRACT: provide arbitrary "resources" for distribution metadata use Moose; with 'Dist::Zilla::Role::MetaProvider'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This plugin adds resources entries to the distribution's metadata. #pod #pod [MetaResources] #pod homepage = http://example.com/~dude/project.asp #pod bugtracker.web = https://rt.cpan.org/Public/Dist/Display.html?Name=Project #pod bugtracker.mailto = bug-Project@rt.cpan.org #pod repository.url = git://github.com/dude/project.git #pod repository.web = http://github.com/dude/project #pod repository.type = git #pod #pod =cut has resources => ( is => 'ro', isa => 'HashRef', required => 1, ); around BUILDARGS => sub { my $orig = shift; my ($class, @arg) = @_; my $args = $class->$orig(@arg); my %copy = %{ $args }; 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; #pod =head1 SEE ALSO #pod #pod Dist::Zilla roles: L. #pod #pod Dist::Zilla plugins on the CPAN: L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::MetaResources - provide arbitrary "resources" for distribution metadata =head1 VERSION version 6.010 =head1 DESCRIPTION This plugin adds resources entries to the distribution's metadata. [MetaResources] homepage = http://example.com/~dude/project.asp bugtracker.web = https://rt.cpan.org/Public/Dist/Display.html?Name=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) 2017 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.pm100644000767000024 451613130677627 22144 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::RemovePrereqs 6.010; # ABSTRACT: a plugin to remove gathered prereqs use Moose; with 'Dist::Zilla::Role::PrereqSource'; use namespace::autoclean; use MooseX::Types::Moose qw(ArrayRef); use MooseX::Types::Perl qw(ModuleName); #pod =head1 SYNOPSIS #pod #pod In your F: #pod #pod [RemovePrereqs] #pod remove = Foo::Bar #pod remove = MRO::Compat #pod #pod This will remove any prerequisite of any type from any prereq phase. This is #pod useful for eliminating incorrectly detected prereqs. #pod #pod =head1 SEE ALSO #pod #pod Dist::Zilla plugins: #pod L, #pod L. #pod #pod =cut 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 => [ sort @{ $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 }) { $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 6.010 =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) 2017 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.pm100644000767000024 731413130677627 22057 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/PluginBundlepackage Dist::Zilla::PluginBundle::Classic 6.010; # 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; #pod =head1 DESCRIPTION #pod #pod This bundle is more or less the original configuration bundled with #pod Dist::Zilla. More than likely, you'd rather be using #pod L<@Basic|Dist::Zilla::PluginBundle::Basic> or a more complex bundle. This one #pod will muck around with your code by adding C<$VERSION> declarations and will #pod mess with you Pod by adding a C<=head1 VERSION> section, but it won't get you a #pod lot of more useful features like autoversioning, autoprereqs, or Pod::Weaver. #pod #pod It includes the following plugins with their default configuration: #pod #pod =for :list #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod * L #pod #pod =head1 SEE ALSO #pod #pod L<@Basic|Dist::Zilla::PluginBundle::Basic> #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::PluginBundle::Classic - the classic (old) default configuration for Dist::Zilla =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 377613130677627 22114 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::LicenseProvider 6.010; # ABSTRACT: something that provides a license for the dist use Moose::Role; with 'Dist::Zilla::Role::Plugin'; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role must provide a C method that #pod will be called when setting the dist's license. #pod #pod If a LicenseProvider offers a license but one has already been set, an #pod exception will be raised. If C returns undef, it will be #pod ignored. #pod #pod =head1 REQUIRED METHODS #pod #pod =head2 C<< provide_license({ copyright_holder => $holder, copyright_year => $year }) >> #pod #pod Generate license object. Returned object should be an instance of #pod L. #pod #pod Plugins are responsible for injecting C<$copyright_holder> and #pod C<$copyright_year> arguments into the license if these arguments are defined. #pod #pod =cut 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 6.010 =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 => $holder, copyright_year => $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) 2017 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.pm100644000767000024 310113130677627 22135 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Rolepackage Dist::Zilla::Role::VersionProvider 6.010; # ABSTRACT: something that provides a version number for the dist use Moose::Role; with 'Dist::Zilla::Role::Plugin'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod Plugins implementing this role must provide a C method that #pod will be called when setting the dist's version. #pod #pod If a VersionProvider offers a version but one has already been set, an #pod exception will be raised. If C returns undef, it will be #pod ignored. #pod #pod =cut requires 'provide_version'; 1; #pod =head1 SEE ALSO #pod #pod Core Dist::Zilla plugins implementing this role: #pod L. #pod #pod =cut __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Role::VersionProvider - something that provides a version number for the dist =head1 VERSION version 6.010 =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) 2017 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 another_perl_script100644000767000024 5713130677627 22461 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_Bin#!/usr/bin/perl print "Hello World!\n"; exit; DZT000755000767000024 013130677627 17736 5ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_NoPm/libSample.pod100644000767000024 20313130677627 21776 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/corpus/dist/DZT_NoPm/lib/DZTuse strict; use warnings; package DZT::Sample; sub return_arrayref_of_values_passed { my $invocant = shift; return \@_; } 1; ConfirmRelease.pm100644000767000024 363413130677627 22243 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::ConfirmRelease 6.010; # ABSTRACT: prompt for confirmation before releasing use Moose; with 'Dist::Zilla::Role::BeforeRelease'; use namespace::autoclean; sub before_release { my ($self, $tgz) = @_; my $releasers = join q{, }, map {; $_->plugin_name } @{ $self->zilla->plugins_with(-Releaser) }; $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; #pod =head1 DESCRIPTION #pod #pod This plugin prompts the author whether or not to continue before releasing #pod the distribution to CPAN. It gives authors a chance to abort before #pod they upload. #pod #pod The default is "no", but you can set the environment variable #pod C to "yes" if you just want to hit enter to #pod release. __END__ =pod =encoding UTF-8 =head1 NAME Dist::Zilla::Plugin::ConfirmRelease - prompt for confirmation before releasing =head1 VERSION version 6.010 =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) 2017 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.pm100644000767000024 325313130677627 22316 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::PodSyntaxTests 6.010; # ABSTRACT: a author test for Pod syntax use Moose; extends 'Dist::Zilla::Plugin::InlineFiles'; with 'Dist::Zilla::Role::PrereqSource'; use namespace::autoclean; #pod =head1 DESCRIPTION #pod #pod This is an extension of L, providing the #pod following files: #pod #pod xt/author/pod-syntax.t - a standard Test::Pod test #pod #pod L C<1.41> will be added as a C dependency. #pod #pod =cut # Register the author 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 author test for Pod syntax =head1 VERSION version 6.010 =head1 DESCRIPTION This is an extension of L, providing the following files: xt/author/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) 2017 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/author/pod-syntax.t ]___ #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); TemplateModule.pm100644000767000024 1064713130677627 22310 0ustar00rjbsstaff000000000000Dist-Zilla-6.010/lib/Dist/Zilla/Pluginpackage Dist::Zilla::Plugin::TemplateModule 6.010; # ABSTRACT: a simple module-from-template plugin use Moose; with qw(Dist::Zilla::Role::ModuleMaker Dist::Zilla::Role::TextTemplate); use Dist::Zilla::Path; 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; #pod =head1 MINTING CONFIGURATION #pod #pod This module is part of the standard configuration of the default L #pod Minting Profile, and all profiles that don't set a custom ':DefaultModuleMaker' #pod so you don't need to normally do anything to configure it. #pod #pod dzil new Some::Module #pod # creates ./Some-Module/* #pod # creates ./Some-Module/lib/Some/Module.pm #pod #pod However, for those who wish to configure this ( or any subclasses ) this is #pod presently required: #pod #pod [TemplateModule / :DefaultModuleMaker] #pod ; template = SomeFile.pm #pod #pod =head1 DESCRIPTION #pod #pod This is a L used for creating new #pod Perl modules files when minting a new dist with C. It uses #pod L (via L) to render a template #pod into a Perl module. The template is given two variables for use in rendering: #pod C<$name>, the module name; and C<$dist>, the Dist::Zilla object. The module is #pod always created as a file under F<./lib>. #pod #pod By default, the template looks something like this: #pod #pod use strict; #pod use warnings; #pod package {{ $name }}; #pod #pod 1; #pod #pod =attr template #pod #pod The C