diff options
Diffstat (limited to 'lib/oxidized/output')
-rw-r--r-- | lib/oxidized/output/file.rb | 4 | ||||
-rw-r--r-- | lib/oxidized/output/git.rb | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/oxidized/output/file.rb b/lib/oxidized/output/file.rb index 2d08106..03c878a 100644 --- a/lib/oxidized/output/file.rb +++ b/lib/oxidized/output/file.rb @@ -14,14 +14,14 @@ class OxidizedFile < Output end end - def store node, data, opt={} + def store node, outputs, opt={} file = @cfg.directory if opt[:group] file = File.join File.dirname(file), opt[:group] end FileUtils.mkdir_p file file = File.join file, node - open(file, 'w') { |fh| fh.write data } + open(file, 'w') { |fh| fh.write outputs.to_cfg } end def fetch node, group diff --git a/lib/oxidized/output/git.rb b/lib/oxidized/output/git.rb index f87ab66..0391d5d 100644 --- a/lib/oxidized/output/git.rb +++ b/lib/oxidized/output/git.rb @@ -28,11 +28,14 @@ class Git < Output repo = @cfg.repo outputs.types.each do |type| + type_cfg = '' type_repo = File.join File.dirname(repo), type + '.git' outputs.type(type).each do |output| + (type_cfg << output; next) if not output.name type_file = file + '--' + output.name update type_repo, type_file, output end + update type_repo, file, type_cfg unless type_cfg.empty? end update repo, file, outputs.to_cfg |