bson 4.9.0-java → 4.10.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -0
- data.tar.gz.sig +0 -0
- data/README.md +17 -5
- data/lib/bson-ruby.jar +0 -0
- data/lib/bson/array.rb +3 -0
- data/lib/bson/date_time.rb +1 -1
- data/lib/bson/error.rb +6 -0
- data/lib/bson/hash.rb +3 -0
- data/lib/bson/regexp.rb +7 -1
- data/lib/bson/timestamp.rb +4 -4
- data/lib/bson/version.rb +1 -1
- data/spec/bson/array_spec.rb +17 -0
- data/spec/bson/byte_buffer_read_spec.rb +59 -3
- data/spec/bson/byte_buffer_spec.rb +10 -7
- data/spec/bson/byte_buffer_write_spec.rb +96 -0
- data/spec/bson/date_time_spec.rb +53 -0
- data/spec/bson/hash_spec.rb +17 -0
- data/spec/bson/raw_spec.rb +12 -1
- data/spec/spec_helper.rb +11 -0
- data/spec/spec_tests/data/corpus/timestamp.json +10 -0
- data/spec/spec_tests/data/corpus/top.json +3 -3
- data/spec/support/spec_config.rb +6 -0
- metadata +119 -98
- 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: 9d460d1c028e7772a80132e18c31942bd3c4f211fc3746b4a39a6e1d6c81241a
|
4
|
+
data.tar.gz: 8deadbdd46e3e3f5093e446b2fea191124359554716d34d9f9289ff44822e49a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fe91a28391f68145170f3997f76b3e909c82cc82324b81bca37ae4bf129442b20e4bff4e30e12384e535ed1641705a753b26429811e3d30c63cf33824baf315
|
7
|
+
data.tar.gz: 1be88552338a2e653bdf188a9b5ece65d5ea396c00ce48bac95a9fc9c04b3714a8f37e70c6169a6a1ebaf0a9ca2bc9cfb4dba1690c62801fc4f488fae8dc9731
|
checksums.yaml.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
H���s�(�HG��͖P\��b7x@�0�
|
data.tar.gz.sig
ADDED
Binary file
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
BSON
|
2
|
-
[![
|
3
|
-
[![
|
4
|
-
[![
|
5
|
-
[![
|
1
|
+
BSON
|
2
|
+
[![Gem Version][rubygems-img]][rubygems-url]
|
3
|
+
[![Build Status][travis-img]][travis-url]
|
4
|
+
[![Build status Windows][appveyor-img]][appveyor-url]
|
5
|
+
[![Coverage Status][coveralls-img]][coveralls-url]
|
6
|
+
[![Inline docs][inch-img]][inch-url]
|
6
7
|
====
|
7
8
|
|
8
9
|
An implementation of the BSON specification in Ruby.
|
@@ -51,3 +52,14 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|
51
52
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
52
53
|
See the License for the specific language governing permissions and
|
53
54
|
limitations under the License.
|
55
|
+
|
56
|
+
[rubygems-img]: https://badge.fury.io/rb/bson.svg
|
57
|
+
[rubygems-url]: http://badge.fury.io/rb/bson
|
58
|
+
[travis-img]: https://secure.travis-ci.org/mongodb/bson-ruby.svg?branch=master
|
59
|
+
[travis-url]: http://travis-ci.org/mongodb/bson-ruby
|
60
|
+
[appveyor-img]: https://ci.appveyor.com/api/projects/status/p5aqko7umsx351nm?svg=true
|
61
|
+
[appveyor-url]: https://ci.appveyor.com/project/p-mongo/bson-ruby/branch/master
|
62
|
+
[coveralls-img]: https://coveralls.io/repos/mongodb/bson-ruby/badge.svg?branch=master
|
63
|
+
[coveralls-url]: https://coveralls.io/r/mongodb/bson-ruby?branch=master
|
64
|
+
[inch-img]: http://inch-ci.org/github/mongodb/bson-ruby.svg?branch=master
|
65
|
+
[inch-url]: http://inch-ci.org/github/mongodb/bson-ruby
|
data/lib/bson-ruby.jar
CHANGED
Binary file
|
data/lib/bson/array.rb
CHANGED
@@ -47,6 +47,9 @@ module BSON
|
|
47
47
|
position = buffer.length
|
48
48
|
buffer.put_int32(0)
|
49
49
|
each_with_index do |value, index|
|
50
|
+
unless value.respond_to?(:bson_type)
|
51
|
+
raise Error::UnserializableClass, "Array element at position #{index} does not define its BSON serialized type: #{value}"
|
52
|
+
end
|
50
53
|
buffer.put_byte(value.bson_type)
|
51
54
|
buffer.put_cstring(index.to_s)
|
52
55
|
value.to_bson(buffer, validating_keys)
|
data/lib/bson/date_time.rb
CHANGED
data/lib/bson/error.rb
CHANGED
@@ -17,5 +17,11 @@ module BSON
|
|
17
17
|
# Exception raised when BSON decoding fails.
|
18
18
|
class BSONDecodeError < Error
|
19
19
|
end
|
20
|
+
|
21
|
+
# Exception raised when serializing an Array or Hash to BSON and an
|
22
|
+
# array or hash element is of a class that does not define how to serialize
|
23
|
+
# itself to BSON.
|
24
|
+
class UnserializableClass < Error
|
25
|
+
end
|
20
26
|
end
|
21
27
|
end
|
data/lib/bson/hash.rb
CHANGED
@@ -44,6 +44,9 @@ module BSON
|
|
44
44
|
position = buffer.length
|
45
45
|
buffer.put_int32(0)
|
46
46
|
each do |field, value|
|
47
|
+
unless value.respond_to?(:bson_type)
|
48
|
+
raise Error::UnserializableClass, "Hash value for key '#{field}' does not define its BSON serialized type: #{value}"
|
49
|
+
end
|
47
50
|
buffer.put_byte(value.bson_type)
|
48
51
|
key = field.to_bson_key(validating_keys)
|
49
52
|
begin
|
data/lib/bson/regexp.rb
CHANGED
@@ -165,7 +165,13 @@ module BSON
|
|
165
165
|
#
|
166
166
|
# @since 3.1.0
|
167
167
|
def respond_to?(method, include_private = false)
|
168
|
-
|
168
|
+
if defined?(@pattern)
|
169
|
+
compile.respond_to?(method, include_private) || super
|
170
|
+
else
|
171
|
+
# YAML calls #respond_to? during deserialization, before the object
|
172
|
+
# is initialized.
|
173
|
+
super
|
174
|
+
end
|
169
175
|
end
|
170
176
|
|
171
177
|
# Encode the Raw Regexp object to BSON.
|
data/lib/bson/timestamp.rb
CHANGED
@@ -124,8 +124,8 @@ module BSON
|
|
124
124
|
#
|
125
125
|
# @since 2.0.0
|
126
126
|
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
|
127
|
-
buffer.
|
128
|
-
buffer.
|
127
|
+
buffer.put_uint32(increment)
|
128
|
+
buffer.put_uint32(seconds)
|
129
129
|
end
|
130
130
|
|
131
131
|
# Deserialize timestamp from BSON.
|
@@ -140,8 +140,8 @@ module BSON
|
|
140
140
|
#
|
141
141
|
# @since 2.0.0
|
142
142
|
def self.from_bson(buffer, **options)
|
143
|
-
increment = buffer.
|
144
|
-
seconds = buffer.
|
143
|
+
increment = buffer.get_uint32
|
144
|
+
seconds = buffer.get_uint32
|
145
145
|
new(seconds, increment)
|
146
146
|
end
|
147
147
|
|
data/lib/bson/version.rb
CHANGED
data/spec/bson/array_spec.rb
CHANGED
@@ -132,6 +132,23 @@ describe Array do
|
|
132
132
|
end
|
133
133
|
end
|
134
134
|
end
|
135
|
+
|
136
|
+
context 'when array contains value of an unserializable class' do
|
137
|
+
class ArraySpecUnserializableClass
|
138
|
+
end
|
139
|
+
|
140
|
+
let(:obj) do
|
141
|
+
[ArraySpecUnserializableClass.new]
|
142
|
+
end
|
143
|
+
|
144
|
+
it 'raises UnserializableClass' do
|
145
|
+
lambda do
|
146
|
+
obj.to_bson
|
147
|
+
end.should raise_error(BSON::Error::UnserializableClass,
|
148
|
+
# C extension does not provide element position in the exception message.
|
149
|
+
/(Array element at position 0|Value) does not define its BSON serialized type:.*ArraySpecUnserializableClass/)
|
150
|
+
end
|
151
|
+
end
|
135
152
|
end
|
136
153
|
|
137
154
|
describe "#to_bson_normalized_value" do
|
@@ -66,7 +66,7 @@ describe BSON::ByteBuffer do
|
|
66
66
|
describe '#get_double' do
|
67
67
|
|
68
68
|
let(:buffer) do
|
69
|
-
described_class.new(
|
69
|
+
described_class.new(12.5.to_bson.to_s)
|
70
70
|
end
|
71
71
|
|
72
72
|
let!(:double) do
|
@@ -85,7 +85,7 @@ describe BSON::ByteBuffer do
|
|
85
85
|
describe '#get_int32' do
|
86
86
|
|
87
87
|
let(:buffer) do
|
88
|
-
described_class.new(
|
88
|
+
described_class.new(12.to_bson.to_s)
|
89
89
|
end
|
90
90
|
|
91
91
|
let!(:int32) do
|
@@ -101,10 +101,66 @@ describe BSON::ByteBuffer do
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
describe '#get_uint32' do
|
105
|
+
context 'when using 2^32-1' do
|
106
|
+
let(:buffer) do
|
107
|
+
described_class.new(4294967295.to_bson.to_s)
|
108
|
+
end
|
109
|
+
|
110
|
+
let!(:int32) do
|
111
|
+
buffer.get_uint32
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'gets the uint32 from the buffer' do
|
115
|
+
expect(int32).to eq(4294967295)
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'increments the position by 4' do
|
119
|
+
expect(buffer.read_position).to eq(4)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
context 'when using 2^32-2' do
|
124
|
+
let(:buffer) do
|
125
|
+
described_class.new(4294967294.to_bson.to_s)
|
126
|
+
end
|
127
|
+
|
128
|
+
let!(:int32) do
|
129
|
+
buffer.get_uint32
|
130
|
+
end
|
131
|
+
|
132
|
+
it 'gets the uint32 from the buffer' do
|
133
|
+
expect(int32).to eq(4294967294)
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'increments the position by 4' do
|
137
|
+
expect(buffer.read_position).to eq(4)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
context 'when using 0' do
|
142
|
+
let(:buffer) do
|
143
|
+
described_class.new(0.to_bson.to_s)
|
144
|
+
end
|
145
|
+
|
146
|
+
let!(:int32) do
|
147
|
+
buffer.get_uint32
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'gets the uint32 from the buffer' do
|
151
|
+
expect(int32).to eq(0)
|
152
|
+
end
|
153
|
+
|
154
|
+
it 'increments the position by 4' do
|
155
|
+
expect(buffer.read_position).to eq(4)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
104
160
|
describe '#get_int64' do
|
105
161
|
|
106
162
|
let(:buffer) do
|
107
|
-
described_class.new(
|
163
|
+
described_class.new((Integer::MAX_64BIT - 1).to_bson.to_s)
|
108
164
|
end
|
109
165
|
|
110
166
|
let!(:int64) do
|
@@ -30,16 +30,19 @@ describe BSON::ByteBuffer do
|
|
30
30
|
let(:buffer) do
|
31
31
|
described_class.new
|
32
32
|
end
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
|
34
|
+
context '#put_int32' do
|
35
|
+
before do
|
36
|
+
buffer.put_int32(5)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'returns the length of the buffer' do
|
40
|
+
expect(buffer.length).to eq(4)
|
41
|
+
end
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
45
|
+
|
43
46
|
context 'when the byte buffer is initialized with some bytes' do
|
44
47
|
|
45
48
|
let(:buffer) do
|
@@ -585,6 +585,102 @@ describe BSON::ByteBuffer do
|
|
585
585
|
end
|
586
586
|
end
|
587
587
|
|
588
|
+
describe '#put_uint32' do
|
589
|
+
context 'when argument is a float' do
|
590
|
+
it 'raises an Argument Error' do
|
591
|
+
expect{ buffer.put_uint32(4.934) }.to raise_error(ArgumentError, "put_uint32: incorrect type: float, expected: integer")
|
592
|
+
end
|
593
|
+
end
|
594
|
+
|
595
|
+
context 'when number is in range' do
|
596
|
+
let(:modified) do
|
597
|
+
buffer.put_uint32(5)
|
598
|
+
end
|
599
|
+
|
600
|
+
it 'returns gets the correct number from the buffer' do
|
601
|
+
expect(modified.get_uint32).to eq(5)
|
602
|
+
end
|
603
|
+
|
604
|
+
it 'returns the length of the buffer' do
|
605
|
+
expect(modified.length).to eq(4)
|
606
|
+
end
|
607
|
+
end
|
608
|
+
|
609
|
+
context 'when number is 0' do
|
610
|
+
let(:modified) do
|
611
|
+
buffer.put_uint32(0)
|
612
|
+
end
|
613
|
+
|
614
|
+
it 'returns gets the correct number from the buffer' do
|
615
|
+
expect(modified.get_uint32).to eq(0)
|
616
|
+
end
|
617
|
+
|
618
|
+
it 'returns the length of the buffer' do
|
619
|
+
expect(modified.length).to eq(4)
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
623
|
+
context 'when number doesn\'t fit in signed int32' do
|
624
|
+
let(:modified) do
|
625
|
+
buffer.put_uint32(4294967295)
|
626
|
+
end
|
627
|
+
|
628
|
+
let(:expected) do
|
629
|
+
[ 4294967295 ].pack(BSON::Int32::PACK)
|
630
|
+
end
|
631
|
+
|
632
|
+
it 'appends the int32 to the byte buffer' do
|
633
|
+
expect(modified.to_s).to eq(expected)
|
634
|
+
end
|
635
|
+
|
636
|
+
it 'get returns correct number' do
|
637
|
+
expect(modified.get_uint32).to eq(4294967295)
|
638
|
+
end
|
639
|
+
|
640
|
+
it 'returns the length of the buffer' do
|
641
|
+
expect(modified.length).to eq(4)
|
642
|
+
end
|
643
|
+
end
|
644
|
+
|
645
|
+
context 'when number is 2^31' do
|
646
|
+
let(:modified) do
|
647
|
+
buffer.put_uint32(2147483648)
|
648
|
+
end
|
649
|
+
|
650
|
+
it 'returns gets the correct number from the buffer' do
|
651
|
+
expect(modified.get_uint32).to eq(2147483648)
|
652
|
+
end
|
653
|
+
|
654
|
+
it 'returns the length of the buffer' do
|
655
|
+
expect(modified.length).to eq(4)
|
656
|
+
end
|
657
|
+
end
|
658
|
+
|
659
|
+
context 'when number is 2^31-1' do
|
660
|
+
let(:modified) do
|
661
|
+
buffer.put_uint32(2147483647)
|
662
|
+
end
|
663
|
+
|
664
|
+
it 'returns gets the correct number from the buffer' do
|
665
|
+
expect(modified.get_uint32).to eq(2147483647)
|
666
|
+
end
|
667
|
+
|
668
|
+
it 'returns the length of the buffer' do
|
669
|
+
expect(modified.length).to eq(4)
|
670
|
+
end
|
671
|
+
end
|
672
|
+
|
673
|
+
context 'when number is not in range' do
|
674
|
+
it 'raises error on out of top range' do
|
675
|
+
expect{ buffer.put_uint32(4294967296) }.to raise_error(RangeError, "Number 4294967296 is out of range [0, 2^32)")
|
676
|
+
end
|
677
|
+
|
678
|
+
it 'raises error on out of bottom range' do
|
679
|
+
expect{ buffer.put_uint32(-1) }.to raise_error(RangeError, "Number -1 is out of range [0, 2^32)")
|
680
|
+
end
|
681
|
+
end
|
682
|
+
end
|
683
|
+
|
588
684
|
describe '#put_int64' do
|
589
685
|
|
590
686
|
context 'when the integer is 64 bit' do
|
data/spec/bson/date_time_spec.rb
CHANGED
@@ -35,5 +35,58 @@ describe DateTime do
|
|
35
35
|
|
36
36
|
it_behaves_like "a serializable bson element"
|
37
37
|
end
|
38
|
+
|
39
|
+
context "when the dates don't both use Gregorian" do
|
40
|
+
|
41
|
+
let(:shakespeare_datetime) do
|
42
|
+
DateTime.iso8601('1616-04-23', Date::ENGLAND)
|
43
|
+
end
|
44
|
+
|
45
|
+
let(:gregorian_datetime) do
|
46
|
+
DateTime.iso8601('1616-04-23', Date::GREGORIAN)
|
47
|
+
end
|
48
|
+
|
49
|
+
context "when putting to bson" do
|
50
|
+
|
51
|
+
let(:shakespeare) do
|
52
|
+
{ a: shakespeare_datetime }.to_bson
|
53
|
+
end
|
54
|
+
|
55
|
+
let(:gregorian) do
|
56
|
+
{ a: gregorian_datetime }.to_bson
|
57
|
+
end
|
58
|
+
|
59
|
+
it "does not equal each other" do
|
60
|
+
expect(shakespeare.to_s).to_not eq(gregorian.to_s)
|
61
|
+
end
|
62
|
+
|
63
|
+
it "the english date is 10 days later" do
|
64
|
+
expect(shakespeare.to_s).to eq({ a: DateTime.iso8601('1616-05-03', Date::GREGORIAN) }.to_bson.to_s)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
context "when putting and receiving from bson" do
|
69
|
+
|
70
|
+
let(:shakespeare) do
|
71
|
+
Hash.from_bson(BSON::ByteBuffer.new({ a: shakespeare_datetime }.to_bson.to_s))
|
72
|
+
end
|
73
|
+
|
74
|
+
let(:gregorian) do
|
75
|
+
Hash.from_bson(BSON::ByteBuffer.new({ a: gregorian_datetime }.to_bson.to_s))
|
76
|
+
end
|
77
|
+
|
78
|
+
it "does not equal each other" do
|
79
|
+
expect(shakespeare).to_not eq(gregorian)
|
80
|
+
end
|
81
|
+
|
82
|
+
it "the english date is 10 days later" do
|
83
|
+
expect(shakespeare[:a]).to eq(DateTime.iso8601('1616-05-03', Date::GREGORIAN).to_time)
|
84
|
+
end
|
85
|
+
|
86
|
+
it "the gregorian date is the same" do
|
87
|
+
expect(gregorian[:a]).to eq(DateTime.iso8601('1616-04-23', Date::GREGORIAN).to_time)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
38
91
|
end
|
39
92
|
end
|
data/spec/bson/hash_spec.rb
CHANGED
@@ -227,6 +227,23 @@ describe Hash do
|
|
227
227
|
end
|
228
228
|
end
|
229
229
|
end
|
230
|
+
|
231
|
+
context 'when hash contains value of an unserializable class' do
|
232
|
+
class HashSpecUnserializableClass
|
233
|
+
end
|
234
|
+
|
235
|
+
let(:obj) do
|
236
|
+
{foo: HashSpecUnserializableClass.new}
|
237
|
+
end
|
238
|
+
|
239
|
+
it 'raises UnserializableClass' do
|
240
|
+
lambda do
|
241
|
+
obj.to_bson
|
242
|
+
end.should raise_error(BSON::Error::UnserializableClass,
|
243
|
+
# C extension does not provide hash key in the exception message.
|
244
|
+
/(Hash value for key 'foo'|Value) does not define its BSON serialized type:.*HashSpecUnserializableClass/)
|
245
|
+
end
|
246
|
+
end
|
230
247
|
end
|
231
248
|
|
232
249
|
describe '#to_bson' do
|
data/spec/bson/raw_spec.rb
CHANGED
@@ -580,4 +580,15 @@ describe Regexp::Raw do
|
|
580
580
|
end
|
581
581
|
end
|
582
582
|
end
|
583
|
-
|
583
|
+
|
584
|
+
describe 'yaml loading' do
|
585
|
+
let(:regexp) { described_class.new('hello.world', 's') }
|
586
|
+
|
587
|
+
it 'round-trips' do
|
588
|
+
actual = YAML.load(regexp.to_yaml)
|
589
|
+
actual.pattern.should == 'hello.world'
|
590
|
+
actual.options.should == 's'
|
591
|
+
actual.compile.should =~ "hello\nworld"
|
592
|
+
end
|
593
|
+
end
|
594
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -60,4 +60,15 @@ RSpec.configure do |config|
|
|
60
60
|
config.expect_with :rspec do |c|
|
61
61
|
c.syntax = [:should, :expect]
|
62
62
|
end
|
63
|
+
|
64
|
+
# To ensure that calling GC.compact does not produce unexpected behavior,
|
65
|
+
# randomly call GC.compact after a small percentage of tests in the suite.
|
66
|
+
# This behavior is only enabled when the COMPACT environment variable is true.
|
67
|
+
if SpecConfig.instance.compact?
|
68
|
+
config.after do
|
69
|
+
if rand < SpecConfig::COMPACTION_CHANCE
|
70
|
+
GC.compact
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
63
74
|
end
|
@@ -13,6 +13,16 @@
|
|
13
13
|
"canonical_bson": "100000001161002A00000015CD5B0700",
|
14
14
|
"canonical_extjson": "{\"a\" : {\"$timestamp\" : {\"t\" : 123456789, \"i\" : 42} } }",
|
15
15
|
"degenerate_extjson": "{\"a\" : {\"$timestamp\" : {\"i\" : 42, \"t\" : 123456789} } }"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"description": "Timestamp with high-order bit set on both seconds and increment",
|
19
|
+
"canonical_bson": "10000000116100FFFFFFFFFFFFFFFF00",
|
20
|
+
"canonical_extjson": "{\"a\" : {\"$timestamp\" : {\"t\" : 4294967295, \"i\" : 4294967295} } }"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"description": "Timestamp with high-order bit set on both seconds and increment (not UINT32_MAX)",
|
24
|
+
"canonical_bson": "1000000011610000286BEE00286BEE00",
|
25
|
+
"canonical_extjson": "{\"a\" : {\"$timestamp\" : {\"t\" : 4000000000, \"i\" : 4000000000} } }"
|
16
26
|
}
|
17
27
|
],
|
18
28
|
"decodeErrors": [
|
@@ -65,11 +65,11 @@
|
|
65
65
|
"parseErrors": [
|
66
66
|
{
|
67
67
|
"description" : "Bad $regularExpression (extra field)",
|
68
|
-
"string" : "{\"a\" : \"$regularExpression\": {\"pattern\": \"abc\", \"options\": \"\", \"unrelated\": true}}}"
|
68
|
+
"string" : "{\"a\" : {\"$regularExpression\": {\"pattern\": \"abc\", \"options\": \"\", \"unrelated\": true}}}"
|
69
69
|
},
|
70
70
|
{
|
71
71
|
"description" : "Bad $regularExpression (missing options field)",
|
72
|
-
"string" : "{\"a\" : \"$regularExpression\": {\"pattern\": \"abc\"}}}"
|
72
|
+
"string" : "{\"a\" : {\"$regularExpression\": {\"pattern\": \"abc\"}}}"
|
73
73
|
},
|
74
74
|
{
|
75
75
|
"description": "Bad $regularExpression (pattern is number, not string)",
|
@@ -81,7 +81,7 @@
|
|
81
81
|
},
|
82
82
|
{
|
83
83
|
"description" : "Bad $regularExpression (missing pattern field)",
|
84
|
-
"string" : "{\"a\" : \"$regularExpression\": {\"options\":\"ix\"}}}"
|
84
|
+
"string" : "{\"a\" : {\"$regularExpression\": {\"options\":\"ix\"}}}"
|
85
85
|
},
|
86
86
|
{
|
87
87
|
"description": "Bad $oid (number, not string)",
|
data/spec/support/spec_config.rb
CHANGED
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.
|
4
|
+
version: 4.10.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Tyler Brock
|
@@ -11,8 +11,29 @@ authors:
|
|
11
11
|
- Gary Murakami
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
|
-
cert_chain:
|
15
|
-
|
14
|
+
cert_chain:
|
15
|
+
- |
|
16
|
+
-----BEGIN CERTIFICATE-----
|
17
|
+
MIIDRDCCAiygAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBtkcml2
|
18
|
+
ZXItcnVieS9EQz0xMGdlbi9EQz1jb20wHhcNMjAwMTIzMTkzNjAxWhcNMjEwMTIy
|
19
|
+
MTkzNjAxWjAmMSQwIgYDVQQDDBtkcml2ZXItcnVieS9EQz0xMGdlbi9EQz1jb20w
|
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
|
+
CwUAA4IBAQBfX4dwxG5PhtxES/LDEOaZIZXyaX6CKe367zhW+HxWbSOXMQJFkIQj
|
30
|
+
m7tzT+sDFJXyiOv5cPtfpUam5pTiryzRw5HD6oxlPIt5vO15EJ69v++3m7shMLbw
|
31
|
+
amZOajKXmu2ZGZfhOtj7bOTwmOj1AnWLKeOQIR3STvvfZCD+6dt1XenW7CdjCsxE
|
32
|
+
ifervPjLFqFPsMOgaxikhgPK6bRtszrQhJSYlifKKzxbX1hYAsmGL7IxjubFSV5r
|
33
|
+
gpvfPNWMwyBDlHaNS3GfO6cRRxBOvEG05GUCsvtTY4Bpe8yjE64wg1ymb47LMOnv
|
34
|
+
Qb1lGORmf/opg45mluKUYl7pQNZHD0d3
|
35
|
+
-----END CERTIFICATE-----
|
36
|
+
date: 2020-07-17 00:00:00.000000000 Z
|
16
37
|
dependencies: []
|
17
38
|
description: A fully featured BSON specification implementation in Ruby
|
18
39
|
email:
|
@@ -207,113 +228,113 @@ signing_key:
|
|
207
228
|
specification_version: 4
|
208
229
|
summary: Ruby implementation of the BSON specification
|
209
230
|
test_files:
|
210
|
-
- spec/bson_spec.rb
|
211
231
|
- spec/spec_helper.rb
|
212
|
-
- spec/
|
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
|
220
|
-
- spec/bson/date_spec.rb
|
221
|
-
- spec/bson/object_spec.rb
|
222
|
-
- spec/bson/int64_spec.rb
|
223
|
-
- spec/bson/int32_spec.rb
|
224
|
-
- spec/bson/object_id_spec.rb
|
225
|
-
- spec/bson/hash_spec.rb
|
226
|
-
- spec/bson/string_spec.rb
|
227
|
-
- spec/bson/boolean_spec.rb
|
228
|
-
- spec/bson/timestamp_spec.rb
|
229
|
-
- spec/bson/open_struct_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
|
235
|
-
- spec/bson/false_class_spec.rb
|
236
|
-
- spec/bson/raw_spec.rb
|
237
|
-
- spec/bson/binary_spec.rb
|
238
|
-
- spec/bson/array_spec.rb
|
239
|
-
- spec/bson/code_with_scope_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
|
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
|
249
|
-
- spec/bson/document_spec.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
|
254
|
-
- spec/support/shared_examples.rb
|
255
|
-
- spec/support/spec_config.rb
|
256
|
-
- spec/support/utils.rb
|
257
|
-
- spec/spec_tests/corpus_legacy_spec.rb
|
232
|
+
- spec/bson_spec.rb
|
258
233
|
- spec/spec_tests/corpus_spec.rb
|
259
234
|
- spec/spec_tests/common_driver_spec.rb
|
260
|
-
- spec/spec_tests/
|
261
|
-
- spec/spec_tests/data/
|
235
|
+
- spec/spec_tests/corpus_legacy_spec.rb
|
236
|
+
- spec/spec_tests/data/corpus/decimal128-7.json
|
237
|
+
- spec/spec_tests/data/corpus/top.json
|
238
|
+
- spec/spec_tests/data/corpus/array.json
|
239
|
+
- spec/spec_tests/data/corpus/null.json
|
240
|
+
- spec/spec_tests/data/corpus/document.json
|
241
|
+
- spec/spec_tests/data/corpus/decimal128-2.json
|
242
|
+
- spec/spec_tests/data/corpus/decimal128-6.json
|
243
|
+
- spec/spec_tests/data/corpus/boolean.json
|
244
|
+
- spec/spec_tests/data/corpus/README.md
|
245
|
+
- spec/spec_tests/data/corpus/maxkey.json
|
246
|
+
- spec/spec_tests/data/corpus/binary.json
|
247
|
+
- spec/spec_tests/data/corpus/multi-type.json
|
248
|
+
- spec/spec_tests/data/corpus/timestamp.json
|
249
|
+
- spec/spec_tests/data/corpus/multi-type-deprecated.json
|
250
|
+
- spec/spec_tests/data/corpus/dbpointer.json
|
251
|
+
- spec/spec_tests/data/corpus/oid.json
|
252
|
+
- spec/spec_tests/data/corpus/regex.json
|
253
|
+
- spec/spec_tests/data/corpus/minkey.json
|
254
|
+
- spec/spec_tests/data/corpus/symbol.json
|
255
|
+
- spec/spec_tests/data/corpus/dbref.json
|
256
|
+
- spec/spec_tests/data/corpus/decimal128-1.json
|
257
|
+
- spec/spec_tests/data/corpus/undefined.json
|
258
|
+
- spec/spec_tests/data/corpus/double.json
|
259
|
+
- spec/spec_tests/data/corpus/decimal128-4.json
|
260
|
+
- spec/spec_tests/data/corpus/decimal128-3.json
|
261
|
+
- spec/spec_tests/data/corpus/decimal128-5.json
|
262
|
+
- spec/spec_tests/data/corpus/int32.json
|
263
|
+
- spec/spec_tests/data/corpus/string.json
|
264
|
+
- spec/spec_tests/data/corpus/code.json
|
265
|
+
- spec/spec_tests/data/corpus/code_w_scope.json
|
266
|
+
- spec/spec_tests/data/corpus/int64.json
|
267
|
+
- spec/spec_tests/data/corpus/datetime.json
|
268
|
+
- spec/spec_tests/data/corpus_legacy/top.json
|
269
|
+
- spec/spec_tests/data/corpus_legacy/array.json
|
262
270
|
- spec/spec_tests/data/corpus_legacy/null.json
|
271
|
+
- spec/spec_tests/data/corpus_legacy/document.json
|
263
272
|
- spec/spec_tests/data/corpus_legacy/boolean.json
|
273
|
+
- spec/spec_tests/data/corpus_legacy/maxkey.json
|
274
|
+
- spec/spec_tests/data/corpus_legacy/binary.json
|
275
|
+
- spec/spec_tests/data/corpus_legacy/timestamp.json
|
264
276
|
- spec/spec_tests/data/corpus_legacy/oid.json
|
265
277
|
- 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
278
|
- spec/spec_tests/data/corpus_legacy/minkey.json
|
271
|
-
- spec/spec_tests/data/corpus_legacy/
|
279
|
+
- spec/spec_tests/data/corpus_legacy/undefined.json
|
280
|
+
- spec/spec_tests/data/corpus_legacy/double.json
|
272
281
|
- 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
282
|
- spec/spec_tests/data/corpus_legacy/string.json
|
276
|
-
- spec/spec_tests/data/corpus_legacy/
|
283
|
+
- spec/spec_tests/data/corpus_legacy/code.json
|
284
|
+
- spec/spec_tests/data/corpus_legacy/code_w_scope.json
|
285
|
+
- spec/spec_tests/data/corpus_legacy/failures/dbpointer.json
|
277
286
|
- spec/spec_tests/data/corpus_legacy/failures/symbol.json
|
278
|
-
- spec/spec_tests/data/corpus_legacy/failures/datetime.json
|
279
287
|
- spec/spec_tests/data/corpus_legacy/failures/int64.json
|
280
|
-
- spec/spec_tests/data/corpus_legacy/failures/
|
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
|
288
|
+
- spec/spec_tests/data/corpus_legacy/failures/datetime.json
|
314
289
|
- spec/spec_tests/data/decimal128/decimal128-7.json
|
290
|
+
- spec/spec_tests/data/decimal128/decimal128-2.json
|
291
|
+
- spec/spec_tests/data/decimal128/decimal128-6.json
|
292
|
+
- spec/spec_tests/data/decimal128/decimal128-1.json
|
293
|
+
- spec/spec_tests/data/decimal128/decimal128-4.json
|
315
294
|
- spec/spec_tests/data/decimal128/decimal128-3.json
|
316
295
|
- spec/spec_tests/data/decimal128/decimal128-5.json
|
317
|
-
- spec/
|
318
|
-
- spec/
|
319
|
-
- spec/
|
296
|
+
- spec/support/utils.rb
|
297
|
+
- spec/support/shared_examples.rb
|
298
|
+
- spec/support/spec_config.rb
|
299
|
+
- spec/runners/common_driver.rb
|
300
|
+
- spec/runners/corpus_legacy.rb
|
301
|
+
- spec/runners/corpus.rb
|
302
|
+
- spec/bson/code_spec.rb
|
303
|
+
- spec/bson/byte_buffer_read_spec.rb
|
304
|
+
- spec/bson/int32_spec.rb
|
305
|
+
- spec/bson/max_key_spec.rb
|
306
|
+
- spec/bson/time_spec.rb
|
307
|
+
- spec/bson/array_spec.rb
|
308
|
+
- spec/bson/date_time_spec.rb
|
309
|
+
- spec/bson/document_spec.rb
|
310
|
+
- spec/bson/float_spec.rb
|
311
|
+
- spec/bson/nil_class_spec.rb
|
312
|
+
- spec/bson/time_with_zone_spec.rb
|
313
|
+
- spec/bson/ext_json_parse_spec.rb
|
314
|
+
- spec/bson/string_spec.rb
|
315
|
+
- spec/bson/open_struct_spec.rb
|
316
|
+
- spec/bson/config_spec.rb
|
317
|
+
- spec/bson/false_class_spec.rb
|
318
|
+
- spec/bson/raw_spec.rb
|
319
|
+
- spec/bson/regexp_spec.rb
|
320
|
+
- spec/bson/binary_spec.rb
|
321
|
+
- spec/bson/object_spec.rb
|
322
|
+
- spec/bson/decimal128_spec.rb
|
323
|
+
- spec/bson/binary_uuid_spec.rb
|
324
|
+
- spec/bson/boolean_spec.rb
|
325
|
+
- spec/bson/byte_buffer_spec.rb
|
326
|
+
- spec/bson/json_spec.rb
|
327
|
+
- spec/bson/symbol_spec.rb
|
328
|
+
- spec/bson/integer_spec.rb
|
329
|
+
- spec/bson/byte_buffer_write_spec.rb
|
330
|
+
- spec/bson/registry_spec.rb
|
331
|
+
- spec/bson/code_with_scope_spec.rb
|
332
|
+
- spec/bson/true_class_spec.rb
|
333
|
+
- spec/bson/undefined_spec.rb
|
334
|
+
- spec/bson/object_id_spec.rb
|
335
|
+
- spec/bson/timestamp_spec.rb
|
336
|
+
- spec/bson/hash_spec.rb
|
337
|
+
- spec/bson/symbol_raw_spec.rb
|
338
|
+
- spec/bson/min_key_spec.rb
|
339
|
+
- spec/bson/int64_spec.rb
|
340
|
+
- spec/bson/date_spec.rb
|
metadata.gz.sig
ADDED
Binary file
|