cbor-diag 0.11.3 → 0.11.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c0c35275d12c07b1b3acc44965f9ff474d8115967b75978b0b15e76c6fce09b
4
- data.tar.gz: d78c3ef942141c80f5b8db750da00e403b4d9ffe3b0f906ad31b897af4a13885
3
+ metadata.gz: 27bbe0ea5090c0e51392bd648c4e63c866471d3e563dfd9db477a98d04cbe262
4
+ data.tar.gz: cd292723e0e0c1a8be82588bc39f6e20d623a77b8b8766a3d813541fe38ca223
5
5
  SHA512:
6
- metadata.gz: d9069cbe7956a8bcd38e5855d067018ce546b25c602b2a8451572b9163188e1e9b23b82fed741e0a98058815ce3af80d727556fc4e9bd4eb82d8d186a7faa4b1
7
- data.tar.gz: b5f4725bc4109487b6e7d2a412b5a9ddd494477e9f653741ba89363980599819675c60543d9d147ffb5252f4c48364a57f76261aa2a3718b167367318ac6f538
6
+ metadata.gz: 7e57f4eff6347800b2b0287865d52907f436ec9da02b16a146427d51aff22e6d54fbf4a57714c78e1b4862319a276610c3201b9ba44bd4434e86013a07d583f8
7
+ data.tar.gz: ebe49e5762ebaed5296f5167df646c04775fdfb2e4aace8100194e222a21a969d1e082461b58c7226d8e30030c8d0124d12bfbe89c049bcf6dbbb3027beba2ae
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.11.3"
3
+ s.version = "0.11.4"
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"
@@ -2,14 +2,16 @@ require 'cbor-deterministic'
2
2
 
3
3
  class CBOR_DIAG::App_bytes
4
4
  def self.decode(_, s)
5
- if CBOR::Sequence === s
6
- a = s.elements
7
- else
8
- a = [s]
9
- end
10
- if a.detect { |el| not String === el }
11
- raise ArgumentError.new("cbor-diagnostic: bytes<<#{a.cbor_diagnostic[1...-1]}>>: not all strings: Argument Error")
12
- end
13
- a.join.b
5
+ a = if CBOR::Sequence === s
6
+ s.elements
7
+ else
8
+ [s]
9
+ end
10
+ a.map { |el|
11
+ unless String === el
12
+ raise ArgumentError.new("cbor-diagnostic: bytes<<#{a.cbor_diagnostic[1...-1]}>>: #{el.cbor_diagnostic} not a string: Argument Error")
13
+ end
14
+ el.b
15
+ }.join.b # .b needed so empty array becomes byte string, too
14
16
  end
15
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cbor-diag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann