X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=tool%2Fgenerate-mouse-tiny.pl;h=045387d05e9a5e2f335c720ac6fbab986fb77e10;hp=508f7efbc10599135333479759eef6e8db8f9317;hb=47c73874c0f53fc133dc692896877b9e936ecae8;hpb=e229d5a947fa3a6becf4a53c368a5429868d4728 diff --git a/tool/generate-mouse-tiny.pl b/tool/generate-mouse-tiny.pl index 508f7ef..045387d 100644 --- a/tool/generate-mouse-tiny.pl +++ b/tool/generate-mouse-tiny.pl @@ -32,6 +32,7 @@ find({ && /\.pm$/ && !/Squirrel/ && !/Tiny/ + && !/Test/ # only for testing && !/Spec/ # has no functionality && !/TypeRegistry/ # deprecated && !/\bouse/ # ouse.pm @@ -54,6 +55,8 @@ for my $file (uniq $contents =~ s/__END__\b.*//s; # remove documentation $contents =~ s/1;\n*$//; # remove success indicator + $contents =~ s{^( (?:[ ]{4})+ )}{ "\t" x (length($1) / 4) }xmsge; # spaces to tabs + $mouse_tiny .= "BEGIN{ # $file\n"; $mouse_tiny .= $contents; $mouse_tiny .= "}\n"; @@ -71,7 +74,7 @@ EOF print { $handle } << 'EOF'; # if regular Mouse is loaded, bail out unless ($INC{'Mouse.pm'}) { - # tell Perl we already have all of the Mouse files loaded: +# tell Perl we already have all of the Mouse files loaded: EOF for my $file (@files) { @@ -93,32 +96,14 @@ END_OF_TINY } # unless Mouse.pm is loaded EOF -print { $handle } << 'EOF'; +print { $handle } << "EOF"; package Mouse::Tiny; +our \$VERSION = '$Mouse::Spec::VERSION'; + Mouse::Exporter->setup_import_methods(also => 'Mouse'); 1; -__END__ - -=head1 NAME - -Mouse::Tiny - Mouse in a single file - -=head1 DESCRIPTION - -Mouse::Tiny is Mouse, but it is in a single file. - -This is B tiny. In fact, it requires a little more memory and time than Mouse. - -Use Mouse directly unless you know what you are doing. - -=head1 SEE ALSO - -L - -=cut - EOF close $handle;