yeptris 0.1.1.1 → 0.1.2.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: 321301694ee81cae03622b737dce8d9603d6fffa87cacc280967c3bf7e9e397b
4
- data.tar.gz: '09892fb7c54261dc8d46c5354a1c55052e6bf1333552bc7632e36cd433706c66'
3
+ metadata.gz: ea509c657951917ea8fed50844c29b0fb6b3e2cf6a96913c7a14640035f20482
4
+ data.tar.gz: d3bf259e4a81b11fb83beeaa21bef444ef1b308629eda73430a4f8c3d76551fe
5
5
  SHA512:
6
- metadata.gz: 2d3e550bfe02ed9abff59332131fa13ae93e0e4ab7bf46b4cbcf8f57670d7592ad2494b2c9aa17c331a504ab3fdca48274bf585cc429a282a8c4d507fd3c5a04
7
- data.tar.gz: b66b1001c328be6081ddbd53d790a9fbfbff4d4881da5ee74edea0d2065cb5266d876cdc1f3bb4ddcacbc6c41b2087661218f2fb11cd4763136a380073dfbbe2
6
+ metadata.gz: e38308ff7c77400f4fad92b6d346dd922e4f3680eae53d61b3d1d8650b587e44d72ee03aaf6fc1e3cc76c5fb0ea0101422726d532a7be68af7233eae4ed51fe5
7
+ data.tar.gz: 610b376e3c8eb48d1914f3efcb485c2be20e1cbb0a4728205dc7be3f9971a5fa44e66d6c72c5c5052c097f6307aa5d5f5f75435b9bc34064b6654035d5bef198
@@ -120,7 +120,16 @@ module Yeptris
120
120
  # xmlschema: "2001-12-14 21:59:43.10 -05:00" ->
121
121
  # "2001-12-14T21:59:43.10-05:00" (Psych's scanner does the
122
122
  # same dance)
123
- Time.xmlschema(v.sub(/ (\d)/, 'T\1').sub(/ ([+-]\d)/, '\1'))
123
+ ts = v.sub(/ (\d)/, 'T\1').sub(/ ([+-]\d)/, '\1').sub(/ +Z\z/i, 'Z')
124
+ # Psych reads a NAIVE timestamp (no zone, no Z) as a UTC
125
+ # instant expressed in the local zone — one wall-clock hour
126
+ # off from reading it as local time (pinned by spec against
127
+ # Psych.unsafe_load across tz shapes)
128
+ if ts.match?(/(Z|[+-]\d\d:?\d\d)\z/i)
129
+ Time.xmlschema(ts)
130
+ else
131
+ Time.xmlschema(ts + "Z").getlocal
132
+ end
124
133
  rescue ArgumentError
125
134
  v
126
135
  end
@@ -225,6 +225,32 @@ module Yeptris
225
225
  i = 0
226
226
  n = kinds.length
227
227
  while i < n
228
+ # the dominant shape: a str:str pair inside one map — place
229
+ # both directly, same conversions as the STR arm (the ':sym'
230
+ # scan rides is_key's text; anchors/merges fall through)
231
+ if kinds[i] == V_STR && ikeys[i] == 1 && i + 1 < n &&
232
+ kinds[i + 1] == V_STR && ikeys[i + 1] == 0 &&
233
+ pending_anchor.nil? && !stack.empty? && stack.last.is_a?(Hash)
234
+ kt = arena.byteslice(offs[i], lens[i])
235
+ if kt != "<<"
236
+ key = if bools[i] == 1 && kt.length > 1 && kt.start_with?(":") &&
237
+ !kt.start_with?("::")
238
+ kt[1..].to_sym
239
+ else
240
+ kt
241
+ end
242
+ vt = arena.byteslice(offs[i + 1], lens[i + 1])
243
+ stack.last[key] =
244
+ if bools[i + 1] == 1 && vt.length > 1 && vt.start_with?(":") &&
245
+ !vt.start_with?("::")
246
+ vt[1..].to_sym
247
+ else
248
+ vt
249
+ end
250
+ i += 2
251
+ next
252
+ end
253
+ end
228
254
  case kinds[i]
229
255
  when V_STR
230
256
  text = arena.byteslice(offs[i], lens[i])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yeptris
4
- VERSION = "0.1.1.1"
4
+ VERSION = "0.1.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yeptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.1
4
+ version: 0.1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.