File Coverage

lib/Slaughter/Transport/rsync.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 25 26 96.1


line stmt bran cond sub pod time code
1              
2             =head1 NAME
3            
4             Slaughter::Transport::rsync - rsync transport class.
5            
6             =head1 SYNOPSIS
7            
8             This transport copes with fetching a remote store to the local system, via rsync.
9            
10             =cut
11              
12             =head1 DESCRIPTION
13            
14             This module uses the L<Slaughter::Transport::revisionControl> base-class in such
15             a way as to offer a rsync-based transport.
16            
17             All the implementation, except for the setup of some variables, comes from that
18             base class.
19            
20             =cut
21              
22             =head1 IMPLEMENTATION
23            
24             The following commands are set in the L</_init> method:
25            
26             =over 8
27            
28             =item cmd_clone
29            
30             This is set to "C<rsync -qazr>".
31            
32             =item cmd_update
33            
34             This is set to "C<rsync -qazr>" - identical to that used in the clone, as rsync
35             is always incremental in nature.
36            
37             =item cmd_version
38            
39             This is set to "C<rsync --version>".
40            
41             =item name
42            
43             This is set to "C<rsync>".
44            
45             =back
46            
47             =cut
48              
49              
50 1     1   1035 use strict;
  1         1  
  1         28  
51 1     1   4 use warnings;
  1         1  
  1         37  
52              
53              
54              
55             package Slaughter::Transport::rsync;
56              
57             #
58             # The version of our release.
59             #
60             our $VERSION = "3.0.5";
61              
62              
63              
64 1     1   3 use parent 'Slaughter::Transport::revisionControl';
  1         1  
  1         5  
65              
66              
67              
68             =head2 new
69            
70             Create a new instance of this object.
71            
72             =cut
73              
74             sub new
75             {
76 1     1 1 434     my ( $class, %args ) = @_;
77 1         6     return $class->SUPER::new(%args);
78             }
79              
80              
81             =head2 _init
82            
83             Initialiaze this object, by setting up the rsync-specific commands, etc.
84            
85             =cut
86              
87             sub _init
88             {
89 1     1   2     my ($self) = (@_);
90              
91             #
92             # The name of our derived transport.
93             #
94 1         4     $self->{ 'name' } = "rsync";
95              
96             #
97             # The command to invoke the version of our revision control system.
98             # Used to test that it is installed.
99             #
100 1         1     $self->{ 'cmd_version' } = "rsync --version";
101              
102             #
103             # The command to clone our remote repository.
104             #
105 1         1     $self->{ 'cmd_clone' } = "rsync -qazr --delete";
106 1 50       3     $self->{ 'cmd_clone' } .= " $self->{'transportargs'} "
107                   if ( $self->{ 'transportargs' } );
108 1         1     $self->{ 'cmd_clone' } .= " #SRC# #DST#";
109              
110             #
111             # The command to update our repository - NOT USED
112             #
113             # In the case or rsync an update is the same as a clone
114             #
115 1         2     $self->{ 'cmd_update' } = $self->{ 'cmd_clone' };
116              
117             }
118              
119              
120             1;
121              
122              
123             =head1 AUTHOR
124            
125             Steve Kemp <steve@steve.org.uk>
126            
127             =cut
128              
129             =head1 LICENSE
130            
131             Copyright (c) 2010-2015 by Steve Kemp. All rights reserved.
132            
133             This module is free software;
134             you can redistribute it and/or modify it under
135             the same terms as Perl itself.
136             The LICENSE file contains the full text of the license.
137            
138             =cut
139