1 ##############################################################################
2 # $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/lib/Perl/Critic/ThemeListing.pm $
3 # $Date: 2008-07-03 10:19:10 -0500 (Thu, 03 Jul 2008) $
6 ##############################################################################
8 package Perl::Critic::ThemeListing;
14 use English qw<-no_match_vars>;
16 use Perl::Critic::Utils qw< hashify >;
18 use overload ( q<""> => 'to_string' );
20 our $VERSION = '1.088';
22 #-----------------------------------------------------------------------------
25 my ($class, %args) = @_;
27 my $self = bless {}, $class;
29 $self->{_policies} = $args{-policies} || [];
34 #-----------------------------------------------------------------------------
40 foreach my $policy ( @{ $self->{_policies} } ) {
41 my @themes = $policy->get_themes();
42 @themes{ @themes } = @themes;
45 return join ("\n", sort keys %themes) . "\n";
48 #-----------------------------------------------------------------------------
58 Perl::Critic::ThemeListing - List the themes of the installed Policies.
63 This is a helper class that gathers the themes of the installed
64 Policies. There are no user-serviceable parts here.
71 =item C<< new( -policies => \@POLICY_OBJECTS ) >>
73 Returns a reference to a new C<Perl::Critic::ThemeListing> object.
86 Returns a string representation of this C<ThemeListing>. See
87 L<"OVERLOADS"> for more information.
96 When a L<Perl::Critic::ThemeListing> is evaluated in string context,
97 it produces a one-line summary of the default severity, policy name,
98 and default themes for each L<Perl::Critic::Policy> object that was
99 given to the constructor of this C<ThemeListing>.
104 Jeffrey Ryan Thalhammer <thaljef@cpan.org>
109 Copyright (c) 2005-2008 Jeffrey Ryan Thalhammer. All rights reserved.
111 This program is free software; you can redistribute it and/or modify
112 it under the same terms as Perl itself. The full text of this license
113 can be found in the LICENSE file included with this module.
119 # cperl-indent-level: 4
121 # indent-tabs-mode: nil
122 # c-indentation-style: bsd
124 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :