about summary refs log tree commit diff
path: root/app/lib/command_tag/processor.rb
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-07-31 01:19:31 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:16 -0500
commitf6b6d595958154c4e1c0a588d36bf09e6a0c6a09 (patch)
tree557d82a880aa24dde3e5e50570a85e380a3060a2 /app/lib/command_tag/processor.rb
parentf8d23f70b9e5658b109a0180881fb272fccc28ca (diff)
[Command Tags] Make startup and shutdown calls to all modules
Diffstat (limited to 'app/lib/command_tag/processor.rb')
-rw-r--r--app/lib/command_tag/processor.rb7
1 files changed, 4 insertions, 3 deletions
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