_concrete_methods_of must return only methods, not any globslot
[gitmo/Role-Tiny.git] / lib / Role / Tiny.pm
index 9a3ce29..b076c8e 100644 (file)
@@ -6,7 +6,7 @@ sub _getstash { \%{"$_[0]::"} }
 use strict;
 use warnings FATAL => 'all';
 
-our $VERSION = '1.002004'; # 1.2.4
+our $VERSION = '1.002005'; # 1.2.5
 $VERSION = eval $VERSION;
 
 our %INFO;
@@ -267,7 +267,7 @@ sub _concrete_methods_of {
     map {
       my $code = *{$stash->{$_}}{CODE};
       # rely on the '' key we added in import for "no code here"
-      exists $not_methods->{$code||''} ? () : ($_ => $code)
+      ( ! $code or exists $not_methods->{$code||''} ) ? () : ($_ => $code)
     } grep !ref($stash->{$_}), keys %$stash
   };
 }
@@ -314,8 +314,17 @@ sub _install_modifiers {
   }
 }
 
+my $vcheck_error;
+
 sub _install_single_modifier {
   my ($me, @args) = @_;
+  defined($vcheck_error) or $vcheck_error = do {
+    local $@;
+    eval { Class::Method::Modifiers->VERSION(1.05); 1 }
+      ? 0
+      : $@
+  };
+  $vcheck_error and die $vcheck_error;
   Class::Method::Modifiers::install_modifier(@args);
 }
 
@@ -355,6 +364,8 @@ sub does_role {
 
 1;
 
+=encoding utf-8
+
 =head1 NAME
 
 Role::Tiny - Roles. Like a nouvelle cuisine portion size slice of Moose.