From: Stevan Little Date: Thu, 3 Jul 2008 17:04:22 +0000 (+0000) Subject: 0.52 X-Git-Tag: 0_55~57 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=68b6146c1c7074aea0737301d7dfa00b1ffeebf1;p=gitmo%2FMoose.git 0.52 --- diff --git a/Changes b/Changes index 2b9e81d..f21b520 100644 --- a/Changes +++ b/Changes @@ -1,14 +1,6 @@ Revision history for Perl extension Moose -0.52 - * Moose::Meta::Attribute - - added legal_options_for_inheritance (wreis) - - * Moose::Cookbook::Snacks::* - - removed some of the unfinished snacks that should - not have been released yet. Added some more examples - and explanation to the 'Keywords' snack. (stevan) - +0.52 Thurs. July 3, 2008 * Moose - added "FEATURE REQUESTS" section to the Moose docs to properly direct people (stevan) (RT #34333) @@ -17,6 +9,20 @@ Revision history for Perl extension Moose (fixed by stevan, found by obra) - added tests for this (stevan) + * Moose::Object + - adding support for DOES (as in UNIVERSAL::DOES) + (nothingmuch) + - added test for this + + * Moose::Meta::Attribute + - added legal_options_for_inheritance (wreis) + - added tests for this (wreis) + + * Moose::Cookbook::Snacks::* + - removed some of the unfinished snacks that should + not have been released yet. Added some more examples + to the 'Keywords' snack. (stevan) + * Moose::Cookbook::Style - added general Moose "style guide" of sorts to the cookbook (nothingmuch) (RT #34335) diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index d276d58..b807ce8 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -18,4 +18,5 @@ cover_db ^TODO$ ^PLANS$ ^benchmarks -^\._.*$ \ No newline at end of file +^\._.*$ +^t\/600_todo_tests\/$ \ No newline at end of file diff --git a/lib/Moose.pm b/lib/Moose.pm index 035168e..38df3c2 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -1026,6 +1026,8 @@ Yuval (nothingmuch) Kogman Chris (perigrin) Prather +Wallace (wreis) Reis + Jonathan (jrockway) Rockway Piotr (dexter) Roszatycki @@ -1034,8 +1036,6 @@ Sam (mugwump) Vilain Shawn (sartak) Moore -Wallace (wreis) Reis - ... and many other #moose folks =head1 COPYRIGHT AND LICENSE diff --git a/lib/Moose/Object.pm b/lib/Moose/Object.pm index 2c52c1d..9b931d0 100644 --- a/lib/Moose/Object.pm +++ b/lib/Moose/Object.pm @@ -22,16 +22,17 @@ sub new { sub BUILDARGS { my $class = shift; - if (scalar @_ == 1) { if (defined $_[0]) { (ref($_[0]) eq 'HASH') || confess "Single parameters to new() must be a HASH ref"; return {%{$_[0]}}; - } else { + } + else { return {}; # FIXME this is compat behavior, but is it correct? } - } else { + } + else { return {@_}; } } @@ -72,12 +73,15 @@ sub DESTROY { $_[0]->DEMOLISHALL; } +# support for UNIVERSAL::DOES ... sub DOES { my ( $self, $class_or_role_name ) = @_; - - $self->SUPER::DOES($class_or_role_name) - or - $self->does($class_or_role_name); + if (my $DOES = __PACKAGE__->meta->find_next_method_by_name('DOES')) { + return $DOES->body->($self, $class_or_role_name) + || $self->does($class_or_role_name); + } + return $self->isa($class_or_role_name) + || $self->does($class_or_role_name); } # new does() methods will be created diff --git a/t/600_todo_tests/002_various_role_shit.t b/t/600_todo_tests/002_various_role_shit.t index ea17eff..9f227ca 100644 --- a/t/600_todo_tests/002_various_role_shit.t +++ b/t/600_todo_tests/002_various_role_shit.t @@ -10,7 +10,10 @@ sub req_or_has ($$) { my ( $role, $method ) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; if ( $role ) { - ok( $role->has_method($method) || $role->requires_method($method), $role->name . " has or requires method $method" ); + ok( + $role->has_method($method) || $role->requires_method($method), + $role->name . " has or requires method $method" + ); } else { fail("role has or requires method $method"); } diff --git a/t/100_bugs/015_immutable_n_around.t b/t/600_todo_tests/003_immutable_n_around.t similarity index 100% rename from t/100_bugs/015_immutable_n_around.t rename to t/600_todo_tests/003_immutable_n_around.t diff --git a/t/300_immutable/010_inlined_constructor_modified_new.t b/t/600_todo_tests/004_inlined_constructor_modified_new.t similarity index 100% rename from t/300_immutable/010_inlined_constructor_modified_new.t rename to t/600_todo_tests/004_inlined_constructor_modified_new.t diff --git a/t/600_todo_tests/005_moose_and_threads.t b/t/600_todo_tests/005_moose_and_threads.t new file mode 100644 index 0000000..4c77671 --- /dev/null +++ b/t/600_todo_tests/005_moose_and_threads.t @@ -0,0 +1,46 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More no_plan => 1; +use Test::Exception; + +BEGIN { + use_ok('Moose'); +} + +=pod + +See this for some details: + +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476579 + +Here is the basic test case, it segfaults, so I am going +to leave it commented out. Basically it seems that there +is some bad interaction between the ??{} construct that +is used in the "parser" for type definitions and threading +so probably the fix would involve removing the ??{} usage +for something else. + +use threads; + +{ + package Foo; + use Moose; + has "bar" => (is => 'rw', isa => "Str | Num"); +} + +my $thr = threads->create(sub {}); +$thr->join(); + +=cut + +{ + local $TODO = 'This is just a stub for the test, see the POD'; + fail('Moose type constraints and threads dont get along'); +} + + + +