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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f78cc554313b637067339aa2d806c605b6b7c585281fda8b8cdea2cc8362b7cc
4
- data.tar.gz: 69f993155150a984ff2adb49690d6e4da65bc5d550ce28c754a6a9142450da8c
3
+ metadata.gz: ec5922add07e46af01522764899f20e12bf53d593fbf0f75285cb56f69446cde
4
+ data.tar.gz: 0adcc4c8363a5f7204dc76821abb6c9d3fe9fa99385080f2c94f24d5406ea621
5
5
  SHA512:
6
- metadata.gz: 6181974367f0bed559cd03efad8795f06476e610f847d72fa8b9896f70d70d2c7937d5b6010d3c3e343ea966281b9cbbe1aa8d8cf7e44f937ce0d444c8f8da11
7
- data.tar.gz: 5ec959d9ce03441472a4a9da6f67a61c8ecfdc6f3e7d452d88292fdf48a284b0f024c8e2f404bd5f906029de234b08f849af569b5e7949c6e7e6983b0d104055
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
@@ -100,7 +100,7 @@ elsif ARGV.length == 1
100
100
  isso = ip_range.in_range?(ip)
101
101
  msg = 'ip ' << ip << (isso ? ' is ' : ' is not ' ) << 'in range: ' << l
102
102
  if isso
103
- info("\n" + msg)
103
+ info("\nidentified IP: " + msg)
104
104
  else
105
105
  debug(msg)
106
106
  end
data/lib/ip_range.rb CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  require_relative 'basic_logging'
20
20
  class IPRange
21
- extend BasicLogging
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. Aborting!')
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.0
17
- SUMMARY="New Logging module, new license, Readme for rubygems.org"
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.0'
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-01-08 00:00:00.000000000 Z
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: New Logging module, new license, Readme for rubygems.org
51
+ summary: better error message when last IP < first IP in a range
52
52
  test_files: []