From: Graham Knop Date: Tue, 27 Aug 2013 18:23:14 +0000 (-0400) Subject: use _composite_name from new Role::Tiny to generate class names X-Git-Tag: v1.003001~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMoo.git;a=commitdiff_plain;h=3b9f74a1ceb5a602066d33a1a6d9ab8125139499 use _composite_name from new Role::Tiny to generate class names This will abbreviate package names that are too long for perl, and allows the name generation to be changed in the future. --- diff --git a/Changes b/Changes index 9e6c1bf..63fe0f6 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - abbreviate class names from created by create_class_with_roles if they are + too long for perl to handle (RT#83248) - prevent destructors from failing in global destruction for certain combinations of Moo and Moose classes subclassing each other (RT#87810) - clarify in docs that Sub::Quote's captured variables are copies, not aliases diff --git a/Makefile.PL b/Makefile.PL index 1ac927a..b594635 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -21,7 +21,7 @@ my %RUN_DEPS = ( 'Class::Method::Modifiers' => 1.10, # or RT#80194 'strictures' => 1.004003, 'Module::Runtime' => 0.012, # for RT#74789 - 'Role::Tiny' => 1.003000, + 'Role::Tiny' => 1.003002, 'Devel::GlobalDestruction' => 0.11, # for RT#78617 'Dist::CheckConflicts' => 0.02, ); diff --git a/lib/Moo/Role.pm b/lib/Moo/Role.pm index edbbdc8..1c42d74 100644 --- a/lib/Moo/Role.pm +++ b/lib/Moo/Role.pm @@ -240,9 +240,7 @@ sub apply_single_role_to_package { sub create_class_with_roles { my ($me, $superclass, @roles) = @_; - my $new_name = join( - '__WITH__', $superclass, my $compose_name = join '__AND__', @roles - ); + my ($new_name, $compose_name) = $me->_composite_name($superclass, @roles); return $new_name if $Role::Tiny::COMPOSED{class}{$new_name};