Module: ExtSampleAuditPatch

Included in:
Clacky::Tools::Terminal
Defined in:
lib/clacky/extension/scaffold/templates/full/patches/audit.rb

Overview

Example monkey-patch. Prepends onto Clacky::Tools::Terminal#execute so we get one log line per shell tool invocation. In production a patch might enforce a denylist, rewrite arguments, or measure timing. Keep the body small and always call super.

Instance Method Summary collapse

Instance Method Details

#execute(*args, **kwargs) ⇒ Object



8
9
10
11
12
# File 'lib/clacky/extension/scaffold/templates/full/patches/audit.rb', line 8

def execute(*args, **kwargs)
  cmd = kwargs[:command] || args.first
  Clacky::Logger.info("[ext-audit] terminal.execute", command: cmd.to_s[0, 200])
  super
end