From: gfx Date: Sun, 12 Sep 2010 06:22:46 +0000 (+0900) Subject: Docs and comments X-Git-Tag: 0.69~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4bef84ef7f1835abdcab5c23f9a74446349749d8;p=gitmo%2FMouse.git Docs and comments --- diff --git a/lib/Mouse.pm b/lib/Mouse.pm index 61cf607..fbbbe0f 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -195,20 +195,21 @@ This document describes Mouse version 0.68 =head1 DESCRIPTION -L is wonderful. B +L is a postmodern object system for Perl5. Moose is wonderful. Unfortunately, Moose has a compile-time penalty. Though significant progress has been made over the years, the compile time penalty is a non-starter for some very specific applications. If you are writing a command-line application or CGI script where startup time is essential, you may not be able to use -Moose. We recommend that you instead use L and FastCGI for the -latter, if possible. +Moose. We recommend that you instead use persistent Perl executing environments +like C for the latter, if possible. -Mouse aims to alleviate this by providing a subset of Moose's functionality, -faster. +Mouse is a Moose compatible object system, which aims to alleviate this by +providing a subset of Moose's functionality. We're also going as light on dependencies as possible. Mouse currently has -B except for testing modules. +B except for testing modules. Mouse also works without XS, +although it has an XS backend to make it much faster. =head2 MOOSE COMPATIBILITY @@ -218,7 +219,7 @@ The Mouse code just runs the test suite 4x faster. The idea is that, if you need the extra power, you should be able to run C on your codebase and have nothing break. To that end, -we have written L which will act as Mouse unless Moose is loaded, +we have written L which will act as Mouse unless Moose is loaded, in which case it will act as Moose. Since Mouse is a little sloppier than Moose, if you run into weird errors, it would be worth running: diff --git a/lib/Mouse/Exporter.pm b/lib/Mouse/Exporter.pm index 98f7eca..14372ab 100644 --- a/lib/Mouse/Exporter.pm +++ b/lib/Mouse/Exporter.pm @@ -169,7 +169,8 @@ sub do_import { } } - $^H |= $strict_bits; # strict->import; + # strict->import; + $^H |= $strict_bits; # warnings->import('all', FATAL => 'recursion'); ${^WARNING_BITS} |= $warnings::Bits{all}; ${^WARNING_BITS} |= $warnings_extra_bits; diff --git a/lib/Mouse/PurePerl.pm b/lib/Mouse/PurePerl.pm index be3635a..ac94947 100644 --- a/lib/Mouse/PurePerl.pm +++ b/lib/Mouse/PurePerl.pm @@ -1,16 +1,14 @@ package Mouse::PurePerl; - -require Mouse::Util; - +# The pure Perl backend for Mouse package Mouse::Util; - use strict; use warnings; - -use warnings FATAL => 'redefine'; # to avoid to load Mouse::PurePerl +use warnings FATAL => 'redefine'; # to avoid to load Mouse::PurePerl twice use B (); +require Mouse::Util; + # taken from Class/MOP.pm sub is_valid_class_name { diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index 75e2ba5..a41de59 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -48,21 +48,18 @@ BEGIN{ }, ); - - # Because Mouse::Util is loaded first in all the Mouse sub-modules, - # XS loader is placed here, not in Mouse.pm. - our $VERSION = '0.68'; my $xs = !(exists $INC{'Mouse/PurePerl.pm'} || $ENV{MOUSE_PUREPERL} || $ENV{PERL_ONLY}); + # Because Mouse::Util is loaded first in all the Mouse sub-modules, + # XSLoader must be placed here, not in Mouse.pm. if($xs){ # XXX: XSLoader tries to get the object path from caller's file name # $hack_mouse_file fools its mechanism - (my $hack_mouse_file = __FILE__) =~ s/.Util//; # .../Mouse/Util.pm -> .../Mouse.pm $xs = eval sprintf("#line %d %s\n", __LINE__, $hack_mouse_file) . q{ - local $^W = 0; # work around 'redefine' warning to &install_subroutines + local $^W = 0; # workaround 'redefine' warning to &install_subroutines require XSLoader; XSLoader::load('Mouse', $VERSION); Mouse::Util->import({ into => 'Mouse::Meta::Method::Constructor::XS' }, ':meta'); @@ -156,7 +153,7 @@ BEGIN { { package # hide from PAUSE Class::C3; - our %MRO; # work around 'once' warnings + our %MRO; # avoid 'once' warnings } # MRO::Compat::__get_linear_isa has no prototype, so diff --git a/xt/002-pod_spell.t b/xt/002-pod_spell.t index 52900a8..66b3888 100644 --- a/xt/002-pod_spell.t +++ b/xt/002-pod_spell.t @@ -271,6 +271,7 @@ newfound reimplements reinitializes specializer +backend ## misspelt on purpose emali