bson 5.0.0-java → 5.0.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +91 -7
  3. data/Rakefile +63 -39
  4. data/lib/bson/array.rb +1 -1
  5. data/lib/bson/binary.rb +16 -1
  6. data/lib/bson/code.rb +1 -1
  7. data/lib/bson/code_with_scope.rb +1 -1
  8. data/lib/bson/db_pointer.rb +1 -1
  9. data/lib/bson/decimal128/builder.rb +1 -1
  10. data/lib/bson/decimal128.rb +1 -1
  11. data/lib/bson/ext_json.rb +1 -1
  12. data/lib/bson/float.rb +1 -1
  13. data/lib/bson/hash.rb +1 -1
  14. data/lib/bson/int32.rb +1 -1
  15. data/lib/bson/int64.rb +1 -1
  16. data/lib/bson/integer.rb +1 -1
  17. data/lib/bson/max_key.rb +1 -1
  18. data/lib/bson/min_key.rb +1 -1
  19. data/lib/bson/object.rb +2 -2
  20. data/lib/bson/object_id.rb +12 -2
  21. data/lib/bson/regexp.rb +1 -1
  22. data/lib/bson/symbol.rb +2 -2
  23. data/lib/bson/time.rb +1 -1
  24. data/lib/bson/timestamp.rb +1 -1
  25. data/lib/bson/undefined.rb +1 -1
  26. data/lib/bson/version.rb +2 -1
  27. data/lib/bson-ruby.jar +0 -0
  28. data/spec/bson/binary_spec.rb +46 -7
  29. data/spec/bson/object_id_spec.rb +14 -0
  30. metadata +99 -172
  31. checksums.yaml.gz.sig +0 -0
  32. data/spec/shared/LICENSE +0 -20
  33. data/spec/shared/bin/get-mongodb-download-url +0 -17
  34. data/spec/shared/bin/s3-copy +0 -45
  35. data/spec/shared/bin/s3-upload +0 -69
  36. data/spec/shared/lib/mrss/child_process_helper.rb +0 -80
  37. data/spec/shared/lib/mrss/cluster_config.rb +0 -231
  38. data/spec/shared/lib/mrss/constraints.rb +0 -378
  39. data/spec/shared/lib/mrss/docker_runner.rb +0 -298
  40. data/spec/shared/lib/mrss/eg_config_utils.rb +0 -51
  41. data/spec/shared/lib/mrss/event_subscriber.rb +0 -210
  42. data/spec/shared/lib/mrss/lite_constraints.rb +0 -238
  43. data/spec/shared/lib/mrss/server_version_registry.rb +0 -113
  44. data/spec/shared/lib/mrss/session_registry.rb +0 -69
  45. data/spec/shared/lib/mrss/session_registry_legacy.rb +0 -60
  46. data/spec/shared/lib/mrss/spec_organizer.rb +0 -179
  47. data/spec/shared/lib/mrss/utils.rb +0 -37
  48. data/spec/shared/share/Dockerfile.erb +0 -321
  49. data/spec/shared/share/haproxy-1.conf +0 -16
  50. data/spec/shared/share/haproxy-2.conf +0 -17
  51. data/spec/shared/shlib/config.sh +0 -27
  52. data/spec/shared/shlib/distro.sh +0 -74
  53. data/spec/shared/shlib/server.sh +0 -416
  54. data/spec/shared/shlib/set_env.sh +0 -169
  55. data.tar.gz.sig +0 -0
  56. metadata.gz.sig +0 -0
@@ -20,17 +20,56 @@ describe BSON::Binary do
20
20
  let(:testing1) { described_class.new("testing") }
21
21
  let(:testing2) { described_class.new("testing") }
22
22
  let(:not_testing) { described_class.new("not testing") }
23
+ let(:testing3) { described_class.new("testing", :user) }
23
24
 
