cbor-diag 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cbor-diag.gemspec +1 -1
- data/lib/cbor-diagnostic.rb +14 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae41bb7e1848fa9d94cab6800cefabdd26d548269cd0266c95b5b58871285823
|
4
|
+
data.tar.gz: 103c9fb602ddae05b03c3fd0b995a4404e69f19d2ef26485d9a1fd564fdcc469
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36e147a02dfbd2acc023b3c5af8afe6ca45e95bf31681861376188452a259fc89dcea55567dd058b0ac2bc1b1ca8d72d633f8f9be7469b362b228d48c37362c8
|
7
|
+
data.tar.gz: 492be6bcc3e8e01e22f324d64a622ce9df3a8da8fa92c1c97d7831cd63e6686c434f9ca153d663783feffb90129ca8f47bd9aa0ce16d0a28679d47fa49a9115e
|
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.5.
|
3
|
+
s.version = "0.5.6"
|
4
4
|
s.summary = "CBOR (Concise Binary Object Representation) diagnostic notation"
|
5
5
|
s.description = %q{cbor-diag implements diagnostic notation for CBOR, RFC 7049}
|
6
6
|
s.author = "Carsten Bormann"
|
data/lib/cbor-diagnostic.rb
CHANGED
@@ -46,6 +46,20 @@ class String
|
|
46
46
|
"(_ #{lengths.map{|l| r = self[pos, l].cbor_diagnostic(options); pos += l; r}.join(", ")})"
|
47
47
|
else
|
48
48
|
if encoding == Encoding::BINARY
|
49
|
+
if options[:try_decode_embedded] && self != ''
|
50
|
+
begin
|
51
|
+
rest = self
|
52
|
+
result = []
|
53
|
+
while rest != ''
|
54
|
+
dv, rest = CBOR.decode_with_rest(rest)
|
55
|
+
result << dv
|
56
|
+
end
|
57
|
+
return "<< #{result.map{|x| x.cbor_diagnostic(options)}.join(", ")} >>"
|
58
|
+
rescue RuntimeError => e
|
59
|
+
# that didn't work out, so continue with other options
|
60
|
+
# puts e.backtrace
|
61
|
+
end
|
62
|
+
end
|
49
63
|
if options[:bytes_as_text] && (u8 = dup.force_encoding(Encoding::UTF_8)).valid_encoding?
|
50
64
|
"'#{u8.cbor_diagnostic(options)[1..-2].gsub("'", "\\\\'")}'" # \' is a backref, so needs \\'
|
51
65
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbor-diag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -127,8 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
|
-
|
131
|
-
rubygems_version: 2.7.6
|
130
|
+
rubygems_version: 3.0.3
|
132
131
|
signing_key:
|
133
132
|
specification_version: 4
|
134
133
|
summary: CBOR (Concise Binary Object Representation) diagnostic notation
|