line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Local::Plugin::Inject; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$CPAN::Local::Plugin::Inject::VERSION = '0.010'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Inject a distribution into the repo |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
813
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
9
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
10
|
1
|
|
|
1
|
|
2052
|
use CPAN::Inject; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Path::Class qw(file); |
12
|
|
|
|
|
|
|
use Try::Tiny qw(try catch); |
13
|
|
|
|
|
|
|
use Moose; |
14
|
|
|
|
|
|
|
extends 'CPAN::Local::Plugin'; |
15
|
|
|
|
|
|
|
with 'CPAN::Local::Role::Inject'; |
16
|
|
|
|
|
|
|
use namespace::clean -except => 'meta'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub inject |
19
|
|
|
|
|
|
|
{ |
20
|
|
|
|
|
|
|
my ( $self, @distros ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my @injected; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
foreach my $distro (@distros) |
25
|
|
|
|
|
|
|
{ |
26
|
|
|
|
|
|
|
my $injector = CPAN::Inject->new( |
27
|
|
|
|
|
|
|
sources => $self->root, |
28
|
|
|
|
|
|
|
author => $distro->authorid, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
next unless try { $injector->add( file => $distro->filename ) } |
32
|
|
|
|
|
|
|
catch { $self->log($_) }; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
push @injected, $self->create_distribution( |
35
|
|
|
|
|
|
|
filename => file( $self->root, $distro->path )->stringify, |
36
|
|
|
|
|
|
|
authorid => $distro->authorid, |
37
|
|
|
|
|
|
|
path => $distro->path, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
return @injected; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 NAME |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
CPAN::Local::Plugin::Inject - Inject a distribution into the repo |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 VERSION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
version 0.010 |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 IMPLEMENTS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=over |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item L<CPAN::Local::Plugin::Inject> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=back |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 METHODS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 inject |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Writes the distributition tarballs to the repository and updates the author |
71
|
|
|
|
|
|
|
checksums. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHOR |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Peter Shangov <pshangov@yahoo.com> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Venda, Inc.. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
82
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|