edn-abnf 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/edn-abnf +11 -1
  3. data/edn-abnf.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f27ae567e340f8f491fd48f61ffcf98080e5a7e25f73e48178ba716382976232
4
- data.tar.gz: 911714cd26c0f5fc215d75bf29f95bb17bb8f7e20b1c89897e2bbdc919047366
3
+ metadata.gz: 5fb3a21c21375974f9e6c3b1f708f002b00aaeaff85e72d430a836ce3e0fd2f7
4
+ data.tar.gz: fcfc55d388ed1b62ab3ecb4503764cc7eb87c6f984d8082c746705091ad38569
5
5
  SHA512:
6
- metadata.gz: adf381d82f725bbcf8f2fcc67bdcf57d999ba236bc6d3f4aae062cc85c0c189770662bb38916134a4e0d5d7a73ed1fa1e0a604cfe39f9f0f29ca34a4102e423b
7
- data.tar.gz: 4edde63c1bd6aac32b14d3c5bf118e43e8d26dd77cc7e4653ec5304699e6341b7e885e96b4afeb7dce3c8f628d07d2f405a85fff24aaa7dfc5324271264c42b3
6
+ metadata.gz: 329bf4e226c07a53b9103a3f9ef58a70d9c2c539ceb5f50a47c80427362dd7d6b4877c4bb53d11da1c0ce811cdd3fda7296e5994e05822b4a706869760819c34
7
+ data.tar.gz: 659cc80dc2d1013c6f2176982205c159e0359036888b50152228c52e0e10148109288f88e716191e6a9eeb104e98ec1a610b00f53d7f1546b64d0a6919f56674
data/bin/edn-abnf CHANGED
@@ -4,6 +4,7 @@ require 'pp'
4
4
  require 'yaml'
5
5
  require 'treetop'
6
6
  require 'json'
7
+ require 'cbor-pretty'
7
8
 
8
9
  require_relative '../lib/edn-abnf.rb'
9
10
 
@@ -46,7 +47,9 @@ begin
46
47
  opts.on("-eEDN", "--e=EDN", "supply EDN on command line") do |v|
47
48
  $options.edn = v
48
49
  end
49
- opts.on("-tFMT", "--to=FMT", [:basic, :neat, :json, :yaml, :edn, :diag], "Target format (default: diag)") do |v|
50
+ opts.on("-tFMT", "--to=FMT",
51
+ [:basic, :neat, :json, :yaml, :edn, :diag, :pretty],
52
+ "Target format (default: diag)") do |v|
50
53
  $options.target = v
51
54
  end
52
55
  end
@@ -137,6 +140,13 @@ when :yaml
137
140
  puts result.to_yaml
138
141
  when :edn, :diag, nil
139
142
  puts result.cbor_diagnostic
143
+ when :pretty
144
+ enc = if CBOR::Sequence === result
145
+ result.to_cborseq
146
+ else
147
+ result.to_cbor
148
+ end
149
+ puts CBOR::pretty_seq(enc)
140
150
  else
141
151
  warn ["Unknown target format: ", $options.target].inspect
142
152
  end
data/edn-abnf.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "edn-abnf"
3
- s.version = "0.3.5"
3
+ s.version = "0.3.6"
4
4
  s.summary = "CBOR Extended Diagnostic Notation (EDN) implemented in ABNF"
5
5
  s.description = %q{edn-abnf implements converters and miscellaneous tools for CBOR EDN's ABNF}
6
6
  s.author = "Carsten Bormann"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edn-abnf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-06 00:00:00.000000000 Z
11
+ date: 2025-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler