aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes6
-rw-r--r--MANIFEST14
-rw-r--r--Makefile.PL23
-rw-r--r--README40
-rwxr-xr-xt/SMOKE21
-rw-r--r--t/TEST.PL10
-rw-r--r--t/basic.t21
-rw-r--r--t/conf/extra.conf.in1
-rw-r--r--t/conf/extra.last.conf.in4
-rw-r--r--t/htdocs/foot.html2
-rw-r--r--t/htdocs/head.html2
11 files changed, 144 insertions, 0 deletions
diff --git a/Changes b/Changes
new file mode 100644
index 0000000..aa56ecf
--- /dev/null
+++ b/Changes
@@ -0,0 +1,6 @@
+Revision history for Perl extension Apache::Inject.
+
+0.01 Fri Apr 23 21:28:10 2021
+ - original version; created by h2xs 1.23 with options
+ -AX --skip-exporter --use-new-tests -b 5.8.0 -n Apache::Inject
+
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..f360aed
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,14 @@
+Changes
+lib/Apache/Inject.pm
+lib/Apache/Inject/Handler.pm
+Makefile.PL
+MANIFEST
+README
+t/basic.t
+t/conf/extra.conf.in
+t/conf/extra.last.conf.in
+t/htdocs/foot.html
+t/htdocs/head.html
+t/SMOKE
+t/TEST
+t/TEST.PL
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644
index 0000000..bf6e6f1
--- /dev/null
+++ b/Makefile.PL
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+use 5.008000;
+
+use ExtUtils::MakeMaker;
+
+use lib qw(../blib/lib lib);
+
+use Apache::TestMM qw/test clean/;
+
+Apache::TestMM::filter_args();
+Apache::TestMM::generate_script('t/TEST');
+
+WriteMakefile(
+ NAME => 'Apache::Inject',
+ VERSION_FROM => 'lib/Apache/Inject.pm',
+ PREREQ_PM => { Apache::Test => 0 },
+ ABSTRACT_FROM => 'lib/Apache/Inject.pm',
+ AUTHOR => 'John Ankarström <john@ankarstrom.se>',
+ LICENSE => 'perl',
+ clean => { FILES => "t/TEST" },
+ dist => { PREOP => 'pod2text lib/Apache/Inject.pm > $(DISTVNAME)/README' },
+);
diff --git a/README b/README
new file mode 100644
index 0000000..c93070e
--- /dev/null
+++ b/README
@@ -0,0 +1,40 @@
+Apache-Inject version 0.01
+==========================
+
+The README is used to introduce the module and provide instructions on
+how to install the module, any machine dependencies it may have (for
+example C compilers and installed libraries) and any other information
+that should be provided before the module is installed.
+
+A README file is required for CPAN modules since CPAN extracts the
+README file from a module distribution so that people browsing the
+archive can use it get an idea of the modules uses. It is usually a
+good idea to provide version information here so that people can
+decide whether fixes for the module are worth downloading.
+
+INSTALLATION
+
+To install this module type the following:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+DEPENDENCIES
+
+This module requires these other modules and libraries:
+
+ blah blah blah
+
+COPYRIGHT AND LICENCE
+
+Put the correct copyright and licence information here.
+
+Copyright (C) 2021 by Charlie &
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.32.1 or,
+at your option, any later version of Perl 5 you may have available.
+
+
diff --git a/t/SMOKE b/t/SMOKE
new file mode 100755
index 0000000..7b1d937
--- /dev/null
+++ b/t/SMOKE
@@ -0,0 +1,21 @@
+#!/usr/local/bin/perl
+# WARNING: this file is generated, do not edit
+# generated on Sat Apr 24 00:40:18 2021
+# 01: /usr/local/lib/perl5/site_perl/mach/5.32/Apache/TestConfig.pm:1003
+# 02: /usr/local/lib/perl5/site_perl/mach/5.32/Apache/TestConfig.pm:1095
+# 03: /usr/local/lib/perl5/site_perl/mach/5.32/Apache/TestSmoke.pm:775
+# 04: /usr/local/lib/perl5/site_perl/mach/5.32/Apache/TestMM.pm:143
+# 05: Makefile.PL:12
+
+BEGIN { eval { require blib && blib->import; } }
+
+use strict;
+use warnings FATAL => 'all';
+
+use lib qw(
+ /root/prj/Apache-Inject
+);
+
+
+use Apache::TestSmoke;
+Apache::TestSmoke->new(@ARGV)->run; \ No newline at end of file
diff --git a/t/TEST.PL b/t/TEST.PL
new file mode 100644
index 0000000..6c1c41c
--- /dev/null
+++ b/t/TEST.PL
@@ -0,0 +1,10 @@
+#!perl
+
+use strict;
+use warnings FATAL => 'all';
+
+use lib qw(lib);
+
+use Apache::TestRunPerl ();
+
+Apache::TestRunPerl->new->run(@ARGV);
diff --git a/t/basic.t b/t/basic.t
new file mode 100644
index 0000000..f6e289f
--- /dev/null
+++ b/t/basic.t
@@ -0,0 +1,21 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestUtil;
+use Apache::TestRequest qw/GET_BODY/;
+
+plan tests => 2;
+
+ok 1;
+
+open my $t, '<', 't/htdocs/test.html' or die;
+open my $h, '<', 't/htdocs/head.html' or die;
+open my $f, '<', 't/htdocs/foot.html' or die;
+my $test = do { local $/; <$t> };
+my $head = do { local $/; <$h> };
+my $foot = do { local $/; <$f> };
+close $t; close $h; close $f;
+
+my $body = GET_BODY '/test.html';
+ok $body, "$head$test$foot", 'Body of test.html includes header and footer';
diff --git a/t/conf/extra.conf.in b/t/conf/extra.conf.in
new file mode 100644
index 0000000..fe9de1d
--- /dev/null
+++ b/t/conf/extra.conf.in
@@ -0,0 +1 @@
+PerlSwitches -I@ServerRoot@/../lib
diff --git a/t/conf/extra.last.conf.in b/t/conf/extra.last.conf.in
new file mode 100644
index 0000000..0156023
--- /dev/null
+++ b/t/conf/extra.last.conf.in
@@ -0,0 +1,4 @@
+PerlLoadModule Apache::Inject
+<FilesMatch ".*\.html">
+ Inject head.html foot.html
+</FilesMatch>
diff --git a/t/htdocs/foot.html b/t/htdocs/foot.html
new file mode 100644
index 0000000..77ef8be
--- /dev/null
+++ b/t/htdocs/foot.html
@@ -0,0 +1,2 @@
+<hr/>
+<p>Copyright &copy; Site Owner</p>
diff --git a/t/htdocs/head.html b/t/htdocs/head.html
new file mode 100644
index 0000000..b4abf3f
--- /dev/null
+++ b/t/htdocs/head.html
@@ -0,0 +1,2 @@
+<h1>Site Header</h1>
+<hr/>