24
- describe "#eql?" do
25
- context "for two equal objects" do
26
- it "returns true" do
27
- expect(testing1).to eql(testing2)
25
+ describe "Comparable" do
26
+ describe "#eql?" do
27
+ context "for two equal objects" do
28
+ it "returns true" do
29
+ expect(testing1).to eql(testing2)
30
+ end
31
+ end
32
+
33
+ context "for two different objects" do
34
+ it "returns false" do
35
+ expect(testing1).not_to eql(not_testing)
36
+ end
37
+ end
38
+
39
+ context 'for objects with identical data but different types' do
40
+ it 'returns false' do
41
+ expect(testing1).not_to eql(testing3)
42
+ end
28
43
  end
29
44
  end
30
45
 
31
- context "for two different objects" do
32
- it "returns false" do
33
- expect(testing1).not_to eql(not_testing)
46
+ describe '#<=>' do
47
+ context 'with a non-Binary object' do
48
+ it 'returns nil' do
49
+ expect(testing1 <=> 'bogus').to be_nil
50
+ end
51
+ end
52
+
53
+ context 'with identical type and data' do
54
+ it 'returns 0' do
55
+ expect(testing1 <=> testing2).to be == 0
56
+ end
57
+ end
58
+
59
+ context 'with mismatched type' do
60
+ it 'returns nil' do
61
+ expect(testing1 <=> testing3).to be_nil
62
+ end
63
+ end
64
+
65
+ context 'with identical type but mismatched data' do
66
+ it 'returns -1 when a < b' do
67
+ expect(not_testing <=> testing1).to be == -1
68
+ end
69
+
70
+ it 'returns 1 when a > b' do
71
+ expect(testing1 <=> not_testing).to be == 1
72
+ end
34
73
  end
35
74
  end
36
75
  end
@@ -622,6 +622,20 @@ describe BSON::ObjectId do
622
622
  end
623
623
  end
624
624
 
625
+ context 'when the timestamp is larger than a 32-bit integer' do
626
+ let(:distant_future) { Time.at(2 ** 32) }
627
+
628
+ before do
629
+ allow(Time).to receive(:now).and_return(distant_future)
630
+ end
631
+
632
+ let(:object_id) { BSON::ObjectId.new }
633
+
634
+ it 'wraps the timestamp to 0' do
635
+ expect(object_id.to_time).to be == Time.at(0)
636
+ end
637
+ end
638
+
625
639
  context 'when fork changes the pid' do
626
640
  before do
627
641
  skip 'requires Process.fork' unless Process.respond_to?(:fork)
metadata CHANGED
@@ -1,41 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bson
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.2
5
5
  platform: java
6
6
  authors:
7
7
  - The MongoDB Ruby Team
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIEeDCCAuCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMREwDwYDVQQDDAhkYngt
14
- cnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZFgNj
15
- b20wHhcNMjQwMjA5MTc0NzIyWhcNMjUwMjA4MTc0NzIyWjBBMREwDwYDVQQDDAhk
16
- YngtcnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZ
17
- FgNjb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC0/Veq9l47cTfX
18
- tQ+kHq2NOCwJuJGt1iXWQ/vH/yp7pZ/bLej7gPDl2CfIngAXRjM7r1FkR9ya7VAm
19
- IneBFcVU3HhpIXWi4ByXGjBOXFD1Dfbz4C4zedIWRk/hNzXa+rQY4KPwpOwG/hZg
20
- id+rSXWSbNlkyN97XfonweVh7JsIa9X/2JY9ADYjhCfEZF+b0+Wl7+jgwzLWb46I
21
- 0WH0bZBIZ0BbKAwUXIgvq5mQf9PzukmMVYCwnkJ/P4wrHO22HuwnbMyvJuGjVwqi
22
- j1NRp/2vjmKBFWxIfhlSXEIiqAmeEVNXzhPvTVeyo+rma+7R3Bo+4WHkcnPpXJJZ
23
- Jd63qXMvTB0GplEcMJPztWhrJOmcxIOVoQyigEPSQT8JpzFVXby4SGioizv2eT7l
24
- VYSiCHuc3yEDyq5M+98WGX2etbj6esYtzI3rDevpIAHPB6HQmtoJIA4dSl3gjFb+
25
- D+YQSuB2qYu021FI9zeY9sbZyWysEXBxhwrmTk+XUV0qz+OQZkMCAwEAAaN7MHkw
26
- CQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFH4nnr4tYlatU57RbExW
27
- jG86YM5nMB8GA1UdEQQYMBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMB8GA1UdEgQY
28
- MBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMA0GCSqGSIb3DQEBCwUAA4IBgQBKGtHA
29
- fpi3N/BL1J5O4CBsAjtF4jHDiw2r5MwK+66NzMh3uedjgPI7MoosemLy++SB+8BR
30
- SE8bDkb6gfDQQzrI6KSXXyqH2TbQXpY5Tac7/yqXRiu8G2qOrOj4czB/Hq7j09CV
31
- YoH88v6hL11i5jt6jPjFh8hXYG0hDQxhi3atRz5Wwd98tUf2DSbyJXJiRgCBeZjl
32
- rP7AnKsWMu0C+zPlL+nXtQr+nTFtkKXRWfUJMqePpBqtriQvgQ+Y1ItqYVTSLuiM
33
- iwUMcn/rGhdCMBSaKDXdFkIveCHQE2f2WBo2EdErrcTrgEKYYdNfzcb/43j7L1kx
34
- AUwyTtk+HFrviBynQbKN82rjbZE+5gukVea5c7idQPkqacPYsoU37DI+hTlUyJkV
35
- dcTtfEg44lLlfNukBslfiQf54r+uWbyB0m0rDUN/py7/Ghyzt5GLBU91uCO3dGoI
36
- 55uFRHMvEcJMTDeImC/nuucPCAiEGMHggr9+NPC0tqpxjGKTo7lS7GzUFjg=
37
- -----END CERTIFICATE-----
38
- date: 2024-02-13 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2024-11-19 00:00:00.000000000 Z
39
12
  dependencies: []
