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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0edf0b9a55eb2ffda0e4fecda00ef328150d0cf9d4ef0bbe364783bac21e535
4
- data.tar.gz: f3d3c5adfa955ad4a3785bca2d8f51ec9fa117cc5ba2f65fc3abfb2bd0664372
3
+ metadata.gz: 89f169b4286f1630dfd386ebdd39c710292231de7dca13d35c5ae11b63eec0bf
4
+ data.tar.gz: 209ec594ca38d57ca34155de171688a24bcd28e73226bb5d3e94f68b33773e54
5
5
  SHA512:
6
- metadata.gz: c8e6ea77555458910a29f0efda8c2c6e81dfe53a9e358b791962fbbfbac0fac64618426aebaa1e8d03da915a0b8e2ad2161133ecc2b04a82e80b1a37aef7e1be
7
- data.tar.gz: 326f9ba27d97976912a79c32cf6bfcf827cfbf58dfd00e6852bbfb65f886677580f30a65313dcae7069ef0a1c8656d8d4182c7782039aeae1efbcb442dd47a38
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
- if (RTEST(gc_on)) {
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) {
@@ -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
- # normalize the YAML 1.1 space forms onto iso8601 for
126
- # xmlschema: "2001-12-14 21:59:43.10 -05:00" ->
127
- # "2001-12-14T21:59:43.10-05:00" (Psych's scanner does the
128
- # same dance)
129
- ts = v.sub(/ (\d)/, 'T\1').sub(/ ([+-]\d)/, '\1').sub(/ +Z\z/i, 'Z')
130
- # Psych reads a NAIVE timestamp (no zone, no Z) as a UTC
131
- # instant expressed in the local zone — one wall-clock hour
132
- # off from reading it as local time (pinned by spec against
133
- # Psych.unsafe_load across tz shapes)
134
- if ts.match?(/(Z|[+-]\d\d:?\d\d)\z/i)
135
- Time.xmlschema(ts)
136
- else
137
- Time.xmlschema(ts + "Z").getlocal
138
- end
139
- rescue ArgumentError
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.3".freeze
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.3
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-02 00:00:00.000000000 Z
11
+ date: 2026-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi