line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# vim: set ts=8 sts=4 sw=4 tw=115 et : |
2
|
1
|
|
|
1
|
|
1756166
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
49
|
|
4
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::Test::PAUSE::Permissions; # git description: v0.002-23-g6f46e24 |
5
|
|
|
|
|
|
|
# ABSTRACT: Generate a test to verify PAUSE permissions |
6
|
|
|
|
|
|
|
# KEYWORDS: plugin test author PAUSE permissions |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.003'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
3
|
use Moose; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
11
|
|
|
|
|
|
|
with ( |
12
|
|
|
|
|
|
|
'Dist::Zilla::Role::FileGatherer', |
13
|
|
|
|
|
|
|
'Dist::Zilla::Role::TextTemplate', |
14
|
|
|
|
|
|
|
'Dist::Zilla::Role::PrereqSource', |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
3972
|
use Path::Tiny; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
49
|
|
18
|
1
|
|
|
1
|
|
4
|
use namespace::autoclean; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
0
|
7
|
sub filename { path(qw(xt release pause-permissions.t))->stringify } |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has username => ( |
23
|
|
|
|
|
|
|
is => 'ro', isa => 'Str|Undef', |
24
|
|
|
|
|
|
|
lazy => 1, |
25
|
|
|
|
|
|
|
default => sub { |
26
|
|
|
|
|
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
my $stash = $self->zilla->stash_named('%PAUSE'); |
28
|
|
|
|
|
|
|
return if not $stash; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my $username = $stash->username; |
31
|
|
|
|
|
|
|
$self->log_debug([ 'using PAUSE id "%s" from Dist::Zilla config', $username ]) if $username; |
32
|
|
|
|
|
|
|
$username; |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
around dump_config => sub |
37
|
|
|
|
|
|
|
{ |
38
|
|
|
|
|
|
|
my ($orig, $self) = @_; |
39
|
|
|
|
|
|
|
my $config = $self->$orig; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $data = { |
42
|
|
|
|
|
|
|
blessed($self) ne __PACKAGE__ ? ( version => $VERSION ) : (), |
43
|
|
|
|
|
|
|
}; |
44
|
|
|
|
|
|
|
$config->{+__PACKAGE__} = $data if keys %$data; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
return $config; |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub register_prereqs |
50
|
|
|
|
|
|
|
{ |
51
|
2
|
|
|
2
|
0
|
6020
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
2
|
|
|
|
|
57
|
$self->zilla->register_prereqs( |
54
|
|
|
|
|
|
|
{ |
55
|
|
|
|
|
|
|
phase => 'develop', |
56
|
|
|
|
|
|
|
type => 'requires', |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
'Test::PAUSE::Permissions' => '0', |
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub gather_files |
63
|
|
|
|
|
|
|
{ |
64
|
2
|
|
|
2
|
0
|
77217
|
my $self = shift; |
65
|
|
|
|
|
|
|
|
66
|
2
|
|
|
|
|
424
|
require Dist::Zilla::File::InMemory; |
67
|
2
|
|
|
|
|
54954
|
$self->add_file(Dist::Zilla::File::InMemory->new( |
68
|
|
|
|
|
|
|
name => $self->filename, |
69
|
|
|
|
|
|
|
content => $self->fill_in_string( |
70
|
|
|
|
|
|
|
<<'TEST', |
71
|
|
|
|
|
|
|
use strict; |
72
|
|
|
|
|
|
|
use warnings; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# this test was generated with {{ ref $plugin }} {{ $plugin->VERSION }} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
use Test::More; |
77
|
|
|
|
|
|
|
BEGIN { |
78
|
|
|
|
|
|
|
plan skip_all => 'Test::PAUSE::Permissions required for testing pause permissions' |
79
|
|
|
|
|
|
|
if $] < 5.010; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
use Test::PAUSE::Permissions; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
all_permissions_ok({{ $username ? qq{'$username'} : '' }}); |
84
|
|
|
|
|
|
|
TEST |
85
|
|
|
|
|
|
|
{ |
86
|
|
|
|
|
|
|
dist => \($self->zilla), |
87
|
|
|
|
|
|
|
plugin => \$self, |
88
|
|
|
|
|
|
|
username => \($self->username), |
89
|
|
|
|
|
|
|
}, |
90
|
|
|
|
|
|
|
), |
91
|
|
|
|
|
|
|
)); |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=pod |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=encoding UTF-8 |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 NAME |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Dist::Zilla::Plugin::Test::PAUSE::Permissions - Generate a test to verify PAUSE permissions |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 VERSION |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
version 0.003 |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 SYNOPSIS |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
In your F<dist.ini>: |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
[Test::PAUSE::Permissions] |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 DESCRIPTION |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This is a L<Dist::Zilla> plugin that runs at the |
119
|
|
|
|
|
|
|
L<gather files|Dist::Zilla::Role::FileGatherer> stage, providing a |
120
|
|
|
|
|
|
|
L<Test::PAUSE::Permissions> test, named F<xt/release/pause-permissions.t>). |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=for Pod::Coverage filename gather_files register_prereqs |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 SEE ALSO |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=over 4 |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item * |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
L<Test::PAUSE::Permissions> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=back |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 SUPPORT |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Test-PAUSE-Permissions> |
137
|
|
|
|
|
|
|
(or L<bug-Dist-Zilla-Plugin-Test-PAUSE-Permissions@rt.cpan.org|mailto:bug-Dist-Zilla-Plugin-Test-PAUSE-Permissions@rt.cpan.org>). |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
There is also a mailing list available for users of this distribution, at |
140
|
|
|
|
|
|
|
L<http://dzil.org/#mailing-list>. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
There is also an irc channel available for users of this distribution, at |
143
|
|
|
|
|
|
|
L<C<#distzilla> on C<irc.perl.org>|irc://irc.perl.org/#distzilla>. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
I am also usually active on irc, as 'ether' at C<irc.perl.org>. |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head1 AUTHOR |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Karen Etheridge <ether@cpan.org> |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head1 CONTRIBUTOR |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=for stopwords Harley Pig |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
Harley Pig <harleypig@gmail.com> |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Karen Etheridge. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
162
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=cut |