File Coverage

blib/lib/Test/Smoke/Syncer/Copy.pm
Criterion Covered Total %
statement 20 22 90.9
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 26 29 89.6


line stmt bran cond sub pod time code
1             package Test::Smoke::Syncer::Copy;
2 11     11   64 use warnings;
  11         52  
  11         315  
3 11     11   56 use strict;
  11         19  
  11         359  
4              
5             our $VERSION = '0.029';
6              
7 11     11   49 use base 'Test::Smoke::Syncer::Base';
  11         20  
  11         2209  
8              
9             =head1 Test::Smoke::Syncer::Copy
10              
11             This handles syncing with the B module from a local
12             directory. It uses the B file is the source directory
13             to determine which fiels to copy. The current source-tree removed
14             before the actual copying.
15              
16             =cut
17              
18             =head2 Test::Smoke::Syncer::Copy->new( %args )
19              
20             This crates the new object. Keys for C<%args>:
21              
22             * ddir: destination directory ( ./perl-current )
23             * cdir: directory to copy from ( undef )
24             * v: verbose
25              
26             =cut
27              
28             =head2 $syncer->sync( )
29              
30             This uses B to do the actual copying. After
31             that it will clean up the source-tree (from F, but ignoring
32             F!).
33              
34             =cut
35              
36             sub sync {
37 4     4 1 1067 my $self = shift;
38              
39 4 50       38 $self->{cdir} eq $self->{ddir} and do {
40 0         0 require Carp;
41 0         0 Carp::croak( "Sourcetree cannot be copied onto it self!" );
42             };
43              
44 4         54 $self->pre_sync;
45 4         1457 require Test::Smoke::SourceTree;
46              
47 4         36 my $tree = Test::Smoke::SourceTree->new($self->{cdir}, $self->verbose);
48 4         26 $tree->copy_from_MANIFEST($self->{ddir});
49              
50 4         32 $tree = Test::Smoke::SourceTree->new( $self->{ddir} );
51 4         23 $tree->clean_from_MANIFEST( 'MANIFEST.SKIP' );
52              
53 4         68 my $plevel = $self->check_dot_patch;
54 4         45 $self->post_sync;
55 4         20 return $plevel;
56             }
57              
58             1;
59              
60             =head1 COPYRIGHT
61              
62             (c) 2002-2013, All rights reserved.
63              
64             * Abe Timmerman
65              
66             This library is free software; you can redistribute it and/or modify
67             it under the same terms as Perl itself.
68              
69             See:
70              
71             * ,
72             *
73              
74             This program is distributed in the hope that it will be useful,
75             but WITHOUT ANY WARRANTY; without even the implied warranty of
76             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
77              
78             =cut