« auto/share/module/Dist-Zilla-MintingProfile-Author-YANICK/default/Module.pm
↑ Summary
Dist/Zilla/MintingProfile/Author/YANICK.pm »
| 1 | package Dist::Zilla::PluginBundle::YANICK::Contributing; | ||
| 2 | 1 | our $AUTHORITY = 'cpan:YANICK'; | |
| 3 | # ABSTRACT: add a CONTRIBUTING.md file to the package | ||
| 4 | 1 | $Dist::Zilla::PluginBundle::YANICK::Contributing::VERSION = '0.32.2'; | |
| 5 | |||
| 6 | 1 | ▶ | use 5.20.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use Dist::Zilla::File::InMemory; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 1 | with qw/ | |
| 13 | Dist::Zilla::Role::Plugin | ||
| 14 | Dist::Zilla::Role::FileGatherer | ||
| 15 | Dist::Zilla::Role::TextTemplate | ||
| 16 | /; | ||
| 17 | |||
| 18 | 1 | ▶ | use experimental 'signatures'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 1 | has '+zilla' => ( | |
| 21 | handles => { | ||
| 22 | distribution_name => 'name', | ||
| 23 | authors => 'authors', | ||
| 24 | } | ||
| 25 | ); | ||
| 26 | |||
| 27 | 0 | ▶ | sub gather_files ($self) { |
|
Subroutine
gather_files: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 28 | 0 | $self->add_file( | |
| 29 | Dist::Zilla::File::InMemory->new({ | ||
| 30 | content => $self->fill_in_string( | ||
| 31 | file_template(), { | ||
| 32 | distribution => $self->distribution_name, | ||
| 33 | }, | ||
| 34 | ), | ||
| 35 | name => 'CONTRIBUTING.md', | ||
| 36 | }) | ||
| 37 | ); | ||
| 38 | } | ||
| 39 | |||
| 40 | 0 | ▶ | sub file_template { |
|
Subroutine
file_template: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 41 | 0 | return <<'END_CONTRIBUTING'; | |
| 42 | |||
| 43 | # Contributing to {{ $distribution }} | ||
| 44 | |||
| 45 | So you want to contribute to this package? Or fork it? Or play with it, or | ||
| 46 | whatever? Excellent! Here, let me try to make it easier for you. | ||
| 47 | |||
| 48 | ## Dist::Zilla and branch structure | ||
| 49 | |||
| 50 | This package, like many of mine, uses [Dist::Zilla](https://metacpan.org/dist/Dist-Zilla). | ||
| 51 | Dist::Zilla (`dzil` to its friends) is a distribution builder | ||
| 52 | that helps (tremendously) with the nitty gritty of grooming | ||
| 53 | and releasing packages to CPAN. It tidies up the | ||
| 54 | documentation, add boilerplate files, update versions, | ||
| 55 | and... do a *bunch* of other things. Because it does so | ||
| 56 | much, it can be scary for some people. But it really doesn't need | ||
| 57 | to be. | ||
| 58 | |||
| 59 | This repository has two core branches: | ||
| 60 | |||
| 61 | * `main` -- the working branch, holding the pre-dzil-munging code. | ||
| 62 | |||
| 63 | * `releases` -- contains the dzil-munged code released to | ||
| 64 | CPAN. | ||
| 65 | |||
| 66 | Which means that if you don't want to bother with | ||
| 67 | Dist::Zilla at all, checkout `releases` and work on it. | ||
| 68 | Since it's the "real" code that made it to CPAN, all it | ||
| 69 | working -- the package itself, the tests, everything. And | ||
| 70 | totally feel free to use this branch as a base for a PR. | ||
| 71 | I'll be very grateful for the work, and I'll take on the last | ||
| 72 | step of porting the patching to `main`, noooo problem. | ||
| 73 | |||
| 74 | ### I'm brave, I want to be on `main` | ||
| 75 | |||
| 76 | Good for you! | ||
| 77 | |||
| 78 | The good news is that dzil mostly tinker with stuff the | ||
| 79 | working code doesn't care about, so you probably won't have | ||
| 80 | to do anything special. In most cases, tinkering with the | ||
| 81 | code will look like: | ||
| 82 | |||
| 83 | $ cpanm --installdeps . | ||
| 84 | $ ... tinker, tinker ... | ||
| 85 | $ prove -l t | ||
| 86 | |||
| 87 | Now, if you want to generate the CPAN-ready tarball, or go | ||
| 88 | full YANICK on things. You'll have to install both | ||
| 89 | Dist::Zilla and my plugin bundle: | ||
| 90 | |||
| 91 | $ cpanm Dist::Zilla Dist::Zilla::PluginBundle::YANICK | ||
| 92 | |||
| 93 | and then you should be able to do all things dzilly; | ||
| 94 | |||
| 95 | # generate the tarball | ||
| 96 | $ dzil build | ||
| 97 | |||
| 98 | # run all the tests on the final code | ||
| 99 | $ dzil test | ||
| 100 | |||
| 101 | Now, a honest caveat: `Dist::Zilla::PluginBundle::YANICK` is | ||
| 102 | tailored to my exact needs; it does a lot, and some of it | ||
| 103 | is not guaranteed to work on somebody else's system. If you | ||
| 104 | try to use it and you hit something weird, just let me know, | ||
| 105 | and I'll do my best to help you. | ||
| 106 | |||
| 107 | Aaaand that's pretty all I think you need to get started. Good luck! :-) | ||
| 108 | END_CONTRIBUTING | ||
| 109 | } | ||
| 110 | |||
| 111 | 1 | __PACKAGE__->meta->make_immutable; | |
| 112 | |||
| 113 | 1 | 1; | |
| 114 | |||
| 115 | __END__ | ||