about summary refs log tree commit diff
path: root/app/lib/command_tag/commands.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/command_tag/commands.rb')
-rw-r--r--app/lib/command_tag/commands.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/lib/command_tag/commands.rb b/app/lib/command_tag/commands.rb
index f27486427..068c8bb66 100644
--- a/app/lib/command_tag/commands.rb
+++ b/app/lib/command_tag/commands.rb
@@ -1,11 +1,10 @@
 # frozen_string_literal: true
 
-Dir[File.join(__dir__, 'command', '*.rb')].sort.each { |file| require file }
-
 module CommandTag::Commands
   def self.included(base)
-    CommandTag::Command.constants.map(&CommandTag::Command.method(:const_get)).grep(Module) do |mod|
-      base.include(mod)
+    Dir[File.join(__dir__, 'commands', '*.rb')].sort.each do |file|
+      require file
+      base.include(CommandTag::Commands.const_get(File.basename(file).gsub('.rb', '').split('_').map(&:capitalize).join))
     end
   end
 end