Subject: | [PATCH] Documentation clarification re: Moose::Error::* |
This patch documents an ordering issue that took me 3 hours of work to
figure out existed, as discussed with perigrin on irc.perl.org/#moose
about 4 hours ago.
(Reversing the statements in the SYNOPSIS in the patches will not work,
as most likely, the metaclass is created by the time the "use metaclass"
statement is executed, and cannot change its parameters.)
Subject: | Moose-Error-documentation.patch |
diff -r -u Moose-0.88/lib/Moose/Error/Confess.pm Moose-0.88/lib/Moose/Error/Confess.pm
--- Moose-0.88/lib/Moose/Error/Confess.pm 2009-07-24 10:47:41.000000000 -0600
+++ Moose-0.88/lib/Moose/Error/Confess.pm 2009-08-13 15:29:16.015625000 -0600
@@ -21,10 +21,13 @@
=head1 SYNOPSIS
- use metaclass => (
- metaclass => "Moose::Meta::Class",
- error_class => "Moose::Error::Confess",
+ # Metaclass definition must come before Moose is used.
+ use metaclass (
+ metaclass => 'Moose::Meta::Class',
+ error_class => 'Moose::Error::Confess',
);
+ use Moose;
+ # ...
=head1 DESCRIPTION
diff -r -u Moose-0.88/lib/Moose/Error/Croak.pm Moose-0.88/lib/Moose/Error/Croak.pm
--- Moose-0.88/lib/Moose/Error/Croak.pm 2009-07-24 10:47:41.000000000 -0600
+++ Moose-0.88/lib/Moose/Error/Croak.pm 2009-08-13 15:29:04.390625000 -0600
@@ -26,10 +26,13 @@
=head1 SYNOPSIS
- use metaclass => (
- metaclass => "Moose::Meta::Class",
- error_class => "Moose::Error::Croak",
+ # Metaclass definition must come before Moose is used.
+ use metaclass (
+ metaclass => 'Moose::Meta::Class',
+ error_class => 'Moose::Error::Croak',
);
+ use Moose;
+ # ...
=head1 DESCRIPTION