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   244 use strict;
  68         96  
  68         1546  
18 68     68   211 use warnings;
  68         87  
  68         1292  
19 68     68   214 use utf8;
  68         87  
  68         389  
20              
21             package Devel::PerlySense::Config::Project::Default;
22             $Devel::PerlySense::Config::Project::Default::VERSION = '0.0217';
23 68     68   2613 use base "Devel::PerlySense::Config::Project";
  68         82  
  68         328  
24              
25              
26              
27              
28              
29 68     68   1726 use Data::Dumper;
  68         80  
  68         2418  
30 68     68   231 use Carp;
  68         89  
  68         2610  
31 68     68   229 use YAML::Tiny ();
  68         76  
  68         1132  
32              
33 68     68   212 use Devel::PerlySense;
  68         75  
  68         345  
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 124 my $pkg = shift;
51              
52 68         402 my $self = $pkg->SUPER::new(@_);
53              
54 68         1087 my $sourceConfig = $self->textConfigDefault;
55 68         370 my ($rhConfig) = eval { YAML::Tiny::Load($sourceConfig) };
  68         227  
56 68 50       165099 $rhConfig or die($YAML::Tiny::errstr);
57              
58 68         2015 $self->rhConfig($rhConfig);
59              
60 68         587 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