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
30 use inc::Module::Install;
33 all_from 'lib/MyApp.pm';
35 requires 'Catalyst::Runtime' => '5.7014';
37 catalyst_ignore('.*temp');
38 catalyst_ignore('.*tmp');
44 L<Module::Install> extension for Catalyst.
50 Calls L<catalyst_files>. Should be the last catalyst*
51 command called in C<Makefile.PL>.
58 if($Module::Install::AUTHOR) {
59 $self->include("File::Copy::Recursive");
63 *** Module::Install::Catalyst
65 $self->catalyst_files;
67 *** Module::Install::Catalyst finished.
73 Collect a list of all files a Catalyst application consists of and copy it
74 inside the blib/lib/ directory. Files and directories that match the modules
75 ignore list are excluded (see L<catalyst_ignore> and L<catalyst_ignore_all>).
86 CATFILES: for my $name ( readdir CATDIR ) {
87 for my $ignore (@IGNORE) {
88 next CATFILES if $name =~ /^$ignore$/;
89 next CATFILES if $name !~ /\w/;
94 my @path = split '-', $self->name;
95 for my $orig (@files) {
96 my $path = File::Spec->catdir( 'blib', 'lib', @path, $orig );
97 File::Copy::Recursive::rcopy( $orig, $path );
101 =head2 catalyst_ignore_all(\@ignore)
103 This function replaces the built-in default ignore list with the given list.
107 sub catalyst_ignore_all {
108 my ( $self, $ignore ) = @_;
112 =head2 catalyst_ignore(@ignore)
114 Add a regexp to the list of ignored patterns. Can be called multiple times.
118 sub catalyst_ignore {
119 my ( $self, @ignore ) = @_;
120 push @IGNORE, @ignore;
125 Catalyst Contributors, see Catalyst.pm
129 This library is free software. You can redistribute it and/or modify it under
130 the same terms as Perl itself.