cbor-diag 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e70f398e625854b183df277bd5035b8604ef33db1dd7981c37c8a4f0499deea
4
- data.tar.gz: f64b6a4be7317cc969338a35fd3f029898f91e2b21b60db4c8b5f5946f403b07
3
+ metadata.gz: fd65812eff17fff91777d0c28f076a1fa5f65dd0a972980243e8a324f1e822a0
4
+ data.tar.gz: 85d593a5feb8593d0e4b24a73078aa68718208b81bb8c00836e711990a5c9d48
5
5
  SHA512:
6
- metadata.gz: 698c8d044dffd383f38fbe07940e4865fa6075db90fa1c69e9350add7b4e1ecc70cb39bee427951b5c79eda046e9a2c45fcd6eaef417c0c9e8c6eedbff6f8a94
7
- data.tar.gz: a35b6183c2f9fbba915ae5dd5989b5fd75ba4d11be52941e68a7ede0d08a1588b771c2a76834d3f5a88d6e670a1ee856db1173502c9c0e161d2de9421f080eaa
6
+ metadata.gz: 14a85c16fdbd914650a52bd982dddef3991e83cae52b504355dcb536be3c9eea91b14bac25d84b98e57f5daa986e76dcd420d81b1f3aebf8e81becf6d63b7e64
7
+ data.tar.gz: 9b24cf004311b95c512b866f71b9c05dadab3c5e676f835eac3a305f32e0cce81bae36f12ea10381918cfd3415af2ea9b644e054981bdf7de162edc1d28ddcbe
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.8.1"
3
+ s.version = "0.8.2"
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"
data/lib/cbor-pretty.rb CHANGED
@@ -13,6 +13,11 @@ class String
13
13
  def hexbytes(sep = '')
14
14
  bytes.map{|x| HEX_FORMAT % x}.join(sep)
15
15
  end
16
+ def to_json_514_workaround
17
+ ret = to_json
18
+ ret.encode(Encoding::UTF_16BE) # exception if bad
19
+ ret
20
+ end
16
21
  end
17
22
 
18
23
 
@@ -76,7 +81,7 @@ module CBOR
76
81
  when 2, 3
77
82
  @out << ' ' * (@indent)
78
83
  s = take_and_print(val)
79
- @out << " # #{s.force_encoding(Encoding::UTF_8).to_json rescue s.inspect}"
84
+ @out << " # #{s.force_encoding(Encoding::UTF_8).to_json_514_workaround rescue s.inspect}"
80
85
  @out << "\n"
81
86
  when 4; val.times { pretty_item }
82
87
  when 5; val.times { pretty_item; pretty_item}
@@ -92,9 +97,9 @@ module CBOR
92
97
  unless seq
93
98
  raise if @pos != @buffer.size
94
99
  end
95
- target = [@out.each_line.map {|ln| ln =~ /#/ || 0}.max, max_target].min
100
+ target = [@out.each_line.map {|ln| ln.index('#') || 0}.max, max_target].min
96
101
  @out.each_line.map {|ln|
97
- col = ln =~ /#/
102
+ col = ln.index('#')
98
103
  if col && col < target
99
104
  ln[col, 0] = ' ' * (target - col)
100
105
  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.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-05 00:00:00.000000000 Z
11
+ date: 2023-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.3.11
193
+ rubygems_version: 3.4.2
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: CBOR (Concise Binary Object Representation) diagnostic notation