snmp-open 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/snmp/open/parser.rb +9 -1
- data/lib/snmp/open/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db7e18f61349f692d1543dcfe02ae4e2bc9bab34
|
4
|
+
data.tar.gz: 37598b9ab5c8797bd2227eac71da7e8e945ddca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7dc1bf3650a77fcce40e30ed2c9d6a7ac4f248e91adfac6e1358f5455e06cb045f44be5d9167287a9de4aef13843147a14f41e6b5cf962840deef5f8ae57a09
|
7
|
+
data.tar.gz: cf03e2bb2dc6509afe2991e8f0aaf02a4a262cefd0bc1ca733da93024d8006272177126e223aa861aaffda6ba750596bac90bb96a721fbde6d3467c919b173fe
|
data/lib/snmp/open/parser.rb
CHANGED
@@ -35,7 +35,7 @@ module SNMP
|
|
35
35
|
|
36
36
|
private
|
37
37
|
|
38
|
-
def
|
38
|
+
def align(columns)
|
39
39
|
indexes = columns.first.map { |value| index_using_first_oid(value) }
|
40
40
|
hash = columns.flat_map { |row| row.map { |v| [v.oid, v] } }.to_h
|
41
41
|
|
@@ -100,6 +100,14 @@ module SNMP
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
+
def table(columns)
|
104
|
+
if columns.size == 1 && columns.all? { |column| column.size == 1 }
|
105
|
+
columns
|
106
|
+
else
|
107
|
+
align(columns)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
103
111
|
def indexes(columns)
|
104
112
|
indexes = SortedSet.new
|
105
113
|
@oids.zip(columns).each do |oid, column|
|
data/lib/snmp/open/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snmp-open
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Miller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|