| 1 | package Test::Smoke::App::SyncTree; | ||
| 2 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 3 | our $VERSION = '0.001'; | |
| 6 | |||
| 7 | 3 | ▶ | use base 'Test::Smoke::App::Base'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 3 | ▶ | use Test::Smoke::Syncer; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | Test::Smoke::App::SyncTree - Synchronise the perl source tree from a source. | ||
| 14 | |||
| 15 | =head1 DESCRIPTION | ||
| 16 | |||
| 17 | This module synchronises the smoke destination directory with a given source in a | ||
| 18 | given way. The source depends on the synchonisation method. | ||
| 19 | |||
| 20 | =head2 Synchronisers | ||
| 21 | |||
| 22 | The primary synchronisers are: | ||
| 23 | |||
| 24 | =over | ||
| 25 | |||
| 26 | =item git | ||
| 27 | |||
| 28 | This method will use the L<git()> program to set up a main clone of the | ||
| 29 | C<gitorigin> source tree. From this local git repository yet another clone is | ||
| 30 | made into the smoke destination directory. See L<Test::Smoke::Syncer::Git> for | ||
| 31 | details. | ||
| 32 | |||
| 33 | =item rsync | ||
| 34 | |||
| 35 | This method uses the L<rsync()> program to synchronise the smoke destination | ||
| 36 | directory with a given remote directory/archive C<source>, with C<opts>. | ||
| 37 | |||
| 38 | =item copy | ||
| 39 | |||
| 40 | This method copies all files in C<cdir>/MANIFEST to C<ddir> and removes all | ||
| 41 | files not mentioned in that MANIFEST. See L<Test::Smoke::SourceTree>. | ||
| 42 | |||
| 43 | =back | ||
| 44 | |||
| 45 | =head2 Test::Smoke::App::Syncer->new() | ||
| 46 | |||
| 47 | Add a L<Test::Smoke::Syncer> object to the instance. | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | 3 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 52 | 3 | my $class = shift; | |
| 53 | 3 | my $self = $class->SUPER::new(@_); | |
| 54 | |||
| 55 | 3 | $self->{_syncer} = Test::Smoke::Syncer->new( | |
| 56 | $self->option('sync_type'), | ||
| 57 | $self->options, | ||
| 58 | v => $self->option('verbose'), | ||
| 59 | ); | ||
| 60 | |||
| 61 | 3 | return $self; | |
| 62 | } | ||
| 63 | |||
| 64 | =head2 $syncer->run() | ||
| 65 | |||
| 66 | Actually call C<< $self->syncer->sync() >>. | ||
| 67 | |||
| 68 | =cut | ||
| 69 | |||
| 70 | 2 | ▶ | sub run { |
|
Subroutine
run: called CC=1 SCAR=0.0
Pod
documented
| |||
| 71 | 2 | my $self = shift; | |
| 72 | |||
| 73 | 2 | my $patchlevel = $self->syncer->sync(); | |
| 74 | 2 | $self->log_info( | |
| 75 | "%s is now up to patchlevel %s", | ||
| 76 | $self->option('ddir'), | ||
| 77 | $patchlevel | ||
| 78 | ); | ||
| 79 | 2 | return $patchlevel; | |
| 80 | } | ||
| 81 | |||
| 82 | 3 | 1; | |
| 83 | |||
| 84 | =head1 COPYRIGHT | ||
| 85 | |||
| 86 | (c) 2002-2013, Abe Timmerman <abeltje@cpan.org> All rights reserved. | ||
| 87 | |||
| 88 | With contributions from Jarkko Hietaniemi, Merijn Brand, Campo | ||
| 89 | Weijerman, Alan Burlison, Allen Smith, Alain Barbet, Dominic Dunlop, | ||
| 90 | Rich Rauenzahn, David Cantrell. | ||
| 91 | |||
| 92 | This library is free software; you can redistribute it and/or modify | ||
| 93 | it under the same terms as Perl itself. | ||
| 94 | |||
| 95 | See: | ||
| 96 | |||
| 97 | =over 4 | ||
| 98 | |||
| 99 | =item * L<http://www.perl.com/perl/misc/Artistic.html> | ||
| 100 | |||
| 101 | =item * L<http://www.gnu.org/copyleft/gpl.html> | ||
| 102 | |||
| 103 | =back | ||
| 104 | |||
| 105 | This program is distributed in the hope that it will be useful, | ||
| 106 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 107 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 108 | |||
| 109 | =cut | ||