network-utility 1.1.43 → 1.1.45
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/document/document.rb +2 -2
- data/network.rb +1 -1
- data/utility/ipv4_address.rb +18 -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: a7a7fec20b0792aa93546f71745f320ece4a5e5fb9a1cc80cf86b9756998da9f
|
|
4
|
+
data.tar.gz: 51acf48cddc7461e9e7c3010c3b345766d69ffc68ca30ab1900330c537d5f6e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f3b30af360ca30db2d54bc6366c54bcd1e4f8bf03d588efac3ea7b52a666d4a6c78061f7c1e92183f484628b0c895d0e94f9dd364f787caac203a54c243b2a1d
|
|
7
|
+
data.tar.gz: eb4b1bcc955ede4825e707d951300bbb572648b31ed03723a65d12bcfe32ba0871b1e7e729fec9063ca6eb002d81a596419d22ebc05d75431df0f756437c0996
|
data/document/document.rb
CHANGED
|
@@ -77,12 +77,12 @@ module Doc
|
|
|
77
77
|
Doc.build paths, runtime: :static, dir: :yes
|
|
78
78
|
Doc.load paths
|
|
79
79
|
end
|
|
80
|
-
if File.exist?(parameters[:document])
|
|
80
|
+
if parameters[:document] && File.exist?(parameters[:document])
|
|
81
81
|
paths = parameters[:document]
|
|
82
82
|
Doc.build paths, runtime: :static, dir: :yes
|
|
83
83
|
Doc.load paths
|
|
84
84
|
end
|
|
85
|
-
if parameters[:expansion]
|
|
85
|
+
if parameters[:expansion] && File.exist?(parameters[:expansion])
|
|
86
86
|
paths = parameters[:expansion]
|
|
87
87
|
Doc.build paths, custom: :active, runtime: :static, dir: :yes
|
|
88
88
|
Doc.load paths
|
data/network.rb
CHANGED
data/utility/ipv4_address.rb
CHANGED
|
@@ -281,7 +281,9 @@ class IPv4Mask
|
|
|
281
281
|
end
|
|
282
282
|
|
|
283
283
|
module IP
|
|
284
|
-
|
|
284
|
+
module_function
|
|
285
|
+
|
|
286
|
+
def v4 string
|
|
285
287
|
ip,msk = string.split("/")
|
|
286
288
|
unless msk
|
|
287
289
|
return IPv4.new(ip)
|
|
@@ -290,4 +292,19 @@ module IP
|
|
|
290
292
|
return IPv4.new(ip),mask
|
|
291
293
|
end
|
|
292
294
|
end
|
|
295
|
+
|
|
296
|
+
def range addr
|
|
297
|
+
if addr.include?('.')
|
|
298
|
+
gateway, netmask = IP.v4(addr)
|
|
299
|
+
elsif addr.include?(':')
|
|
300
|
+
gateway, netmask = IP.v6(addr)
|
|
301
|
+
end
|
|
302
|
+
if netmask
|
|
303
|
+
network = gateway.network_with(netmask)
|
|
304
|
+
start, finish = network.range_with(netmask)
|
|
305
|
+
return [start, finish]
|
|
306
|
+
else
|
|
307
|
+
return [gateway, gateway]
|
|
308
|
+
end
|
|
309
|
+
end
|
|
293
310
|
end
|