cddl 0.9.1 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cddl.gemspec +1 -1
- data/data/cddl.abnf +1 -1
- data/lib/cddl.rb +10 -9
- 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: 53440c040b2f038a19f13930772e0c274d40c2074818c333883f571048b094f1
|
4
|
+
data.tar.gz: 606acb287909e0abbf9fe6c038bd1a29649a966a4feab28fa3ffaa20090e3531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ede3ed88ccb5dba90731fa47da28ed2bd68a05b207fdd4c10cbf495c3fea7da31a65b25aa9d24000276ba1a7518d3d11d6c5a156239e7901b105646bfec6b1f
|
7
|
+
data.tar.gz: 5003a424b4e7edaca09bff529acc1349006dcfba8d3b645b1e3b084aacaf3a0b146f0e371a77427dfbedeb978ff12a10896cc87e1ef44854f6bae94f0b614031
|
data/cddl.gemspec
CHANGED
data/data/cddl.abnf
CHANGED
data/lib/cddl.rb
CHANGED
@@ -255,7 +255,7 @@ module CDDL
|
|
255
255
|
# Memoize a bit here
|
256
256
|
|
257
257
|
REGEXP_FOR_STRING = Hash.new {|h, k|
|
258
|
-
h[k] = Regexp.new("\\A
|
258
|
+
h[k] = Regexp.new("\\A(?:#{k})\\z")
|
259
259
|
}
|
260
260
|
|
261
261
|
ABNF_PARSER_FOR_STRING = Hash.new {|h, k|
|
@@ -1119,20 +1119,21 @@ module CDDL
|
|
1119
1119
|
# warn n
|
1120
1120
|
s = n.to_s
|
1121
1121
|
if s[-1] == "'"
|
1122
|
-
parts = s.split("'",
|
1123
|
-
if parts[
|
1124
|
-
warn "***
|
1122
|
+
bsqual, *parts = s.split("'", -1)
|
1123
|
+
if parts[-1] != ""
|
1124
|
+
warn "*** Problem decoding byte string #{s.inspect}"
|
1125
1125
|
end
|
1126
|
+
bsval = parts[0...-1].join("'").gsub(/\\(.)/){$1}
|
1126
1127
|
[:bytes,
|
1127
|
-
case
|
1128
|
+
case bsqual
|
1128
1129
|
when ""
|
1129
|
-
|
1130
|
+
bsval.b
|
1130
1131
|
when "h"
|
1131
|
-
|
1132
|
+
bsval.gsub(/\s/, "").chars.each_slice(2).map{ |x| Integer(x.join, 16).chr("BINARY") }.join.b
|
1132
1133
|
when "b64"
|
1133
|
-
Base64.urlsafe_decode64(
|
1134
|
+
Base64.urlsafe_decode64(bsval)
|
1134
1135
|
else
|
1135
|
-
warn "*** Can't handle byte string type #{
|
1136
|
+
warn "*** Can't handle byte string type #{bsqual.inspect} yet"
|
1136
1137
|
end
|
1137
1138
|
]
|
1138
1139
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cddl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cbor-diag
|