diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-02-19 15:15:54 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-19 15:15:54 -0600 |
commit | 8f7c3a0b118dcd99fecfdf70e6d4a48802462d9a (patch) | |
tree | 9037773d813cbabf3e7da2054b2782e4fd03a456 /app/lib | |
parent | 3cc046d278fda7ec556de51784b12018f23ace78 (diff) |
resort to sprinkling print debug statements in production to find bangtags bug because the devs are tired
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/bangtags.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index d922be84b..d9da6147c 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -12,6 +12,7 @@ class Bangtags @user = @account.user @parent_status = Status.find(status.in_reply_to_id) if status.in_reply_to_id + @debug = true @crunch_newlines = false @once = false @sroff_open = false @@ -121,14 +122,19 @@ class Bangtags next elsif @vars['_bangtags:off'] || @vars['_bangtags:skip'] if chunk.in?(['#!bangtags:on', '#!bangtags:enable']) + Rails.logger.info("#{@account.id}: 'bangtags:on' encountered") if @debug + @vars.delete('_bangtags:off') @vars.delete('_bangtags:skip') next end + Rails.logger.info("#{@account.id}: bangtags off, appending verbaim chunk") if @debug @chunks << orig_chunk.gsub("#\ufdd6!", '#!') next else + Rails.logger.info("#{@account.id}: found bangtag token in chunk, parsing it") if @debug + cmd = chunk[2..-1].strip next if cmd.blank? @@ -146,7 +152,12 @@ class Bangtags end end - next if cmd[0].nil? + if cmd[0].nil? + Rails.logger.info("#{@account.id}: chunk has no command") if @debug + next + end + + Rails.logger.info("#{@account.id}: chunk has command: #{cmd[0].downcase}") if @debug if cmd[0].downcase == 'once' @once = true @@ -156,17 +167,22 @@ class Bangtags case cmd[0].downcase when 'bangtags' + Rails.logger.info("#{@account.id}: handing command: #{cmd[0].downcase}") if @debug + chunk = nil next if cmd[1].nil? case cmd[1].downcase when 'off', 'disable' + Rails.logger.info("#{@account.id}: 'off' encountered") if @debug @vars['_bangtags:off'] = true next when 'skip' + Rails.logger.info("#{@account.id}: 'skip' encountered") if @debug @vars['_bangtags:skip'] = true next when 'break' + Rails.logger.info("#{@account.id}: 'break' encountered") if @debug break end |