From f6b6d595958154c4e1c0a588d36bf09e6a0c6a09 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Fri, 31 Jul 2020 01:19:31 -0500 Subject: [Command Tags] Make startup and shutdown calls to all modules --- app/lib/command_tag/processor.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/lib/command_tag/processor.rb') diff --git a/app/lib/command_tag/processor.rb b/app/lib/command_tag/processor.rb index cb447f851..414c08638 100644 --- a/app/lib/command_tag/processor.rb +++ b/app/lib/command_tag/processor.rb @@ -49,7 +49,7 @@ class CommandTag::Processor reset_status_caches - initialize_handlers! + all_handlers!(:startup) parse_statements @@ -79,13 +79,14 @@ class CommandTag::Processor end execute_statements(:at_end) + all_handlers!(:shutdown) reset_status_caches end private - def initialize_handlers! - self.class.instance_methods.grep(/\Ainitialize_\w+!\z/).each do |name| + def all_handlers!(affix) + self.class.instance_methods.grep(/\Ahandle_\w+_#{affix}\z/).each do |name| public_send(name) end end -- cgit