File Coverage

blib/lib/Dist/Zilla/App/Command/release.pm
Criterion Covered Total %
statement 6 16 37.5
branch 0 4 0.0
condition 0 2 0.0
subroutine 2 5 40.0
pod 3 3 100.0
total 11 30 36.6


line stmt bran cond sub pod time code
1             package Dist::Zilla::App::Command::release 6.030;
2             # ABSTRACT: release your dist to the CPAN
3              
4 4     4   2628 use Dist::Zilla::Pragmas;
  4         13  
  4         30  
5              
6 4     4   28 use Dist::Zilla::App -command;
  4         9  
  4         30  
7              
8             #pod =head1 SYNOPSIS
9             #pod
10             #pod dzil release
11             #pod
12             #pod dzil release --trial
13             #pod
14             #pod # long form, jobs takes an integer
15             #pod dzil release --jobs 9
16             #pod
17             #pod # short form, same as above
18             #pod dzil release -j 9
19             #pod
20             #pod This command is a very, very thin wrapper around the
21             #pod C<L<release|Dist::Zilla/release>> method on the Dist::Zilla object. It will
22             #pod build, archive, and release your distribution using your Releaser plugins.
23             #pod
24             #pod Available options are:
25             #pod
26             #pod =over
27             #pod
28             #pod =item C<--trial>, will cause it to build a trial build.
29             #pod
30             #pod =item C<--jobs|-j=i>, number of test jobs run in parallel using L<Test::Harness|Test::Harness>.
31             #pod
32             #pod =back
33             #pod
34             #pod The default for L<Test::Harness|Test::Harness> is C<9>. The number of parallel jobs can also be specified setting C<HARNESS_OPTIONS>.
35             #pod
36             #pod HARNESS_OPTIONS=j9
37             #pod
38             #pod See L<Test::Harness|Test::Harness> for more details.
39             #pod
40             #pod =cut
41              
42 0     0 1   sub abstract { 'release your dist' }
43              
44             sub opt_spec {
45 0     0 1   [ 'trial' => 'build a trial release that PAUSE will not index' ],
46             [ 'jobs|j=i' => 'number of parallel test jobs to run' ],
47             }
48              
49             sub execute {
50 0     0 1   my ($self, $opt, $arg) = @_;
51              
52 0           my $zilla;
53             {
54             # isolate changes to RELEASE_STATUS to zilla construction
55 0           local $ENV{RELEASE_STATUS} = $ENV{RELEASE_STATUS};
  0            
56 0 0         $ENV{RELEASE_STATUS} = 'testing' if $opt->trial;
57 0           $zilla = $self->zilla;
58             }
59              
60 0 0 0       local $ENV{HARNESS_OPTIONS} = join ':', split(':', $ENV{HARNESS_OPTIONS} // ''), 'j'.$opt->jobs if $opt->jobs;
61 0           $self->zilla->release;
62             }
63              
64             1;
65              
66             __END__
67              
68             =pod
69              
70             =encoding UTF-8
71              
72             =head1 NAME
73              
74             Dist::Zilla::App::Command::release - release your dist to the CPAN
75              
76             =head1 VERSION
77              
78             version 6.030
79              
80             =head1 SYNOPSIS
81              
82             dzil release
83              
84             dzil release --trial
85              
86             # long form, jobs takes an integer
87             dzil release --jobs 9
88              
89             # short form, same as above
90             dzil release -j 9
91              
92             This command is a very, very thin wrapper around the
93             C<L<release|Dist::Zilla/release>> method on the Dist::Zilla object. It will
94             build, archive, and release your distribution using your Releaser plugins.
95              
96             Available options are:
97              
98             =over
99              
100             =item C<--trial>, will cause it to build a trial build.
101              
102             =item C<--jobs|-j=i>, number of test jobs run in parallel using L<Test::Harness|Test::Harness>.
103              
104             =back
105              
106             The default for L<Test::Harness|Test::Harness> is C<9>. The number of parallel jobs can also be specified setting C<HARNESS_OPTIONS>.
107              
108             HARNESS_OPTIONS=j9
109              
110             See L<Test::Harness|Test::Harness> for more details.
111              
112             =head1 PERL VERSION
113              
114             This module should work on any version of perl still receiving updates from
115             the Perl 5 Porters. This means it should work on any version of perl released
116             in the last two to three years. (That is, if the most recently released
117             version is v5.40, then this module should work on both v5.40 and v5.38.)
118              
119             Although it may work on older versions of perl, no guarantee is made that the
120             minimum required version will not be increased. The version may be increased
121             for any reason, and there is no promise that patches will be accepted to lower
122             the minimum required perl.
123              
124             =head1 AUTHOR
125              
126             Ricardo SIGNES 😏 <cpan@semiotic.systems>
127              
128             =head1 COPYRIGHT AND LICENSE
129              
130             This software is copyright (c) 2023 by Ricardo SIGNES.
131              
132             This is free software; you can redistribute it and/or modify it under
133             the same terms as the Perl 5 programming language system itself.
134              
135             =cut