cbor-diag-e 0.0.3 → 0.0.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 +4 -4
- data/cbor-diag-e.gemspec +1 -1
- data/lib/cbor-diagnostic-app/e.rb +11 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f86a688b315b2cd89e22c5e1aec5034d12ebd7b85d1af9385d093bbdd3cb452
|
4
|
+
data.tar.gz: 3309fc819618f80e68e54f806eb45b40d1cca6b5e076855b9e45596e137246eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 567be10315168576433a025d3d52866bce95dfdef82e67a36bd38ed811e5fccacf01d673f7534bdf2f562fa26c77780a2b4e4f342ad6c84513f2060900391b0f
|
7
|
+
data.tar.gz: 569d5c15156f0f62007c74af2c323d2fb031ab8fbbdaad6a80d41557ad2e3b7e7bfd1e44fa161f6230b640b25d44e8d9e2b4598c6e3f3bd18f5bc2c8ec494a0e
|
data/cbor-diag-e.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cbor-diag-e"
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.4"
|
4
4
|
s.summary = "CBOR (Concise Binary Object Representation) diagnostic notation"
|
5
5
|
s.description = %q{cbor-diag-e implements external constants for CBOR diagnostic notation}
|
6
6
|
s.author = "Carsten Bormann"
|
@@ -5,16 +5,21 @@ require 'yaml'
|
|
5
5
|
|
6
6
|
class CBOR_DIAG::App_e
|
7
7
|
CBOR_DIAG_CDDL_NAME = ENV["CBOR_DIAG_CDDL"]
|
8
|
-
raise "e'...': No CBOR_DIAG_CDDL given" unless CBOR_DIAG_CDDL_NAME
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
def self.consts_map(s)
|
10
|
+
@cached_consts_map ||= (
|
11
|
+
raise "e'#{s}': No CBOR_DIAG_CDDL file name given in environment" unless CBOR_DIAG_CDDL_NAME
|
12
|
+
|
13
|
+
cddlcs, status = Open3.capture2("cddlc -2tconst #{Shellwords.escape(CBOR_DIAG_CDDL_NAME)}")
|
14
|
+
raise "e'#{s}': Cannot run cddlc on #{CBOR_DIAG_CDDL_NAME.inspect}" unless status.success?
|
15
|
+
YAML.load(cddlcs)
|
16
|
+
)
|
17
|
+
end
|
13
18
|
|
14
19
|
def self.decode(_, s)
|
15
|
-
|
20
|
+
consts_map(s).fetch(s) do
|
16
21
|
construct = "e'#{s}'"
|
17
|
-
warn "***
|
22
|
+
warn "*** #{construct}: No external constant value defined in #{CBOR_DIAG_CDDL_NAME.inspect}"
|
18
23
|
construct
|
19
24
|
end
|
20
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbor-diag-e
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cddlc
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.5.9
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: CBOR (Concise Binary Object Representation) diagnostic notation
|