cbor-diag 0.5.12 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cborseq2pretty.rb +1 -5
- data/cbor-diag.gemspec +1 -1
- data/lib/cbor-pretty.rb +13 -2
- data/lib/cbor-pure.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b0da5131896552d6bd336a401413b35987ce36a8a007a4f495f6be129bb96b9
|
4
|
+
data.tar.gz: a3e51b152b59cadf5b5dda60c1bc2cfc7b8356cccced607ae5b7f5998945b60c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9939f8edabf591e7e17bf0294589e6208e44f4656ed59c62cabc562e295fc765b2075391320ff51e0fd499c24f305ae372de450d6461f9b68e8d47d0be8575d6
|
7
|
+
data.tar.gz: 57c99ecad423f8c1a556a5e40e24aac0f5fb0fb6efcedb1d3c35ceac94a27a67aabe7215d31f6dc9e57e36633fe69cd81faa903402cb2b78f0030459bcea4d09
|
data/bin/cborseq2pretty.rb
CHANGED
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.13"
|
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"
|
data/lib/cbor-pretty.rb
CHANGED
@@ -17,6 +17,15 @@ module CBOR
|
|
17
17
|
Buffer.new(s).pretty_item_final(indent, max_target)
|
18
18
|
end
|
19
19
|
|
20
|
+
def self.pretty_seq(s, indent = 0, max_target = 40)
|
21
|
+
b = Buffer.new(s)
|
22
|
+
res = '' # XXX: not all indented the same
|
23
|
+
while !b.empty?
|
24
|
+
res << b.pretty_item_final(indent, max_target, true)
|
25
|
+
end
|
26
|
+
res
|
27
|
+
end
|
28
|
+
|
20
29
|
class Buffer
|
21
30
|
|
22
31
|
def take_and_print(n, prefix = '')
|
@@ -72,11 +81,13 @@ module CBOR
|
|
72
81
|
nil
|
73
82
|
end
|
74
83
|
|
75
|
-
def pretty_item_final(indent = 0, max_target = 40)
|
84
|
+
def pretty_item_final(indent = 0, max_target = 40, seq = false)
|
76
85
|
@out = ''
|
77
86
|
@indent = indent
|
78
87
|
pretty_item
|
79
|
-
|
88
|
+
unless seq
|
89
|
+
raise if @pos != @buffer.size
|
90
|
+
end
|
80
91
|
target = [@out.each_line.map {|ln| ln =~ /#/ || 0}.max, max_target].min
|
81
92
|
@out.each_line.map {|ln|
|
82
93
|
col = ln =~ /#/
|
data/lib/cbor-pure.rb
CHANGED
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.13
|
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-02-
|
11
|
+
date: 2021-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|