40
13
  description: A fully featured BSON specification implementation in Ruby
41
14
  email: dbx-ruby@mongodb.com
@@ -157,29 +130,6 @@ files:
157
130
  - spec/runners/common_driver.rb
158
131
  - spec/runners/corpus.rb
159
132
  - spec/runners/corpus_legacy.rb
160
- - spec/shared/LICENSE
161
- - spec/shared/bin/get-mongodb-download-url
162
- - spec/shared/bin/s3-copy
163
- - spec/shared/bin/s3-upload
164
- - spec/shared/lib/mrss/child_process_helper.rb
165
- - spec/shared/lib/mrss/cluster_config.rb
166
- - spec/shared/lib/mrss/constraints.rb
167
- - spec/shared/lib/mrss/docker_runner.rb
168
- - spec/shared/lib/mrss/eg_config_utils.rb
169
- - spec/shared/lib/mrss/event_subscriber.rb
170
- - spec/shared/lib/mrss/lite_constraints.rb
171
- - spec/shared/lib/mrss/server_version_registry.rb
172
- - spec/shared/lib/mrss/session_registry.rb
173
- - spec/shared/lib/mrss/session_registry_legacy.rb
174
- - spec/shared/lib/mrss/spec_organizer.rb
175
- - spec/shared/lib/mrss/utils.rb
176
- - spec/shared/share/Dockerfile.erb
177
- - spec/shared/share/haproxy-1.conf
178
- - spec/shared/share/haproxy-2.conf
179
- - spec/shared/shlib/config.sh
180
- - spec/shared/shlib/distro.sh
181
- - spec/shared/shlib/server.sh
182
- - spec/shared/shlib/set_env.sh
183
133
  - spec/spec_helper.rb
184
134
  - spec/spec_tests/common_driver_spec.rb
185
135
  - spec/spec_tests/corpus_legacy_spec.rb
@@ -271,147 +221,124 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
221
  - !ruby/object:Gem::Version
272
222
  version: 1.3.6
273
223
  requirements: []
274
- rubygems_version: 3.2.33
224
+ rubygems_version: 3.3.26
275
225
  signing_key:
276
226
  specification_version: 4
277
227
  summary: Ruby implementation of the BSON specification
278
228
  test_files:
279
229
  - spec/README.md
