Modified source files and compiled any and armel versions of packages
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / lib / Perl / Critic / Exception / Configuration / Option / Global / ParameterValue.pm
1 ##############################################################################
2 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/lib/Perl/Critic/Exception/Configuration/Option/Global/ParameterValue.pm $
3 #     $Date: 2008-07-03 10:19:10 -0500 (Thu, 03 Jul 2008) $
4 #   $Author: clonezone $
5 # $Revision: 2489 $
6 ##############################################################################
7
8 package Perl::Critic::Exception::Configuration::Option::Global::ParameterValue;
9
10 use 5.006001;
11 use strict;
12 use warnings;
13
14 use Readonly;
15
16 use Perl::Critic::Utils qw{ :characters };
17
18 our $VERSION = '1.088';
19
20 #-----------------------------------------------------------------------------
21
22 use Exception::Class (
23     'Perl::Critic::Exception::Configuration::Option::Global::ParameterValue' => {
24         isa         => 'Perl::Critic::Exception::Configuration::Option::Global',
25         description => 'A problem with the value of a global parameter.',
26         alias       => 'throw_global_value',
27     },
28 );
29
30 #-----------------------------------------------------------------------------
31
32 Readonly::Array our @EXPORT_OK => qw< throw_global_value >;
33
34 #-----------------------------------------------------------------------------
35
36 sub full_message {
37     my ( $self ) = @_;
38
39     my $source = $self->source();
40     if ($source) {
41         $source = qq{ found in "$source"};
42     }
43     else {
44         $source = $EMPTY;
45     }
46
47     my $option_name = $self->option_name();
48     my $option_value =
49         defined $self->option_value()
50             ? $DQUOTE . $self->option_value() . $DQUOTE
51             : '<undef>';
52     my $message_suffix = $self->message_suffix() || $EMPTY;
53
54     return
55             qq{The value for the global "$option_name" option }
56         .   qq{($option_value)$source $message_suffix};
57 }
58
59
60 1;
61
62 __END__
63
64 #-----------------------------------------------------------------------------
65
66 =pod
67
68 =for stopwords
69
70 =head1 NAME
71
72 Perl::Critic::Exception::Configuration::Option::Global::ParameterValue - A problem with the value of a global parameter.
73
74 =head1 DESCRIPTION
75
76 A representation of a problem found with the value of a global
77 parameter, whether from a F<.perlcriticrc>, another profile file, or
78 command line.
79
80
81 =head1 CLASS METHODS
82
83 =over
84
85 =item C<< throw( option_name => $option_name, option_value => $option_value, source => $source, message_suffix => $message_suffix ) >>
86
87 See L<Exception::Class/"throw">.
88
89
90 =item C<< new( option_name => $option_name, option_value => $option_value, source => $source, message_suffix => $message_suffix ) >>
91
92 See L<Exception::Class/"new">.
93
94
95 =back
96
97
98 =head1 METHODS
99
100 =over
101
102 =item C<full_message()>
103
104 Provide a standard message for global configuration problems.  See
105 L<Exception::Class/"full_message">.
106
107
108 =back
109
110
111 =head1 AUTHOR
112
113 Elliot Shank <perl@galumph.com>
114
115 =head1 COPYRIGHT
116
117 Copyright (c) 2007-2008 Elliot Shank.  All rights reserved.
118
119 This program is free software; you can redistribute it and/or modify
120 it under the same terms as Perl itself.  The full text of this license
121 can be found in the LICENSE file included with this module.
122
123 =cut
124
125 # Local Variables:
126 #   mode: cperl
127 #   cperl-indent-level: 4
128 #   fill-column: 78
129 #   indent-tabs-mode: nil
130 #   c-indentation-style: bsd
131 # End:
132 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :