X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FSpec.pm;h=56fd8b78028d39f2e3c69c91efe90137e457f6b8;hb=983d58a5ea543a21c48cb04311883f1b36de1874;hp=f9af436b5bacb8151da829fa9ece14cdcc224b70;hpb=fc44e30e64cdf372dbbc22ad3f7f3a477eef5c51;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Spec.pm b/lib/Mouse/Spec.pm index f9af436..56fd8b7 100644 --- a/lib/Mouse/Spec.pm +++ b/lib/Mouse/Spec.pm @@ -2,13 +2,159 @@ package Mouse::Spec; use strict; use warnings; -our $VERSION = '0.37_04'; +our $VERSION = '0.94'; our $MouseVersion = $VERSION; -our $MooseVersion = '0.90'; +our $MooseVersion = '1.13'; sub MouseVersion{ $MouseVersion } sub MooseVersion{ $MooseVersion } 1; __END__ + +=head1 NAME + +Mouse::Spec - To what extent Mouse is compatible with Moose + +=head1 VERSION + +This document describes Mouse version 0.94 + +=head1 SYNOPSIS + + use Mouse::Spec; + + printf "Mouse/%s is compatible with Moose/%s\n", + Mouse::Spec->MouseVersion, Mouse::Spec->MooseVersion; + +=head1 DESCRIPTION + +Mouse is a subset of Moose. This document describes to what extend Mouse is +compatible (and incompatible) with Moose. + +=head2 Compatibility with Moose + +=head3 Sugary APIs + +The sugary APIs are highly compatible with Moose. Methods which have the +same name as Moose's are expected to be compatible with Moose's. + +=head3 Meta object protocols + +Meta object protocols are a subset of the counterpart of Moose. +Their methods which have the same name as Moose's are expected to be +compatible with Moose's. Feel free to use these methods even if they +are not documented. + +However, there are differences between Moose's MOP and Mouse's. +For example, meta object protocols in Mouse have no attributes by default, +so C<< $metaclass->meta->make_immutable() >> will not work as you expect. +B. + +=head3 Mouse::Meta::Instance + +Meta instance mechanism is not implemented, so you cannot change the reftype +of Mouse objects in the same way as Moose. + +=head3 Role exclusion + +Role exclusion, C, is not implemented. + +=head3 -metaclass in Mouse::Exporter + +C<< use Mouse -metaclass => ... >> are not implemented. +Use C<< use Mouse -traits => ... >> instead. + +=head3 Mouse::Meta::Attribute::Native + +Native traits are not supported directly, but C is +available on CPAN. Once you have installed it, you can use it as the same way +in Moose. That is, native traits are automatically loaded by Mouse. + +See L for details. + +=head2 Notes about Moose::Cookbook + +Many recipes in L fit L, including: + +=over 4 + +=item * + +L - The (always classic) B example + +=item * + +L - A simple B example + +=item * + +L - A lazy B example + +=item * + +L - Subtypes, and modeling a simple B class hierarchy + +=item * + +L - More subtypes, coercion in a B class + +=item * + +L - The augment/inner example + +=item * + +L - Making Moose fast with immutable + +=item * + +L - Builder methods and lazy_build + +=item * + +L - Operator overloading, subtypes, and coercion + +=item * + +L - Using BUILDARGS and BUILD to hook into object construction + +=item * + +L - The Moose::Role example + +=item * + +L - Advanced Role Composition - method exclusion and aliasing + +=item * + +L - Applying a role to an object instance + +=item * + +L - A meta-attribute, attributes with labels + +=item * + +L - Labels implemented via attribute traits + +=item * + +L - Providing an alternate base object class + +=back + +=head1 SEE ALSO + +L + +L + +L + +L + +=cut +