cbor-diag 0.9.8 → 0.9.9
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/cbor-diag.gemspec +1 -1
- data/lib/cbor-diag-parser.rb +5 -3
- data/lib/cbor-pure.rb +12 -2
- 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: 54f6f772655e8d9e5c33d6f51030f4b51076f8ddb9a0dec7f778b679e6e0d13d
|
4
|
+
data.tar.gz: 45327c30bf0ff893e38243fa511516267a91a9b60c3168a52b73b530e2e6ff52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47a70a70dbb3cf27f15048ee83f080b359778deada122840a40896f709941b46c8fe7169d333081de947ac94fdefdd415d0493cfceb0f3aa353cd723466cf8cd
|
7
|
+
data.tar.gz: 160560be71a888c113e761bad1f3835b519221b6ed3075ef8c6565c428c89feb06e6cfdf2ea227de06c7d3c76e610ebdd7e794fdea9dc18c4b89e02ebd36b5fb
|
data/cbor-diag.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cbor-diag"
|
3
|
-
s.version = "0.9.
|
3
|
+
s.version = "0.9.9"
|
4
4
|
s.summary = "CBOR (Concise Binary Object Representation) diagnostic notation"
|
5
5
|
s.description = %q{cbor-diag implements diagnostic notation for CBOR, RFC 8949 and RFC 8742}
|
6
6
|
s.author = "Carsten Bormann"
|
data/lib/cbor-diag-parser.rb
CHANGED
@@ -3507,9 +3507,11 @@ module CBOR_DIAG
|
|
3507
3507
|
r0
|
3508
3508
|
end
|
3509
3509
|
|
3510
|
-
end
|
3511
3510
|
|
3512
|
-
class
|
3513
|
-
|
3511
|
+
class Parser < Treetop::Runtime::CompiledParser
|
3512
|
+
include CBOR_DIAG
|
3513
|
+
end
|
3514
3514
|
end
|
3515
3515
|
|
3516
|
+
CBOR_DIAGParser = CBOR_DIAG::Parser
|
3517
|
+
|
data/lib/cbor-pure.rb
CHANGED
@@ -302,8 +302,18 @@ module CBOR
|
|
302
302
|
raise "two-byte simple is #{val} but must be between 32 and 255" unless val >= 32;
|
303
303
|
Simple.new(val)
|
304
304
|
when 25; Half.decode(val)
|
305
|
-
when 26;
|
306
|
-
|
305
|
+
when 26;
|
306
|
+
v = s.unpack("g").first # cannot go directly from val in Ruby
|
307
|
+
if v.nan?
|
308
|
+
# work around quiet bit always set with unpack("g"):
|
309
|
+
# https://bugs.ruby-lang.org/issues/20662
|
310
|
+
qbit = s.getbyte(1)[6]
|
311
|
+
vbytes = [v].pack("G")
|
312
|
+
vbytes.setbyte(1, vbytes.getbyte(1) & 0xf7 | qbit << 3)
|
313
|
+
v = vbytes.unpack("G").first
|
314
|
+
end
|
315
|
+
v
|
316
|
+
when 27; s.unpack("G").first # cannot go directly from val in Ruby
|
307
317
|
else
|
308
318
|
Simple.new(val)
|
309
319
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbor-diag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-08-04 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bundler
|