Get rid of safe_can_nodie
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 8 Feb 2015 12:45:10 +0000 (14:45 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 8 Feb 2015 12:45:10 +0000 (14:45 +0200)
lib/Gruntmaster/Daemon.pm

index 880c0da..4f3360c 100644 (file)
@@ -35,19 +35,13 @@ use constant FORMAT_EXTENSION => {
 
 my $db;
 
-sub safe_can_nodie {
+sub safe_can {
        my ($type, $sub, $name) = @_;
 
        return unless $name =~ /^\w+$/s;
        my $pkg = __PACKAGE__ . "::${type}::${name}";
        eval "require $pkg" or get_logger->warn("Error while requiring $pkg: $@");
-       $pkg->can($sub);
-}
-
-sub safe_can {
-       my ($type, $sub, $name) = @_;
-
-       safe_can_nodie @_ or get_logger->logdie("No such \l$type: '$name'");
+       $pkg->can($sub) or get_logger->logdie("No such \l$type: '$name'");
 }
 
 sub process{
This page took 0.027684 seconds and 4 git commands to generate.