From c54bc69936a45dc10756d3d0813452a8989e1ae5 Mon Sep 17 00:00:00 2001 From: Stas Date: Wed, 16 Dec 2015 17:55:56 +0200 Subject: [PATCH] 108874730-depp_parsing changed --- app/models/depp/domain.rb | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/app/models/depp/domain.rb b/app/models/depp/domain.rb index fd0e71e9b..7b4630008 100644 --- a/app/models/depp/domain.rb +++ b/app/models/depp/domain.rb @@ -152,23 +152,17 @@ module Depp } end - data.css('dsData').each_with_index do |x, i| - ds = { - ds_key_tag: x.css('keyTag').first.try(:text), - ds_alg: x.css('alg').first.try(:text), - ds_digest_type: x.css('digestType').first.try(:text), - ds_digest: x.css('digest').first.try(:text) + data.css('keyData').each_with_index do |x, i| + ret[:dnskeys_attributes][i] = { + flags: x.css('flags').text, + protocol: x.css('protocol').text, + alg: x.css('alg').text, + public_key: x.css('pubKey').text, + ds_key_tag: x.css('keyTag').first.try(:text), + ds_alg: x.css('alg').first.try(:text), + ds_digest_type: x.css('digestType').first.try(:text), + ds_digest: x.css('digest').first.try(:text) } - - kd = x.css('keyData').first - ds.merge!({ - flags: kd.css('flags').first.try(:text), - protocol: kd.css('protocol').first.try(:text), - alg: kd.css('alg').first.try(:text), - public_key: kd.css('pubKey').first.try(:text) - }) if kd - - ret[:dnskeys_attributes][i] = ds end data.css('status').each_with_index do |x, i|