cbor-diag 0.5.19 → 0.5.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cbor2diag.rb +4 -1
- data/bin/cbor2json.rb +4 -1
- data/bin/cbor2yaml.rb +4 -1
- data/bin/cborleader2diag.rb +4 -1
- data/bin/cborseq2diag.rb +4 -1
- data/bin/cborseq2json.rb +3 -1
- data/bin/cborseq2neatjson.rb +3 -1
- data/bin/cborseq2yaml.rb +4 -1
- data/bin/diag2diag.rb +4 -1
- data/bin/json2cbor.rb +4 -1
- data/bin/json2json.rb +4 -1
- data/bin/json2neatjson.rb +4 -1
- data/bin/json2yaml.rb +4 -1
- data/bin/yaml2cbor.rb +4 -1
- data/bin/yaml2json.rb +4 -1
- data/cbor-diag.gemspec +2 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dbeccb9b1a15bac6beb52ab1388adddac2c19cf5fce92d2184de8120326fb5e
|
4
|
+
data.tar.gz: ccd67a87d8e7c04518e0fc7852e4eac5076182cdbe58a97b7e2daea13acbfc53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f1cadddbfc82820493a77b7c50eb1bbb365be5a61016ee155f5ab88895f667d4c789d03b6d8e78983b5a765d34c316053dfbe8b730716f3d2979061759624b4
|
7
|
+
data.tar.gz: e3eff5464c68065fb23c2158fba3209880878edb8ecb04bc225bd757b572343f23513856da112377517f2318c5d8c0f2872579e2faa197088eda952ac4e01e48
|
data/bin/cbor2diag.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'cbor-diagnostic'
|
3
|
+
require 'cbor-packed'
|
3
4
|
require 'cbor-deterministic'
|
4
5
|
require 'cbor-canonical'
|
5
6
|
|
6
7
|
options = ''
|
7
|
-
while /\A-([
|
8
|
+
while /\A-([cdetpqu]+)\z/ === ARGV[0]
|
8
9
|
options << $1
|
9
10
|
ARGV.shift
|
10
11
|
end
|
@@ -12,6 +13,8 @@ end
|
|
12
13
|
ARGF.binmode
|
13
14
|
i = ARGF.read
|
14
15
|
o = CBOR.decode(i)
|
16
|
+
o = o.to_packed_cbor if /p/ === options
|
17
|
+
o = o.to_unpacked_cbor if /q/ === options
|
15
18
|
o = o.cbor_pre_canonicalize if /c/ === options
|
16
19
|
o = o.cbor_prepare_deterministic if /d/ === options
|
17
20
|
puts o.cbor_diagnostic(try_decode_embedded: /e/ === options,
|
data/bin/cbor2json.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'json'
|
3
3
|
require 'cbor-pure'
|
4
|
+
require 'cbor-packed'
|
4
5
|
require 'cbor-deterministic'
|
5
6
|
require 'cbor-canonical'
|
6
7
|
|
7
8
|
options = ''
|
8
|
-
while /\A-([
|
9
|
+
while /\A-([cdpq]+)\z/ === ARGV[0]
|
9
10
|
options << $1
|
10
11
|
ARGV.shift
|
11
12
|
end
|
@@ -13,6 +14,8 @@ end
|
|
13
14
|
ARGF.binmode
|
14
15
|
i = ARGF.read
|
15
16
|
o = CBOR.decode(i)
|
17
|
+
o = o.to_packed_cbor if /p/ === options
|
18
|
+
o = o.to_unpacked_cbor if /q/ === options
|
16
19
|
o = o.cbor_pre_canonicalize if /c/ === options
|
17
20
|
o = o.cbor_prepare_deterministic if /d/ === options
|
18
21
|
puts JSON.pretty_generate(o)
|
data/bin/cbor2yaml.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'psych.rb' # WTF
|
3
3
|
require 'yaml'
|
4
4
|
require 'cbor-pure'
|
5
|
+
require 'cbor-packed'
|
5
6
|
require 'cbor-deterministic'
|
6
7
|
require 'cbor-canonical'
|
7
8
|
|
@@ -12,7 +13,7 @@ class Array
|
|
12
13
|
end
|
13
14
|
|
14
15
|
options = ''
|
15
|
-
while /\A-([
|
16
|
+
while /\A-([cdpq]+)\z/ === ARGV[0]
|
16
17
|
options << $1
|
17
18
|
ARGV.shift
|
18
19
|
end
|
@@ -20,6 +21,8 @@ end
|
|
20
21
|
ARGF.binmode
|
21
22
|
i = ARGF.read
|
22
23
|
o = CBOR.decode(i)
|
24
|
+
o = o.to_packed_cbor if /p/ === options
|
25
|
+
o = o.to_unpacked_cbor if /q/ === options
|
23
26
|
o = o.cbor_prepare_deterministic if /d/ === options
|
24
27
|
o = o.cbor_pre_canonicalize if /c/ === options
|
25
28
|
puts YAML.dump(o)
|
data/bin/cborleader2diag.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'cbor-diagnostic'
|
3
|
+
require 'cbor-packed'
|
3
4
|
require 'cbor-deterministic'
|
4
5
|
require 'cbor-canonical'
|
5
6
|
|
6
7
|
options = ''
|
7
|
-
while /\A-([
|
8
|
+
while /\A-([cdetpqu]+)\z/ === ARGV[0]
|
8
9
|
options << $1
|
9
10
|
ARGV.shift
|
10
11
|
end
|
@@ -15,6 +16,8 @@ o,r = CBOR.decode_with_rest(i)
|
|
15
16
|
if r != ''
|
16
17
|
warn "** ignoring rest of #{r.bytesize} bytes after first CBOR data item"
|
17
18
|
end
|
19
|
+
o = o.to_packed_cbor if /p/ === options
|
20
|
+
o = o.to_unpacked_cbor if /q/ === options
|
18
21
|
o = o.cbor_prepare_deterministic if /d/ === options
|
19
22
|
o = o.cbor_pre_canonicalize if /c/ === options
|
20
23
|
puts o.cbor_diagnostic(try_decode_embedded: /e/ === options,
|
data/bin/cborseq2diag.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'cbor-diagnostic'
|
3
|
+
require 'cbor-packed'
|
3
4
|
require 'cbor-deterministic'
|
4
5
|
require 'cbor-canonical'
|
5
6
|
|
6
7
|
options = ''
|
7
|
-
while /\A-([
|
8
|
+
while /\A-([cdetpqu]+)\z/ === ARGV[0]
|
8
9
|
options << $1
|
9
10
|
ARGV.shift
|
10
11
|
end
|
@@ -13,6 +14,8 @@ ARGF.binmode
|
|
13
14
|
i = ARGF.read
|
14
15
|
while !i.empty?
|
15
16
|
o, i = CBOR.decode_with_rest(i)
|
17
|
+
o = o.to_packed_cbor if /p/ === options
|
18
|
+
o = o.to_unpacked_cbor if /q/ === options
|
16
19
|
o = o.cbor_pre_canonicalize if /c/ === options
|
17
20
|
o = o.cbor_prepare_deterministic if /d/ === options
|
18
21
|
out = o.cbor_diagnostic(try_decode_embedded: /e/ === options,
|
data/bin/cborseq2json.rb
CHANGED
@@ -5,7 +5,7 @@ require 'cbor-deterministic'
|
|
5
5
|
require 'cbor-canonical'
|
6
6
|
|
7
7
|
options = ''
|
8
|
-
while /\A-([
|
8
|
+
while /\A-([cdpq]+)\z/ === ARGV[0]
|
9
9
|
options << $1
|
10
10
|
ARGV.shift
|
11
11
|
end
|
@@ -14,6 +14,8 @@ ARGF.binmode
|
|
14
14
|
i = ARGF.read
|
15
15
|
while i != ''
|
16
16
|
o, i = CBOR.decode_with_rest(i)
|
17
|
+
o = o.to_packed_cbor if /p/ === options
|
18
|
+
o = o.to_unpacked_cbor if /q/ === options
|
17
19
|
o = o.cbor_pre_canonicalize if /c/ === options
|
18
20
|
o = o.cbor_prepare_deterministic if /d/ === options
|
19
21
|
puts JSON.pretty_generate(o)
|
data/bin/cborseq2neatjson.rb
CHANGED
@@ -6,7 +6,7 @@ require 'cbor-deterministic'
|
|
6
6
|
require 'cbor-canonical'
|
7
7
|
|
8
8
|
options = ''
|
9
|
-
while /\A-([
|
9
|
+
while /\A-([cdpq]+)\z/ === ARGV[0]
|
10
10
|
options << $1
|
11
11
|
ARGV.shift
|
12
12
|
end
|
@@ -15,6 +15,8 @@ ARGF.binmode
|
|
15
15
|
i = ARGF.read
|
16
16
|
while i != ''
|
17
17
|
o, i = CBOR.decode_with_rest(i)
|
18
|
+
o = o.to_packed_cbor if /p/ === options
|
19
|
+
o = o.to_unpacked_cbor if /q/ === options
|
18
20
|
o = o.cbor_pre_canonicalize if /c/ === options
|
19
21
|
o = o.cbor_prepare_deterministic if /d/ === options
|
20
22
|
puts JSON.neat_generate(o, after_comma: 1, after_colon: 1)
|
data/bin/cborseq2yaml.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'psych.rb' # WTF
|
3
3
|
require 'yaml'
|
4
4
|
require 'cbor-pure'
|
5
|
+
require 'cbor-packed'
|
5
6
|
require 'cbor-deterministic'
|
6
7
|
require 'cbor-canonical'
|
7
8
|
|
@@ -12,7 +13,7 @@ class Array
|
|
12
13
|
end
|
13
14
|
|
14
15
|
options = ''
|
15
|
-
while /\A-([
|
16
|
+
while /\A-([cdpq]+)\z/ === ARGV[0]
|
16
17
|
options << $1
|
17
18
|
ARGV.shift
|
18
19
|
end
|
@@ -22,6 +23,8 @@ ARGF.binmode
|
|
22
23
|
i = ARGF.read
|
23
24
|
while i != ''
|
24
25
|
o, i = CBOR.decode_with_rest(i)
|
26
|
+
o = o.to_packed_cbor if /p/ === options
|
27
|
+
o = o.to_unpacked_cbor if /q/ === options
|
25
28
|
o = o.cbor_pre_canonicalize if /c/ === options
|
26
29
|
o = o.cbor_prepare_deterministic if /d/ === options
|
27
30
|
puts YAML.dump(o)
|
data/bin/diag2diag.rb
CHANGED
@@ -7,16 +7,19 @@ unless ''.respond_to? :b
|
|
7
7
|
end
|
8
8
|
require 'cbor-pretty'
|
9
9
|
require 'cbor-diagnostic'
|
10
|
+
require 'cbor-packed'
|
10
11
|
require 'cbor-deterministic'
|
11
12
|
require 'cbor-canonical'
|
12
13
|
|
13
14
|
options = ''
|
14
|
-
while /\A-([
|
15
|
+
while /\A-([cdetpqu]+)\z/ === ARGV[0]
|
15
16
|
options << $1
|
16
17
|
ARGV.shift
|
17
18
|
end
|
18
19
|
|
19
20
|
def diagnostic(o, options)
|
21
|
+
o = o.to_packed_cbor if /p/ === options
|
22
|
+
o = o.to_unpacked_cbor if /q/ === options
|
20
23
|
o = o.cbor_pre_canonicalize if /c/ === options
|
21
24
|
o = o.cbor_prepare_deterministic if /d/ === options
|
22
25
|
puts o.cbor_diagnostic(try_decode_embedded: /e/ === options,
|
data/bin/json2cbor.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'json'
|
3
3
|
require 'cbor-pure'
|
4
|
+
require 'cbor-packed'
|
4
5
|
require 'cbor-deterministic'
|
5
6
|
require 'cbor-canonical'
|
6
7
|
|
7
8
|
options = ''
|
8
|
-
while /\A-([
|
9
|
+
while /\A-([cdpqv]+)\z/ === ARGV[0]
|
9
10
|
options << $1
|
10
11
|
ARGV.shift
|
11
12
|
end
|
@@ -13,6 +14,8 @@ end
|
|
13
14
|
$stdout.binmode
|
14
15
|
i = ARGF.read
|
15
16
|
o = JSON.load(i)
|
17
|
+
o = o.to_packed_cbor if /p/ === options
|
18
|
+
o = o.to_unpacked_cbor if /q/ === options
|
16
19
|
o = o.cbor_pre_canonicalize if /c/ === options
|
17
20
|
o = o.cbor_prepare_deterministic if /d/ === options
|
18
21
|
o = CBOR.encode(o)
|
data/bin/json2json.rb
CHANGED
@@ -1,17 +1,20 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'json'
|
3
3
|
require 'cbor-pure'
|
4
|
+
require 'cbor-packed'
|
4
5
|
require 'cbor-deterministic'
|
5
6
|
require 'cbor-canonical'
|
6
7
|
|
7
8
|
options = ''
|
8
|
-
while /\A-([
|
9
|
+
while /\A-([cdpq]+)\z/ === ARGV[0]
|
9
10
|
options << $1
|
10
11
|
ARGV.shift
|
11
12
|
end
|
12
13
|
|
13
14
|
i = ARGF.read
|
14
15
|
o = JSON.load(i)
|
16
|
+
o = o.to_packed_cbor if /p/ === options
|
17
|
+
o = o.to_unpacked_cbor if /q/ === options
|
15
18
|
o = o.cbor_pre_canonicalize if /c/ === options
|
16
19
|
o = o.cbor_prepare_deterministic if /d/ === options
|
17
20
|
puts JSON.pretty_generate(o)
|
data/bin/json2neatjson.rb
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
require 'json'
|
3
3
|
require 'cbor-pure'
|
4
4
|
require 'neatjson'
|
5
|
+
require 'cbor-packed'
|
5
6
|
require 'cbor-deterministic'
|
6
7
|
require 'cbor-canonical'
|
7
8
|
|
8
9
|
options = ''
|
9
|
-
while /\A-([
|
10
|
+
while /\A-([cdpq]+)\z/ === ARGV[0]
|
10
11
|
options << $1
|
11
12
|
ARGV.shift
|
12
13
|
end
|
@@ -14,6 +15,8 @@ end
|
|
14
15
|
$stdout.binmode
|
15
16
|
i = ARGF.read
|
16
17
|
o = JSON.load(i)
|
18
|
+
o = o.to_packed_cbor if /p/ === options
|
19
|
+
o = o.to_unpacked_cbor if /q/ === options
|
17
20
|
o = o.cbor_pre_canonicalize if /c/ === options
|
18
21
|
o = o.cbor_prepare_deterministic if /d/ === options
|
19
22
|
puts JSON.neat_generate(o, after_comma: 1, after_colon: 1)
|
data/bin/json2yaml.rb
CHANGED
@@ -3,6 +3,7 @@ require 'psych.rb' # WTF
|
|
3
3
|
require 'yaml'
|
4
4
|
require 'json'
|
5
5
|
require 'cbor-pure'
|
6
|
+
require 'cbor-packed'
|
6
7
|
require 'cbor-deterministic'
|
7
8
|
require 'cbor-canonical'
|
8
9
|
|
@@ -13,13 +14,15 @@ class Array
|
|
13
14
|
end
|
14
15
|
|
15
16
|
options = ''
|
16
|
-
while /\A-([
|
17
|
+
while /\A-([cdpq]+)\z/ === ARGV[0]
|
17
18
|
options << $1
|
18
19
|
ARGV.shift
|
19
20
|
end
|
20
21
|
|
21
22
|
i = ARGF.read
|
22
23
|
o = JSON.load(i)
|
24
|
+
o = o.to_packed_cbor if /p/ === options
|
25
|
+
o = o.to_unpacked_cbor if /q/ === options
|
23
26
|
o = o.cbor_pre_canonicalize if /c/ === options
|
24
27
|
o = o.cbor_prepare_deterministic if /d/ === options
|
25
28
|
puts YAML.dump(o)
|
data/bin/yaml2cbor.rb
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
require 'psych.rb' # WTF
|
3
3
|
require 'yaml'
|
4
4
|
require 'cbor-pure'
|
5
|
+
require 'cbor-packed'
|
5
6
|
require 'cbor-deterministic'
|
6
7
|
require 'cbor-canonical'
|
7
8
|
|
8
9
|
options = ''
|
9
|
-
while /\A-([
|
10
|
+
while /\A-([cdpqv]+)\z/ === ARGV[0]
|
10
11
|
options << $1
|
11
12
|
ARGV.shift
|
12
13
|
end
|
@@ -14,6 +15,8 @@ end
|
|
14
15
|
$stdout.binmode
|
15
16
|
i = ARGF.read
|
16
17
|
o = YAML.load(i)
|
18
|
+
o = o.to_packed_cbor if /p/ === options
|
19
|
+
o = o.to_unpacked_cbor if /q/ === options
|
17
20
|
o = o.cbor_pre_canonicalize if /c/ === options
|
18
21
|
o = o.cbor_prepare_deterministic if /d/ === options
|
19
22
|
o = CBOR.encode(o)
|
data/bin/yaml2json.rb
CHANGED
@@ -3,17 +3,20 @@ require 'json'
|
|
3
3
|
require 'psych.rb' # WTF
|
4
4
|
require 'yaml'
|
5
5
|
require 'cbor-pure'
|
6
|
+
require 'cbor-packed'
|
6
7
|
require 'cbor-deterministic'
|
7
8
|
require 'cbor-canonical'
|
8
9
|
|
9
10
|
options = ''
|
10
|
-
while /\A-([
|
11
|
+
while /\A-([cdpq]+)\z/ === ARGV[0]
|
11
12
|
options << $1
|
12
13
|
ARGV.shift
|
13
14
|
end
|
14
15
|
|
15
16
|
i = ARGF.read
|
16
17
|
o = YAML.load(i)
|
18
|
+
o = o.to_packed_cbor if /p/ === options
|
19
|
+
o = o.to_unpacked_cbor if /q/ === options
|
17
20
|
o = o.cbor_pre_canonicalize if /c/ === options
|
18
21
|
o = o.cbor_prepare_deterministic if /d/ === options
|
19
22
|
puts JSON.pretty_generate(o)
|
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.20"
|
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"
|
@@ -22,4 +22,5 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_dependency 'neatjson'
|
23
23
|
s.add_dependency 'cbor-deterministic'
|
24
24
|
s.add_dependency 'cbor-canonical'
|
25
|
+
s.add_dependency 'cbor-packed'
|
25
26
|
end
|
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.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: cbor-packed
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: cbor-diag implements diagnostic notation for CBOR, RFC 8949 and RFC 8742
|
98
112
|
email: cabo@tzi.org
|
99
113
|
executables:
|
@@ -171,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
185
|
- !ruby/object:Gem::Version
|
172
186
|
version: '0'
|
173
187
|
requirements: []
|
174
|
-
rubygems_version: 3.2.
|
188
|
+
rubygems_version: 3.2.15
|
175
189
|
signing_key:
|
176
190
|
specification_version: 4
|
177
191
|
summary: CBOR (Concise Binary Object Representation) diagnostic notation
|