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 +4 -4
- data/lib/yeptris/materializer.rb +10 -1
- data/lib/yeptris/valueml.rb +26 -0
- data/lib/yeptris/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: ea509c657951917ea8fed50844c29b0fb6b3e2cf6a96913c7a14640035f20482
|
|
4
|
+
data.tar.gz: d3bf259e4a81b11fb83beeaa21bef444ef1b308629eda73430a4f8c3d76551fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e38308ff7c77400f4fad92b6d346dd922e4f3680eae53d61b3d1d8650b587e44d72ee03aaf6fc1e3cc76c5fb0ea0101422726d532a7be68af7233eae4ed51fe5
|
|
7
|
+
data.tar.gz: 610b376e3c8eb48d1914f3efcb485c2be20e1cbb0a4728205dc7be3f9971a5fa44e66d6c72c5c5052c097f6307aa5d5f5f75435b9bc34064b6654035d5bef198
|
data/lib/yeptris/materializer.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
data/lib/yeptris/valueml.rb
CHANGED
|
@@ -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])
|
data/lib/yeptris/version.rb
CHANGED