use Mouse::Exporter; # enables strict and warnings
-our $VERSION = '0.37_06';
+our $VERSION = '0.40_09';
use Carp qw(confess);
use Scalar::Util qw(blessed);
],
);
-# XXX: for backward compatibility
-our @EXPORT = qw(
- extends with
- has
- before after around
- override super
- augment inner
- blessed confess
-);
-sub extends { Mouse::Meta::Class->initialize(scalar caller)->superclasses(@_) }
+sub extends {
+ Mouse::Meta::Class->initialize(scalar caller)->superclasses(@_);
+ return;
+}
+
+sub with {
+ Mouse::Util::apply_all_roles(scalar(caller), @_);
+ return;
+}
sub has {
my $meta = Mouse::Meta::Class->initialize(scalar caller);
my $name = shift;
- $meta->throw_error(q{Usage: has 'name' => ( key => value, ... )})\r
+ $meta->throw_error(q{Usage: has 'name' => ( key => value, ... )})
if @_ % 2; # odd number of arguments
- $meta->add_attribute($_ => @_) for ref($name) ? @{$name} : $name;
+ if(ref $name){ # has [qw(foo bar)] => (...)
+ for (@{$name}){
+ $meta->add_attribute($_ => @_);
+ }
+ }
+ else{ # has foo => (...)
+ $meta->add_attribute($name => @_);
+ }
+ return;
}
sub before {
for (@_) {
$meta->add_before_method_modifier($_ => $code);
}
+ return;
}
sub after {
for (@_) {
$meta->add_after_method_modifier($_ => $code);
}
+ return;
}
sub around {
for (@_) {
$meta->add_around_method_modifier($_ => $code);
}
-}
-
-sub with {
- Mouse::Util::apply_all_roles(scalar(caller), @_);
+ return;
}
our $SUPER_PACKAGE;
sub augment {
#my($name, $method) = @_;
Mouse::Meta::Class->initialize(scalar caller)->add_augment_method_modifier(@_);
+ return;
}
sub init_meta {
=head1 VERSION
-This document describes Mouse version 0.37_06
+This document describes Mouse version 0.40_09
=head1 SYNOPSIS
Mouse aims to alleviate this by providing a subset of Moose's functionality,
faster.
-We're also going as light on dependencies as possible.
-L<Class::Method::Modifiers::Fast> or L<Class::Method::Modifiers> is required
-if you want support for L</before>, L</after>, and L</around>.
+We're also going as light on dependencies as possible. Mouse currently has
+B<no dependencies> except for testing modules.
=head2 MOOSE COMPATIBILITY
to see if the bug is caused by Mouse. Moose's diagnostics and validation are
also much better.
+See also L<Mouse::Spec> for compatibility and incompatibility with Moose.
+
=head2 MouseX
Please don't copy MooseX code to MouseX. If you need extensions, you really
=head2 C<< before (method|methods) => CodeRef >>
-Installs a "before" method modifier. See L<Moose/before> or
-L<Class::Method::Modifiers/before>.
-
-Use of this feature requires L<Class::Method::Modifiers>!
+Installs a "before" method modifier. See L<Moose/before>.
=head2 C<< after (method|methods) => CodeRef >>
-Installs an "after" method modifier. See L<Moose/after> or
-L<Class::Method::Modifiers/after>.
-
-Use of this feature requires L<Class::Method::Modifiers>!
-
+Installs an "after" method modifier. See L<Moose/after>.
=head2 C<< around (method|methods) => CodeRef >>
-Installs an "around" method modifier. See L<Moose/around> or
-L<Class::Method::Modifiers/around>.
-
-Use of this feature requires L<Class::Method::Modifiers>!
-
+Installs an "around" method modifier. See L<Moose/around>.
=head2 C<< has (name|names) => parameters >>
Adds an attribute (or if passed an arrayref of names, multiple attributes) to
We have a public git repository:
- git clone git://jules.scsys.co.uk/gitmo/Mouse.git
+ git clone git://git.moose.perl.org/Mouse.git
=head1 DEPENDENCIES
=head1 SEE ALSO
+L<Mouse::Spec>
+
L<Moose>
+L<Moose::Manual>
+
+L<Moose::Cookbook>
+
L<Class::MOP>
=head1 AUTHORS
-Shawn M Moore, E<lt>sartak at gmail.comE<gt>
+Shawn M Moore E<lt>sartak at gmail.comE<gt>
-Yuval Kogman, E<lt>nothingmuch at woobling.orgE<gt>
+Yuval Kogman E<lt>nothingmuch at woobling.orgE<gt>
tokuhirom