[Bps-public-commit] rt-onlinedocs branch, master, updated. 0.10-13-gf73dcd1
Kevin Falcone
falcone at bestpractical.com
Thu Oct 27 11:44:28 EDT 2011
The branch, master has been updated
via f73dcd11791cfcaaeb5f0657664fc5836870436a (commit)
from 03bf1b8e80910d6c53e61d8dfcd39c67045fd375 (commit)
Summary of changes:
inc/Module/Install/ReadmeFromPod.pm | 48 +++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
create mode 100644 inc/Module/Install/ReadmeFromPod.pm
- Log -----------------------------------------------------------------
commit f73dcd11791cfcaaeb5f0657664fc5836870436a
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Thu Oct 27 11:44:26 2011 -0400
ship the readme from pod shenanigans
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
new file mode 100644
index 0000000..348531e
--- /dev/null
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -0,0 +1,48 @@
+#line 1
+package Module::Install::ReadmeFromPod;
+
+use 5.006;
+use strict;
+use warnings;
+use base qw(Module::Install::Base);
+use vars qw($VERSION);
+
+$VERSION = '0.12';
+
+sub readme_from {
+ my $self = shift;
+ return unless $self->is_admin;
+
+ my $file = shift || $self->_all_from
+ or die "Can't determine file to make readme_from";
+ my $clean = shift;
+
+ print "Writing README from $file\n";
+
+ require Pod::Text;
+ my $parser = Pod::Text->new();
+ open README, '> README' or die "$!\n";
+ $parser->output_fh( *README );
+ $parser->parse_file( $file );
+ if ($clean) {
+ $self->clean_files('README');
+ }
+ return 1;
+}
+
+sub _all_from {
+ my $self = shift;
+ return unless $self->admin->{extensions};
+ my ($metadata) = grep {
+ ref($_) eq 'Module::Install::Metadata';
+ } @{$self->admin->{extensions}};
+ return unless $metadata;
+ return $metadata->{values}{all_from} || '';
+}
+
+'Readme!';
+
+__END__
+
+#line 112
+
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list