From bde440bbd66ba7b9fbec99ab012dd4de80945a4c Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 16 Apr 2014 15:04:05 +0300 Subject: run cmd :secret blocks if CFG.remove_secret is set Model can inmplement something like cmd :secret do |cfg| cfg.sub! / secret (\d+) (\S+).*/, '\\1 SECRET' cfg end Which is called for all commands if CFG.remove_secret is set --- lib/oxidized/model/model.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/model.rb b/lib/oxidized/model/model.rb index d8f5fe2..6e44039 100644 --- a/lib/oxidized/model/model.rb +++ b/lib/oxidized/model/model.rb @@ -80,6 +80,11 @@ module Oxidized self.class.cmds[:all].each do |all_block| out = instance_exec out, string, &all_block end + if CFG.remove_secret? + self.class.cmds[:secret].each do |all_block| + out = instance_exec out, string, &all_block + end + end out = instance_exec out, &block if block out end -- cgit v1.2.1