From 7aa9299971a2cacad29ab86e82cc780354d659e0 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Thu, 7 Aug 2014 14:33:18 +0300 Subject: Keep config as Oxidized::Config instead of hash The model will look like this: cmd 'show ip cef' do |out| out.type = 'poop' out end cmd 'show process cpu' do |out| out.type = 'poop' out end cmd 'show memory statistics' do |out| out.type = 'poop' out end I think it's cleaner. --- lib/oxidized/output/git.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/oxidized/output') diff --git a/lib/oxidized/output/git.rb b/lib/oxidized/output/git.rb index 59b6bd4..f87ab66 100644 --- a/lib/oxidized/output/git.rb +++ b/lib/oxidized/output/git.rb @@ -21,7 +21,6 @@ class Git < Output end def store file, outputs, opt={} - data = outputs.to_cfg @msg = opt[:msg] @user = (opt[:user] or @cfg.user) @email = (opt[:email] or @cfg.email) @@ -29,11 +28,10 @@ class Git < Output repo = @cfg.repo outputs.types.each do |type| - next if type == 'cfg' type_repo = File.join File.dirname(repo), type + '.git' outputs.type(type).each do |output| - type_file = file + '--' + output[:name].strip.gsub(/\s+/, '_') - update type_repo, type_file, output[:output] + type_file = file + '--' + output.name + update type_repo, type_file, output end end -- cgit v1.2.1