Merge branch 'topic/support_all'
Dave Rolsky [Thu, 22 Dec 2011 23:42:47 +0000 (17:42 -0600)]
Changes
lib/MooseX/Types/Combine.pm
t/18_combined_libs.t

diff --git a/Changes b/Changes
index b87a79c..2f376e2 100644 (file)
--- 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)
index 73e1e20..43aa79f 100644 (file)
@@ -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}) {
index 6ef2191..976d924 100644 (file)
@@ -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();