vpndetection 5.10.0 → 5.10.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dedd11823619c5d0503009b84e5b77acf1975d5e1f0a4f3484683543b5b48554
4
- data.tar.gz: eab3545e7200ff9939caae8a5e42394d7973c92147b59d7e148a9ad8cbdccf41
3
+ metadata.gz: 76106ede294f9b386872b7f1efe422ebda1069e555e68e13be3f581c40893c33
4
+ data.tar.gz: 66c563257fb096cb6f0ace3df367f247a73b01ee97314147f3ed394d712ec89d
5
5
  SHA512:
6
- metadata.gz: 880e2eab30ca0651db6ae6954272ace94c3b3e6986824dc28a6498b40dce87a800513c037a1d6904a7040d5920d2ba7b55146e22d21bc7a69de96d4c4d4f6c77
7
- data.tar.gz: a832c58a56fb28b0d6637a4b0fb5b64459e2d23d369ccfd31034afb03407edf520a170e4d9cfb021b0bc55dfcb0b352f5045d06cd8ab8d1fc85502d8f39978e9
6
+ metadata.gz: 914b1f86249d2de078c30cb6afb3ef34a0c2a60fe54b2957590e019a300f6f89572bc67da3460cffbdcb7ee098d13d3cd126aadaca0900cdabf215365b2abbb6
7
+ data.tar.gz: bd0c45a754eb065322e2435e09cdf6d22958767313d2419d89137e190157492b00ba71ea38440a9f4d193546459990db86fbb83fa464e35d62ab2e670ac0b0a2
@@ -317,6 +317,23 @@ module VPNDetection
317
317
  created],
318
318
  }.freeze
319
319
 
320
+ # RFC 3339's full-date, the spec's `date`, and its date-time, the spec's
321
+ # `date-time`, in the upper case the API sends. Anything else reached the
322
+ # generated reader's Date.parse or Time.parse, which read "monday" as this
323
+ # week's, "10:00" as today in the process's zone and 30 February as 2 March,
324
+ # or a lookup's detail handed it back as served (5.10.0, measured 2026-10-21).
325
+ RFC3339_DATE = /\A(\d{4})-(\d{2})-(\d{2})\z/
326
+ RFC3339_DATE_TIME = /\A(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))\z/
327
+
328
+ # A date in the form its type names, on a day and at a time that exist: an
329
+ # hour of 24 rolls over the way a missing day does.
330
+ def self.date?(value, type)
331
+ m = (type == 'Date' ? RFC3339_DATE : RFC3339_DATE_TIME).match(value)
332
+ return false unless m && Date.valid_date?(m[1].to_i, m[2].to_i, m[3].to_i)
333
+
334
+ type == 'Date' || (m[4].to_i < 24 && m[5].to_i < 60 && m[6].to_i < 60 && m[7].to_i < 24 && m[8].to_i < 60)
335
+ end
336
+
320
337
  # True when the parsed `value` has the generated `type`, a model's members
321
338
  # recursively; raises TypeError naming where it does not. No list entry or
322
339
  # map value the spec describes may be null: through 5.9.0 one came back as
@@ -327,7 +344,8 @@ module VPNDetection
327
344
 
328
345
  typed =
329
346
  case type
330
- when 'String', 'Date', 'Time' then value.is_a?(String)
347
+ when 'String' then value.is_a?(String)
348
+ when 'Date', 'Time' then value.is_a?(String) && date?(value, type)
331
349
  when 'Integer' then value.is_a?(Integer)
332
350
  when 'Float' then value.is_a?(Numeric)
333
351
  when 'Boolean' then [true, false].include?(value)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VPNDetection
4
- VERSION = '5.10.0'
4
+ VERSION = '5.10.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vpndetection
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.10.0
4
+ version: 5.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mslm Dev