280
- - spec/spec_helper.rb
230
+ - spec/bson/array_spec.rb
231
+ - spec/bson/big_decimal_spec.rb
232
+ - spec/bson/binary_spec.rb
233
+ - spec/bson/binary_uuid_spec.rb
234
+ - spec/bson/boolean_spec.rb
235
+ - spec/bson/byte_buffer_read_spec.rb
236
+ - spec/bson/byte_buffer_spec.rb
237
+ - spec/bson/byte_buffer_write_spec.rb
238
+ - spec/bson/code_spec.rb
239
+ - spec/bson/code_with_scope_spec.rb
240
+ - spec/bson/config_spec.rb
241
+ - spec/bson/date_spec.rb
242
+ - spec/bson/date_time_spec.rb
243
+ - spec/bson/dbref_legacy_spec.rb
244
+ - spec/bson/dbref_spec.rb
245
+ - spec/bson/decimal128_spec.rb
246
+ - spec/bson/document_as_spec.rb
247
+ - spec/bson/document_spec.rb
248
+ - spec/bson/ext_json_parse_spec.rb
249
+ - spec/bson/false_class_spec.rb
250
+ - spec/bson/float_spec.rb
251
+ - spec/bson/hash_as_spec.rb
252
+ - spec/bson/hash_spec.rb
253
+ - spec/bson/int32_spec.rb
254
+ - spec/bson/int64_spec.rb
255
+ - spec/bson/integer_spec.rb
256
+ - spec/bson/json_spec.rb
257
+ - spec/bson/max_key_spec.rb
258
+ - spec/bson/min_key_spec.rb
259
+ - spec/bson/nil_class_spec.rb
260
+ - spec/bson/object_id_spec.rb
261
+ - spec/bson/object_spec.rb
262
+ - spec/bson/open_struct_spec.rb
263
+ - spec/bson/raw_spec.rb
264
+ - spec/bson/regexp_spec.rb
265
+ - spec/bson/registry_spec.rb
266
+ - spec/bson/string_spec.rb
267
+ - spec/bson/symbol_raw_spec.rb
268
+ - spec/bson/symbol_spec.rb
269
+ - spec/bson/time_spec.rb
270
+ - spec/bson/time_with_zone_spec.rb
271
+ - spec/bson/timestamp_spec.rb
272
+ - spec/bson/true_class_spec.rb
273
+ - spec/bson/undefined_spec.rb
281
274
  - spec/bson_spec.rb
282
- - spec/shared/LICENSE
283
- - spec/shared/share/Dockerfile.erb
284
- - spec/shared/share/haproxy-1.conf
285
- - spec/shared/share/haproxy-2.conf
286
- - spec/shared/bin/s3-copy
287
- - spec/shared/bin/s3-upload
288
- - spec/shared/bin/get-mongodb-download-url
289
- - spec/shared/shlib/server.sh
290
- - spec/shared/shlib/set_env.sh
291
- - spec/shared/shlib/config.sh
292
- - spec/shared/shlib/distro.sh
293
- - spec/shared/lib/mrss/docker_runner.rb
294
- - spec/shared/lib/mrss/eg_config_utils.rb
295
- - spec/shared/lib/mrss/session_registry.rb
296
- - spec/shared/lib/mrss/child_process_helper.rb
297
- - spec/shared/lib/mrss/utils.rb
298
- - spec/shared/lib/mrss/lite_constraints.rb
299
- - spec/shared/lib/mrss/constraints.rb
300
- - spec/shared/lib/mrss/server_version_registry.rb
301
- - spec/shared/lib/mrss/event_subscriber.rb
302
- - spec/shared/lib/mrss/cluster_config.rb
303
- - spec/shared/lib/mrss/spec_organizer.rb
304
- - spec/shared/lib/mrss/session_registry_legacy.rb
305
- - spec/runners/corpus_legacy.rb
306
275
  - spec/runners/common_driver.rb
307
276
  - spec/runners/corpus.rb
308
- - spec/spec_tests/corpus_legacy_spec.rb
277
+ - spec/runners/corpus_legacy.rb
278
+ - spec/spec_helper.rb
309
279
  - spec/spec_tests/common_driver_spec.rb
280
+ - spec/spec_tests/corpus_legacy_spec.rb
310
281
  - spec/spec_tests/corpus_spec.rb
