data_collector 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/data_collector/output.rb +21 -1
- data/lib/data_collector/rules_ng.rb +2 -1
- data/lib/data_collector/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c364ef9791c9ac026f6c6d0e0b228d338a7753f597708485d6e66e01e07bb29
|
4
|
+
data.tar.gz: fa7bfdeffc86728354607f7a58ab0d2fce5b64603506457d4f89acb5ca1107be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '071387ac380b1ec2498b233ab4e8923a414d2354779a9eb62014a5edec34fd75d0122e7d0c448f2ba4a5d43c774abc41081acd2be565b7b61af5c75dde07f7b2'
|
7
|
+
data.tar.gz: a962c642f586e08b1bf2699a8a1d042edc2a9ccbb091ae774fb12e41c4197d18c6e08fa7a7ff1fbe1db433e64391eaa93c556ec2d874fc1efdc70cfb14d677d5
|
@@ -32,7 +32,11 @@ module DataCollector
|
|
32
32
|
unless v.nil?
|
33
33
|
if data.has_key?(k)
|
34
34
|
if data[k].is_a?(Array) then
|
35
|
-
|
35
|
+
if v.is_a?(Array)
|
36
|
+
data[k] += v
|
37
|
+
else
|
38
|
+
data[k] << v
|
39
|
+
end
|
36
40
|
else
|
37
41
|
t = data[k]
|
38
42
|
data[k] = Array.new([t, v])
|
@@ -58,6 +62,22 @@ module DataCollector
|
|
58
62
|
end
|
59
63
|
end
|
60
64
|
|
65
|
+
def key?(key)
|
66
|
+
@data.key?(key)
|
67
|
+
end
|
68
|
+
|
69
|
+
def has_key?(key)
|
70
|
+
@data.key?(key)
|
71
|
+
end
|
72
|
+
|
73
|
+
def include?(key)
|
74
|
+
@data.key?(key)
|
75
|
+
end
|
76
|
+
|
77
|
+
def keys
|
78
|
+
@data.keys
|
79
|
+
end
|
80
|
+
|
61
81
|
def raw
|
62
82
|
@data
|
63
83
|
end
|
@@ -91,7 +91,8 @@ module DataCollector
|
|
91
91
|
|
92
92
|
output_data.compact! if output_data.is_a?(Array)
|
93
93
|
output_data.flatten! if output_data.is_a?(Array)# || output_data.is_a?(Hash)
|
94
|
-
output_data = output_data.first if output_data.is_a?(Array) && output_data.size == 1
|
94
|
+
output_data = output_data.first if output_data.is_a?(Array) && output_data.size == 1 && output_data.first.is_a?(Array)
|
95
|
+
|
95
96
|
output_data
|
96
97
|
end
|
97
98
|
|