bson 3.2.3 → 3.2.4
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 +0 -0
- data/CHANGELOG.md +6 -2
- data/lib/bson/hash.rb +2 -2
- data/lib/bson/version.rb +1 -1
- data/spec/bson/document_spec.rb +34 -0
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dc5021cec13fb522184eff22fbc21da999e4e00
|
4
|
+
data.tar.gz: 1af593ca4fa28815a0c73fa9caed09a8e77ac898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98b53c5f9e1b5528507698be9cd6119d61a454be7400dbae4e1289944bb46d6d6732c6caf4c3adb14655ebd8a872da66841019b276865070e80a596b5ccb56e8
|
7
|
+
data.tar.gz: 080fde6e480edee7b400e2cfcad9a5363a33c4c75df0aff7e8883427cd8a32d2bb7cfa4e08ff3314bf2b2f01607a6f03bef8c284d1bd5325007d16c5075313ce
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
BSON Changelog
|
2
2
|
==============
|
3
3
|
|
4
|
+
## 3.2.4
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* [RUBY-1019](https://jira.mongodb.org/browse/RUBY-1019) Performace improvements on deserialization.
|
9
|
+
|
4
10
|
## 3.2.3
|
5
11
|
|
6
12
|
### Bug Fixes
|
@@ -9,8 +15,6 @@ BSON Changelog
|
|
9
15
|
|
10
16
|
* [#40](https://github.com/mongodb/bson-ruby/pull/40) Added big endian support. (Jeff Blight)
|
11
17
|
|
12
|
-
* [RUBY-1019](https://jira.mongodb.org/browse/RUBY-1019) Performace improvements on deserialization.
|
13
|
-
|
14
18
|
## 3.2.1
|
15
19
|
|
16
20
|
### Bug Fixes
|
data/lib/bson/hash.rb
CHANGED
@@ -72,11 +72,11 @@ module BSON
|
|
72
72
|
#
|
73
73
|
# @since 2.0.0
|
74
74
|
def from_bson(bson)
|
75
|
-
hash =
|
75
|
+
hash = Document.allocate
|
76
76
|
bson.read(4) # Swallow the first four bytes.
|
77
77
|
while (type = bson.readbyte.chr) != NULL_BYTE
|
78
78
|
field = bson.gets(NULL_BYTE).from_bson_string.chop!
|
79
|
-
hash
|
79
|
+
hash.store(field, BSON::Registry.get(type).from_bson(bson))
|
80
80
|
end
|
81
81
|
hash
|
82
82
|
end
|
data/lib/bson/version.rb
CHANGED
data/spec/bson/document_spec.rb
CHANGED
@@ -626,6 +626,40 @@ describe BSON::Document do
|
|
626
626
|
end
|
627
627
|
end
|
628
628
|
|
629
|
+
describe "#from_bson" do
|
630
|
+
|
631
|
+
context "when the document has embedded documents in an array" do
|
632
|
+
|
633
|
+
let(:embedded_document) do
|
634
|
+
BSON::Document.new(n: 1)
|
635
|
+
end
|
636
|
+
|
637
|
+
let(:embedded_documents) do
|
638
|
+
[ embedded_document ]
|
639
|
+
end
|
640
|
+
|
641
|
+
let(:document) do
|
642
|
+
BSON::Document.new(field: 'value', embedded: embedded_documents)
|
643
|
+
end
|
644
|
+
|
645
|
+
let(:serialized) do
|
646
|
+
document.to_bson
|
647
|
+
end
|
648
|
+
|
649
|
+
let(:deserialized) do
|
650
|
+
described_class.from_bson(StringIO.new(serialized))
|
651
|
+
end
|
652
|
+
|
653
|
+
it 'deserializes the documents' do
|
654
|
+
expect(deserialized).to eq(document)
|
655
|
+
end
|
656
|
+
|
657
|
+
it 'deserializes embedded documents as document type' do
|
658
|
+
expect(deserialized[:embedded].first).to be_a(BSON::Document)
|
659
|
+
end
|
660
|
+
end
|
661
|
+
end
|
662
|
+
|
629
663
|
describe "#to_bson/#from_bson" do
|
630
664
|
|
631
665
|
let(:type) { 3.chr }
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Brock
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
XZOS48LlWh15EG4yZo/gRzqNAW2LUIkYA5eMS2Kp6r+KV8IBUO/LaHdrXbdilpa8
|
35
35
|
BRsuCo7UZDbFVRns04HLyjVvkj+K/ywIcdKdS0csz5M=
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2015-09-
|
37
|
+
date: 2015-09-04 00:00:00.000000000 Z
|
38
38
|
dependencies: []
|
39
39
|
description: A full featured BSON specification implementation, in Ruby
|
40
40
|
email:
|
metadata.gz.sig
CHANGED
Binary file
|