bson 4.10.0 → 4.10.1

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: a62c9c51fa6fafda7b1e9a084a118fd34e25804fd97ffd504f8d00690d2eb9f0
4
- data.tar.gz: 219e45cccac4d1d1b7f7dfad0e6f386538678d632cc9937b9f0f6c06f57e4118
3
+ metadata.gz: e39811e4c57495904b3efdb835093609b89e3eea90bc5c493c56bc3adf803a29
4
+ data.tar.gz: ac5ca45bcfe81e133931420591d8c866b674912138cbcc5de36edfb94d0ee2ce
5
5
  SHA512:
6
- metadata.gz: 40cab24a15e3430250426e270e99700ab2527d417ac9a248976afc1e1cee5deb9bd1b7dc07112d1d772cb4e65387a3c6fab00943bc55b9d426bc29fee39aba9e
7
- data.tar.gz: 349f013a08fc84afea777262e88f8813586621f4dc4273ebf122fd347d574dc8dee8b102ba901085b373b3479b1172c3c596a8dd3e5086e05d19b109845f6168
6
+ metadata.gz: 6a9d6eb3a581073ba8de7bf5d718d2368426841ea6681d82bb771239759aa62038c281c596caf853e898d00af7549b96e1b5f48e3b04a04ff652e93f94f8c5f3
7
+ data.tar.gz: f7f4b93b14c632ce2b70211bbb879b24a0e65cc2f4bdf430b75d88c9f6b994f931ce8fdd1021dbd987b52ce634972a0155dc0468caca22bb4264a60a7c2b895d
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -42,12 +42,12 @@ void pvt_raise_decode_error(volatile VALUE msg) {
42
42
  int32_t pvt_validate_length(byte_buffer_t *b)
43
43
  {
44
44
  int32_t length;
45
-
45
+
46
46
  ENSURE_BSON_READ(b, 4);
47
47
  memcpy(&length, READ_PTR(b), 4);
48
48
  length = BSON_UINT32_TO_LE(length);
49
49
 
50
- /* minimum valid length is 4 (byte count) + 1 (terminating byte) */
50
+ /* minimum valid length is 4 (byte count) + 1 (terminating byte) */
51
51
  if(length >= 5){
52
52
  ENSURE_BSON_READ(b, length);
53
53
 
@@ -60,7 +60,7 @@ int32_t pvt_validate_length(byte_buffer_t *b)
60
60
  else{
61
61
  rb_raise(rb_eRangeError, "Buffer contained invalid length %d at %zu", length, b->read_position);
62
62
  }
63
-
63
+
64
64
  return length;
65
65
  }
66
66
 
@@ -176,13 +176,13 @@ VALUE pvt_get_string(byte_buffer_t *b, const char *data_type)
176
176
  }
177
177
  ENSURE_BSON_READ(b, 4 + length);
178
178
  str_ptr = READ_PTR(b) + 4;
179
- last_byte = *(READ_PTR(b) + 4 + length_le - 1);
179
+ last_byte = *(READ_PTR(b) + 4 + length - 1);
180
180
  if (last_byte != 0) {
181
181
  pvt_raise_decode_error(rb_sprintf("Last byte of the string is not null: 0x%x", (int) last_byte));
182
182
  }
183
183
  rb_bson_utf8_validate(str_ptr, length - 1, true, data_type);
184
184
  string = rb_enc_str_new(str_ptr, length - 1, rb_utf8_encoding());
185
- b->read_position += 4 + length_le;
185
+ b->read_position += 4 + length;
186
186
  return string;
187
187
  }
188
188
 
@@ -206,7 +206,7 @@ VALUE pvt_get_symbol(byte_buffer_t *b, VALUE rb_buffer, int argc, VALUE *argv)
206
206
  klass = rb_funcall(rb_bson_registry, rb_intern("get"), 1, INT2FIX(BSON_TYPE_SYMBOL));
207
207
  value = rb_funcall(klass, rb_intern("from_bson"), 1, rb_buffer);
208
208
  }
209
-
209
+
210
210
  RB_GC_GUARD(klass);
211
211
  return value;
212
212
  }
@@ -307,7 +307,7 @@ VALUE pvt_get_int64(byte_buffer_t *b, int argc, VALUE *argv)
307
307
  memcpy(&i64, READ_PTR(b), 8);
308
308
  b->read_position += 8;
309
309
  num = LL2NUM(BSON_UINT64_FROM_LE(i64));
310
-
310
+
311
311
  if (pvt_get_mode_option(argc, argv) == BSON_MODE_BSON) {
312
312
  VALUE klass = rb_funcall(rb_bson_registry,rb_intern("get"),1, INT2FIX(BSON_TYPE_INT64));
313
313
  VALUE value = rb_funcall(klass, rb_intern("new"), 1, num);
@@ -316,7 +316,7 @@ VALUE pvt_get_int64(byte_buffer_t *b, int argc, VALUE *argv)
316
316
  } else {
317
317
  return num;
318
318
  }
319
-
319
+
320
320
  RB_GC_GUARD(num);
321
321
  }
322
322
 
@@ -376,11 +376,11 @@ VALUE rb_bson_byte_buffer_get_hash(int argc, VALUE *argv, VALUE self){
376
376
  rb_hash_aset(doc, field, pvt_read_field(b, self, type, argc, argv));
377
377
  RB_GC_GUARD(field);
378
378
  }
379
-
379
+
380
380
  if (READ_PTR(b) - start_ptr != length) {
381
381
  pvt_raise_decode_error(rb_sprintf("Expected to read %d bytes for the hash but read %ld bytes", length, READ_PTR(b) - start_ptr));
382
382
  }
383
-
383
+
384
384
  return doc;
385
385
  }
386
386
 
@@ -402,10 +402,10 @@ VALUE rb_bson_byte_buffer_get_array(int argc, VALUE *argv, VALUE self){
402
402
  rb_ary_push(array, pvt_read_field(b, self, type, argc, argv));
403
403
  }
404
404
  RB_GC_GUARD(array);
405
-
405
+
406
406
  if (READ_PTR(b) - start_ptr != length) {
407
407
  pvt_raise_decode_error(rb_sprintf("Expected to read %d bytes for the hash but read %ld bytes", length, READ_PTR(b) - start_ptr));
408
408
  }
409
-
409
+
410
410
  return array;
411
411
  }
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module BSON
16
- VERSION = "4.10.0".freeze
16
+ VERSION = "4.10.1".freeze
17
17
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bson
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.0
4
+ version: 4.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Brock
@@ -33,7 +33,7 @@ cert_chain:
33
33
  gpvfPNWMwyBDlHaNS3GfO6cRRxBOvEG05GUCsvtTY4Bpe8yjE64wg1ymb47LMOnv
34
34
  Qb1lGORmf/opg45mluKUYl7pQNZHD0d3
35
35
  -----END CERTIFICATE-----
36
- date: 2020-07-17 00:00:00.000000000 Z
36
+ date: 2020-10-13 00:00:00.000000000 Z
37
37
  dependencies: []
38
38
  description: A fully featured BSON specification implementation in Ruby
39
39
  email:
@@ -99,6 +99,7 @@ files:
99
99
  - lib/bson/true_class.rb
100
100
  - lib/bson/undefined.rb
101
101
  - lib/bson/version.rb
102
+ - lib/bson_native.bundle
102
103
  - spec/bson/array_spec.rb
103
104
  - spec/bson/binary_spec.rb
104
105
  - spec/bson/binary_uuid_spec.rb
@@ -239,113 +240,113 @@ signing_key:
239
240
  specification_version: 4
240
241
  summary: Ruby implementation of the BSON specification
241
242
  test_files:
242
- - spec/spec_helper.rb
243
- - spec/spec_tests/corpus_spec.rb
244
243
  - spec/spec_tests/common_driver_spec.rb
245
- - spec/spec_tests/data/corpus/decimal128-7.json
246
- - spec/spec_tests/data/corpus/top.json
244
+ - spec/spec_tests/corpus_legacy_spec.rb
247
245
  - spec/spec_tests/data/corpus/array.json
248
- - spec/spec_tests/data/corpus/null.json
249
246
  - spec/spec_tests/data/corpus/document.json
250
- - spec/spec_tests/data/corpus/decimal128-2.json
251
- - spec/spec_tests/data/corpus/decimal128-6.json
252
- - spec/spec_tests/data/corpus/boolean.json
253
- - spec/spec_tests/data/corpus/README.md
247
+ - spec/spec_tests/data/corpus/decimal128-7.json
248
+ - spec/spec_tests/data/corpus/decimal128-3.json
254
249
  - spec/spec_tests/data/corpus/maxkey.json
255
- - spec/spec_tests/data/corpus/binary.json
256
- - spec/spec_tests/data/corpus/multi-type.json
257
- - spec/spec_tests/data/corpus/timestamp.json
258
- - spec/spec_tests/data/corpus/multi-type-deprecated.json
250
+ - spec/spec_tests/data/corpus/code.json
259
251
  - spec/spec_tests/data/corpus/dbpointer.json
252
+ - spec/spec_tests/data/corpus/int32.json
253
+ - spec/spec_tests/data/corpus/README.md
254
+ - spec/spec_tests/data/corpus/decimal128-5.json
255
+ - spec/spec_tests/data/corpus/decimal128-4.json
256
+ - spec/spec_tests/data/corpus/decimal128-2.json
257
+ - spec/spec_tests/data/corpus/double.json
258
+ - spec/spec_tests/data/corpus/code_w_scope.json
259
+ - spec/spec_tests/data/corpus/binary.json
260
260
  - spec/spec_tests/data/corpus/oid.json
261
+ - spec/spec_tests/data/corpus/null.json
262
+ - spec/spec_tests/data/corpus/decimal128-6.json
263
+ - spec/spec_tests/data/corpus/int64.json
264
+ - spec/spec_tests/data/corpus/dbref.json
261
265
  - spec/spec_tests/data/corpus/regex.json
262
266
  - spec/spec_tests/data/corpus/minkey.json
267
+ - spec/spec_tests/data/corpus/multi-type.json
268
+ - spec/spec_tests/data/corpus/top.json
263
269
  - spec/spec_tests/data/corpus/symbol.json
264
- - spec/spec_tests/data/corpus/dbref.json
265
- - spec/spec_tests/data/corpus/decimal128-1.json
270
+ - spec/spec_tests/data/corpus/multi-type-deprecated.json
266
271
  - spec/spec_tests/data/corpus/undefined.json
267
- - spec/spec_tests/data/corpus/double.json
268
- - spec/spec_tests/data/corpus/decimal128-4.json
269
- - spec/spec_tests/data/corpus/decimal128-3.json
270
- - spec/spec_tests/data/corpus/decimal128-5.json
271
- - spec/spec_tests/data/corpus/int32.json
272
- - spec/spec_tests/data/corpus/string.json
273
- - spec/spec_tests/data/corpus/code.json
274
- - spec/spec_tests/data/corpus/code_w_scope.json
275
- - spec/spec_tests/data/corpus/int64.json
276
272
  - spec/spec_tests/data/corpus/datetime.json
277
- - spec/spec_tests/data/corpus_legacy/top.json
273
+ - spec/spec_tests/data/corpus/string.json
274
+ - spec/spec_tests/data/corpus/boolean.json
275
+ - spec/spec_tests/data/corpus/timestamp.json
276
+ - spec/spec_tests/data/corpus/decimal128-1.json
277
+ - spec/spec_tests/data/decimal128/decimal128-7.json
278
+ - spec/spec_tests/data/decimal128/decimal128-3.json
279
+ - spec/spec_tests/data/decimal128/decimal128-5.json
280
+ - spec/spec_tests/data/decimal128/decimal128-4.json
281
+ - spec/spec_tests/data/decimal128/decimal128-2.json
282
+ - spec/spec_tests/data/decimal128/decimal128-6.json
283
+ - spec/spec_tests/data/decimal128/decimal128-1.json
278
284
  - spec/spec_tests/data/corpus_legacy/array.json
279
- - spec/spec_tests/data/corpus_legacy/null.json
280
285
  - spec/spec_tests/data/corpus_legacy/document.json
281
- - spec/spec_tests/data/corpus_legacy/boolean.json
282
286
  - spec/spec_tests/data/corpus_legacy/maxkey.json
287
+ - spec/spec_tests/data/corpus_legacy/code.json
288
+ - spec/spec_tests/data/corpus_legacy/int32.json
289
+ - spec/spec_tests/data/corpus_legacy/double.json
290
+ - spec/spec_tests/data/corpus_legacy/code_w_scope.json
283
291
  - spec/spec_tests/data/corpus_legacy/binary.json
284
- - spec/spec_tests/data/corpus_legacy/timestamp.json
285
- - spec/spec_tests/data/corpus_legacy/failures/dbpointer.json
286
- - spec/spec_tests/data/corpus_legacy/failures/symbol.json
287
- - spec/spec_tests/data/corpus_legacy/failures/int64.json
288
- - spec/spec_tests/data/corpus_legacy/failures/datetime.json
289
292
  - spec/spec_tests/data/corpus_legacy/oid.json
293
+ - spec/spec_tests/data/corpus_legacy/null.json
290
294
  - spec/spec_tests/data/corpus_legacy/regex.json
291
295
  - spec/spec_tests/data/corpus_legacy/minkey.json
296
+ - spec/spec_tests/data/corpus_legacy/top.json
297
+ - spec/spec_tests/data/corpus_legacy/failures/dbpointer.json
298
+ - spec/spec_tests/data/corpus_legacy/failures/int64.json
299
+ - spec/spec_tests/data/corpus_legacy/failures/symbol.json
300
+ - spec/spec_tests/data/corpus_legacy/failures/datetime.json
292
301
  - spec/spec_tests/data/corpus_legacy/undefined.json
293
- - spec/spec_tests/data/corpus_legacy/double.json
294
- - spec/spec_tests/data/corpus_legacy/int32.json
295
302
  - spec/spec_tests/data/corpus_legacy/string.json
296
- - spec/spec_tests/data/corpus_legacy/code.json
297
- - spec/spec_tests/data/corpus_legacy/code_w_scope.json
298
- - spec/spec_tests/data/decimal128/decimal128-7.json
299
- - spec/spec_tests/data/decimal128/decimal128-2.json
300
- - spec/spec_tests/data/decimal128/decimal128-6.json
301
- - spec/spec_tests/data/decimal128/decimal128-1.json
302
- - spec/spec_tests/data/decimal128/decimal128-4.json
303
- - spec/spec_tests/data/decimal128/decimal128-3.json
304
- - spec/spec_tests/data/decimal128/decimal128-5.json
305
- - spec/spec_tests/corpus_legacy_spec.rb
306
- - spec/support/utils.rb
307
- - spec/support/shared_examples.rb
308
- - spec/support/spec_config.rb
309
- - spec/runners/common_driver.rb
310
- - spec/runners/corpus_legacy.rb
303
+ - spec/spec_tests/data/corpus_legacy/boolean.json
304
+ - spec/spec_tests/data/corpus_legacy/timestamp.json
305
+ - spec/spec_tests/corpus_spec.rb
311
306
  - spec/runners/corpus.rb
