From 9b01c91668935c8e6ecf8a5d285bfc70e47e2802 Mon Sep 17 00:00:00 2001 From: Swaeltjie Date: Sat, 16 Nov 2024 07:08:21 +0200 Subject: [PATCH] - Removed unnecessary modules and variables. - Simplified the prompt definition. - Replaced `\s` with explicit spaces in regex patterns. - Used `cut_both` to simplify output trimming. - Removed dynamic date to prevent unnecessary diffs. - Outputted extracted information directly as comments. --- lib/oxidized/model/riverbed.rb | 98 +++++++++++++--------------------- 1 file changed, 36 insertions(+), 62 deletions(-) diff --git a/lib/oxidized/model/riverbed.rb b/lib/oxidized/model/riverbed.rb index b7bd35bba..048e757f2 100644 --- a/lib/oxidized/model/riverbed.rb +++ b/lib/oxidized/model/riverbed.rb @@ -1,101 +1,82 @@ class Riverbed < Oxidized::Model using Refinements - # Define the prompt - PROMPT = /^.*\s*[\w-]+\s*[#>]\s*$/i - prompt PROMPT + # Define the prompt directly + prompt /^.* *[\w-]+ *[#>] *$/ # Define comment character comment '! ' - # Use procs to remove unwanted lines - procs do - # Remove "Last login" message - proc { |output| output.gsub!(/^Last login:.*\n/, '') } - end - # Remove sensitive information cmd :secret do |cfg| - cfg.gsub! /^(\s*tacacs-server (.+ )?key) .+/, '\\1