311
- - spec/spec_tests/data/corpus/document.json
282
+ - spec/spec_tests/data/corpus/README.md
283
+ - spec/spec_tests/data/corpus/array.json
284
+ - spec/spec_tests/data/corpus/binary.json
285
+ - spec/spec_tests/data/corpus/boolean.json
286
+ - spec/spec_tests/data/corpus/code.json
287
+ - spec/spec_tests/data/corpus/code_w_scope.json
288
+ - spec/spec_tests/data/corpus/datetime.json
289
+ - spec/spec_tests/data/corpus/dbpointer.json
312
290
  - spec/spec_tests/data/corpus/dbref.json
313
- - spec/spec_tests/data/corpus/null.json
291
+ - spec/spec_tests/data/corpus/decimal128-1.json
292
+ - spec/spec_tests/data/corpus/decimal128-2.json
293
+ - spec/spec_tests/data/corpus/decimal128-3.json
314
294
  - spec/spec_tests/data/corpus/decimal128-4.json
315
- - spec/spec_tests/data/corpus/README.md
295
+ - spec/spec_tests/data/corpus/decimal128-5.json
316
296
  - spec/spec_tests/data/corpus/decimal128-6.json
297
+ - spec/spec_tests/data/corpus/decimal128-7.json
298
+ - spec/spec_tests/data/corpus/document.json
317
299
  - spec/spec_tests/data/corpus/double.json
318
- - spec/spec_tests/data/corpus/decimal128-5.json
319
- - spec/spec_tests/data/corpus/string.json
320
- - spec/spec_tests/data/corpus/minkey.json
321
- - spec/spec_tests/data/corpus/decimal128-1.json
322
- - spec/spec_tests/data/corpus/decimal128-2.json
323
- - spec/spec_tests/data/corpus/maxkey.json
324
- - spec/spec_tests/data/corpus/timestamp.json
325
- - spec/spec_tests/data/corpus/undefined.json
326
- - spec/spec_tests/data/corpus/oid.json
327
- - spec/spec_tests/data/corpus/top.json
300
+ - spec/spec_tests/data/corpus/int32.json
328
301
  - spec/spec_tests/data/corpus/int64.json
329
- - spec/spec_tests/data/corpus/code_w_scope.json
330
- - spec/spec_tests/data/corpus/binary.json
331
- - spec/spec_tests/data/corpus/datetime.json
332
- - spec/spec_tests/data/corpus/decimal128-3.json
333
- - spec/spec_tests/data/corpus/array.json
334
- - spec/spec_tests/data/corpus/multi-type.json
335
- - spec/spec_tests/data/corpus/boolean.json
302
+ - spec/spec_tests/data/corpus/maxkey.json
303
+ - spec/spec_tests/data/corpus/minkey.json
336
304
  - spec/spec_tests/data/corpus/multi-type-deprecated.json
337
- - spec/spec_tests/data/corpus/dbpointer.json
338
- - spec/spec_tests/data/corpus/int32.json
339
- - spec/spec_tests/data/corpus/symbol.json
340
- - spec/spec_tests/data/corpus/decimal128-7.json
341
- - spec/spec_tests/data/corpus/code.json
305
+ - spec/spec_tests/data/corpus/multi-type.json
306
+ - spec/spec_tests/data/corpus/null.json
307
+ - spec/spec_tests/data/corpus/oid.json
342
308
  - spec/spec_tests/data/corpus/regex.json
