X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=author%2Fgenerate-mouse-tiny.pl;h=e2925438d54f02fa848610434e01f41a9132616b;hb=448fbe3285470e2885ab4e105044fa84bdc9e078;hp=30777cc29e59e58173791076fcd4d9492818e89f;hpb=44b31b54069a41e4dc4d724c98b1fdfa61bd0a48;p=gitmo%2FMouse.git diff --git a/author/generate-mouse-tiny.pl b/author/generate-mouse-tiny.pl index 30777cc..e292543 100755 --- a/author/generate-mouse-tiny.pl +++ b/author/generate-mouse-tiny.pl @@ -10,7 +10,13 @@ unlink 'lib/Mouse/Tiny.pm'; my @files; find({ - wanted => sub { push @files, $_ if -f $_ && !/Squirrel|\.sw[po]$/ }, + wanted => sub { + push @files, $_ + if -f $_ + && !/Squirrel/ + && !/\bouse/ + && !/\.sw[po]$/ + }, no_chdir => 1, }, 'lib'); @@ -21,7 +27,6 @@ for my $file (uniq 'lib/Mouse/Util.pm', sort @files) { $contents =~ s/__END__\b.*//s; # remove documentation $contents =~ s/1;\n*$//; # remove success indicator - $contents =~ s/^.*\n//; # remove shebang $contents =~ s/^use Mouse\S*\s*\n//mg; # we're already loading everything $contents =~ s/^use (Mouse\S*)\s*(.+);/BEGIN { $1->import($2) }/mg; @@ -32,12 +37,11 @@ for my $file (uniq 'lib/Mouse/Util.pm', sort @files) { open my $handle, '>lib/Mouse/Tiny.pm' or die "Can't write lib/Mouse/Tiny.pm: $!"; print { $handle } << 'EOF'; -#!/usr/bin/env perl # THIS FILE IS AUTOGENERATED! # if regular Mouse is loaded, bail out unless ($INC{'Mouse.pm'}) { -eval q{ +eval <<'END_OF_TINY'; # tell Perl we already have all of the Mouse files loaded: EOF @@ -51,7 +55,7 @@ print { $handle } "\n# and now their contents\n\n"; print { $handle } $mouse_tiny; -print { $handle } "}; #eval\n} #unless\n\n"; +print { $handle } "END_OF_TINY\n} #unless\n\n"; print { $handle } << 'EOF'; package Mouse::Tiny;