1 package Module::Install::Catalyst;
5 use base qw/ Module::Install::Base /;
7 require Module::Install::Base;
11 use File::Copy::Recursive;
19 qw/Build Build.PL Changes MANIFEST META.yml Makefile.PL Makefile README
20 _build blib lib script t inc .*\.svn \.git _darcs \.bzr \.hg
21 debian build-stamp install-stamp configure-stamp/;
25 Module::Install::Catalyst - Module::Install extension for Catalyst
29 use inc::Module::Install;
32 all_from 'lib/MyApp.pm';
34 requires 'Catalyst::Runtime' => '5.7014';
36 catalyst_ignore('.*temp');
37 catalyst_ignore('.*tmp');
43 L<Module::Install> extension for Catalyst.
49 Calls L<catalyst_files>. Should be the last catalyst*
50 command called in C<Makefile.PL>.
57 if($Module::Install::AUTHOR) {
58 $self->include("File::Copy::Recursive");
62 *** Module::Install::Catalyst
64 $self->catalyst_files;
66 *** Module::Install::Catalyst finished.
72 Collect a list of all files a Catalyst application consists of and copy it
73 inside the blib/lib/ directory. Files and directories that match the modules
74 ignore list are excluded (see L<catalyst_ignore> and L<catalyst_ignore_all>).
85 CATFILES: for my $name ( readdir CATDIR ) {
86 for my $ignore (@IGNORE) {
87 next CATFILES if $name =~ /^$ignore$/;
88 next CATFILES if $name !~ /\w/;
93 my @path = split '-', $self->name;
94 for my $orig (@files) {
95 my $path = File::Spec->catdir( 'blib', 'lib', @path, $orig );
96 File::Copy::Recursive::rcopy( $orig, $path );
100 =head2 catalyst_ignore_all(\@ignore)
102 This function replaces the built-in default ignore list with the given list.
106 sub catalyst_ignore_all {
107 my ( $self, $ignore ) = @_;
111 =head2 catalyst_ignore(@ignore)
113 Add a regexp to the list of ignored patterns. Can be called multiple times.
117 sub catalyst_ignore {
118 my ( $self, @ignore ) = @_;
119 push @IGNORE, @ignore;
124 Catalyst Contributors, see Catalyst.pm
128 This library is free software. You can redistribute it and/or modify it under
129 the same terms as Perl itself.