ip_in_range 1.0 → 1.02
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/ip_in_range +1 -1
- data/lib/ip_range.rb +5 -2
- data/lib/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec5922add07e46af01522764899f20e12bf53d593fbf0f75285cb56f69446cde
|
4
|
+
data.tar.gz: 0adcc4c8363a5f7204dc76821abb6c9d3fe9fa99385080f2c94f24d5406ea621
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d74db379a62121a15dc2b492829aec897d2f6e57095eb33009fee2719523bc16eaa383be8828912a681769857476ed67494d485cac9ee27bab3eb8296c7788a
|
7
|
+
data.tar.gz: f65083f6148ee1c6bed6cec741bcb90c2fd163e07cbcd300174cd0052b15e58292b4beb98b126afbab666256749878a516c14e8ce81c8f08670174bc86137326
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ To test on address:
|
|
5
5
|
> **ip_in_range first_in_range last_in_range ip_to_check**
|
6
6
|
|
7
7
|
To verify Received-headers:
|
8
|
-
> **ip_in_range < [email] first_in_range last_in_range
|
8
|
+
> **ip_in_range < [email] first_in_range last_in_range**
|
9
9
|
|
10
10
|
or
|
11
11
|
> **ip_in_range < [email] [range_list.txt]**
|
data/bin/ip_in_range
CHANGED
data/lib/ip_range.rb
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
require_relative 'basic_logging'
|
20
20
|
class IPRange
|
21
|
-
|
21
|
+
include BasicLogging
|
22
22
|
|
23
23
|
private
|
24
24
|
|
@@ -54,7 +54,8 @@ class IPRange
|
|
54
54
|
#last IP
|
55
55
|
@last = ip_to_number args[1]
|
56
56
|
if @last && @first && ( @last < @first )
|
57
|
-
error('ERROR! Last IP is smaller than first.
|
57
|
+
error('ERROR! Last IP is smaller than the first (' << @first.to_s << ' - ' << @last.to_s << ')')
|
58
|
+
error('Aborting!')
|
58
59
|
exit false
|
59
60
|
end
|
60
61
|
@vrange = args[0,2]
|
@@ -66,6 +67,8 @@ end
|
|
66
67
|
######### TEST #############
|
67
68
|
if __FILE__ == $0
|
68
69
|
rg = IPRange.new(['192.168.2.33', '192.168.255.150'])
|
70
|
+
#### ERROR :
|
71
|
+
# rg = IPRange.new(['23.122.9.11', '23.122.8.11'])
|
69
72
|
puts rg.first
|
70
73
|
puts rg.last
|
71
74
|
puts rg.in_range? '192.168.1.35'
|
data/lib/version.rb
CHANGED
@@ -13,8 +13,8 @@
|
|
13
13
|
***************************************************************************/
|
14
14
|
=end
|
15
15
|
|
16
|
-
VERSION = 1.
|
17
|
-
SUMMARY="
|
16
|
+
VERSION = 1.02
|
17
|
+
SUMMARY="better error message when last IP < first IP in a range"
|
18
18
|
AUTHORS=["Michael Uplawski@uplawski.eu"]
|
19
19
|
EMAIL="michael.uplawski@uplawski.eu"
|
20
20
|
AUTHORS_MAIL=["<michael.uplawski@uplawski.eu>"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ip_in_range
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.02'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Uplawski@uplawski.eu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Verify that an IP is in a range
|
14
14
|
email: "<michael.uplawski@uplawski.eu>"
|
@@ -48,5 +48,5 @@ requirements: []
|
|
48
48
|
rubygems_version: 3.4.20
|
49
49
|
signing_key:
|
50
50
|
specification_version: 4
|
51
|
-
summary:
|
51
|
+
summary: better error message when last IP < first IP in a range
|
52
52
|
test_files: []
|