From c31030ef7016095dc80446fcda267e2a4590abeb Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 23 Jul 2017 13:46:27 +0100 Subject: [PATCH] fixes because Dancer docs are a mess! --- lib/App/Netdisco/Core/Plugin.pm | 7 ++++--- lib/App/Netdisco/Manual/Configuration.pod | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/App/Netdisco/Core/Plugin.pm b/lib/App/Netdisco/Core/Plugin.pm index 380bf803..0789c24b 100644 --- a/lib/App/Netdisco/Core/Plugin.pm +++ b/lib/App/Netdisco/Core/Plugin.pm @@ -2,12 +2,12 @@ package App::Netdisco::Core::Plugin; use Dancer ':syntax'; use Dancer::Plugin; -use Dancer::Hook; +use Dancer::Factory::Hook; use App::Netdisco::Util::Permission qw/check_acl_no check_acl_only/; use Try::Tiny; -Dancer::Hook->instance->register_hooks_name( +Dancer::Factory::Hook->instance->install_hooks( map {("before_$_", $_, "after_$_")} @{ setting('core_phases') } ); @@ -24,7 +24,7 @@ register 'register_core_action' => sub { return error "bad param to register_core_action" unless ref sub {} eq ref $code and ref {} eq ref $args and exists $args->{action} - and Dancer::Hook->hook_is_registered($args->{action}); + and Dancer::Factory::Hook->instance->hook_is_registered($args->{action}); my $no = $args->{no}; my $only = $args->{only}; @@ -44,6 +44,7 @@ register 'register_core_action' => sub { return ($happy ? ($args->{final} ? 1 : 0) : -1); }; + # NOTE: using Dancer::Factory::Hook internals if ($args->{final} and $args->{action} !~ m/^(?:before|after)_/) { unshift @{$store->hooks->{ $args->{action} }}, $hook; } diff --git a/lib/App/Netdisco/Manual/Configuration.pod b/lib/App/Netdisco/Manual/Configuration.pod index 82298662..7dbd4d5b 100644 --- a/lib/App/Netdisco/Manual/Configuration.pod +++ b/lib/App/Netdisco/Manual/Configuration.pod @@ -801,7 +801,7 @@ transport or driver documentation pages for further details. For example: community: public - tag: sshcollector only: 'group:sshcollectordevices' - driver: cli + driver: cli method: arpnip_nodes username: foo password: bar