cbor-diag 0.11.2 → 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: 51e165b6f7736a19dc463453c3bf1e22b0ada9c64af2c0cf24f4860560815b96
4
- data.tar.gz: 01b3d9cdfab3ff0ce35d4c0d4b396dc3f19464576e96ddad8a66a71fa26076ae
3
+ metadata.gz: 27bbe0ea5090c0e51392bd648c4e63c866471d3e563dfd9db477a98d04cbe262
4
+ data.tar.gz: cd292723e0e0c1a8be82588bc39f6e20d623a77b8b8766a3d813541fe38ca223
5
5
  SHA512:
6
- metadata.gz: 12c9324a59fbc351c4734971db06ab46b7ab04403c6488ecd6313aa93c2eb443d3ce23eb609edbbd0af9f9dbd22b489deeb616a8f9182465be168c9f9f707a3e
7
- data.tar.gz: 1c5502bcd23078139c0f56709754eb486821d7e257cb1e06b5d679c383a004a96e96e48d0f425b4c45422c2bab1d6b525b8ff7e52b7caca0d095adad3ab566a8
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.2"
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"
@@ -0,0 +1,17 @@
1
+ require 'cbor-deterministic'
2
+
3
+ class CBOR_DIAG::App_bytes
4
+ def self.decode(_, s)
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
16
+ end
17
+ end
@@ -0,0 +1,22 @@
1
+ require 'cbor-deterministic'
2
+
3
+ class CBOR_DIAG::App_same
4
+ def self.decode(_, s)
5
+ if CBOR::Sequence === s
6
+ a = s.elements
7
+ else
8
+ a = [s]
9
+ end
10
+ unless a.size > 0
11
+ raise ArgumentError.new("cbor-diagnostic: same<< #{a.inspect[1...-1]} >>: Argument Error")
12
+ end
13
+ v1 = a.first
14
+ e1 = v1.to_deterministic_cbor
15
+ a[1..-1].each do |v2|
16
+ unless v2.to_deterministic_cbor == e1
17
+ raise ArgumentError.new("cbor-diagnostic: same<<>>: #{v1.cbor_diagnostic} not same as #{v2.cbor_diagnostic}: Argument Error")
18
+ end
19
+ end
20
+ v1
21
+ end
22
+ 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.2
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
@@ -166,10 +166,12 @@ files:
166
166
  - cbor-diag.gemspec
167
167
  - lib/cbor-diag-parser.rb
168
168
  - lib/cbor-diagnostic-app/0.rb
169
+ - lib/cbor-diagnostic-app/bytes.rb
169
170
  - lib/cbor-diagnostic-app/dt.rb
170
171
  - lib/cbor-diagnostic-app/float.rb
171
172
  - lib/cbor-diagnostic-app/hash.rb
172
173
  - lib/cbor-diagnostic-app/nan.rb
174
+ - lib/cbor-diagnostic-app/same.rb
173
175
  - lib/cbor-diagnostic-helper.rb
174
176
  - lib/cbor-diagnostic-parser.rb
175
177
  - lib/cbor-diagnostic.rb
@@ -197,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
199
  - !ruby/object:Gem::Version
198
200
  version: '0'
199
201
  requirements: []
200
- rubygems_version: 4.0.2
202
+ rubygems_version: 4.0.8
201
203
  specification_version: 4
202
204
  summary: CBOR (Concise Binary Object Representation) diagnostic notation
203
205
  test_files: []