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 +4 -4
- data/lib/vpndetection/transport.rb +19 -1
- data/lib/vpndetection/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 76106ede294f9b386872b7f1efe422ebda1069e555e68e13be3f581c40893c33
|
|
4
|
+
data.tar.gz: 66c563257fb096cb6f0ace3df367f247a73b01ee97314147f3ed394d712ec89d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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'
|
|
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)
|
data/lib/vpndetection/version.rb
CHANGED