Merge branch 'master' of gitmo@jules.scsys.co.uk:Moose
[gitmo/Moose.git] / lib / Moose.pm
index 1d63788..7b46f53 100644 (file)
@@ -1,12 +1,8 @@
-
 package Moose;
 
-use strict;
-use warnings;
-
 use 5.008;
 
-our $VERSION   = '0.75_01';
+our $VERSION   = '0.82';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -15,7 +11,7 @@ use Carp         'confess';
 
 use Moose::Exporter;
 
-use Class::MOP 0.82_01;
+use Class::MOP 0.87;
 
 use Moose::Meta::Class;
 use Moose::Meta::TypeConstraint;
@@ -70,7 +66,7 @@ sub has {
     my $name  = shift;
 
     Moose->throw_error('Usage: has \'name\' => ( key => value, ... )')
-        if @_ == 1;
+        if @_ % 2 == 1;
 
     my %options = ( definition_context => _caller_info(), @_ );
     my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];
@@ -212,7 +208,7 @@ sub init_meta {
         my $method_meta = $class->meta;
 
         ( blessed($method_meta) && $method_meta->isa('Moose::Meta::Class') )
-            || Moose->throw_error("$class already has a &meta function, but it does not return a Moose::Meta::Class ($meta)");
+            || Moose->throw_error("$class already has a &meta function, but it does not return a Moose::Meta::Class ($method_meta)");
 
         $meta = $method_meta;
     }
@@ -267,6 +263,7 @@ $_->make_immutable(
     Moose::Meta::Role
     Moose::Meta::Role::Method
     Moose::Meta::Role::Method::Required
+    Moose::Meta::Role::Method::Conflicting
 
     Moose::Meta::Role::Composite
 
@@ -440,9 +437,10 @@ is expected to have consumed.
 
 =item I<required =E<gt> (1|0)>
 
-This marks the attribute as being required. This means a I<defined> value must be
-supplied during class construction, and the attribute may never be set to
-C<undef> with an accessor.
+This marks the attribute as being required. This means a value must be
+supplied during class construction, I<or> the attribute must be lazy
+and have either a default or a builder. Note that c<required> does not
+say anything about the attribute's value, which can be C<undef>.
 
 =item I<weak_ref =E<gt> (1|0)>
 
@@ -464,7 +462,7 @@ This is only legal if your C<isa> option is either C<ArrayRef> or C<HashRef>.
 
 The I<trigger> option is a CODE reference which will be called after
 the value of the attribute is set. The CODE ref will be passed the
-instance itself and the updated value. You B<cannot> have a trigger on
+instance itself and the updated value. You B<can> have a trigger on
 a read-only attribute.
 
 B<NOTE:> Triggers will only fire when you B<assign> to the attribute,
@@ -649,6 +647,13 @@ to). See the L<initializer option docs in
 Class::MOP::Attribute|Class::MOP::Attribute/initializer> for more
 information.
 
+=item I<documentation> => $string
+
+An arbitrary string that can be retrieved later by calling C<<
+$attr->documentation >>.
+
+
+
 =back
 
 =item B<has +$name =E<gt> %options>
@@ -698,6 +703,10 @@ Here is another example, but within the context of a role:
 In this case, we are basically taking the attribute which the role supplied
 and altering it within the bounds of this feature.
 
+Note that you can only extend an attribute from either a superclass or a role,
+you cannot extend an attribute in a role that composes over an attribute from
+another role.
+
 Aside from where the attributes come from (one from superclass, the other
 from a role), this feature works exactly the same. This feature is restricted
 somewhat, so as to try and force at least I<some> sanity into it. You are only
@@ -1064,11 +1073,14 @@ interface at L<http://rt.cpan.org>.
 We are very strict about what features we add to the Moose core, especially
 the user-visible features. Instead we have made sure that the underlying
 meta-system of Moose is as extensible as possible so that you can add your
-own features easily. That said, occasionally there is a feature needed in the
-meta-system to support your planned extension, in which case you should
-either email the mailing list or join us on irc at #moose to discuss. The
-L<Moose::Manual::Contributing> has more detail about how and when you can
-contribute.
+own features easily.
+
+That said, occasionally there is a feature needed in the meta-system
+to support your planned extension, in which case you should either
+email the mailing list (moose@perl.org) or join us on IRC at
+L<irc://irc.perl.org/#moose> to discuss. The
+L<Moose::Manual::Contributing> has more detail about how and when you
+can contribute.
 
 =head1 AUTHOR
 
@@ -1133,6 +1145,8 @@ Sam (mugwump) Vilain
 
 Cory (gphat) Watson
 
+Dylan Hardison (doc fixes)
+
 ... and many other #moose folks
 
 =head1 COPYRIGHT AND LICENSE