minfraud 1.4.0 → 1.4.1

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: 1b1e4e92365857b6d5d5be13e1d31a863b4c89bc9b845df4e54faebd0ffd4104
4
- data.tar.gz: 0d320caef5e7ce0bbb751c1d5a7e1ec60c6c0d97d4d683649c19c84e16b2b733
3
+ metadata.gz: aa255a8f579aa729b4ceeb84db99f283bafdc2276fc6eba3d52e6133a8e2d4ea
4
+ data.tar.gz: 1d9717004f0f07eadf3d986f4f697f4d2c41ef7c08c21b9b1f3b7e6291c36286
5
5
  SHA512:
6
- metadata.gz: 2fd31f60de5693ec4248852f4bbd8c73d5e5e86cadc6648028b3fcac794c4e66fd4b1a002eef8e24bffdc4a3100cd14965a093f9e1c0bfaacfd220611087708f
7
- data.tar.gz: c183a0bd27ad2710f34e04b33f3a0e46f8abfbd573faafdbbcdbc8533a634a59e111d59fc14b23c7984da4ee5af1911b6a4c7f70a103ae8a7bc9448ca3f162de
6
+ metadata.gz: a57eac0733d6c1d64319c80f458f00585897030433414ab0b4888606fedafac833e5fd1298fe608f8a343b87536ad2974bc794bba9317a5043980aa689c2e0cd
7
+ data.tar.gz: 0ef9a279e2ed6d9a08b3f972338f7ade34ecf1f2c409e6777333c9a6afcf1dbab3c03927b8e6a350c54ed4dd2c86bdd64672a36f51caa2087bfb8e53ab824b2a
@@ -1,5 +1,11 @@
1
1
  # Minfraud Changelog
2
2
 
3
+ ## v1.4.1 (2020-12-01)
4
+
5
+ * Do not throw an exception if the response does not include IP address
6
+ information. Previously we would incorrectly try to retrieve fields from
7
+ `nil`, leading to a `NoMethodError`.
8
+
3
9
  ## v1.4.0 (2020-10-13)
4
10
 
5
11
  * IMPORTANT: Ruby 2.0 is no longer supported. If you're using Ruby 2.0,
@@ -33,7 +33,7 @@ module MaxMind
33
33
  # @!visibility private
34
34
  def initialize(record)
35
35
  super(record)
36
- if !record.key?('network') && record.key?('ip_address') &&
36
+ if record && !record.key?('network') && record.key?('ip_address') &&
37
37
  record.key?('prefix_length')
38
38
  ip = IPAddr.new(record['ip_address']).mask(record['prefix_length'])
39
39
  # We could use ip.prefix instead of record['prefix_length'], but that
@@ -89,7 +89,7 @@ module MaxMind
89
89
  # NAT, this may differ from the IP address locally assigned to it. This
90
90
  # attribute is returned by all end points.
91
91
  #
92
- # @return [String]
92
+ # @return [String, nil]
93
93
  def ip_address
94
94
  get('ip_address')
95
95
  end
@@ -169,7 +169,7 @@ module MaxMind
169
169
  # this is the largest network where all of the fields besides ip_address
170
170
  # have the same value.
171
171
  #
172
- # @return [String]
172
+ # @return [String, nil]
173
173
  def network
174
174
  get('network')
175
175
  end
@@ -15,7 +15,11 @@ module Minfraud
15
15
 
16
16
  # @!visibility private
17
17
  def initialize(record, locales)
18
- super(record, locales)
18
+ if record
19
+ super(record, locales)
20
+ else
21
+ super({}, locales)
22
+ end
19
23
 
20
24
  if record
21
25
  @location = Minfraud::Model::GeoIP2Location.new(record.fetch('location', nil))
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Minfraud
4
4
  # The Gem version.
5
- VERSION = '1.4.0'
5
+ VERSION = '1.4.1'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minfraud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kushnir.yb
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-13 00:00:00.000000000 Z
11
+ date: 2020-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday