bson 4.9.4 → 4.9.5
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 +4 -4
- checksums.yaml.gz.sig +1 -2
- data.tar.gz.sig +0 -0
- data/ext/bson/read.c +12 -12
- data/lib/bson/version.rb +1 -1
- data/lib/bson_native.bundle +0 -0
- metadata +80 -79
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e5e88dfb0ddb4d37e05be097f8b26c7a980bfc1abcc9d1e05fe40aa4130c7b5
|
4
|
+
data.tar.gz: d388af7cec7de94fa13487c78bdd747eb5bf0ac99c6aaf5a4dd012bc95e7800d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ae9d9e323587d434ce674440d0c3f980ee9aa1c8654a3a895e8dc23c66d2f4a58608f6897b1367b811f6c7fb72cccf8e4cb150fb7ca6951ba17ee3051e74eeb
|
7
|
+
data.tar.gz: 2fda4fc32c12e3d3a69dc2ba9ea35f85b784d71824e4e69268bb30898dea237f973b59be8c0fba625d13dbabb1ef2083ba56bdddb38ed0c43ecea11ffaf4afe5
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
�ɒ��[���E`�}��|$�lP�/R�Ag��)�Q��P�ϼ�t�:���X�lFi��eoy/��u�HM���j!\���ISL��B�0������c[D�)�{n:��:Q�����Tm;�&�!�a�f�CÌd�%?ț����O�X���%��;<���.Y~�_{��'����?�,0p<���9�H�����������q����L����#^�
|
1
|
+
@#��8n\��E�T)�ܬsgЈw��t���u`*UT�kV��'�EZ�Io�lˀj���n_!iA_�`ٻ) �ȣ��F!������թ^0��,���%&�ߚ��2�FQw��J% Pl��*e�̈́���X\���o)%�c~n�e�M{�_���͵�ˠn2R$|����/�d9H*]����d�����%4T����i2�L���t�<��� �y4��S|���<��r!���]�u�:�eLu��
|
data.tar.gz.sig
CHANGED
Binary file
|
data/ext/bson/read.c
CHANGED
@@ -41,12 +41,12 @@ void pvt_raise_decode_error(volatile VALUE msg) {
|
|
41
41
|
int32_t pvt_validate_length(byte_buffer_t *b)
|
42
42
|
{
|
43
43
|
int32_t length;
|
44
|
-
|
44
|
+
|
45
45
|
ENSURE_BSON_READ(b, 4);
|
46
46
|
memcpy(&length, READ_PTR(b), 4);
|
47
47
|
length = BSON_UINT32_TO_LE(length);
|
48
48
|
|
49
|
-
/* minimum valid length is 4 (byte count) + 1 (terminating byte) */
|
49
|
+
/* minimum valid length is 4 (byte count) + 1 (terminating byte) */
|
50
50
|
if(length >= 5){
|
51
51
|
ENSURE_BSON_READ(b, length);
|
52
52
|
|
@@ -59,7 +59,7 @@ int32_t pvt_validate_length(byte_buffer_t *b)
|
|
59
59
|
else{
|
60
60
|
rb_raise(rb_eRangeError, "Buffer contained invalid length %d at %zu", length, b->read_position);
|
61
61
|
}
|
62
|
-
|
62
|
+
|
63
63
|
return length;
|
64
64
|
}
|
65
65
|
|
@@ -175,13 +175,13 @@ VALUE pvt_get_string(byte_buffer_t *b, const char *data_type)
|
|
175
175
|
}
|
176
176
|
ENSURE_BSON_READ(b, 4 + length);
|
177
177
|
str_ptr = READ_PTR(b) + 4;
|
178
|
-
last_byte = *(READ_PTR(b) + 4 +
|
178
|
+
last_byte = *(READ_PTR(b) + 4 + length - 1);
|
179
179
|
if (last_byte != 0) {
|
180
180
|
pvt_raise_decode_error(rb_sprintf("Last byte of the string is not null: 0x%x", (int) last_byte));
|
181
181
|
}
|
182
182
|
rb_bson_utf8_validate(str_ptr, length - 1, true, data_type);
|
183
183
|
string = rb_enc_str_new(str_ptr, length - 1, rb_utf8_encoding());
|
184
|
-
b->read_position += 4 +
|
184
|
+
b->read_position += 4 + length;
|
185
185
|
return string;
|
186
186
|
}
|
187
187
|
|
@@ -205,7 +205,7 @@ VALUE pvt_get_symbol(byte_buffer_t *b, VALUE rb_buffer, int argc, VALUE *argv)
|
|
205
205
|
klass = rb_funcall(rb_bson_registry, rb_intern("get"), 1, INT2FIX(BSON_TYPE_SYMBOL));
|
206
206
|
value = rb_funcall(klass, rb_intern("from_bson"), 1, rb_buffer);
|
207
207
|
}
|
208
|
-
|
208
|
+
|
209
209
|
RB_GC_GUARD(klass);
|
210
210
|
return value;
|
211
211
|
}
|
@@ -284,7 +284,7 @@ VALUE pvt_get_int64(byte_buffer_t *b, int argc, VALUE *argv)
|
|
284
284
|
memcpy(&i64, READ_PTR(b), 8);
|
285
285
|
b->read_position += 8;
|
286
286
|
num = LL2NUM(BSON_UINT64_FROM_LE(i64));
|
287
|
-
|
287
|
+
|
288
288
|
if (pvt_get_mode_option(argc, argv) == BSON_MODE_BSON) {
|
289
289
|
VALUE klass = rb_funcall(rb_bson_registry,rb_intern("get"),1, INT2FIX(BSON_TYPE_INT64));
|
290
290
|
VALUE value = rb_funcall(klass, rb_intern("new"), 1, num);
|
@@ -293,7 +293,7 @@ VALUE pvt_get_int64(byte_buffer_t *b, int argc, VALUE *argv)
|
|
293
293
|
} else {
|
294
294
|
return num;
|
295
295
|
}
|
296
|
-
|
296
|
+
|
297
297
|
RB_GC_GUARD(num);
|
298
298
|
}
|
299
299
|
|
@@ -353,11 +353,11 @@ VALUE rb_bson_byte_buffer_get_hash(int argc, VALUE *argv, VALUE self){
|
|
353
353
|
rb_hash_aset(doc, field, pvt_read_field(b, self, type, argc, argv));
|
354
354
|
RB_GC_GUARD(field);
|
355
355
|
}
|
356
|
-
|
356
|
+
|
357
357
|
if (READ_PTR(b) - start_ptr != length) {
|
358
358
|
pvt_raise_decode_error(rb_sprintf("Expected to read %d bytes for the hash but read %ld bytes", length, READ_PTR(b) - start_ptr));
|
359
359
|
}
|
360
|
-
|
360
|
+
|
361
361
|
return doc;
|
362
362
|
}
|
363
363
|
|
@@ -379,10 +379,10 @@ VALUE rb_bson_byte_buffer_get_array(int argc, VALUE *argv, VALUE self){
|
|
379
379
|
rb_ary_push(array, pvt_read_field(b, self, type, argc, argv));
|
380
380
|
}
|
381
381
|
RB_GC_GUARD(array);
|
382
|
-
|
382
|
+
|
383
383
|
if (READ_PTR(b) - start_ptr != length) {
|
384
384
|
pvt_raise_decode_error(rb_sprintf("Expected to read %d bytes for the hash but read %ld bytes", length, READ_PTR(b) - start_ptr));
|
385
385
|
}
|
386
|
-
|
386
|
+
|
387
387
|
return array;
|
388
388
|
}
|
data/lib/bson/version.rb
CHANGED
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.9.
|
4
|
+
version: 4.9.5
|
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-
|
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/
|
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-
|
251
|
-
- spec/spec_tests/data/corpus/decimal128-
|
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/
|
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/
|
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/
|
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/
|
297
|
-
- spec/spec_tests/data/corpus_legacy/
|
298
|
-
- spec/spec_tests/
|
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/
|
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/
|
316
|
-
- spec/bson/
|
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/
|
323
|
+
- spec/bson/document_spec.rb
|
324
|
+
- spec/bson/min_key_spec.rb
|
327
325
|
- spec/bson/false_class_spec.rb
|
328
|
-
- spec/bson/
|
329
|
-
- spec/bson/
|
330
|
-
- spec/bson/
|
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/
|
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/
|
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/
|
336
|
+
- spec/bson/raw_spec.rb
|
337
|
+
- spec/bson/string_spec.rb
|
345
338
|
- spec/bson/timestamp_spec.rb
|
346
|
-
- spec/bson/
|
347
|
-
- spec/bson/
|
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
|