From: Stevan Little Date: Thu, 13 Apr 2006 00:00:15 +0000 (+0000) Subject: 0_03_02 X-Git-Tag: 0_05~40 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0677220dc4c8246094e010c2036c5c64ef2cab3e;p=gitmo%2FMoose.git 0_03_02 --- diff --git a/Changes b/Changes index 8064b09..1f82770 100644 --- a/Changes +++ b/Changes @@ -1,14 +1,26 @@ Revision history for Perl extension Moose -0.03_02 +0.03_02 Wed. April 12, 2006 * Moose - you must now explictly use Moose::Util::TypeConstraints it no longer gets exported for you automatically * Moose::Object - new() now accepts hash-refs as well as key/value lists + - added does() method to check for Roles + - added tests for this + + * Moose::Meta::Class + - added roles attribute along with the add_role() and + does_role() methods + - added tests for this + + * Moose::Meta::Role + - now adds a does() method to consuming classes + which tests the class's hierarchy for roles + - added tests for this -0.03_01 Mon. March 10, 2006 +0.03_01 Mon. April 10, 2006 * Moose::Cookbook - added new Role recipe (no content yet, only code) diff --git a/README b/README index 0a056a7..3d47cd7 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Moose version 0.03_01 +Moose version 0.03_02 =========================== See the individual module documentation for more information diff --git a/lib/Moose.pm b/lib/Moose.pm index 56525da..ddc0a3d 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -4,7 +4,7 @@ package Moose; use strict; use warnings; -our $VERSION = '0.03_01'; +our $VERSION = '0.03_02'; use Scalar::Util 'blessed', 'reftype'; use Carp 'confess'; @@ -29,8 +29,6 @@ sub import { # we should never export to main return if $pkg eq 'main'; - #Moose::Util::TypeConstraints->import($pkg); - # make a subtype for each Moose class subtype $pkg => as 'Object' diff --git a/lib/Moose/Object.pm b/lib/Moose/Object.pm index 5773a96..c497104 100644 --- a/lib/Moose/Object.pm +++ b/lib/Moose/Object.pm @@ -7,6 +7,8 @@ use metaclass 'Moose::Meta::Class' => ( ':attribute_metaclass' => 'Moose::Meta::Attribute' ); +use Carp 'confess'; + our $VERSION = '0.04'; sub new { @@ -35,7 +37,12 @@ sub DESTROY { goto &DEMOLISHALL } # new does() methods will be created # as approiate see Moose::Meta::Role -sub does { 0 } +sub does { + my (undef, $role_name) = @_; + (defined $role_name) + || confess "You much supply a role name to does()"; + 0; +} 1;