bson 4.7.0-java → 4.9.0-java

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.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -2
  3. data/lib/bson-ruby.jar +0 -0
  4. data/lib/bson.rb +4 -1
  5. data/lib/bson/active_support.rb +1 -1
  6. data/lib/bson/array.rb +34 -5
  7. data/lib/bson/binary.rb +42 -4
  8. data/lib/bson/boolean.rb +12 -3
  9. data/lib/bson/code.rb +16 -2
  10. data/lib/bson/code_with_scope.rb +32 -5
  11. data/lib/bson/config.rb +1 -1
  12. data/lib/bson/date.rb +1 -1
  13. data/lib/bson/date_time.rb +1 -1
  14. data/lib/bson/db_pointer.rb +110 -0
  15. data/lib/bson/decimal128.rb +16 -2
  16. data/lib/bson/decimal128/builder.rb +1 -1
  17. data/lib/bson/document.rb +1 -1
  18. data/lib/bson/environment.rb +2 -1
  19. data/lib/bson/error.rb +21 -0
  20. data/lib/bson/ext_json.rb +375 -0
  21. data/lib/bson/false_class.rb +1 -1
  22. data/lib/bson/float.rb +48 -2
  23. data/lib/bson/hash.rb +36 -5
  24. data/lib/bson/int32.rb +22 -2
  25. data/lib/bson/int64.rb +29 -4
  26. data/lib/bson/integer.rb +35 -1
  27. data/lib/bson/json.rb +1 -1
  28. data/lib/bson/max_key.rb +13 -1
  29. data/lib/bson/min_key.rb +13 -1
  30. data/lib/bson/nil_class.rb +4 -2
  31. data/lib/bson/object.rb +28 -1
  32. data/lib/bson/object_id.rb +16 -2
  33. data/lib/bson/open_struct.rb +1 -1
  34. data/lib/bson/regexp.rb +20 -3
  35. data/lib/bson/registry.rb +1 -1
  36. data/lib/bson/specialized.rb +4 -2
  37. data/lib/bson/string.rb +4 -2
  38. data/lib/bson/symbol.rb +93 -4
  39. data/lib/bson/time.rb +63 -4
  40. data/lib/bson/time_with_zone.rb +1 -1
  41. data/lib/bson/timestamp.rb +16 -2
  42. data/lib/bson/true_class.rb +1 -1
  43. data/lib/bson/undefined.rb +12 -1
  44. data/lib/bson/version.rb +2 -2
  45. data/spec/bson/array_spec.rb +1 -1
  46. data/spec/bson/binary_spec.rb +34 -4
  47. data/spec/bson/binary_uuid_spec.rb +1 -1
  48. data/spec/bson/boolean_spec.rb +1 -1
  49. data/spec/bson/code_spec.rb +1 -1
  50. data/spec/bson/code_with_scope_spec.rb +1 -1
  51. data/spec/bson/date_spec.rb +1 -1
  52. data/spec/bson/date_time_spec.rb +1 -1
  53. data/spec/bson/decimal128_spec.rb +1 -1
  54. data/spec/bson/document_spec.rb +1 -1
  55. data/spec/bson/ext_json_parse_spec.rb +308 -0
  56. data/spec/bson/false_class_spec.rb +1 -1
  57. data/spec/bson/float_spec.rb +37 -1
  58. data/spec/bson/hash_spec.rb +71 -1
  59. data/spec/bson/int32_spec.rb +21 -1
  60. data/spec/bson/int64_spec.rb +39 -1
  61. data/spec/bson/integer_spec.rb +27 -1
  62. data/spec/bson/json_spec.rb +1 -1
  63. data/spec/bson/max_key_spec.rb +1 -1
  64. data/spec/bson/min_key_spec.rb +1 -1
  65. data/spec/bson/nil_class_spec.rb +1 -1
  66. data/spec/bson/object_id_spec.rb +1 -1
  67. data/spec/bson/object_spec.rb +1 -1
  68. data/spec/bson/open_struct_spec.rb +1 -1
  69. data/spec/bson/raw_spec.rb +22 -1
  70. data/spec/bson/regexp_spec.rb +1 -1
  71. data/spec/bson/registry_spec.rb +1 -1
  72. data/spec/bson/string_spec.rb +1 -1
  73. data/spec/bson/symbol_raw_spec.rb +45 -0
  74. data/spec/bson/symbol_spec.rb +61 -1
  75. data/spec/bson/time_spec.rb +205 -2
  76. data/spec/bson/time_with_zone_spec.rb +1 -1
  77. data/spec/bson/timestamp_spec.rb +1 -1
  78. data/spec/bson/true_class_spec.rb +1 -1
  79. data/spec/bson/undefined_spec.rb +1 -1
  80. data/spec/bson_spec.rb +1 -1
  81. data/spec/{support → runners}/common_driver.rb +1 -1
  82. data/spec/runners/corpus.rb +185 -0
  83. data/spec/{support/corpus.rb → runners/corpus_legacy.rb} +41 -59
  84. data/spec/spec_helper.rb +10 -3
  85. data/spec/{bson/driver_bson_spec.rb → spec_tests/common_driver_spec.rb} +1 -0
  86. data/spec/{bson/corpus_spec.rb → spec_tests/corpus_legacy_spec.rb} +4 -4
  87. data/spec/spec_tests/corpus_spec.rb +124 -0
  88. data/spec/spec_tests/data/corpus/README.md +15 -0
  89. data/spec/spec_tests/data/corpus/array.json +49 -0
  90. data/spec/spec_tests/data/corpus/binary.json +85 -0
  91. data/spec/spec_tests/data/corpus/boolean.json +27 -0
  92. data/spec/spec_tests/data/corpus/code.json +67 -0
  93. data/spec/spec_tests/data/corpus/code_w_scope.json +78 -0
  94. data/spec/spec_tests/data/corpus/datetime.json +42 -0
  95. data/spec/spec_tests/data/corpus/dbpointer.json +56 -0
  96. data/spec/spec_tests/data/corpus/dbref.json +31 -0
  97. data/spec/spec_tests/data/corpus/decimal128-1.json +317 -0
  98. data/spec/spec_tests/data/corpus/decimal128-2.json +793 -0
  99. data/spec/spec_tests/data/corpus/decimal128-3.json +1771 -0
  100. data/spec/spec_tests/data/corpus/decimal128-4.json +117 -0
  101. data/spec/spec_tests/data/corpus/decimal128-5.json +402 -0
  102. data/spec/spec_tests/data/corpus/decimal128-6.json +119 -0
  103. data/spec/spec_tests/data/corpus/decimal128-7.json +323 -0
  104. data/spec/spec_tests/data/corpus/document.json +36 -0
  105. data/spec/spec_tests/data/corpus/double.json +87 -0
  106. data/spec/spec_tests/data/corpus/int32.json +43 -0
  107. data/spec/spec_tests/data/corpus/int64.json +43 -0
  108. data/spec/spec_tests/data/corpus/maxkey.json +12 -0
  109. data/spec/spec_tests/data/corpus/minkey.json +12 -0
  110. data/spec/spec_tests/data/corpus/multi-type-deprecated.json +15 -0
  111. data/spec/spec_tests/data/corpus/multi-type.json +11 -0
  112. data/spec/spec_tests/data/corpus/null.json +12 -0
  113. data/spec/spec_tests/data/corpus/oid.json +28 -0
  114. data/spec/spec_tests/data/corpus/regex.json +65 -0
  115. data/spec/spec_tests/data/corpus/string.json +72 -0
  116. data/spec/spec_tests/data/corpus/symbol.json +80 -0
  117. data/spec/spec_tests/data/corpus/timestamp.json +24 -0
  118. data/spec/spec_tests/data/corpus/top.json +236 -0
  119. data/spec/spec_tests/data/corpus/undefined.json +15 -0
  120. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/array.json +0 -0
  121. data/spec/{support/corpus-tests/failures → spec_tests/data/corpus_legacy}/binary.json +0 -0
  122. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/boolean.json +0 -0
  123. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/code.json +1 -1
  124. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/code_w_scope.json +1 -1
  125. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/document.json +1 -1
  126. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/double.json +1 -1
  127. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/failures/datetime.json +0 -0
  128. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/failures/dbpointer.json +0 -0
  129. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/failures/int64.json +0 -0
  130. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/failures/symbol.json +0 -0
  131. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/int32.json +1 -1
  132. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/maxkey.json +1 -1
  133. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/minkey.json +1 -1
  134. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/null.json +1 -1
  135. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/oid.json +0 -0
  136. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/regex.json +1 -1
  137. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/string.json +0 -0
  138. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/timestamp.json +1 -1
  139. data/spec/{support/corpus-tests → spec_tests/data/corpus_legacy}/top.json +0 -0
  140. data/spec/{support/corpus-tests/failures → spec_tests/data/corpus_legacy}/undefined.json +0 -0
  141. data/spec/{support/driver-spec-tests → spec_tests/data}/decimal128/decimal128-1.json +0 -0
  142. data/spec/{support/driver-spec-tests → spec_tests/data}/decimal128/decimal128-2.json +0 -0
  143. data/spec/{support/driver-spec-tests → spec_tests/data}/decimal128/decimal128-3.json +0 -0
  144. data/spec/{support/driver-spec-tests → spec_tests/data}/decimal128/decimal128-4.json +0 -0
  145. data/spec/{support/driver-spec-tests → spec_tests/data}/decimal128/decimal128-5.json +0 -0
  146. data/spec/{support/driver-spec-tests → spec_tests/data}/decimal128/decimal128-6.json +0 -0
  147. data/spec/{support/driver-spec-tests → spec_tests/data}/decimal128/decimal128-7.json +0 -0
  148. data/spec/support/shared_examples.rb +1 -1
  149. metadata +171 -120
  150. checksums.yaml.gz.sig +0 -2
  151. data.tar.gz.sig +0 -1
  152. metadata.gz.sig +0 -0
