From: Dave Rolsky Date: Thu, 22 Dec 2011 23:42:47 +0000 (-0600) Subject: Merge branch 'topic/support_all' X-Git-Tag: v0.31~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ff3c51e80bdbf4845fd4dd3e6413199b2fe2e5e;hp=1c88af05065911d576e498d100d1d136f2391d96;p=gitmo%2FMooseX-Types.git Merge branch 'topic/support_all' --- diff --git a/Changes b/Changes index b87a79c..2f376e2 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for MooseX-Types {{$NEXT}} + - Add support for qw( :all ) on MooseX::Types::Combine libraries. (kentnl) 0.30 2011-09-17 - Fix a bug in the tests that caused failures with Moose HEAD. (doy) diff --git a/lib/MooseX/Types/Combine.pm b/lib/MooseX/Types/Combine.pm index 73e1e20..43aa79f 100644 --- a/lib/MooseX/Types/Combine.pm +++ b/lib/MooseX/Types/Combine.pm @@ -33,6 +33,12 @@ sub import { my %types = $class->_provided_types; + if ( grep { $_ eq ':all' } @types ) { + $_->import( { -into => $caller }, q{:all} ) + for $class->provide_types_from; + return; + } + my %from; for my $type (@types) { unless ($types{$type}) { diff --git a/t/18_combined_libs.t b/t/18_combined_libs.t index 6ef2191..976d924 100644 --- a/t/18_combined_libs.t +++ b/t/18_combined_libs.t @@ -36,4 +36,6 @@ qr/\Qmain asked for a type (NonExistentType) which is not found in any of the ty 'cannot combine types from a package which does not exist'; } +is exception { 'Combined'->import(':all') }, undef, ':all syntax works'; + done_testing();