cbor 0.5.10.1 → 0.5.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 350f51028ed72c54fb5adf9ab595f08e18384cecb8c82d874d195aab6eb16a65
4
- data.tar.gz: 1eb340e507d590530f0c2d9a3cfaf723fb9210596a312443e7b2dc95b912614f
3
+ metadata.gz: fafbded4dd72295218759d12eea5b09b280ec06719eca7d646164173a2405fe2
4
+ data.tar.gz: abcc97eaa52ad9abd549b3bf18819ff2982f09d1ab283df06ff46d7f10a4c470
5
5
  SHA512:
6
- metadata.gz: 30fb71f7d3fce1bbf5f40c84d7ca389a1e30051c186c01553d0be07e784a4029dc27cdf6c01a70dd1a155c6bddd050d21705c642e5df6727633d15b39808d153
7
- data.tar.gz: 75783b66fccc0dd03ce323411f81848964e0904805e5eeb9218cc59214d1bfd1a3011df255de2b6a95a92b1d42475d5fb770a0029d6486c6c4060605a3e24f94
6
+ metadata.gz: 82e84122c5a22dc4a6644823d92a33de60a55f58ef0844637aad0e72a6fdf899afa1f016aafc1306e12ec323c55c035ef5a9148252c68f162fd75d222f61262f
7
+ data.tar.gz: a68bc717c4886e2dc5dd969941f2f33d620bcdbe8d9609ab06356ecc7d2de7e26699c21f8b56eb51d3b942204772e84413778aa7fb7fdcfb9a933c7a1923362a
@@ -73,8 +73,6 @@ static ID get_partial_read_method(VALUE io)
73
73
  {
74
74
  if(rb_respond_to(io, s_readpartial)) {
75
75
  return s_readpartial;
76
- } else if(rb_respond_to(io, s_read)) {
77
- return s_read;
78
76
  } else {
79
77
  return s_read;
80
78
  }
data/ext/cbor/unpacker.c CHANGED
@@ -683,6 +683,7 @@ int msgpack_unpacker_read(msgpack_unpacker_t* uk, size_t target_stack_depth)
683
683
  if(msgpack_unpacker_stack_pop(uk) <= target_stack_depth) {
684
684
  return PRIMITIVE_OBJECT_COMPLETE;
685
685
  }
686
+ r = PRIMITIVE_OBJECT_COMPLETE;
686
687
  goto container_completed;
687
688
  }
688
689
  }
data/lib/cbor/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CBOR
2
- VERSION = "0.5.10.1"
2
+ VERSION = "0.5.10.2"
3
3
  end
data/spec/format_spec.rb CHANGED
@@ -334,6 +334,66 @@ describe MessagePack do
334
334
  }.should raise_error(MessagePack::MalformedFormatError)
335
335
  end
336
336
 
337
+ # Regression tests for https://github.com/cabo/cbor-ruby/issues/20
338
+ # Nested indefinite-length containers should decode correctly.
339
+
340
+ it "{_ 'a' => [_ 1]}" do
341
+ # indefinite map containing an indefinite array
342
+ check_decode "\xbf\x61a\x9f\x01\xff\xff", {"a" => [1]}
343
+ end
344
+
345
+ it "{_ 'a' => [_ 1], 'b' => [2, 3]}" do
346
+ # indefinite map containing an indefinite and a definite array
347
+ check_decode "\xbf\x61a\x9f\x01\xff\x61b\x82\x02\x03\xff", {"a" => [1], "b" => [2, 3]}
348
+ end
349
+
350
+ it "{_ 'a' => {_ 'b' => 1}}" do
351
+ # indefinite map containing an indefinite map
352
+ check_decode "\xbf\x61a\xbf\x61b\x01\xff\xff", {"a" => {"b" => 1}}
353
+ end
354
+
355
+ it "{_ 'a' => {_ }}" do
356
+ # indefinite map containing an empty indefinite map
357
+ check_decode "\xbf\x61a\xbf\xff\xff", {"a" => {}}
358
+ end
359
+
360
+ it "{_ 'a' => {_ NO BREAK}" do
361
+ # indefinite map containing an empty indefinite map
362
+ lambda {
363
+ check_decode "\xbf\x61a\xbf\xff", {"a" => {}}
364
+ }.should raise_error(EOFError)
365
+ end
366
+
367
+ it "{_ 'a' => {} NO BREAK" do
368
+ # indefinite map containing an empty indefinite map
369
+ lambda {
370
+ check_decode "\xbf\x61a\xa0", {"a" => {}}
371
+ }.should raise_error(EOFError)
372
+ end
373
+
374
+ it "{_ 'a' => {_ 'b' => 1}, 'b' => {'c' => 2}}" do
375
+ # indefinite map containing an indefinite and a definite map
376
+ check_decode "\xbf\x61a\xbf\x61b\x01\xff\x61b\xa1\x61c\x02\xff", {"a" => {"b" => 1}, "b" => {"c" => 2}}
377
+ end
378
+
379
+ it "[_ {_ 'a' => 1}]" do
380
+ # indefinite array containing an indefinite map
381
+ check_decode "\x9f\xbf\x61a\x01\xff\xff", [{"a" => 1}]
382
+ end
383
+
384
+ it "{_ 'files' => [{_ 'name' => 'foo'}]}" do
385
+ # indefinite map containing a definite array of indefinite maps
386
+ # (the exact pattern produced by Jackson's CBOR serializer)
387
+ check_decode "\xbf\x65files\x81\xbf\x64name\x63foo\xff\xff",
388
+ {"files" => [{"name" => "foo"}]}
389
+ end
390
+
391
+ it "deeply nested indefinite containers" do
392
+ # {_ "a" => {_ "b" => [_ {_ "c" => 1}]}}
393
+ check_decode "\xbf\x61a\xbf\x61b\x9f\xbf\x61c\x01\xff\xff\xff\xff",
394
+ {"a" => {"b" => [{"c" => 1}]}}
395
+ end
396
+
337
397
  it "(_ a b)" do
338
398
  check_decode "\x7f\xff", "".encode_as_utf8
339
399
  check_decode "\x5f\xff", "".b
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cbor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10.1
4
+ version: 0.5.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann, standing on the tall shoulders of Sadayuki Furuhashi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-08-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bundler
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubygems_version: 3.6.2
176
+ rubygems_version: 4.0.2
177
177
  specification_version: 4
178
178
  summary: CBOR, Concise Binary Object Representation.
179
179
  test_files: