Commits

Anonymous committed 18f73fd

Importing the module files

Comments (0)

Files changed (11)

modules/App-XML-DocBook-Docmake/Build.PL

+use strict;
+use warnings;
+use Module::Build;
+
+my $builder = Module::Build->new(
+    module_name         => 'App::XML::DocBook::Builder',
+    license             => 'bsd',
+    dist_author         => 'Shlomi Fish <shlomif@cpan.org>',
+    dist_version_from   => 'lib/App/XML/DocBook/Builder.pm',
+    build_requires => {
+        'Test::More' => 0,
+    },
+    add_to_cleanup      => [ 'App::XML::DocBook::Builder-*' ],
+    script_files => [ "bin/docmake" ],
+);
+
+$builder->create_build_script();

modules/App-XML-DocBook-Docmake/Changes

+0.01    Fri Feb 16 17:41:03 IST 2007
+        First version, released on an unsuspecting world.
+

modules/App-XML-DocBook-Docmake/MANIFEST

+bin/docmake
+Build.PL
+Changes
+MANIFEST
+META.yml # Will be created by "make dist"
+README
+lib/App/XML/DocBook/Builder.pm
+t/00-load.t
+t/boilerplate.t
+t/pod-coverage.t
+t/pod.t

modules/App-XML-DocBook-Docmake/META.yml

+---
+name: App-XML-DocBook-Builder
+version: 0.01
+author:
+  - 'Shlomi Fish <shlomif@cpan.org>'
+abstract: Build DocBook/XML files.
+license: bsd
+resources:
+  license: http://www.opensource.org/licenses/bsd-license.php
+build_requires:
+  Test::More: 0
+provides:
+  App::XML::DocBook::Builder:
+    file: lib/App/XML/DocBook/Builder.pm
+    version: 0.01
+generated_by: Module::Build version 0.2805
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.2.html
+  version: 1.2

modules/App-XML-DocBook-Docmake/README

+App::XML::DocBook::Builder
+
+This module can be used to generate makefile templates for building
+DocBook/XML files.
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+    perl Build.PL
+    ./Build
+    ./Build test
+    ./Build install
+
+
+SUPPORT AND DOCUMENTATION
+
+After installing, you can find documentation for this module with the perldoc command.
+
+    perldoc App::DocBook::XML::Builder
+
+You can also look for information at:
+
+    Search CPAN
+        http://search.cpan.org/dist/App::DocBook::XML::Builder
+
+    CPAN Request Tracker:
+        http://rt.cpan.org/NoAuth/Bugs.html?Dist=App::DocBook::XML::Builder
+
+    AnnoCPAN, annotated CPAN documentation:
+        http://annocpan.org/dist/App::DocBook::XML::Builder
+
+    CPAN Ratings:
+        http://cpanratings.perl.org/d/App::DocBook::XML::Builder
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2007 Shlomi Fish
+
+This program is released under the following license: bsd

modules/App-XML-DocBook-Docmake/bin/docmake

+#!/usr/bin/perl
+
+use lib "$ENV{HOME}/apps/docbook-builder/lib/perl5/site_perl/5.8.8/";
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+
+use App::XML::DocBook::Builder;
+
+my $app = App::XML::DocBook::Builder->new();
+
+my $command = shift(@ARGV);
+
+if ($command eq "setup")
+{
+    my $base;
+    GetOptions(
+        'base=s' => \$base,
+    );
+    if (!defined ($base))
+    {
+        die "Usage: docmake setup --base=\$my_doc_base";
+    }
+    $app->initialize_makefiles({doc_base => $base});
+}
+else
+{
+    die "Unknown command!";
+}
+

modules/App-XML-DocBook-Docmake/lib/App/XML/DocBook/Builder.pm