@@ -0,0 +1,24 @@
1
+ {
2
+ "description": "Timestamp type",
3
+ "bson_type": "0x11",
4
+ "test_key": "a",
5
+ "valid": [
6
+ {
7
+ "description": "Timestamp: (123456789, 42)",
8
+ "canonical_bson": "100000001161002A00000015CD5B0700",
9
+ "canonical_extjson": "{\"a\" : {\"$timestamp\" : {\"t\" : 123456789, \"i\" : 42} } }"
10
+ },
11
+ {
12
+ "description": "Timestamp: (123456789, 42) (keys reversed)",
13
+ "canonical_bson": "100000001161002A00000015CD5B0700",
14
+ "canonical_extjson": "{\"a\" : {\"$timestamp\" : {\"t\" : 123456789, \"i\" : 42} } }",
15
+ "degenerate_extjson": "{\"a\" : {\"$timestamp\" : {\"i\" : 42, \"t\" : 123456789} } }"
16
+ }
17
+ ],
18
+ "decodeErrors": [
19
+ {
20
+ "description": "Truncated timestamp field",
21
+ "bson": "0f0000001161002A00000015CD5B00"
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,236 @@
1
+ {
2
+ "description": "Top-level document validity",
3
+ "bson_type": "0x00",
4
+ "valid": [
5
+ {
6
+ "description": "Document with keys that start with $",
7
+ "canonical_bson": "0F00000010246B6579002A00000000",
8
+ "canonical_extjson": "{\"$key\": {\"$numberInt\": \"42\"}}"
9
+ }
10
+ ],
11
+ "decodeErrors": [
12
+ {
13
+ "description": "An object size that's too small to even include the object size, but is a well-formed, empty object",
14
+ "bson": "0100000000"
15
+ },
16
+ {
17
+ "description": "An object size that's only enough for the object size, but is a well-formed, empty object",
18
+ "bson": "0400000000"
19
+ },
20
+ {
21
+ "description": "One object, with length shorter than size (missing EOO)",
22
+ "bson": "05000000"
23
+ },
24
+ {
25
+ "description": "One object, sized correctly, with a spot for an EOO, but the EOO is 0x01",
26
+ "bson": "0500000001"
27
+ },
28
+ {
29
+ "description": "One object, sized correctly, with a spot for an EOO, but the EOO is 0xff",
30
+ "bson": "05000000FF"
31
+ },
32
+ {
33
+ "description": "One object, sized correctly, with a spot for an EOO, but the EOO is 0x70",
34
+ "bson": "0500000070"
35
+ },
36
+ {
37
+ "description": "Byte count is zero (with non-zero input length)",
38
+ "bson": "00000000000000000000"
39
+ },
40
+ {
41
+ "description": "Stated length exceeds byte count, with truncated document",
42
+ "bson": "1200000002666F6F0004000000626172"
43
+ },
44
+ {
45
+ "description": "Stated length exceeds byte count, with valid envelope",
46
+ "bson": "1300000002666F6F00040000006261720000"
47
+ },
48
+ {
49
+ "description": "Stated length less than byte count, with valid envelope",
50
+ "bson": "1100000002666F6F00040000006261720000"
51
+ },
52
+ {
53
+ "description": "Invalid BSON type low range",
54
+ "bson": "07000000000000"
55
+ },
56
+ {
57
+ "description": "Invalid BSON type high range",
58
+ "bson": "07000000800000"
59
+ },
60
+ {
61
+ "description": "Document truncated mid-key",
62
+ "bson": "1200000002666F"
63
+ }
64
+ ],
65
+ "parseErrors": [
66
+ {
67
+ "description" : "Bad $regularExpression (extra field)",
68
+ "string" : "{\"a\" : \"$regularExpression\": {\"pattern\": \"abc\", \"options\": \"\", \"unrelated\": true}}}"
69
+ },
70
+ {
71
+ "description" : "Bad $regularExpression (missing options field)",
72
+ "string" : "{\"a\" : \"$regularExpression\": {\"pattern\": \"abc\"}}}"
73
+ },
74
+ {
75
+ "description": "Bad $regularExpression (pattern is number, not string)",
76
+ "string": "{\"x\" : {\"$regularExpression\" : { \"pattern\": 42, \"$options\" : \"\"}}}"
77
+ },
78
+ {
79
+ "description": "Bad $regularExpression (options are number, not string)",
80
+ "string": "{\"x\" : {\"$regularExpression\" : { \"pattern\": \"a\", \"$options\" : 0}}}"
81
+ },
82
+ {
83
+ "description" : "Bad $regularExpression (missing pattern field)",
84
+ "string" : "{\"a\" : \"$regularExpression\": {\"options\":\"ix\"}}}"
85
+ },
86
+ {
87
+ "description": "Bad $oid (number, not string)",
88
+ "string": "{\"a\" : {\"$oid\" : 42}}"
89
+ },
90
+ {
91
+ "description": "Bad $oid (extra field)",
92
+ "string": "{\"a\" : {\"$oid\" : \"56e1fc72e0c917e9c4714161\", \"unrelated\": true}}"
93
+ },
94
+ {
95
+ "description": "Bad $numberInt (number, not string)",
96
+ "string": "{\"a\" : {\"$numberInt\" : 42}}"
97
+ },
98
+ {
99
+ "description": "Bad $numberInt (extra field)",
100
+ "string": "{\"a\" : {\"$numberInt\" : \"42\", \"unrelated\": true}}"
101
+ },
102
+ {
103
+ "description": "Bad $numberLong (number, not string)",
104
+ "string": "{\"a\" : {\"$numberLong\" : 42}}"
105
+ },
106
+ {
107
+ "description": "Bad $numberLong (extra field)",
108
+ "string": "{\"a\" : {\"$numberLong\" : \"42\", \"unrelated\": true}}"
109
+ },
110
+ {
111
+ "description": "Bad $numberDouble (number, not string)",
112
+ "string": "{\"a\" : {\"$numberDouble\" : 42}}"
113
+ },
114
+ {
115
+ "description": "Bad $numberDouble (extra field)",
116
+ "string": "{\"a\" : {\"$numberDouble\" : \".1\", \"unrelated\": true}}"
117
+ },
118
+ {
119
+ "description": "Bad $numberDecimal (number, not string)",
120
+ "string": "{\"a\" : {\"$numberDecimal\" : 42}}"
121
+ },
122
+ {
123
+ "description": "Bad $numberDecimal (extra field)",
124
+ "string": "{\"a\" : {\"$numberDecimal\" : \".1\", \"unrelated\": true}}"
125
+ },
126
+ {
127
+ "description": "Bad $binary (binary is number, not string)",
128
+ "string": "{\"x\" : {\"$binary\" : {\"base64\" : 0, \"subType\" : \"00\"}}}"
129
+ },
130
+ {
131
+ "description": "Bad $binary (type is number, not string)",
132
+ "string": "{\"x\" : {\"$binary\" : {\"base64\" : \"\", \"subType\" : 0}}}"
133
+ },
134
+ {
135
+ "description": "Bad $binary (missing $type)",
136
+ "string": "{\"x\" : {\"$binary\" : {\"base64\" : \"//8=\"}}}"
137
+ },
138
+ {
139
+ "description": "Bad $binary (missing $binary)",
140
+ "string": "{\"x\" : {\"$binary\" : {\"subType\" : \"00\"}}}"
141
+ },
142
+ {
143
+ "description": "Bad $binary (extra field)",
144
+ "string": "{\"x\" : {\"$binary\" : {\"base64\" : \"//8=\", \"subType\" : 0, \"unrelated\": true}}}"
145
+ },
146
+ {
147
+ "description": "Bad $code (type is number, not string)",
148
+ "string": "{\"a\" : {\"$code\" : 42}}"
149
+ },
150
+ {
151
+ "description": "Bad $code (type is number, not string) when $scope is also present",
152
+ "string": "{\"a\" : {\"$code\" : 42, \"$scope\" : {}}}"
153
+ },
154
+ {
155
+ "description": "Bad $code (extra field)",
156
+ "string": "{\"a\" : {\"$code\" : \"\", \"unrelated\": true}}"
157
+ },
158
+ {
159
+ "description": "Bad $code with $scope (scope is number, not doc)",
160
+ "string": "{\"x\" : {\"$code\" : \"\", \"$scope\" : 42}}"
161
+ },
162
+ {
163
+ "description": "Bad $timestamp (type is number, not doc)",
164
+ "string": "{\"a\" : {\"$timestamp\" : 42} }"
165
+ },
166
+ {
167
+ "description": "Bad $timestamp ('t' type is string, not number)",
168
+ "string": "{\"a\" : {\"$timestamp\" : {\"t\" : \"123456789\", \"i\" : 42} } }"
169
+ },
170
+ {
171
+ "description": "Bad $timestamp ('i' type is string, not number)",
172
+ "string": "{\"a\" : {\"$timestamp\" : {\"t\" : 123456789, \"i\" : \"42\"} } }"
173
+ },
174
+ {
175
+ "description": "Bad $timestamp (extra field at same level as $timestamp)",
176
+ "string": "{\"a\" : {\"$timestamp\" : {\"t\" : \"123456789\", \"i\" : \"42\"}, \"unrelated\": true } }"
177
+ },
178
+ {
179
+ "description": "Bad $timestamp (extra field at same level as t and i)",
180
+ "string": "{\"a\" : {\"$timestamp\" : {\"t\" : \"123456789\", \"i\" : \"42\", \"unrelated\": true} } }"
181
+ },
182
+ {
183
+ "description": "Bad $timestamp (missing t)",
184
+ "string": "{\"a\" : {\"$timestamp\" : {\"i\" : \"42\"} } }"
185
+ },
186
+ {
187
+ "description": "Bad $timestamp (missing i)",
188
+ "string": "{\"a\" : {\"$timestamp\" : {\"t\" : \"123456789\"} } }"
189
+ },
190
+ {
191
+ "description": "Bad $date (number, not string or hash)",
192
+ "string": "{\"a\" : {\"$date\" : 42}}"
193
+ },
194
+ {
195
+ "description": "Bad $date (extra field)",
196
+ "string": "{\"a\" : {\"$date\" : {\"$numberLong\" : \"1356351330501\"}, \"unrelated\": true}}"
197
+ },
198
+ {
199
+ "description": "Bad DBRef (ref is number, not string)",
200
+ "string": "{\"x\" : {\"$ref\" : 42, \"$id\" : \"abc\"}}"
201
+ },
202
+ {
203
+ "description": "Bad DBRef (db is number, not string)",
204
+ "string": "{\"x\" : {\"$ref\" : \"a\", \"$id\" : \"abc\", \"$db\" : 42}}"
205
+ },
206
+ {
207
+ "description": "Bad $minKey (boolean, not integer)",
208
+ "string": "{\"a\" : {\"$minKey\" : true}}"
209
+ },
210
+ {
211
+ "description": "Bad $minKey (wrong integer)",
212
+ "string": "{\"a\" : {\"$minKey\" : 0}}"
213
+ },
214
+ {
215
+ "description": "Bad $minKey (extra field)",
216
+ "string": "{\"a\" : {\"$minKey\" : 1, \"unrelated\": true}}"
217
+ },
218
+ {
219
+ "description": "Bad $maxKey (boolean, not integer)",
220
+ "string": "{\"a\" : {\"$maxKey\" : true}}"
221
+ },
222
+ {
223
+ "description": "Bad $maxKey (wrong integer)",
224
+ "string": "{\"a\" : {\"$maxKey\" : 0}}"
225
+ },
226
+ {
227
+ "description": "Bad $maxKey (extra field)",
228
+ "string": "{\"a\" : {\"$maxKey\" : 1, \"unrelated\": true}}"
229
+ },
230
+ {
231
+ "description": "Bad DBpointer (extra field)",
232
+ "string": "{\"a\": {\"$dbPointer\": {\"a\": {\"$numberInt\": \"1\"}, \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}, \"c\": {\"$numberInt\": \"2\"}, \"$ref\": \"b\"}}}"
233
+ }
234
+
235
+ ]
236
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "description": "Undefined type (deprecated)",
3
+ "bson_type": "0x06",
4
+ "deprecated": true,
5
+ "test_key": "a",
6
+ "valid": [
7
+ {
8
+ "description": "Undefined",
9
+ "canonical_bson": "0800000006610000",
10
+ "canonical_extjson": "{\"a\" : {\"$undefined\" : true}}",
11
+ "converted_bson": "080000000A610000",
12
+ "converted_extjson": "{\"a\" : null}"
13
+ }
14
+ ]
15
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Javascript Code",
2
+ "description": "Code",
3
3
  "bson_type": "0x0D",
4
4
  "test_key": "a",
5
5
  "valid": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Javascript Code with Scope",
2
+ "description": "CodeWithScope",
3
3
  "bson_type": "0x0F",
4
4
  "test_key": "a",
5
5
  "valid": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Document type (sub-documents)",
2
+ "description": "Document",
3
3
  "bson_type": "0x03",
4
4
  "test_key": "x",
5
5
  "valid": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Double type",
2
+ "description": "Float",
3
3
  "bson_type": "0x01",
4
4
  "test_key": "d",
5
5
  "valid": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Int32 type",
2
+ "description": "Integer",
3
3
  "bson_type": "0x10",
4
4
  "test_key": "i",
5
5
  "valid": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Maxkey type",
2
+ "description": "MaxKey",
3
3
  "bson_type": "0xFF",
4
4
  "test_key": "a",
5
5
  "valid": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Minkey type",
2
+ "description": "MinKey",
3
3
  "bson_type": "0xFF",
4
4
  "test_key": "a",
5
5
  "valid": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Null type",
2
+ "description": "NilClass",
3
3
  "bson_type": "0x0A",
4
4
  "test_key": "a",
5
5
  "valid": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Regular Expression type",
2
+ "description": "Regexp",
3
3
  "bson_type": "0x0B",
4
4
  "test_key": "a",
5
5
  "valid": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Timestamp type",
2
+ "description": "Timestamp",
3
3
  "bson_type": "0x11",
4
4
  "test_key": "a",
5
5
  "valid": [
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2009-2019 MongoDB Inc.
1
+ # Copyright (C) 2009-2020 MongoDB Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
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.7.0
4
+ version: 4.9.0
5
5
  platform: java
6
6
  authors:
7
7
  - Tyler Brock
@@ -11,33 +11,11 @@ authors:
11
11
  - Gary Murakami
12
12
  autorequire:
13
13
  bindir: bin
14
- cert_chain:
15
- - |
16
- -----BEGIN CERTIFICATE-----
17
- MIIDRDCCAiygAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBtkcml2
18
- ZXItcnVieS9EQz0xMGdlbi9EQz1jb20wHhcNMTkwMTE3MjIzMDE1WhcNMjAwMTE3
19
- MjIzMDE1WjAmMSQwIgYDVQQDDBtkcml2ZXItcnVieS9EQz0xMGdlbi9EQz1jb20w
20
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRXUgGvH0ZtWwDPc2umdHw
21
- B+INNm6jNTRp8PMyUKxPzxaxX2OiBQk9gLC3zsK9ZmlZu4lNfpHVSCEPoiP/fhPg
22
- Kyfq2xld3Qz0Pki5d5i0/r14343MTKiNiFulLlbbdlN0cXeEFNJHUycZnD2LOXwz
23
- egYGHOl14FI8t5visIWtqRnLXXIlDsBHzmeEZjUZRGSgjC0R3RT/I+Fk5yUhn1w4
24
- rqFyAiW+cjjzmT7mmqT0jV6fd0JFHbKnSgt9iPijKSimBgUOsorHwOTMlTzwsy0d
25
- ZT+al1RiT5zqlAJLxFHwmoYOxD/bSNtKsYl60ek0hK2mISBVy9BBmLvCgHDx5uSp
26
- AgMBAAGjfTB7MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRbd1mx
27
- fvSaVIwKI+tnEAYDW/B81zAgBgNVHREEGTAXgRVkcml2ZXItcnVieUAxMGdlbi5j
28
- b20wIAYDVR0SBBkwF4EVZHJpdmVyLXJ1YnlAMTBnZW4uY29tMA0GCSqGSIb3DQEB
29
- CwUAA4IBAQBtXpljL+EXFgH2YRSkYTNn9WKurclJKqaMTJvJoEm2mX1IbAg+BX+i
30
- Eb+rKelkjezRqVkurzRjif8RI9aGBpAyfobQfHHJNzHQzSFwhEmwlGDQRgQzrDhN
31
- cbkRB2wDgGJNjnjMKLXfeZX+SjWAsHDrOc+Ue9nHs2AdJxCTDgB1MMNGZ1UjLL9/
32
- HhO93otEnxwCVijD9ruORb0bT9LlNKosQQEzrhXtOtNK9k7s7G6Gi0BFMOIJDVyq
33
- bMYVwXXhV8czdzgkQB/ZPWHSbEWXnmkze1mzvqWBCPOVXYrcnL9cnEl/RoxtS1hr
34
- Db6Ac6mCUSYfYHBWpWqxjc45n70i5Xi1
35
- -----END CERTIFICATE-----
36
- date: 2019-12-13 00:00:00.000000000 Z
14
+ cert_chain: []
15
+ date: 2020-06-02 00:00:00.000000000 Z
37
16
  dependencies: []
38
17
  description: A fully featured BSON specification implementation in Ruby
39
18
  email:
40
- - mongodb-dev@googlegroups.com
41
19
  executables: []
42
20
  extensions: []
43
21
  extra_rdoc_files: []
@@ -59,10 +37,13 @@ files:
59
37
  - lib/bson/config.rb
60
38
  - lib/bson/date.rb
61
39
  - lib/bson/date_time.rb
40
+ - lib/bson/db_pointer.rb
62
41
  - lib/bson/decimal128.rb
63
42
  - lib/bson/decimal128/builder.rb
64
43
  - lib/bson/document.rb
65
44
  - lib/bson/environment.rb
45
+ - lib/bson/error.rb
46
+ - lib/bson/ext_json.rb
66
47
  - lib/bson/false_class.rb
67
48
  - lib/bson/float.rb
68
49
  - lib/bson/hash.rb
@@ -97,12 +78,11 @@ files:
97
78
  - spec/bson/code_spec.rb
98
79
  - spec/bson/code_with_scope_spec.rb
99
80
  - spec/bson/config_spec.rb
100
- - spec/bson/corpus_spec.rb
101
81
  - spec/bson/date_spec.rb
102
82
  - spec/bson/date_time_spec.rb
103
83
  - spec/bson/decimal128_spec.rb
104
84
  - spec/bson/document_spec.rb
105
- - spec/bson/driver_bson_spec.rb
85
+ - spec/bson/ext_json_parse_spec.rb
106
86
  - spec/bson/false_class_spec.rb
107
87
  - spec/bson/float_spec.rb
108
88
  - spec/bson/hash_spec.rb
@@ -120,6 +100,7 @@ files:
120
100
  - spec/bson/regexp_spec.rb
121
101
  - spec/bson/registry_spec.rb
122
102
  - spec/bson/string_spec.rb
103
+ - spec/bson/symbol_raw_spec.rb
123
104
  - spec/bson/symbol_spec.rb
124
105
  - spec/bson/time_spec.rb
125
106
  - spec/bson/time_with_zone_spec.rb
@@ -127,37 +108,73 @@ files:
127
108
  - spec/bson/true_class_spec.rb
128
109
  - spec/bson/undefined_spec.rb
129
110
  - spec/bson_spec.rb
111
+ - spec/runners/common_driver.rb
112
+ - spec/runners/corpus.rb
113
+ - spec/runners/corpus_legacy.rb
130
114
  - spec/spec_helper.rb
131
- - spec/support/common_driver.rb
132
- - spec/support/corpus-tests/array.json
133
- - spec/support/corpus-tests/boolean.json
134
- - spec/support/corpus-tests/code.json
135
- - spec/support/corpus-tests/code_w_scope.json
136
- - spec/support/corpus-tests/document.json
137
- - spec/support/corpus-tests/double.json
138
- - spec/support/corpus-tests/failures/binary.json
139
- - spec/support/corpus-tests/failures/datetime.json
140
- - spec/support/corpus-tests/failures/dbpointer.json
141
- - spec/support/corpus-tests/failures/int64.json
142
- - spec/support/corpus-tests/failures/symbol.json
143
- - spec/support/corpus-tests/failures/undefined.json
144
- - spec/support/corpus-tests/int32.json
145
- - spec/support/corpus-tests/maxkey.json
146
- - spec/support/corpus-tests/minkey.json
147
- - spec/support/corpus-tests/null.json
148
- - spec/support/corpus-tests/oid.json
149
- - spec/support/corpus-tests/regex.json
150
- - spec/support/corpus-tests/string.json
151
- - spec/support/corpus-tests/timestamp.json
152
- - spec/support/corpus-tests/top.json
153
- - spec/support/corpus.rb
154
- - spec/support/driver-spec-tests/decimal128/decimal128-1.json
155
- - spec/support/driver-spec-tests/decimal128/decimal128-2.json
156
- - spec/support/driver-spec-tests/decimal128/decimal128-3.json
157
- - spec/support/driver-spec-tests/decimal128/decimal128-4.json
158
- - spec/support/driver-spec-tests/decimal128/decimal128-5.json
159
- - spec/support/driver-spec-tests/decimal128/decimal128-6.json
160
- - spec/support/driver-spec-tests/decimal128/decimal128-7.json
115
+ - spec/spec_tests/common_driver_spec.rb
116
+ - spec/spec_tests/corpus_legacy_spec.rb
117
+ - spec/spec_tests/corpus_spec.rb
118
+ - spec/spec_tests/data/corpus/README.md
119
+ - spec/spec_tests/data/corpus/array.json
120
+ - spec/spec_tests/data/corpus/binary.json
121
+ - spec/spec_tests/data/corpus/boolean.json
122
+ - spec/spec_tests/data/corpus/code.json
123
+ - spec/spec_tests/data/corpus/code_w_scope.json
124
+ - spec/spec_tests/data/corpus/datetime.json
125
+ - spec/spec_tests/data/corpus/dbpointer.json
126
+ - spec/spec_tests/data/corpus/dbref.json
127
+ - spec/spec_tests/data/corpus/decimal128-1.json
128
+ - spec/spec_tests/data/corpus/decimal128-2.json
129
+ - spec/spec_tests/data/corpus/decimal128-3.json
130
+ - spec/spec_tests/data/corpus/decimal128-4.json
131
+ - spec/spec_tests/data/corpus/decimal128-5.json
132
+ - spec/spec_tests/data/corpus/decimal128-6.json
133
+ - spec/spec_tests/data/corpus/decimal128-7.json
134
+ - spec/spec_tests/data/corpus/document.json
135
+ - spec/spec_tests/data/corpus/double.json
136
+ - spec/spec_tests/data/corpus/int32.json
137
+ - spec/spec_tests/data/corpus/int64.json
138
+ - spec/spec_tests/data/corpus/maxkey.json
139
+ - spec/spec_tests/data/corpus/minkey.json
140
+ - spec/spec_tests/data/corpus/multi-type-deprecated.json
141
+ - spec/spec_tests/data/corpus/multi-type.json
142
+ - spec/spec_tests/data/corpus/null.json
143
+ - spec/spec_tests/data/corpus/oid.json
144
+ - spec/spec_tests/data/corpus/regex.json
145
+ - spec/spec_tests/data/corpus/string.json
146
+ - spec/spec_tests/data/corpus/symbol.json
147
+ - spec/spec_tests/data/corpus/timestamp.json
148
+ - spec/spec_tests/data/corpus/top.json
149
+ - spec/spec_tests/data/corpus/undefined.json
150
+ - spec/spec_tests/data/corpus_legacy/array.json
151
+ - spec/spec_tests/data/corpus_legacy/binary.json
152
+ - spec/spec_tests/data/corpus_legacy/boolean.json
153
+ - spec/spec_tests/data/corpus_legacy/code.json
154
+ - spec/spec_tests/data/corpus_legacy/code_w_scope.json
155
+ - spec/spec_tests/data/corpus_legacy/document.json
156
+ - spec/spec_tests/data/corpus_legacy/double.json
157
+ - spec/spec_tests/data/corpus_legacy/failures/datetime.json
158
+ - spec/spec_tests/data/corpus_legacy/failures/dbpointer.json
159
+ - spec/spec_tests/data/corpus_legacy/failures/int64.json
160
+ - spec/spec_tests/data/corpus_legacy/failures/symbol.json
161
+ - spec/spec_tests/data/corpus_legacy/int32.json
162
+ - spec/spec_tests/data/corpus_legacy/maxkey.json
163
+ - spec/spec_tests/data/corpus_legacy/minkey.json
164
+ - spec/spec_tests/data/corpus_legacy/null.json
165
+ - spec/spec_tests/data/corpus_legacy/oid.json
166
+ - spec/spec_tests/data/corpus_legacy/regex.json
167
+ - spec/spec_tests/data/corpus_legacy/string.json
168
+ - spec/spec_tests/data/corpus_legacy/timestamp.json
169
+ - spec/spec_tests/data/corpus_legacy/top.json
170
+ - spec/spec_tests/data/corpus_legacy/undefined.json
171
+ - spec/spec_tests/data/decimal128/decimal128-1.json
172
+ - spec/spec_tests/data/decimal128/decimal128-2.json
173
+ - spec/spec_tests/data/decimal128/decimal128-3.json
174
+ - spec/spec_tests/data/decimal128/decimal128-4.json
175
+ - spec/spec_tests/data/decimal128/decimal128-5.json
176
+ - spec/spec_tests/data/decimal128/decimal128-6.json
177
+ - spec/spec_tests/data/decimal128/decimal128-7.json
161
178
  - spec/support/shared_examples.rb
162
179
  - spec/support/spec_config.rb
163
180
  - spec/support/utils.rb
@@ -169,7 +186,6 @@ metadata:
169
186
  changelog_uri: https://github.com/mongodb/bson-ruby/releases
170
187
  documentation_uri: https://docs.mongodb.com/ruby-driver/current/tutorials/bson-v4/
171
188
  homepage_uri: https://docs.mongodb.com/ruby-driver/current/tutorials/bson-v4/
172
- mailing_list_uri: https://groups.google.com/group/mongodb-user
173
189
  source_code_uri: https://github.com/mongodb/bson-ruby
174
190
  post_install_message:
175
191
  rdoc_options: []
@@ -186,83 +202,118 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
202
  - !ruby/object:Gem::Version
187
203
  version: 1.3.6
188
204
  requirements: []
189
- rubyforge_project:
190
- rubygems_version: 2.7.9
205
+ rubygems_version: 3.0.6
191
206
  signing_key:
192
207
  specification_version: 4
193
208
  summary: Ruby implementation of the BSON specification
194
209
  test_files:
195
- - spec/spec_helper.rb
196
210
  - spec/bson_spec.rb
211
+ - spec/spec_helper.rb
212
+ - spec/runners/corpus.rb
213
+ - spec/runners/corpus_legacy.rb
214
+ - spec/runners/common_driver.rb
215
+ - spec/bson/max_key_spec.rb
216
+ - spec/bson/byte_buffer_spec.rb
217
+ - spec/bson/ext_json_parse_spec.rb
218
+ - spec/bson/byte_buffer_read_spec.rb
219
+ - spec/bson/decimal128_spec.rb
197
220
  - spec/bson/date_spec.rb
198
- - spec/bson/config_spec.rb
199
- - spec/bson/int64_spec.rb
200
- - spec/bson/undefined_spec.rb
201
- - spec/bson/corpus_spec.rb
202
- - spec/bson/code_spec.rb
203
- - spec/bson/driver_bson_spec.rb
204
221
  - spec/bson/object_spec.rb
205
- - spec/bson/date_time_spec.rb
206
- - spec/bson/raw_spec.rb
207
- - spec/bson/min_key_spec.rb
208
- - spec/bson/time_with_zone_spec.rb
209
- - spec/bson/time_spec.rb
210
- - spec/bson/hash_spec.rb
211
- - spec/bson/timestamp_spec.rb
222
+ - spec/bson/int64_spec.rb
212
223
  - spec/bson/int32_spec.rb
213
- - spec/bson/byte_buffer_spec.rb
214
- - spec/bson/registry_spec.rb
215
- - spec/bson/regexp_spec.rb
216
- - spec/bson/byte_buffer_write_spec.rb
217
- - spec/bson/symbol_spec.rb
224
+ - spec/bson/object_id_spec.rb
225
+ - spec/bson/hash_spec.rb
218
226
  - spec/bson/string_spec.rb
219
227
  - spec/bson/boolean_spec.rb
228
+ - spec/bson/timestamp_spec.rb
220
229
  - spec/bson/open_struct_spec.rb
221
- - spec/bson/decimal128_spec.rb
222
- - spec/bson/json_spec.rb
223
- - spec/bson/array_spec.rb
230
+ - spec/bson/config_spec.rb
231
+ - spec/bson/nil_class_spec.rb
232
+ - spec/bson/regexp_spec.rb
233
+ - spec/bson/time_with_zone_spec.rb
234
+ - spec/bson/code_spec.rb
224
235
  - spec/bson/false_class_spec.rb
225
- - spec/bson/true_class_spec.rb
236
+ - spec/bson/raw_spec.rb
226
237
  - spec/bson/binary_spec.rb
227
- - spec/bson/binary_uuid_spec.rb
228
- - spec/bson/object_id_spec.rb
238
+ - spec/bson/array_spec.rb
229
239
  - spec/bson/code_with_scope_spec.rb
230
- - spec/bson/nil_class_spec.rb
240
+ - spec/bson/symbol_spec.rb
241
+ - spec/bson/float_spec.rb
242
+ - spec/bson/symbol_raw_spec.rb
243
+ - spec/bson/true_class_spec.rb
231
244
  - spec/bson/integer_spec.rb
245
+ - spec/bson/binary_uuid_spec.rb
246
+ - spec/bson/time_spec.rb
247
+ - spec/bson/json_spec.rb
248
+ - spec/bson/date_time_spec.rb
232
249
  - spec/bson/document_spec.rb
233
- - spec/bson/max_key_spec.rb
234
- - spec/bson/byte_buffer_read_spec.rb
235
- - spec/bson/float_spec.rb
236
- - spec/support/utils.rb
237
- - spec/support/corpus.rb
250
+ - spec/bson/byte_buffer_write_spec.rb
251
+ - spec/bson/min_key_spec.rb
252
+ - spec/bson/undefined_spec.rb
253
+ - spec/bson/registry_spec.rb
238
254
  - spec/support/shared_examples.rb
239
255
  - spec/support/spec_config.rb
240
- - spec/support/common_driver.rb
241
- - spec/support/corpus-tests/string.json
242
- - spec/support/corpus-tests/null.json
243
- - spec/support/corpus-tests/int32.json
244
- - spec/support/corpus-tests/maxkey.json
245
- - spec/support/corpus-tests/timestamp.json
246
- - spec/support/corpus-tests/code.json
247
- - spec/support/corpus-tests/document.json
248
- - spec/support/corpus-tests/double.json
249
- - spec/support/corpus-tests/regex.json
250
- - spec/support/corpus-tests/oid.json
251
- - spec/support/corpus-tests/top.json
252
- - spec/support/corpus-tests/boolean.json
253
- - spec/support/corpus-tests/array.json
254
- - spec/support/corpus-tests/code_w_scope.json
255
- - spec/support/corpus-tests/minkey.json
256
- - spec/support/corpus-tests/failures/binary.json
257
- - spec/support/corpus-tests/failures/dbpointer.json
258
- - spec/support/corpus-tests/failures/symbol.json
259
- - spec/support/corpus-tests/failures/undefined.json
260
- - spec/support/corpus-tests/failures/datetime.json
261
- - spec/support/corpus-tests/failures/int64.json
262
- - spec/support/driver-spec-tests/decimal128/decimal128-4.json
263
- - spec/support/driver-spec-tests/decimal128/decimal128-2.json
264
- - spec/support/driver-spec-tests/decimal128/decimal128-5.json
265
- - spec/support/driver-spec-tests/decimal128/decimal128-3.json
266
- - spec/support/driver-spec-tests/decimal128/decimal128-6.json
267
- - spec/support/driver-spec-tests/decimal128/decimal128-1.json
268
- - spec/support/driver-spec-tests/decimal128/decimal128-7.json
256
+ - spec/support/utils.rb
257
+ - spec/spec_tests/corpus_legacy_spec.rb
258
+ - spec/spec_tests/corpus_spec.rb
259
+ - spec/spec_tests/common_driver_spec.rb
260
+ - spec/spec_tests/data/corpus_legacy/code.json
261
+ - spec/spec_tests/data/corpus_legacy/code_w_scope.json
262
+ - spec/spec_tests/data/corpus_legacy/null.json
263
+ - spec/spec_tests/data/corpus_legacy/boolean.json
264
+ - spec/spec_tests/data/corpus_legacy/oid.json
265
+ - spec/spec_tests/data/corpus_legacy/regex.json
266
+ - spec/spec_tests/data/corpus_legacy/array.json
267
+ - spec/spec_tests/data/corpus_legacy/document.json
268
+ - spec/spec_tests/data/corpus_legacy/undefined.json
269
+ - spec/spec_tests/data/corpus_legacy/binary.json
270
+ - spec/spec_tests/data/corpus_legacy/minkey.json
271
+ - spec/spec_tests/data/corpus_legacy/maxkey.json
272
+ - spec/spec_tests/data/corpus_legacy/int32.json
273
+ - spec/spec_tests/data/corpus_legacy/timestamp.json
274
+ - spec/spec_tests/data/corpus_legacy/top.json
275
+ - spec/spec_tests/data/corpus_legacy/string.json
276
+ - spec/spec_tests/data/corpus_legacy/double.json
277
+ - spec/spec_tests/data/corpus_legacy/failures/symbol.json
278
+ - spec/spec_tests/data/corpus_legacy/failures/datetime.json
279
+ - spec/spec_tests/data/corpus_legacy/failures/int64.json
280
+ - spec/spec_tests/data/corpus_legacy/failures/dbpointer.json
281
+ - spec/spec_tests/data/corpus/code.json
282
+ - spec/spec_tests/data/corpus/code_w_scope.json
283
+ - spec/spec_tests/data/corpus/decimal128-1.json
284
+ - spec/spec_tests/data/corpus/null.json
285
+ - spec/spec_tests/data/corpus/multi-type.json
286
+ - spec/spec_tests/data/corpus/boolean.json
287
+ - spec/spec_tests/data/corpus/symbol.json
288
+ - spec/spec_tests/data/corpus/datetime.json
289
+ - spec/spec_tests/data/corpus/oid.json
290
+ - spec/spec_tests/data/corpus/regex.json
291
+ - spec/spec_tests/data/corpus/int64.json
292
+ - spec/spec_tests/data/corpus/decimal128-7.json
293
+ - spec/spec_tests/data/corpus/array.json
294
+ - spec/spec_tests/data/corpus/decimal128-3.json
295
+ - spec/spec_tests/data/corpus/decimal128-5.json
296
+ - spec/spec_tests/data/corpus/document.json
297
+ - spec/spec_tests/data/corpus/multi-type-deprecated.json
298
+ - spec/spec_tests/data/corpus/README.md
299
+ - spec/spec_tests/data/corpus/dbpointer.json
300
+ - spec/spec_tests/data/corpus/decimal128-4.json
301
+ - spec/spec_tests/data/corpus/undefined.json
302
+ - spec/spec_tests/data/corpus/decimal128-6.json
303
+ - spec/spec_tests/data/corpus/dbref.json
304
+ - spec/spec_tests/data/corpus/binary.json
305
+ - spec/spec_tests/data/corpus/minkey.json
306
+ - spec/spec_tests/data/corpus/decimal128-2.json
307
+ - spec/spec_tests/data/corpus/maxkey.json
308
+ - spec/spec_tests/data/corpus/int32.json
309
+ - spec/spec_tests/data/corpus/timestamp.json
310
+ - spec/spec_tests/data/corpus/top.json
311
+ - spec/spec_tests/data/corpus/string.json
312
+ - spec/spec_tests/data/corpus/double.json
313
+ - spec/spec_tests/data/decimal128/decimal128-1.json
314
+ - spec/spec_tests/data/decimal128/decimal128-7.json
315
+ - spec/spec_tests/data/decimal128/decimal128-3.json
316
+ - spec/spec_tests/data/decimal128/decimal128-5.json
317
+ - spec/spec_tests/data/decimal128/decimal128-4.json
318
+ - spec/spec_tests/data/decimal128/decimal128-6.json
319
+ - spec/spec_tests/data/decimal128/decimal128-2.json