File Coverage

blib/lib/Debian/WNPP/Bug.pm
Criterion Covered Total %
statement 12 16 75.0
branch n/a
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 18 24 75.0


line stmt bran cond sub pod time code
1             package Debian::WNPP::Bug;
2              
3 2     2   3429983 use strict;
  2         17  
  2         144  
4 2     2   15 use warnings;
  2         5  
  2         301  
5              
6             our $VERSION = '0.64';
7              
8             =head1 NAME
9              
10             Debian::WNPP::Bug - handy representation of Debian WNPP bug reports
11              
12             =head1 SYNOPSIS
13              
14             my $b = Debian::WNPP::Bug->new(
15             { number => 1234,
16             title => 'RFP: nice-package -- do nice things easier',
17             type => 'rfp',
18             package => 'nice-package',
19             short_description => 'do nice things together',
20             submitter => "Joe Developer "
21             }
22             );
23              
24             print "$b"; # 1234
25              
26             =cut
27              
28 2     2   132 use base qw(Class::Accessor);
  2         5  
  2         1871  
29             __PACKAGE__->mk_accessors(
30             qw(
31             number title type package short_description submitter
32             )
33             );
34              
35             =head1 CONSTRUCTOR
36              
37             =over
38              
39             =item new
40              
41             Constructs new instance of the class. Initial values are to be given as a hash
42             reference.
43              
44             =back
45              
46             =head1 FIELDS
47              
48             =over
49              
50             =item number
51              
52             The unique ID of the big in the BTS.
53              
54             =item title
55              
56             The title of the bug. Usually something like
57              
58             RFP: nice-package -- do nice things easier
59              
60             =item type
61              
62             The type of the WNPP bug. Either of:
63              
64             =over
65              
66             =item RFP
67              
68             request for package
69              
70             =item ITP
71              
72             intent to package
73              
74             =item O
75              
76             orphaned package
77              
78             =item RFH
79              
80             request for help
81              
82             =item RFA
83              
84             request for adoption
85              
86             =item ITA
87              
88             intent to adopt
89              
90             =back
91              
92             =item package
93              
94             Package name
95              
96             =item short_description
97              
98             The short description of the package
99              
100             =item submitter
101              
102             The bug submitter in the form C<< Full Name >>
103              
104             =back
105              
106             =head1 OVERLOADS
107              
108             =over
109              
110             =item ""
111              
112             C object instances stringify via the method L<|as_string>. The
113             default C method returns the bug number.
114              
115             =cut
116              
117 2     2   4359 use overload '""' => \&as_string;
  2         5  
  2         85  
118              
119             =back
120              
121             =head1 METHODS
122              
123             =over
124              
125             =item type_and_number
126              
127             Returns a string representing the bug type and number in the form I
128             #I, e.g. C.
129              
130             =cut
131              
132             sub type_and_number {
133 0     0 1   my $self = shift;
134 0           return $self->type . ' #' . $self->number;
135             }
136              
137             =item as_string
138              
139             Used for the "" overload. Returns the bug number.
140              
141             =cut
142              
143             sub as_string {
144 0     0 1   my $self = shift;
145 0           return $self->number;
146             }
147              
148             =back
149              
150             =head1 AUTHOR
151              
152             =over 4
153              
154             =item Damyan Ivanov
155              
156             =back
157              
158             =head1 COPYRIGHT & LICENSE
159              
160             =over 4
161              
162             =item Copyright (C) 2010 Damyan Ivanov
163              
164             =back
165              
166             This program is free software; you can redistribute it and/or modify it under
167             the terms of the GNU General Public License version 2 as published by the Free
168             Software Foundation.
169              
170             This program is distributed in the hope that it will be useful, but WITHOUT ANY
171             WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
172             PARTICULAR PURPOSE. See the GNU General Public License for more details.
173              
174             You should have received a copy of the GNU General Public License along with
175             this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
176             Street, Fifth Floor, Boston, MA 02110-1301 USA.
177              
178             =cut
179              
180             1;