about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-07-20 21:30:07 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:44:01 -0500
commit62923dc93fb317eba2112a439e240c4b1d9205bb (patch)
tree3995469dff4c079450c706f6f2256f02e176ca54
parent2c0a92bc3f85f8668fff66fcf942a1878363426d (diff)
[Convenience] Treat colons and dots as underscores and ignore consecutive word separators when translating command tags to method names
-rw-r--r--app/lib/command_tag/processor.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/command_tag/processor.rb b/app/lib/command_tag/processor.rb
index 74dcb047d..1e177a015 100644
--- a/app/lib/command_tag/processor.rb
+++ b/app/lib/command_tag/processor.rb
@@ -55,7 +55,7 @@ class CommandTag::Processor
       next if statement.blank? || statement[0]&.strip.blank?
 
       statement = statement.scan(/^(.*) (?:start|begin|do)$(.*)|'([^']*)'|"([^"]*)"|(\S+)/im).flatten.compact
-      statement[0] = statement[0].strip.tr('- ', '_').downcase
+      statement[0] = statement[0].strip.tr(':.\- ', '_').gsub(/__+/, '_').downcase
       statement
     end.compact
   end