343
- - spec/spec_tests/data/decimal128/decimal128-4.json
344
- - spec/spec_tests/data/decimal128/decimal128-6.json
345
- - spec/spec_tests/data/decimal128/decimal128-5.json
346
- - spec/spec_tests/data/decimal128/decimal128-1.json
347
- - spec/spec_tests/data/decimal128/decimal128-2.json
348
- - spec/spec_tests/data/decimal128/decimal128-3.json
349
- - spec/spec_tests/data/decimal128/decimal128-7.json
350
- - spec/spec_tests/data/corpus_legacy/document.json
351
- - spec/spec_tests/data/corpus_legacy/null.json
352
- - spec/spec_tests/data/corpus_legacy/double.json
353
- - spec/spec_tests/data/corpus_legacy/string.json
354
- - spec/spec_tests/data/corpus_legacy/minkey.json
355
- - spec/spec_tests/data/corpus_legacy/maxkey.json
356
- - spec/spec_tests/data/corpus_legacy/timestamp.json
357
- - spec/spec_tests/data/corpus_legacy/undefined.json
358
- - spec/spec_tests/data/corpus_legacy/oid.json
359
- - spec/spec_tests/data/corpus_legacy/top.json
360
- - spec/spec_tests/data/corpus_legacy/code_w_scope.json
361
- - spec/spec_tests/data/corpus_legacy/binary.json
309
+ - spec/spec_tests/data/corpus/string.json
310
+ - spec/spec_tests/data/corpus/symbol.json
311
+ - spec/spec_tests/data/corpus/timestamp.json
312
+ - spec/spec_tests/data/corpus/top.json
313
+ - spec/spec_tests/data/corpus/undefined.json
362
314
  - spec/spec_tests/data/corpus_legacy/array.json
315
+ - spec/spec_tests/data/corpus_legacy/binary.json
363
316
  - spec/spec_tests/data/corpus_legacy/boolean.json
364
- - spec/spec_tests/data/corpus_legacy/int32.json
365
317
  - spec/spec_tests/data/corpus_legacy/code.json
366
- - spec/spec_tests/data/corpus_legacy/regex.json
367
- - spec/spec_tests/data/corpus_legacy/failures/int64.json
318
+ - spec/spec_tests/data/corpus_legacy/code_w_scope.json
319
+ - spec/spec_tests/data/corpus_legacy/document.json
320
+ - spec/spec_tests/data/corpus_legacy/double.json
368
321
  - spec/spec_tests/data/corpus_legacy/failures/datetime.json
369
322
  - spec/spec_tests/data/corpus_legacy/failures/dbpointer.json
323
+ - spec/spec_tests/data/corpus_legacy/failures/int64.json
370
324
  - spec/spec_tests/data/corpus_legacy/failures/symbol.json
371
- - spec/bson/object_id_spec.rb
372
- - spec/bson/time_with_zone_spec.rb
373
- - spec/bson/config_spec.rb
374
- - spec/bson/time_spec.rb
375
- - spec/bson/open_struct_spec.rb
376
- - spec/bson/registry_spec.rb
377
- - spec/bson/big_decimal_spec.rb
378
- - spec/bson/timestamp_spec.rb
379
- - spec/bson/date_spec.rb
380
- - spec/bson/byte_buffer_write_spec.rb
381
- - spec/bson/max_key_spec.rb
382
- - spec/bson/binary_uuid_spec.rb
383
- - spec/bson/regexp_spec.rb
384
- - spec/bson/float_spec.rb
385
- - spec/bson/code_spec.rb
386
- - spec/bson/byte_buffer_spec.rb
387
- - spec/bson/symbol_spec.rb
388
- - spec/bson/integer_spec.rb
389
- - spec/bson/int64_spec.rb
390
- - spec/bson/hash_spec.rb
391
- - spec/bson/object_spec.rb
392
- - spec/bson/raw_spec.rb
393
- - spec/bson/binary_spec.rb
394
- - spec/bson/json_spec.rb
395
- - spec/bson/min_key_spec.rb
396
- - spec/bson/date_time_spec.rb
397
- - spec/bson/int32_spec.rb
398
- - spec/bson/hash_as_spec.rb
399
- - spec/bson/symbol_raw_spec.rb
400
- - spec/bson/false_class_spec.rb
401
- - spec/bson/string_spec.rb
402
- - spec/bson/dbref_legacy_spec.rb
403
- - spec/bson/boolean_spec.rb
404
- - spec/bson/dbref_spec.rb
405
- - spec/bson/nil_class_spec.rb
406
- - spec/bson/ext_json_parse_spec.rb
407
- - spec/bson/true_class_spec.rb
408
- - spec/bson/byte_buffer_read_spec.rb
409
- - spec/bson/document_as_spec.rb
410
- - spec/bson/code_with_scope_spec.rb
411
- - spec/bson/undefined_spec.rb
412
- - spec/bson/array_spec.rb
413
- - spec/bson/document_spec.rb
414
- - spec/bson/decimal128_spec.rb
325
+ - spec/spec_tests/data/corpus_legacy/int32.json
326
+ - spec/spec_tests/data/corpus_legacy/maxkey.json
327
+ - spec/spec_tests/data/corpus_legacy/minkey.json
328
+ - spec/spec_tests/data/corpus_legacy/null.json
329
+ - spec/spec_tests/data/corpus_legacy/oid.json
330
+ - spec/spec_tests/data/corpus_legacy/regex.json
331
+ - spec/spec_tests/data/corpus_legacy/string.json
332
+ - spec/spec_tests/data/corpus_legacy/timestamp.json
333
+ - spec/spec_tests/data/corpus_legacy/top.json
334
+ - spec/spec_tests/data/corpus_legacy/undefined.json
335
+ - spec/spec_tests/data/decimal128/decimal128-1.json
336
+ - spec/spec_tests/data/decimal128/decimal128-2.json
337
+ - spec/spec_tests/data/decimal128/decimal128-3.json
338
+ - spec/spec_tests/data/decimal128/decimal128-4.json
339
+ - spec/spec_tests/data/decimal128/decimal128-5.json
340
+ - spec/spec_tests/data/decimal128/decimal128-6.json
341
+ - spec/spec_tests/data/decimal128/decimal128-7.json
415
342
  - spec/support/shared_examples.rb
