File Coverage

blib/lib/Module/Install/Authority.pm
Criterion Covered Total %
statement 9 12 75.0
branch n/a
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 17 76.4


line stmt bran cond sub pod time code
1             package Module::Install::Authority;
2 1     1   867 use strict;
  1         2  
  1         41  
3 1     1   6 use warnings;
  1         2  
  1         38  
4 1     1   15 use base qw/Module::Install::Base/;
  1         2  
  1         709  
5              
6             our $VERSION = '0.03';
7             $VERSION = eval $VERSION;
8              
9             sub authority {
10 0     0 1   my $self = shift;
11 0           my $pause_id = shift;
12 0           $self->Meta->{values}->{x_authority} = $pause_id;
13             }
14              
15             1;
16              
17             =head1 NAME
18              
19             Module::Install::Authority - Add an x_authority key to META.yml
20              
21             =head1 SYNOPSIS
22              
23             use inc::Module::Install;
24             name 'Example';
25             all_from 'lib/Example.pm'
26             authority 'cpan:BOBTFISH';
27             WriteAll;
28              
29             =head1 DESCRIPTION
30              
31             If you upload a distribution which contains an C key in the META.yml
32             then PAUSE will assign 'firstcome' permissions on any packages in that distribution
33             to the user given by the C key (and assign co-maint to the uploader).
34              
35             Traditionally, if you uploaded a dist containing A.pm, and then gave someone else
36             comaint, and they uploaded a subsequent release including B.pm, then you had a problem
37             as the initial author (you!) has no permissions to release B.pm
38              
39             Adding the C key to your distribution fixes this, as it ensures that any
40             subsequent packages uploaded as part of the dist by co-maintainers get their permissions
41             set so that one person is the canonical source of permissions for the dist.
42              
43             This makes coordination (and maintainance sharing) much easier for large distributions,
44             or those maintained by a pool of people.
45              
46             =head1 METHODS
47              
48             =head2 authority ($pause_id)
49              
50             Adds an C key to your META.yml or META.json
51              
52             =head1 BUGS
53              
54             This module should be able to take x_authority from the $AUTHORITY variable in the 'main' module
55             of the dist if present.
56              
57             =head1 AUTHOR
58              
59             Tomas Doran (t0m)
60              
61             =head1 COPYRIGHT
62              
63             Copyright (C) 2012 Tomas Doran
64              
65             =head1 LICENSE
66              
67             This software is licensed under the same terms as perl itself.
68              
69             =cut
70