vipnet_parser 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vipnet_parser.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0a1997613b4a4ac1fe34f9286285f6bd836a7ba
|
4
|
+
data.tar.gz: d2cbefaed7171372af531b3dfc2409869c528f9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9203be7210a078af027ed913d5f212e66706c1b8f146a3a03bf7420bf09280bd768c93ec198963154f6836ddfc8d865598e861484cedc4cf8029debb8ed237a6
|
7
|
+
data.tar.gz: 2f5b3c88ad25cf94c488fd1fecc7b3e04e81fca06a5ed4e6a8d1132f4defb20ae0fe59d903c3457760efd46cc64d1492be2d032773e4945c29f05ccac08a57b1
|
data/lib/vipnet_parser.rb
CHANGED
@@ -71,7 +71,7 @@ module VipnetParser
|
|
71
71
|
|
72
72
|
module_function :id, :network
|
73
73
|
|
74
|
-
class
|
74
|
+
class VipnetConfig
|
75
75
|
def ==(other)
|
76
76
|
res = true
|
77
77
|
@props.each do |prop|
|
@@ -81,7 +81,7 @@ module VipnetParser
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
class Iplirconf <
|
84
|
+
class Iplirconf < VipnetConfig
|
85
85
|
PROPS = [:content, :id, :sections]
|
86
86
|
attr_accessor *PROPS, :last_error
|
87
87
|
private_constant :PROPS
|
@@ -144,7 +144,7 @@ module VipnetParser
|
|
144
144
|
private :get_section_param
|
145
145
|
end
|
146
146
|
|
147
|
-
class Nodename <
|
147
|
+
class Nodename < VipnetConfig
|
148
148
|
PROPS = [:content, :records]
|
149
149
|
attr_accessor *PROPS, :last_error
|
150
150
|
private_constant :PROPS
|
@@ -167,7 +167,7 @@ module VipnetParser
|
|
167
167
|
tmp_record[:name].rstrip!
|
168
168
|
tmp_record[:enabled] = { "1" => true, "0" => false }[tmp_record[:enabled]]
|
169
169
|
tmp_record[:category] = { "A" => :client, "S" => :server, "G" => :group }[tmp_record[:category]]
|
170
|
-
@records[tmp_record[:id]] = tmp_record
|
170
|
+
@records[VipnetParser::id(tmp_record[:id])[0]] = tmp_record
|
171
171
|
end
|
172
172
|
true
|
173
173
|
end
|