Commits

Toby Inkster committed 144c9ad Draft

pass hints for around sub{...}=>sub{...}

Comments (0)

Files changed (2)

lib/MooseX/RoleQR.pm

 
 BEGIN {
 	$MooseX::RoleQR::AUTHORITY = 'cpan:TOBYINK';
-	$MooseX::RoleQR::VERSION   = '0.002';
+	$MooseX::RoleQR::VERSION   = '0.003';
 }
 
 use Moose ();
 	BEGIN {
 		no warnings;
 		our $AUTHORITY = 'cpan:TOBYINK';
-		our $VERSION   = '0.002';
+		our $VERSION   = '0.003';
 	};
 
 	has [qw/ expression body /] => (is => 'ro', required => 1);
 #	sub _matches_name
 	sub matches_name
 	{
-		my ($meta, $name) = @_;
+		my ($meta, $name, $hints) = @_;
 		my $expr = $meta->expression;
-		return $name =~ $expr if does($expr, REGEXP);
-		return $expr->($name) if does($expr, CODE);  # ssh... secret!
+		return $name =~ $expr                if does($expr, REGEXP);
+		return $expr->($name, @{$hints||[]}) if does($expr, CODE);  # ssh... secret!
 		return;
 	}
 };
 	BEGIN {
 		no warnings;
 		our $AUTHORITY = 'cpan:TOBYINK';
-		our $VERSION   = '0.002';
+		our $VERSION   = '0.003';
 	};
 
 	has deferred_modifier_class => (
 		
 		next if $type eq 'override';
 		*{"get_deferred_${type}_method_modifiers"} = sub {
-			my ($meta, $name) = @_;
-			grep { $_->matches_name($name) } @{ $meta->$attr };
+			my ($meta, $name, $hints) = @_;
+			grep { $_->matches_name($name, $hints) } @{ $meta->$attr };
 		};
 	}
 	
 	BEGIN {
 		no warnings;
 		our $AUTHORITY = 'cpan:TOBYINK';
-		our $VERSION   = '0.002';
+		our $VERSION   = '0.003';
 	};
 
 	after apply => sub {
 	BEGIN {
 		no warnings;
 		our $AUTHORITY = 'cpan:TOBYINK';
-		our $VERSION   = '0.002';
+		our $VERSION   = '0.003';
 	};
 
 	before apply => sub {
 			ROLE: for my $r (@roles)
 			{
 				next ROLE unless $r->can($get);
-				MODIFIER: for ($r->$get($method))
+				MODIFIER: for ($r->$get($method, \@_))
 				{
 #					warn "@{[$role->name]} modifying @{[$class->name]} method $method";
 					$class->$add($method, $_->body);
 	BEGIN {
 		no warnings;
 		our $AUTHORITY = 'cpan:TOBYINK';
-		our $VERSION   = '0.002';
+		our $VERSION   = '0.003';
 	};
 
 	before apply => sub {

meta/changes.pret

 		item "Bundle an 'examples' dir."^^Packaging;
 	].
 
+`MooseX-RoleQR 0.003 cpan:TOBYINK`
+	issued  2012-10-19;
+	label   "changelog redacted".
+