+package App::XML::DocBook::Builder;
+
+use warnings;
+use strict;
+
+use base 'Class::Accessor';
+
+=head1 NAME
+
+App::XML::DocBook::Builder - Build DocBook/XML files.
+
+=head1 VERSION
+
+Version 0.01
+
+=cut
+
+our $VERSION = '0.01';
+
+=head1 SYNOPSIS
+
+    use App::XML::DocBook::Builder;
+
+    my $foo = App::XML::DocBook::Builder->new();
+
+=cut
+
+my $inst_dir = "$ENV{HOME}/apps/docbook-builder";
+
+=head1 FUNCTIONS
+
+=head2 initialize_makefiles($args)
+
+Initialize the makefile in the directory.
+
+Accepts one named argument which is "doc_base" for the document base name.
+
+=cut
+
+sub initialize_makefiles
+{
+    my $self = shift;
+
+    my $args = shift;
+
+    my $redirect_makefile = "docmake.mak";
+
+    open my $docbook_mak, ">", $redirect_makefile or
+        die "Could not open Makefile for writing";
+
+    print $docbook_mak <<"EOF";
+DOCBOOK_MAK_PATH = $inst_dir
+
+DOCBOOK_MAK_MAKEFILES_PATH = \$(DOCBOOK_MAK_PATH)/share/make/
+
+include \$(DOCBOOK_MAK_MAKEFILES_PATH)/main-docbook.mak
+EOF
+
+    close ($docbook_mak);
+
+    open my $main_mak, ">", "Makefile.main";
+    print $main_mak "DOC = " . $args->{doc_base} . "\n\ninclude $redirect_makefile\n\n";
+    close ($main_mak);
+}
+
+=head1 AUTHOR
+
+Shlomi Fish, C<< <shlomif at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to
+C<bug-app-docbook-xml-builder at rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App::XML::DocBook::Builder>.
+I will be notified, and then you'll automatically be notified of progress on
+your bug as I make changes.
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+    perldoc App::XML::DocBook::Builder
+
+You can also look for information at:
+
+=over 4
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/App::XML::DocBook::Builder>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/App::XML::DocBook::Builder>
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=App::XML::DocBook::Builder>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/App::XML::DocBook::Builder>
+
+=back
+
+=head1 ACKNOWLEDGEMENTS
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2007 Shlomi Fish, all rights reserved.
+
+This program is released under the following license: bsd
+
+=cut
+
+1; # End of App::XML::DocBook::Builder

modules/App-XML-DocBook-Docmake/t/00-load.t

+#!perl -T
+
+use Test::More tests => 1;
+
+BEGIN {
+	use_ok( 'App::XML::DocBook::Builder' );
+}
+
+diag( "Testing App::XML::DocBook::Builder $App::XML::DocBook::Builder::VERSION, Perl $], $^X" );

modules/App-XML-DocBook-Docmake/t/boilerplate.t

+#!perl -T
+
+use strict;
+use warnings;
+use Test::More tests => 3;
+
+sub not_in_file_ok {
+    my ($filename, %regex) = @_;
+    open my $fh, "<", $filename
+        or die "couldn't open $filename for reading: $!";
+
+    my %violated;
+
+    while (my $line = <$fh>) {
+        while (my ($desc, $regex) = each %regex) {
+            if ($line =~ $regex) {
+                push @{$violated{$desc}||=[]}, $.;
+            }
+        }
+    }
+
+    if (%violated) {
+        fail("$filename contains boilerplate text");
+        diag "$_ appears on lines @{$violated{$_}}" for keys %violated;
+    } else {
+        pass("$filename contains no boilerplate text");
+    }
+}
+
+not_in_file_ok(README =>
+    "The README is used..."       => qr/The README is used/,
+    "'version information here'"  => qr/to provide version information/,
+);
+
+not_in_file_ok(Changes =>
+    "placeholder date/time"       => qr(Date/time)
+);
+
+sub module_boilerplate_ok {
+    my ($module) = @_;
+    not_in_file_ok($module =>
+        'the great new $MODULENAME'   => qr/ - The great new /,
+        'boilerplate description'     => qr/Quick summary of what the module/,
+        'stub function definition'    => qr/function[12]/,
+    );
+}
+
+module_boilerplate_ok('lib/App/XML/DocBook/Builder.pm');

modules/App-XML-DocBook-Docmake/t/pod-coverage.t

+#!perl -T
+
+use Test::More;
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
+all_pod_coverage_ok();

modules/App-XML-DocBook-Docmake/t/pod.t

+#!perl -T
+
+use Test::More;
+eval "use Test::Pod 1.14";
+plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+all_pod_files_ok();