From 62923dc93fb317eba2112a439e240c4b1d9205bb Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Mon, 20 Jul 2020 21:30:07 -0500 Subject: [Convenience] Treat colons and dots as underscores and ignore consecutive word separators when translating command tags to method names --- app/lib/command_tag/processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit