Skip to content
Browse files

Generate pod with Build.PL

  • Loading branch information...
1 parent f72ced6 commit 92591cc9a2b6d54bd296f3bcf7da81926d06b923 @dann committed
Showing with 61 additions and 20 deletions.
  1. +24 −2 Build.PL
  2. +37 −15 README
  3. +0 −3 README.pod
View
26 Build.PL
@@ -2,7 +2,27 @@ use strict;
use warnings FATAL => 'all';
use Module::Build;
-my $build = Module::Build->new(
+my $class = Module::Build->subclass(
+ class => 'My::Builder',
+ code => q{
+ sub ACTION_docs {
+ use Pod::Readme;
+ use Pod::Select;
+
+ my $self = shift;
+
+ podselect({ -output => 'README.pod' },
+ 'lib/Test/Perl/Metrics/Lite.pm');
+
+ my $parser = Pod::Readme->new();
+ $parser->parse_from_file('README.pod', 'README');
+
+ return $self->SUPER::ACTION_docs;
+ }
+ }
+);
+
+my $build = $class->new(
name => 'Test-Perl-Metrics-Lite',
module_name => 'Test::Perl::Metrics::Lite',
dist_author => 'Dann',
@@ -26,7 +46,9 @@ my $build = Module::Build->new(
create_readme => 1,
create_license => 1,
meta_merge => {
- resources => { 'repository' => 'http://github.com/dann/p5-test-perl-metrics-lite', }
+ resources => {
+ 'repository' => 'http://github.com/dann/p5-test-perl-metrics-lite'
+ }
},
);
$build->create_build_script();
View
52 README
@@ -1,27 +1,49 @@
-This is Perl module Test::Perl::Metrics::Lite.
+NAME
+ Test::Perl::Metrics::Lite - Use Perl::Metrics::Lite in test programs
-INSTALLATION
+SYNOPSIS
+ Basic usage.
-Test::Perl::Metrics::Lite installation is straightforward. If your CPAN shell is set up,
-you should just be able to do
+ use Test::Perl::Metrics::Lite;
+ all_metrics_ok();
- % cpan Test::Perl::Metrics::Lite
+ You can change the metrics threshold.
-Download it, unpack it, then build it as per the usual:
+ use Test::Perl::Metrics::Lite (-mccabe_complexity => 20, -loc => 100);
+ all_metrics_ok();
- % perl Makefile.PL
- % make && make test
+ Exclude some files with except_file option
-Then install it:
+ use Test::Perl::Metrics::Lite (
+ -except_file => [
+ 'lib/SomeClass.pm',
+ 'lib/SomeDir/SomeClass.pm'
+ ]
+ );
+ all_metrics_ok();
- % make install
+DESCRIPTION
+ Test::Perl::Metrics::Lite wraps the Perl::Metrics::Lite engine in a
+ convenient subroutine suitable for test programs written using the
+ Test::More framework
-DOCUMENTATION
+ This makes it easy to integrate metrics enforcement into the build
+ process.
-Test::Perl::Metrics::Lite documentation is available as in POD. So you can do:
+ Mccabe complexity theshold is 10 and the lines of code theshold is 60.
+ all_metrics_ok() test is failed when metrics exceed threshold values
+ relative to the baseline.
- % perldoc Test::Perl::Metrics::Lite
+SOURCE AVAILABILITY
+ This source is in Github:
-to read the documentation online with your favorite pager.
+ http://github.com/dann/p5-test-perl-metrics-lite
+
+AUTHOR
+ Dann <techmemo@gmail.com>
+
+SEE ALSO
+LICENSE
+ This library is free software; you can redistribute it and/or modify it
+ under the same terms as Perl itself.
-Dann
View
3 README.pod
@@ -57,6 +57,3 @@ Dann E<lt>techmemo@gmail.comE<gt>
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-
-=cut
-

0 comments on commit 92591cc

Please sign in to comment.
Something went wrong with that request. Please try again.