network_scanner 0.1.1 → 0.1.2
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/bin/network_scanner +10 -0
- data/lib/network_scanner/version.rb +1 -1
- 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: 8f351dfdd49c5fb13c6de81822dcaf4a827eb50f
|
|
4
|
+
data.tar.gz: d04e133632d7211bd880c55bc347e93d33db5754
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ef54d79c3a1b28dee00ecac66584b04b10169aeb652c35515ef1e0a6eb47003db3df11e08b8661c02b870b213704cce17b4e8e0bcdaf160d9c0db66892db0cf
|
|
7
|
+
data.tar.gz: 8cde28331eda3bb3360e530843fc8f84a0cc04f997301e9944d2889b9072385c4fb53564c94a7a3de949fc4ac588152d82b60308ebf8918f94c55c850942f7eb
|
data/bin/network_scanner
CHANGED
|
@@ -52,6 +52,16 @@ OptionParser.new do |opts|
|
|
|
52
52
|
end
|
|
53
53
|
end.parse!
|
|
54
54
|
|
|
55
|
+
def one_of?(options, *args)
|
|
56
|
+
if (options.keys & args).length != 1
|
|
57
|
+
puts "Must specify one of #{args}. Try `network_scanner -h` for help"
|
|
58
|
+
exit
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
one_of?(options, :interface, :range, :cache)
|
|
63
|
+
one_of?(options, :ping, :port, :nslookup)
|
|
64
|
+
|
|
55
65
|
network_scanner = NetworkScanner.new
|
|
56
66
|
if options[:pool]
|
|
57
67
|
unless options[:pool] > 0
|