312
- - spec/bson/code_spec.rb
307
+ - spec/runners/corpus_legacy.rb
308
+ - spec/runners/common_driver.rb
309
+ - spec/spec_helper.rb
310
+ - spec/support/spec_config.rb
311
+ - spec/support/shared_examples.rb
312
+ - spec/support/utils.rb
313
+ - spec/bson/ext_json_parse_spec.rb
314
+ - spec/bson/object_spec.rb
315
+ - spec/bson/json_spec.rb
316
+ - spec/bson/true_class_spec.rb
313
317
  - spec/bson/byte_buffer_read_spec.rb
318
+ - spec/bson/config_spec.rb
314
319
  - spec/bson/int32_spec.rb
315
- - spec/bson/max_key_spec.rb
316
- - spec/bson/time_spec.rb
317
- - spec/bson/array_spec.rb
318
- - spec/bson/date_time_spec.rb
319
- - spec/bson/document_spec.rb
320
- - spec/bson/float_spec.rb
321
- - spec/bson/nil_class_spec.rb
322
- - spec/bson/time_with_zone_spec.rb
323
- - spec/bson/ext_json_parse_spec.rb
324
- - spec/bson/string_spec.rb
320
+ - spec/bson/regexp_spec.rb
321
+ - spec/bson/symbol_raw_spec.rb
325
322
  - spec/bson/open_struct_spec.rb
326
- - spec/bson/config_spec.rb
323
+ - spec/bson/document_spec.rb
324
+ - spec/bson/min_key_spec.rb
327
325
  - spec/bson/false_class_spec.rb
328
- - spec/bson/raw_spec.rb
329
- - spec/bson/regexp_spec.rb
330
- - spec/bson/binary_spec.rb
331
- - spec/bson/object_spec.rb
326
+ - spec/bson/code_spec.rb
327
+ - spec/bson/symbol_spec.rb
328
+ - spec/bson/object_id_spec.rb
332
329
  - spec/bson/decimal128_spec.rb
333
- - spec/bson/binary_uuid_spec.rb
330
+ - spec/bson/registry_spec.rb
331
+ - spec/bson/time_spec.rb
334
332
  - spec/bson/boolean_spec.rb
335
333
  - spec/bson/byte_buffer_spec.rb
336
- - spec/bson/json_spec.rb
337
- - spec/bson/symbol_spec.rb
338
- - spec/bson/integer_spec.rb
339
- - spec/bson/byte_buffer_write_spec.rb
340
- - spec/bson/registry_spec.rb
341
- - spec/bson/code_with_scope_spec.rb
342
- - spec/bson/true_class_spec.rb
334
+ - spec/bson/hash_spec.rb
343
335
  - spec/bson/undefined_spec.rb
344
- - spec/bson/object_id_spec.rb
336
+ - spec/bson/raw_spec.rb
337
+ - spec/bson/string_spec.rb
345
338
  - spec/bson/timestamp_spec.rb
346
- - spec/bson/hash_spec.rb
347
- - spec/bson/symbol_raw_spec.rb
348
- - spec/bson/min_key_spec.rb
339
+ - spec/bson/date_time_spec.rb
340
+ - spec/bson/max_key_spec.rb
349
341
  - spec/bson/int64_spec.rb
342
+ - spec/bson/byte_buffer_write_spec.rb
350
343
  - spec/bson/date_spec.rb
344
+ - spec/bson/binary_spec.rb
345
+ - spec/bson/code_with_scope_spec.rb
346
+ - spec/bson/integer_spec.rb
347
+ - spec/bson/binary_uuid_spec.rb
348
+ - spec/bson/nil_class_spec.rb
349
+ - spec/bson/array_spec.rb
350
+ - spec/bson/time_with_zone_spec.rb
351
+ - spec/bson/float_spec.rb
351
352
  - spec/bson_spec.rb
metadata.gz.sig CHANGED
Binary file