bson 3.2.3-java → 3.2.4-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f26a7b8ccb6c0548531e355c034502829b34de1
4
- data.tar.gz: 8f375a231324b77bab2e4560f280fe0d75cfdb8f
3
+ metadata.gz: c56b5705464d23f23e17cb6075facfe3a0920507
4
+ data.tar.gz: 7026777dc603e8c421e7484f00a196580a0a5c34
5
5
  SHA512:
6
- metadata.gz: 2ce3ae7127770804eead1d2af180f28af63399ab1eda8f8b4047e0c500e7749966b1c469827b6d245efc391179b5647100c2cdfca00a41b45dff047e7de28866
7
- data.tar.gz: f58f0144e81a0cf2b9079d48741840da6881a1351e150b3654bbf1a199ffc0bd7363cd9325e7be243e6c91207899948bcc8999d530812a82506a7b5676ff4022
6
+ metadata.gz: e14b929b5918634f7a0fc6f92776150715ae4514a7aa2ee063c1be773c7cf42b41840cd605d70a76255acb3baee828d5ec59215e3f5635c535167860adb7bc21
7
+ data.tar.gz: ac58c8d00dc791fdf507f058d409f82283eeab622af37cb30ef0c3eba680364cda0bb13c36a4cc5f4c47c18d554f3478d62b4235e859b53d263eedac568f7c6c
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
Binary file
@@ -72,11 +72,11 @@ module BSON
72
72
  #
73
73
  # @since 2.0.0
74
74
  def from_bson(bson)
75
- hash = new
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[field] = BSON::Registry.get(type).from_bson(bson)
79
+ hash.store(field, BSON::Registry.get(type).from_bson(bson))
80
80
  end
81
81
  hash
82
82
  end
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module BSON
16
- VERSION = "3.2.3"
16
+ VERSION = "3.2.4"
17
17
  end
@@ -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 }
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.3
4
+ version: 3.2.4
5
5
  platform: java
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-03 00:00:00.000000000 Z
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