Import upstream version 0.02+git20120307.1.3bb9810
Debian Janitor
2 years ago
0 | ||
1 | 0 | This is the Perl distribution MasonX-ProcessDir. |
2 | 1 | |
3 | 2 | Installing MasonX-ProcessDir is straightforward. |
8 | 7 | |
9 | 8 | % cpanm MasonX::ProcessDir |
10 | 9 | |
11 | If you are installing into a system-wide directory, you may need to pass the | |
12 | "-S" flag to cpanm, which uses sudo to install the module: | |
13 | ||
14 | % cpanm -S MasonX::ProcessDir | |
10 | If it does not have permission to install modules to the current perl, cpanm | |
11 | will automatically set up and install to a local::lib in your home directory. | |
12 | See the local::lib documentation (https://metacpan.org/pod/local::lib) for | |
13 | details on enabling it in your environment. | |
15 | 14 | |
16 | 15 | ## Installing with the CPAN shell |
17 | 16 | |
22 | 21 | ## Manual installation |
23 | 22 | |
24 | 23 | As a last resort, you can manually install it. Download the tarball, untar it, |
25 | then build it: | |
24 | install configure prerequisites (see below), then build it: | |
26 | 25 | |
27 | 26 | % perl Makefile.PL |
28 | 27 | % make && make test |
31 | 30 | |
32 | 31 | % make install |
33 | 32 | |
34 | If you are installing into a system-wide directory, you may need to run: | |
33 | On Windows platforms, you should use `dmake` or `nmake`, instead of `make`. | |
35 | 34 | |
36 | % sudo make install | |
35 | If your perl is system-managed, you can create a local::lib in your home | |
36 | directory to install modules to. For details, see the local::lib documentation: | |
37 | https://metacpan.org/pod/local::lib | |
38 | ||
39 | The prerequisites of this distribution will also have to be installed manually. The | |
40 | prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated | |
41 | by running the manual build process described above. | |
42 | ||
43 | ## Configure Prerequisites | |
44 | ||
45 | This distribution requires other modules to be installed before this | |
46 | distribution's installer can be run. They can be found under the | |
47 | "configure_requires" key of META.yml or the | |
48 | "{prereqs}{configure}{requires}" key of META.json. | |
49 | ||
50 | ## Other Prerequisites | |
51 | ||
52 | This distribution may require additional modules to be installed after running | |
53 | Makefile.PL. | |
54 | Look for prerequisites in the following phases: | |
55 | ||
56 | * to run make, PHASE = build | |
57 | * to use the module code itself, PHASE = runtime | |
58 | * to run tests, PHASE = test | |
59 | ||
60 | They can all be found in the "PHASE_requires" key of MYMETA.yml or the | |
61 | "{prereqs}{PHASE}{requires}" key of MYMETA.json. | |
37 | 62 | |
38 | 63 | ## Documentation |
39 | 64 | |
40 | 65 | MasonX-ProcessDir documentation is available as POD. |
41 | You can run perldoc from a shell to read the documentation: | |
66 | You can run `perldoc` from a shell to read the documentation: | |
42 | 67 | |
43 | 68 | % perldoc MasonX::ProcessDir |
69 | ||
70 | For more information on installing Perl modules via CPAN, please see: | |
71 | https://www.cpan.org/modules/INSTALL.html |
17 | 17 | |
18 | 18 | The GNU General Public License, Version 1, February 1989 |
19 | 19 | |
20 | GNU GENERAL PUBLIC LICENSE | |
21 | Version 1, February 1989 | |
20 | GNU GENERAL PUBLIC LICENSE | |
21 | Version 1, February 1989 | |
22 | 22 | |
23 | 23 | Copyright (C) 1989 Free Software Foundation, Inc. |
24 | 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA | |
24 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
25 | ||
25 | 26 | Everyone is permitted to copy and distribute verbatim copies |
26 | 27 | of this license document, but changing it is not allowed. |
27 | 28 | |
28 | Preamble | |
29 | Preamble | |
29 | 30 | |
30 | 31 | The license agreements of most software companies try to keep users |
31 | 32 | at the mercy of those companies. By contrast, our General Public |
66 | 67 | The precise terms and conditions for copying, distribution and |
67 | 68 | modification follow. |
68 | 69 | |
69 | GNU GENERAL PUBLIC LICENSE | |
70 | GNU GENERAL PUBLIC LICENSE | |
70 | 71 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
71 | 72 | |
72 | 73 | 0. This License Agreement applies to any program or other work which |
184 | 185 | of preserving the free status of all derivatives of our free software and |
185 | 186 | of promoting the sharing and reuse of software generally. |
186 | 187 | |
187 | NO WARRANTY | |
188 | NO WARRANTY | |
188 | 189 | |
189 | 190 | 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
190 | 191 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
206 | 207 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
207 | 208 | POSSIBILITY OF SUCH DAMAGES. |
208 | 209 | |
209 | END OF TERMS AND CONDITIONS | |
210 | ||
211 | Appendix: How to Apply These Terms to Your New Programs | |
210 | END OF TERMS AND CONDITIONS | |
211 | ||
212 | Appendix: How to Apply These Terms to Your New Programs | |
212 | 213 | |
213 | 214 | If you develop a new program, and you want it to be of the greatest |
214 | 215 | possible use to humanity, the best way to achieve this is to make it |
234 | 235 | GNU General Public License for more details. |
235 | 236 | |
236 | 237 | You should have received a copy of the GNU General Public License |
237 | along with this program; if not, write to the Free Software Foundation, | |
238 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | |
238 | along with this program; if not, write to the Free Software | |
239 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA | |
240 | ||
239 | 241 | |
240 | 242 | Also add information on how to contact you by electronic and paper mail. |
241 | 243 |
0 | # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.017. | |
0 | 1 | Changes |
1 | 2 | INSTALL |
2 | 3 | LICENSE |
3 | 3 | "Jonathan Swartz <swartz@pobox.com>" |
4 | 4 | ], |
5 | 5 | "dynamic_config" : 0, |
6 | "generated_by" : "Dist::Zilla version 4.200008, CPAN::Meta::Converter version 2.113640", | |
6 | "generated_by" : "Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010", | |
7 | 7 | "license" : [ |
8 | 8 | "perl_5" |
9 | 9 | ], |
15 | 15 | "prereqs" : { |
16 | 16 | "configure" : { |
17 | 17 | "requires" : { |
18 | "ExtUtils::MakeMaker" : "6.30" | |
18 | "ExtUtils::MakeMaker" : "0" | |
19 | 19 | } |
20 | 20 | }, |
21 | 21 | "runtime" : { |
26 | 26 | }, |
27 | 27 | "test" : { |
28 | 28 | "requires" : { |
29 | "Test::More" : 0 | |
29 | "Test::More" : "0" | |
30 | 30 | } |
31 | 31 | } |
32 | 32 | }, |
42 | 42 | "web" : "https://github.com/jonswar/perl-masonx-processdir" |
43 | 43 | } |
44 | 44 | }, |
45 | "version" : "0.02" | |
45 | "version" : "0.02", | |
46 | "x_generated_by_perl" : "v5.32.1", | |
47 | "x_serialization_backend" : "JSON::XS version 4.03", | |
48 | "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" | |
46 | 49 | } |
47 | 50 |
2 | 2 | author: |
3 | 3 | - 'Jonathan Swartz <swartz@pobox.com>' |
4 | 4 | build_requires: |
5 | Test::More: 0 | |
5 | Test::More: '0' | |
6 | 6 | configure_requires: |
7 | ExtUtils::MakeMaker: 6.30 | |
7 | ExtUtils::MakeMaker: '0' | |
8 | 8 | dynamic_config: 0 |
9 | generated_by: 'Dist::Zilla version 4.200008, CPAN::Meta::Converter version 2.113640' | |
9 | generated_by: 'Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010' | |
10 | 10 | license: perl |
11 | 11 | meta-spec: |
12 | 12 | url: http://module-build.sourceforge.net/META-spec-v1.4.html |
13 | version: 1.4 | |
13 | version: '1.4' | |
14 | 14 | name: MasonX-ProcessDir |
15 | 15 | requires: |
16 | Any::Template::ProcessDir: 0.04 | |
17 | Mason: 2.10 | |
16 | Any::Template::ProcessDir: '0.04' | |
17 | Mason: '2.10' | |
18 | 18 | resources: |
19 | 19 | bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=MasonX-ProcessDir |
20 | 20 | repository: git://github.com/jonswar/perl-masonx-processdir.git |
21 | version: 0.02 | |
21 | version: '0.02' | |
22 | x_generated_by_perl: v5.32.1 | |
23 | x_serialization_backend: 'YAML::Tiny version 1.73' | |
24 | x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' |
0 | ||
0 | # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.017. | |
1 | 1 | use strict; |
2 | 2 | use warnings; |
3 | 3 | |
4 | 4 | |
5 | 5 | |
6 | use ExtUtils::MakeMaker 6.30; | |
7 | ||
8 | ||
6 | use ExtUtils::MakeMaker; | |
9 | 7 | |
10 | 8 | my %WriteMakefileArgs = ( |
11 | 'ABSTRACT' => 'Process a directory of Mason templates', | |
12 | 'AUTHOR' => 'Jonathan Swartz <swartz@pobox.com>', | |
13 | 'BUILD_REQUIRES' => { | |
14 | 'Test::More' => '0' | |
9 | "ABSTRACT" => "Process a directory of Mason templates", | |
10 | "AUTHOR" => "Jonathan Swartz <swartz\@pobox.com>", | |
11 | "CONFIGURE_REQUIRES" => { | |
12 | "ExtUtils::MakeMaker" => 0 | |
15 | 13 | }, |
16 | 'CONFIGURE_REQUIRES' => { | |
17 | 'ExtUtils::MakeMaker' => '6.30' | |
14 | "DISTNAME" => "MasonX-ProcessDir", | |
15 | "LICENSE" => "perl", | |
16 | "NAME" => "MasonX::ProcessDir", | |
17 | "PREREQ_PM" => { | |
18 | "Any::Template::ProcessDir" => "0.04", | |
19 | "Mason" => "2.10" | |
18 | 20 | }, |
19 | 'DISTNAME' => 'MasonX-ProcessDir', | |
20 | 'EXE_FILES' => [], | |
21 | 'LICENSE' => 'perl', | |
22 | 'NAME' => 'MasonX::ProcessDir', | |
23 | 'PREREQ_PM' => { | |
24 | 'Any::Template::ProcessDir' => '0.04', | |
25 | 'Mason' => '2.10' | |
21 | "TEST_REQUIRES" => { | |
22 | "Test::More" => 0 | |
26 | 23 | }, |
27 | 'VERSION' => '0.02', | |
28 | 'test' => { | |
29 | 'TESTS' => 't/*.t' | |
24 | "VERSION" => "0.02", | |
25 | "test" => { | |
26 | "TESTS" => "t/*.t" | |
30 | 27 | } |
31 | 28 | ); |
32 | 29 | |
33 | 30 | |
34 | unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { | |
35 | my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; | |
36 | my $pp = $WriteMakefileArgs{PREREQ_PM}; | |
37 | for my $mod ( keys %$br ) { | |
38 | if ( exists $pp->{$mod} ) { | |
39 | $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; | |
40 | } | |
41 | else { | |
42 | $pp->{$mod} = $br->{$mod}; | |
43 | } | |
44 | } | |
31 | my %FallbackPrereqs = ( | |
32 | "Any::Template::ProcessDir" => "0.04", | |
33 | "Mason" => "2.10", | |
34 | "Test::More" => 0 | |
35 | ); | |
36 | ||
37 | ||
38 | unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { | |
39 | delete $WriteMakefileArgs{TEST_REQUIRES}; | |
40 | delete $WriteMakefileArgs{BUILD_REQUIRES}; | |
41 | $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; | |
45 | 42 | } |
46 | 43 | |
47 | 44 | delete $WriteMakefileArgs{CONFIGURE_REQUIRES} |
48 | 45 | unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; |
49 | 46 | |
50 | 47 | WriteMakefile(%WriteMakefileArgs); |
51 | ||
52 | ||
53 |
0 | NAME | |
1 | MasonX::ProcessDir - Process a directory of Mason 2 templates | |
2 | ||
3 | VERSION | |
4 | version 0.02 | |
5 | ||
6 | SYNOPSIS | |
7 | use MasonX::ProcessDir; | |
8 | ||
9 | # Generate result files in the same directory as the templates | |
10 | # | |
11 | my $pd = MasonX::ProcessDir->new( | |
12 | dir => '/path/to/dir' | |
13 | ); | |
14 | $pd->process_dir(); | |
15 | ||
16 | # Generate result files in a separate directory | |
17 | # | |
18 | my $pd = MasonX::ProcessDir->new( | |
19 | source_dir => '/path/to/source/dir', | |
20 | dest_dir => '/path/to/dest/dir' | |
21 | ); | |
22 | $pd->process_dir(); | |
23 | ||
24 | DESCRIPTION | |
25 | Recursively processes a directory of Mason 2 templates, generating a set | |
26 | of result files in the same directory or in a parallel directory. | |
27 | ||
28 | Every file with suffix ".mc" will be processed, and the results placed | |
29 | in a file of the same name without the suffix. ".mi", autobase and | |
30 | dhandler files will be used by Mason when processing the templates but | |
31 | will not generate files themselves. | |
32 | ||
33 | For example, if the source directory contains | |
34 | ||
35 | Base.mc | |
36 | httpd.conf.mc | |
37 | proxy.conf.mc | |
38 | etc/crontab.mc | |
39 | blah.mi | |
40 | somefile.txt | |
41 | ||
42 | and we run | |
43 | ||
44 | my $pd = MasonX::ProcessDir->new( | |
45 | source_dir => '/path/to/source/dir', | |
46 | dest_dir => '/path/to/dest/dir' | |
47 | ); | |
48 | $pd->process_dir(); | |
49 | ||
50 | then afterwards the destination directory will contain files | |
51 | ||
52 | httpd.conf | |
53 | proxy.conf | |
54 | etc/crontab | |
55 | somefile.txt | |
56 | ||
57 | where *foo* and *bar* are the results of processing *foo.mc* and | |
58 | *bar.mc* through Mason. *Base.mc* and *blah.mi* may be used during Mason | |
59 | processing but won't generate result files themselves. | |
60 | ||
61 | This class is a convenience extension of Any::Template::ProcessDir. | |
62 | ||
63 | CONSTRUCTOR | |
64 | Specifying directory/directories | |
65 | * If you want to generate the result files in the same directory as | |
66 | the templates, just specify *dir*. | |
67 | ||
68 | my $pd = MasonX::ProcessDir->new( | |
69 | dir => '/path/to/dir', | |
70 | ... | |
71 | ); | |
72 | ||
73 | * If you want to generate the result files in a separate directory | |
74 | from the templates, specify *source_dir* and *dest_dir*. | |
75 | ||
76 | my $pd = MasonX::ProcessDir->new( | |
77 | source_dir => '/path/to/source/dir', | |
78 | source_dir => '/path/to/dest/dir', | |
79 | ... | |
80 | ); | |
81 | ||
82 | Mason options | |
83 | mason_options | |
84 | An optional hash of options to the Mason interpreter. For example, | |
85 | the default Mason data directory will be ".mason" under the source | |
86 | directory, but you can override this: | |
87 | ||
88 | mason_options => { data_dir => '/path/to/data/dir' } | |
89 | ||
90 | Options inherited from Any::Template::ProcessDir | |
91 | See Any::Template::ProcessDir for other options, such as | |
92 | ||
93 | dir_create_mode | |
94 | file_create_mode | |
95 | readme_filename | |
96 | ||
97 | SUPPORT AND DOCUMENTATION | |
98 | Bugs and feature requests will be tracked at RT: | |
99 | ||
100 | http://rt.cpan.org/NoAuth/Bugs.html?Dist=MasonX-ProcessDir | |
101 | bug-masonx-processdir@rt.cpan.org | |
102 | ||
103 | The latest source code can be browsed and fetched at: | |
104 | ||
105 | http://github.com/jonswar/perl-masonx-processdir | |
106 | git clone git://github.com/jonswar/perl-masonx-processdir.git | |
107 | ||
108 | SEE ALSO | |
109 | Mason, Any::Template::ProcessDir | |
110 | ||
111 | AUTHOR | |
112 | Jonathan Swartz <swartz@pobox.com> | |
113 | ||
114 | COPYRIGHT AND LICENSE | |
115 | This software is copyright (c) 2011 by Jonathan Swartz. | |
116 | ||
117 | This is free software; you can redistribute it and/or modify it under | |
118 | the same terms as the Perl 5 programming language system itself. | |
119 |
0 | 0 | package MasonX::ProcessDir; |
1 | BEGIN { | |
2 | $MasonX::ProcessDir::VERSION = '0.02'; | |
3 | } | |
1 | $MasonX::ProcessDir::VERSION = '0.02'; | |
4 | 2 | use Mason; |
5 | 3 | use Moose; |
6 | 4 | use strict; |
35 | 33 | |
36 | 34 | 1; |
37 | 35 | |
38 | ||
36 | __END__ | |
39 | 37 | |
40 | 38 | =pod |
41 | 39 | |
186 | 184 | the same terms as the Perl 5 programming language system itself. |
187 | 185 | |
188 | 186 | =cut |
189 | ||
190 | ||
191 | __END__ | |
192 |