File Coverage

blib/lib/Devel/PerlySense/Config/Project/Default.pm
Criterion Covered Total %
statement 32 32 100.0
branch 1 2 50.0
condition n/a
subroutine 9 9 100.0
pod 1 1 100.0
total 43 44 97.7


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             Devel::PerlySense::Config::Project::Default - A Project's default configuration
4              
5              
6             =head1 DESCRIPTION
7              
8             This is the default config for a project, used whenever a proper
9             .PerlySenseProject with a project.yml couldn't be identified.
10              
11             =cut
12              
13              
14              
15              
16              
17 68     68   249 use strict;
  68         84  
  68         1596  
18 68     68   220 use warnings;
  68         84  
  68         1368  
19 68     68   219 use utf8;
  68         85  
  68         412  
20              
21             package Devel::PerlySense::Config::Project::Default;
22             $Devel::PerlySense::Config::Project::Default::VERSION = '0.0218';
23 68     68   2668 use base "Devel::PerlySense::Config::Project";
  68         82  
  68         321  
24              
25              
26              
27              
28              
29 68     68   1865 use Data::Dumper;
  68         89  
  68         2462  
30 68     68   241 use Carp;
  68         81  
  68         2718  
31 68     68   240 use YAML::Tiny ();
  68         84  
  68         813  
32              
33 68     68   214 use Devel::PerlySense;
  68         78  
  68         350  
34              
35              
36              
37              
38              
39             =head1 METHODS
40              
41             =head2 new()
42              
43             Create new default Config object, with rhConfig set to the default.
44              
45             Return the new object, or die, e.g. if the yaml contains syntax
46             errors.
47              
48             =cut
49             sub new(@) {
50 68     68 1 120 my $pkg = shift;
51              
52 68         419 my $self = $pkg->SUPER::new(@_);
53              
54 68         1131 my $sourceConfig = $self->textConfigDefault;
55 68         393 my ($rhConfig) = eval { YAML::Tiny::Load($sourceConfig) };
  68         240  
56 68 50       170522 $rhConfig or die($YAML::Tiny::errstr);
57              
58 68         2029 $self->rhConfig($rhConfig);
59              
60 68         608 return $self;
61             }
62              
63              
64              
65              
66              
67             1;
68              
69              
70              
71              
72              
73             __END__
74              
75             =encoding utf8
76              
77             =head1 AUTHOR
78              
79             Johan Lindstrom, C<< <johanl@cpan.org> >>
80              
81             =head1 BUGS
82              
83             Please report any bugs or feature requests to
84             C<bug-devel-perlysense@rt.cpan.org>, or through the web interface at
85             L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Devel-PerlySense>.
86             I will be notified, and then you'll automatically be notified of progress on
87             your bug as I make changes.
88              
89             =head1 ACKNOWLEDGEMENTS
90              
91             =head1 COPYRIGHT & LICENSE
92              
93             Copyright 2005 Johan Lindstrom, All Rights Reserved.
94              
95             This program is free software; you can redistribute it and/or modify it
96             under the same terms as Perl itself.
97              
98             =cut