cddl 0.12.9 → 0.12.10

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: 4c98730c57c25c57066cc2c35d0912b14df39e1d3f3ff3815950217435513d30
4
- data.tar.gz: 1da65aafd52644087e1fa33d5e158ae4c85d58b11658fc39bf64a465f8cf3b43
3
+ metadata.gz: 49a1d0bc5804fcc0cc5d3a67b3b6754e917146021043b63fb53de148e568029b
4
+ data.tar.gz: ab3c7a943a3d8acf7f557f1f796ca30de5572417ea5bb7ad198edf6453ceed4c
5
5
  SHA512:
6
- metadata.gz: 54a58e321f94a6c8e3c61dd0216f1e6afd214972dbd71cc4326a5ec294714b4f0ce5b1695ab951bd5526e1cd9a1550c5102333395e3fdda4cac3a87d0c4d075b
7
- data.tar.gz: ad35e2794090e2d403ffa218fd3c9414052c00092b0a1b34ab11d9a7563be3ac06b0e3b5923982f1f46e9b0a2b13e578c7c3da0b12b4cc4ee6eaff0bb5581f5b
6
+ metadata.gz: e395661ff52a4dd30cfa8e22275c1a247f0ffbe24643a568c431372b7ed86a487ce6d2334cdbe07786e96e0931ed265c653e03c65917a3f82e5b5bdb1046e77b
7
+ data.tar.gz: b022f002061187c6d35312e4e9339dcc01b7b7da3a25f536e8789463f7dd0ec070df99e3ccba93e06e267a3ec938725c05301e3331f60cbb0d441f3be379fab3
data/cddl.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'cddl'
3
- s.version = '0.12.9'
3
+ s.version = '0.12.10'
4
4
  s.summary = "CDDL generator and validator."
5
5
  s.description = %{A parser, generator, and validator for CDDL}
6
6
  s.add_dependency('cbor-diag')
data/lib/cddl.rb CHANGED
@@ -626,7 +626,13 @@ module CDDL
626
626
  end
627
627
  content = JSON::dump(generate1(control))
628
628
  content
629
- when :decimal
629
+ when :decimal, :base10
630
+ if conop == :decimal
631
+ unless @decimal_warned
632
+ warn "** .decimal control operator is now called .base10"
633
+ @decimal_warned = true
634
+ end
635
+ end
630
636
  unless target == [:prim, 3]
631
637
  fail "Don't know yet how to generate #{where}"
632
638
  end
@@ -1200,7 +1206,14 @@ module CDDL
1200
1206
  end
1201
1207
  when :json
1202
1208
  ann if validate1((JSON::load(d) rescue :BAD_JSON), control)
1203
- when :decimal
1209
+ when :decimal, :base10
1210
+ if conop == :decimal
1211
+ unless @decimal_warned
1212
+ warn "** .decimal control operator is now called .base10"
1213
+ @decimal_warned = true
1214
+ end
1215
+ end
1216
+
1204
1217
  ann if (
1205
1218
  if /\A0|-?[1-9][0-9]*\z/ === d
1206
1219
  validate1((d.to_i rescue :BAD_JSON), control)
@@ -1741,7 +1754,7 @@ module CDDL
1741
1754
  :within, :and,
1742
1755
  :default, :lt, :le, :gt, :ge, :eq, :ne,
1743
1756
  :feature, :abnf, :abnfb, :det, :cat, :plus,
1744
- :json, :decimal, :join,
1757
+ :json, :decimal, :base10, :join,
1745
1758
  :b64u, :"b64u-sloppy", :b64c, :"b64c-sloppy",
1746
1759
  :b45, :b32, :h32, :hex, :hexlc, :hexuc,
1747
1760
  :printf,
@@ -0,0 +1 @@
1
+ s = [text .decimal 4711, text .base10 4712]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cddl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.9
4
+ version: 0.12.10
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-12-15 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cbor-diag
@@ -184,6 +184,7 @@ files:
184
184
  - test-data/cose.cddl
185
185
  - test-data/dcaf.cddl
186
186
  - test-data/dcaf1.cddl
187
+ - test-data/decimal-warn.cddl
187
188
  - test-data/decimal.cddl
188
189
  - test-data/decimal2.cddl
189
190
  - test-data/det1.cddl