Converter.pm

filter: Statementstmt 94.7% 18 / 19 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 89.2% 25 / 28 CC 3 SCAR 7.3
CC
3
Cov
87%
new
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« Converter/RT3.pm ↑ Summary Converter/RT1/Config.pm »
1 package RT::Extension::Converter;
2  
3 3 our $VERSION = '0.03';
4  
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 1 ▶sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod documented
41 1 my $class = shift;
42 1 my %args = @_;
43  
44 1 ▶ Carp::confess "Must pass a type [$args{type}]" unless $args{type};
Branch: 1 branch
BranchTrueFalseTotal
unless $args{"type"} 0 1 1
45  
46 1 my $subclass = "${class}::$args{type}";
47 1 eval "require $subclass";
48 1 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 1 0 1
49 1 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<bug-rtx-converter@rt.cpan.org>, or through the web interface at
62 L<http://rt.cpan.org> or on C<rt-devel@lists.bestpractical.com>
63  
64  
65 =head1 AUTHOR
66  
67 Kevin Falcone C<< <falcone@bestpractical.com> >>
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<perlartistic>.
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 3 1;
« Converter/RT3.pm ↑ Summary Converter/RT1/Config.pm »