File Coverage

blib/lib/RT/Extension/Converter.pm
Criterion Covered Total %
statement 16 17 94.1
branch 2 4 50.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 23 26 88.4


line stmt bran cond sub pod time code
1             package RT::Extension::Converter;
2              
3             our $VERSION = '0.03';
4              
5 2     2   24030 use warnings;
  2         4  
  2         106  
6 2     2   10 use strict;
  2         3  
  2         63  
7 2     2   10 use Carp;
  2         6  
  2         494  
8              
9              
10             =head1 NAME
11              
12             RT::Extension::Converter - base class for rtX-to-rt3 scripts
13              
14              
15             =head1 SYNOPSIS
16              
17             use RT::Extension::Converter;
18             my $rt1converter = RT::Extension::Converter->new( type => 'rt1' );
19             my $rt3converter = RT::Extension::Converter->new( type => 'rt3' );
20              
21             foreach my $user ($rt1converter->users) {
22             $rt3converter->add_user( $user );
23             }
24              
25             =head1 DESCRIPTION
26              
27             Top level Converter class, used to get access to the RT(1,2,3) converter
28             objects.
29              
30             =head1 METHODS
31              
32             =head2 new
33              
34             Requires a type argument
35              
36             new( type => 'RT1' );
37              
38             =cut
39              
40             sub new {
41 1     1 1 13 my $class = shift;
42 1         6 my %args = @_;
43              
44 1 50       6 Carp::confess "Must pass a type [$args{type}]" unless $args{type};
45              
46 1         4 my $subclass = "${class}::$args{type}";
47 1         107 eval "require $subclass";
48 1 50       10 if ($@) {
49 1         947 Carp::confess "Not a valid type $args{type} $subclass $@";
50             }
51              
52 0           return $subclass->new;
53             }
54              
55              
56             =head1 BUGS AND LIMITATIONS
57              
58             No bugs have been reported.
59              
60             Please report any bugs or feature requests to
61             C, or through the web interface at
62             L or on C
63              
64              
65             =head1 AUTHOR
66              
67             Kevin Falcone C<< >>
68              
69              
70             =head1 LICENCE AND COPYRIGHT
71              
72             Copyright (c) 2007, Best Practical Solutions, LLC. All rights reserved.
73              
74             This module is free software; you can redistribute it and/or
75             modify it under the same terms as Perl itself. See L.
76              
77              
78             =head1 DISCLAIMER OF WARRANTY
79              
80             BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
81             FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
82             OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
83             PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
84             EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
85             WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
86             ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
87             YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
88             NECESSARY SERVICING, REPAIR, OR CORRECTION.
89              
90             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
91             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
92             REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
93             LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
94             OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
95             THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
96             RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
97             FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
98             SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
99             SUCH DAMAGES.
100              
101             =cut
102              
103             1;