ip_lookup 1.2.3 → 1.2.4
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/lib/ip_lookup.rb +5 -1
- data/lib/ip_lookup/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 56f8d386f164038d905d0847f1d1854cd9769518de4d68198bb15dde3ff1140c
|
|
4
|
+
data.tar.gz: 751cf470063f7754d35ee532b397c809745c7b8004358c6bcbef8c9e36362067
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 726b74610936c5bdc280efde68d3b54946776911da19606e7d3be03f4619884c8ac6736e44f6e80152bf21c779755a28c84875316ad50222bcec4be75facc47a
|
|
7
|
+
data.tar.gz: a2db8f5ca770924c3d60712dce1570e8f4d1c93a74db632c76bb91732258d6a09bcc0e7c293ba75dc91aaa92bb5caf6eff81a8c600dfda52efd9c42e0080448d
|
data/lib/ip_lookup.rb
CHANGED
|
@@ -13,7 +13,7 @@ class IPLookup
|
|
|
13
13
|
|
|
14
14
|
def initialize(ip_address, silent_exceptions: false)
|
|
15
15
|
@silent_exceptions = silent_exceptions
|
|
16
|
-
@result = DB.new(silent_exceptions).lookup(ip_address)
|
|
16
|
+
@result = DB.new(silent_exceptions).lookup(sanitize(ip_address))
|
|
17
17
|
rescue IPAddr::InvalidAddressError, IPAddr::AddressFamilyError => e
|
|
18
18
|
raise e unless silent_exceptions
|
|
19
19
|
end
|
|
@@ -48,6 +48,10 @@ class IPLookup
|
|
|
48
48
|
|
|
49
49
|
private
|
|
50
50
|
|
|
51
|
+
def sanitize(ip_address)
|
|
52
|
+
ip_address.split(/\s*,\s*/).last
|
|
53
|
+
end
|
|
54
|
+
|
|
51
55
|
def timezone_for(iso_code)
|
|
52
56
|
tz = TZInfo::Country.get iso_code
|
|
53
57
|
tz.zone_identifiers.first if tz.zone_identifiers.any?
|
data/lib/ip_lookup/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ip_lookup
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ole Richter
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2019-06-04 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: maxminddb
|