416
- - spec/support/utils.rb
417
343
  - spec/support/spec_config.rb
344
+ - spec/support/utils.rb
checksums.yaml.gz.sig DELETED
Binary file
data/spec/shared/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2020 MongoDB, Inc.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- desired_version, arch = ARGV
4
- if arch.nil?
5
- STDERR.puts "Usage: get-mongodb-download-url desired-version arch"
6
- exit 1
7
- end
8
-
9
- $: << File.join(File.dirname(__FILE__), '../lib')
10
- require 'mrss/server_version_registry'
11
-
12
- begin
13
- puts Mrss::ServerVersionRegistry.new(desired_version, arch).download_url
14
- rescue Mrss::ServerVersionRegistry::Error => exc
15
- STDERR.puts "Error: #{exc}"
16
- exit 2
17
- end
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'optparse'
4
- require 'aws-sdk-s3'
5
-
6
- options = {}
7
- OptionParser.new do |opts|
8
- opts.banner = "Usage: s3-copy options"
9
-
10
- opts.on("-r", "--region=REGION", "AWS region to use (default us-east-1)") do |v|
11
- options[:region] = v
12
- end
13
-
14
- opts.on("-p", "--param=KEY=VALUE", "Specify parameter for new files") do |v|
15
- options[:params] ||= {}
16
- k, v = v.split('=', 2)
17
- options[:params][k.to_sym] = v
18
- end
19
-
20
- opts.on("-f", "--from=BUCKET:PATH", "Bucket name and key (or path) to copy from") do |v|
21
- options[:from] = v
22
- end
23
-
24
- opts.on("-t", "--to=BUCKET:PATH", "Bucket name and key (or path) to write to (may be specified more than once)") do |v|
25
- options[:to] ||= []
26
- options[:to] << v
27
- end
28
- end.parse!
29
-
30
- ENV['AWS_REGION'] ||= options[:region] || 'us-east-1'
31
-
32
- bucket, key = options.fetch(:from).split(':', 2)
33
-
34
- s3 = Aws::S3::Client.new
35
-
36
- options.fetch(:to).each do |dest|
37
- STDERR.puts "Copying to #{dest}"
38
- dbucket, dkey = dest.split(':', 2)
39
- s3.copy_object(
40
- bucket: dbucket,
41
- key: dkey,
42
- copy_source: "/#{bucket}/#{key}",
43
- **options[:params] || {},
44
- )
45
- end
@@ -1,69 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'optparse'
4
- require 'aws-sdk-s3'
5
-
6
- options = {}
7
- OptionParser.new do |opts|
8
- opts.banner = "Usage: s3-upload options"
9
-
10
- opts.on("-r", "--region=REGION", "AWS region to use (default us-east-1)") do |v|
11
- options[:region] = v
12
- end
13
-
14
- opts.on("-p", "--param=KEY=VALUE", "Specify parameter for S3 upload") do |v|
15
- options[:params] ||= {}
16
- k, v = v.split('=', 2)
17
- options[:params][k.to_sym] = v
18
- end
19
-
20
- opts.on("-f", "--file=PATH", "Path to the file to upload, - to upload standard input") do |v|
21
- options[:file] = v
22
- end
23
-
24
- opts.on("-w", "--write=BUCKET:PATH", "Bucket name and key (or path) to upload to") do |v|
25
- options[:write] = v
26
- end
27
-
28
- opts.on("-c", "--copy=BUCKET:PATH", "Bucket name and key (or path) to copy to (may be specified more than once)") do |v|
29
- options[:copy] ||= []
30
- options[:copy] << v
31
- end
32
- end.parse!
33
-
34
- ENV['AWS_REGION'] ||= options[:region] || 'us-east-1'
35
-
36
- def upload(f, options)
37
- s3 = Aws::S3::Client.new
38
- write = options.fetch(:write)
39
- STDERR.puts "Writing #{write}"
40
- bucket, key = write.split(':', 2)
41
- s3.put_object(
42
- body: f.read,
43
- bucket: bucket,
44
- key: key,
45
- **options[:params] || {},
46
- )
47
- if copy = options[:copy]
48
- copy.each do |dest|
49
- STDERR.puts "Copying to #{dest}"
50
- dbucket, dkey = dest.split(':', 2)
51
- s3.copy_object(
52
- bucket: dbucket,
53
- key: dkey,
54
- copy_source: "/#{bucket}/#{key}",
55
- **options[:params] || {},
56
- )
57
- end
58
- end
59
- end
60
-
61
- if options[:file] == '-'
62
- upload(STDIN, options)
63
- elsif options[:file]
64
- File.open(options[:file]) do |f|
65
- upload(f, options)
66
- end
67
- else
68
- upload(STDIN, options)
69
- end
@@ -1,80 +0,0 @@
1
- # frozen_string_literal: true
2
- # encoding: utf-8
3
-
4
- autoload :ChildProcess, 'childprocess'
5
- autoload :Tempfile, 'tempfile'
6
-
7
- module Mrss
8
- module ChildProcessHelper
9
- class SpawnError < StandardError; end
10
-
11
- module_function def call(cmd, env: nil, cwd: nil)
12
- process = ChildProcess.new(*cmd)
13
- process.io.inherit!
14
- if cwd
15
- process.cwd = cwd
16
- end
17
- if env
18
- env.each do |k, v|
19
- process.environment[k.to_s] = v
20
- end
21
- end
22
- process.start
23
- process.wait
24
- process
25
- end
26
-
27
- module_function def check_call(cmd, env: nil, cwd: nil)
28
- process = call(cmd, env: env, cwd: cwd)
29
- unless process.exit_code == 0
30
- raise SpawnError, "Failed to execute: #{cmd}"
31
- end
32
- end
33
-
34
- module_function def get_output(cmd, env: nil, cwd: nil)
35
- process = ChildProcess.new(*cmd)
36
- process.io.inherit!
37
- if cwd
38
- process.cwd = cwd
39
- end
40
- if env
41
- env.each do |k, v|
42
- process.environment[k.to_s] = v
43
- end
44
- end
45
-
46
- output = ''
47
- r, w = IO.pipe
48
-
49
- begin
50
- process.io.stdout = w
51
- process.start
52
- w.close
53
-
54
- thread = Thread.new do
55
- begin
56
- loop do
57
- output << r.readpartial(16384)
58
- end
59
- rescue EOFError
60
- end
61
- end
62
-
63
- process.wait
64
- thread.join
65
- ensure
66
- r.close
67
- end
68
-
69
- [process, output]
70
- end
71
-
72
- module_function def check_output(*args)
73
- process, output = get_output(*args)
74
- unless process.exit_code == 0
75
- raise SpawnError,"Failed to execute: #{args}"
76
- end
77
- output
78
- end
79
- end
80
- end