vipnet_parser 2.4.4 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vipnet_parser/iplirconf.rb +15 -16
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f34f4c745bd3a341d9533cec786627fb9c4c5e17
|
4
|
+
data.tar.gz: b71a31766cf8d09cb150c75f0caca655903a5857
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f0bb47248bc5b33ecbb84185ebd1886ca03413fa57905e2ad2ae880d45124d44faf6a4b4873d10ff6419b9a7a9cc39ae6a9956bc77eec0fd574a297c5ef38b1
|
7
|
+
data.tar.gz: 5d4824a82f2a05171c077cbbbb37b4bf3c5c05a2233db4677e762914b02fce1dcf3b13c74ab276ae67ffea1114f2d6ebc90e1ce1e5459dd156b6cb53c501eecd
|
@@ -2,7 +2,7 @@ require "vipnet_parser/vipnet_config"
|
|
2
2
|
|
3
3
|
module VipnetParser
|
4
4
|
class Iplirconf < VipnetConfig
|
5
|
-
attr_accessor :string, :hash
|
5
|
+
attr_accessor :string, :hash, :version
|
6
6
|
|
7
7
|
DEFAULT_PARSE_ARGS = {
|
8
8
|
format: :hash,
|
@@ -83,24 +83,12 @@ module VipnetParser
|
|
83
83
|
# :servers => ["0x1a0e000a, coordinator1"]
|
84
84
|
@hash[:servers] = @hash[:servers][:server] || nil unless @hash.empty?
|
85
85
|
|
86
|
+
_calculate_version
|
87
|
+
|
86
88
|
@hash
|
87
89
|
end
|
88
90
|
end
|
89
91
|
|
90
|
-
# Returns config version.
|
91
|
-
def version
|
92
|
-
self.parse(format: :hash) unless self.hash
|
93
|
-
return nil if self.hash.empty?
|
94
|
-
config_version = self.hash[:misc][:config_version]
|
95
|
-
parsed_config_version = if config_version
|
96
|
-
config_version
|
97
|
-
else
|
98
|
-
"3.x"
|
99
|
-
end
|
100
|
-
|
101
|
-
parsed_config_version
|
102
|
-
end
|
103
|
-
|
104
92
|
def downgrade(to)
|
105
93
|
# TODO: downgrade string too (need rebuild() first).
|
106
94
|
return false unless @hash
|
@@ -213,6 +201,17 @@ module VipnetParser
|
|
213
201
|
[hash, current_key]
|
214
202
|
end
|
215
203
|
|
216
|
-
|
204
|
+
def _calculate_version
|
205
|
+
config_version = self.hash[:misc][:config_version]
|
206
|
+
parsed_config_version = if config_version
|
207
|
+
config_version
|
208
|
+
else
|
209
|
+
"3.x"
|
210
|
+
end
|
211
|
+
|
212
|
+
@version = parsed_config_version
|
213
|
+
end
|
214
|
+
|
215
|
+
private :_section_hash, :_calculate_version
|
217
216
|
end
|
218
217
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vipnet_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Morozov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Parses ViPNet™ IDs, iplir.conf and other files
|
14
14
|
email: ntcomp12@gmail.com
|
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
|
-
rubygems_version: 2.
|
44
|
+
rubygems_version: 2.5.2
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
47
|
summary: ViPNet™ strings parser
|