yeptris 0.6.28.3 → 0.6.28.6
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/ext/yeptris_native/cbor_ruby.c +6 -1
- data/lib/yeptris/materializer.rb +24 -15
- data/lib/yeptris.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: 89f169b4286f1630dfd386ebdd39c710292231de7dca13d35c5ae11b63eec0bf
|
|
4
|
+
data.tar.gz: 209ec594ca38d57ca34155de171688a24bcd28e73226bb5d3e94f68b33773e54
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7a317d28c22b3cedc053d29d6c1b03f30c73067d37223cbe2e195a3b7d837fcd33b3a42f14f4e81e313dc3aa422a7c2905d6ace7aac4d4e357a2d6db0c8fb2ed
|
|
7
|
+
data.tar.gz: 5c15dae41a30d026feeb121e1734d0e1a40e73432fbdfe7d63b0b46382c1f116dc1767817a0ca2bda6f9fcb533bf04a98a5d3a5aac314660a99bed8fa3cfb40e
|
|
@@ -183,7 +183,12 @@ VALUE yep_rb_cbor_load(const char* p, size_t len, int strict) {
|
|
|
183
183
|
yep_cbor_sink sink = RV_SINK;
|
|
184
184
|
sink.ctx = &ctx;
|
|
185
185
|
st = yep_cbor_decode_gen((const unsigned char*)p, len, strict, NULL, &sink);
|
|
186
|
-
|
|
186
|
+
/* rb_gc_disable returns Qfalse when GC was ON — enable exactly
|
|
187
|
+
* then (the old RTEST(gc_on) tested the inverted sense, so every
|
|
188
|
+
* CBOR load left GC permanently off; the Init self-check rides
|
|
189
|
+
* this path too, so one require disabled GC for the process —
|
|
190
|
+
* #259's linear RSS growth and never-running finalizers) */
|
|
191
|
+
if (gc_on == Qfalse) {
|
|
187
192
|
rb_gc_enable();
|
|
188
193
|
}
|
|
189
194
|
if (st != YEPTRIS_OK) {
|
data/lib/yeptris/materializer.rb
CHANGED
|
@@ -122,21 +122,30 @@ module Yeptris
|
|
|
122
122
|
# the ported test_julian_date otherwise)
|
|
123
123
|
return ::Date.strptime(v, "%F", ::Date::GREGORIAN) unless v.match?(/[Tt ]\d/)
|
|
124
124
|
|
|
125
|
-
#
|
|
126
|
-
# xmlschema
|
|
127
|
-
# "2001-12-
|
|
128
|
-
#
|
|
129
|
-
|
|
130
|
-
#
|
|
131
|
-
# instant
|
|
132
|
-
# off from reading it as local time
|
|
133
|
-
# Psych.unsafe_load across tz shapes)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
125
|
+
# stdlib scalar_scanner's parse_time, verbatim arithmetic:
|
|
126
|
+
# Time.xmlschema REJECTS the short offsets psych accepts
|
|
127
|
+
# ("2001-12-14 21:59:43 -5" — psych's zone is [-+]\d+(:\d\d)?),
|
|
128
|
+
# so a tagged timestamp must not ride xmlschema's zone
|
|
129
|
+
# grammar; the offset is applied by hand exactly as psych
|
|
130
|
+
# does, and a NAIVE timestamp (no zone, no Z) is read as a
|
|
131
|
+
# UTC instant in the local zone (klass.at in psych — one
|
|
132
|
+
# wall-clock hour off from reading it as local time; pinned
|
|
133
|
+
# by spec against Psych.unsafe_load across tz shapes)
|
|
134
|
+
date, time = v.split(/[Tt]|\s+/, 2)
|
|
135
|
+
(yy, m, dd) = date.match(/^(-?\d{4})-(\d{1,2})-(\d{1,2})/).captures.map(&:to_i)
|
|
136
|
+
md = time.match(/(\d+:\d+:\d+)(?:\.(\d*))?\s*(Z|[-+]\d+(:\d\d)?)?/)
|
|
137
|
+
(hh, mm, ss) = md[1].split(":").map(&:to_i)
|
|
138
|
+
us = (md[2] ? Rational("0.#{md[2]}") : 0) * 1_000_000
|
|
139
|
+
|
|
140
|
+
t = ::Time.utc(yy, m, dd, hh, mm, ss, us)
|
|
141
|
+
return t if md[3] == "Z"
|
|
142
|
+
return t.getlocal unless md[3]
|
|
143
|
+
|
|
144
|
+
tz = md[3].match(/^([+-]?\d{1,2}):?(\d{1,2})?$/)[1..].compact.map { |d| Integer(d, 10) }
|
|
145
|
+
offset = tz.first * 3600
|
|
146
|
+
offset += (offset.negative? ? -1 : 1) * ((tz[1] || 0) * 60)
|
|
147
|
+
::Time.new(yy, m, dd, hh, mm, ss + Rational(us, 1_000_000), offset)
|
|
148
|
+
rescue ArgumentError, NoMethodError
|
|
140
149
|
v
|
|
141
150
|
end
|
|
142
151
|
|
data/lib/yeptris.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Yeptris
|
|
4
4
|
# The gem's version lives in the parent namespace's file — the last
|
|
5
5
|
# internal require (yeptris/version) retired with it.
|
|
6
|
-
VERSION = "0.6.28.
|
|
6
|
+
VERSION = "0.6.28.6".freeze
|
|
7
7
|
|
|
8
8
|
# Informational notices are OPT-IN (yeptris-ruby#217): consumers
|
|
9
9
|
# embed yeptris inside CLIs that assert clean stderr, and a
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yeptris
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.28.
|
|
4
|
+
version: 0.6.28.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ffi
|