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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efefda6c8d40e86b6cbf5721bce9069fc335e2593e7bc53245538738fac87643
4
- data.tar.gz: f5e98f9ada324bdcb1df2bb108bb5bb2cd59408d7b5ab4cd31631c1eefc27a8b
3
+ metadata.gz: a7a7fec20b0792aa93546f71745f320ece4a5e5fb9a1cc80cf86b9756998da9f
4
+ data.tar.gz: 51acf48cddc7461e9e7c3010c3b345766d69ffc68ca30ab1900330c537d5f6e1
5
5
  SHA512:
6
- metadata.gz: 5b590eb785a6bbf02cf5b7b7011f2f80e23210ff855e52ad241f2ef4a955c23a3a8eaf38998f58042a34ecd153a95cc1488a9741efc665b0dddaa9c418fe86d4
7
- data.tar.gz: 298bf7e8f4da077a4fbb3643cbb0dafd802173d435457c3f462058cc62c87956d5f074cc370d4d194ed25baa742850fccf17ae62e939bdb00cf190f39a87c45a
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
@@ -22,5 +22,5 @@
22
22
  ].each{|mod|require mod}
23
23
 
24
24
  module Network
25
- VERSION = '1.1.43'
25
+ VERSION = '1.1.45'
26
26
  end
@@ -281,7 +281,9 @@ class IPv4Mask
281
281
  end
282
282
 
283
283
  module IP
284
- def self.v4 string
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: network-utility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.43
4
+ version: 1.1.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt