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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5412d8c84a3817a547ef58b0533cc2d6669a4bf348ca89e47b9df48b7bb3dfe
4
- data.tar.gz: 335516f432fc310852e56ace91cbdb2ed0c141883d877b2c62aef1557cf856e4
3
+ metadata.gz: ae41bb7e1848fa9d94cab6800cefabdd26d548269cd0266c95b5b58871285823
4
+ data.tar.gz: 103c9fb602ddae05b03c3fd0b995a4404e69f19d2ef26485d9a1fd564fdcc469
5
5
  SHA512:
6
- metadata.gz: a8f5c21b327d527fd3682d97a52684a3cf1526c00997e6978c6252ca53c495ae01722a437f15ff2377e619e429f5a89ed01732ab953edfdbe7ac7c345a77be30
7
- data.tar.gz: 3d0e26906c4d3e46f415db082ffc95c0589fd9c430abcd2cf1199f4d789ace055978d9678f88d55dfa0fba1a583b1b6c23aa784baae3828a4c504aa32ab39bde
6
+ metadata.gz: 36e147a02dfbd2acc023b3c5af8afe6ca45e95bf31681861376188452a259fc89dcea55567dd058b0ac2bc1b1ca8d72d633f8f9be7469b362b228d48c37362c8
7
+ data.tar.gz: 492be6bcc3e8e01e22f324d64a622ce9df3a8da8fa92c1c97d7831cd63e6686c434f9ca153d663783feffb90129ca8f47bd9aa0ce16d0a28679d47fa49a9115e
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cbor-diag"
3
- s.version = "0.5.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"
@@ -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.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: 2018-06-21 00:00:00.000000000 Z
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
- rubyforge_project:
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