bson 3.1.2-java → 3.2.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 +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +10 -0
- data/lib/bson-ruby.jar +0 -0
- data/lib/bson.rb +16 -0
- data/lib/bson/binary.rb +1 -1
- data/lib/bson/object_id.rb +1 -1
- data/lib/bson/version.rb +1 -1
- data/spec/bson/object_id_spec.rb +5 -1
- data/spec/bson_spec.rb +10 -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: ffe178fd95f00fd40e6939901c3500102f60cc67
|
4
|
+
data.tar.gz: c7ffee83f85064e1a6e0eafa0f2d040875407c6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ce0bd27f43518077db60b25cc4009c721173aa3d43819a0ba5152cfa67e6cead5a11642d8cd0f12d6fe231c008cfeee40802ab9369a2a309f74d6353d66f348
|
7
|
+
data.tar.gz: 26a4d727425f8ae539cc7f26185be7704d79e062172be98b50de3c281dbf50ae6f1b8687f962c512c55f1ef8c90ff7a3b98d376961bd55c39213b7adada32a87
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
BSON Changelog
|
2
2
|
==============
|
3
3
|
|
4
|
+
## 3.2.0
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* [RUBY-950](https://jira.mongodb.org/browse/RUBY-950) Don't encode to UTF-8 in Binary#to_bson, only force BINARY encoding.
|
9
|
+
|
10
|
+
### New features
|
11
|
+
|
12
|
+
* Add `BSON.ObjectId` constructor for instantiating an ObjectId from a String. Update ObjectId#inspect to print out a string that can be evaluated into the corresponding ObjectId. (Tony Ta)
|
13
|
+
|
4
14
|
## 3.1.2
|
5
15
|
|
6
16
|
### Bug Fixes
|
data/lib/bson-ruby.jar
CHANGED
Binary file
|
data/lib/bson.rb
CHANGED
@@ -19,6 +19,22 @@ require "bson/environment"
|
|
19
19
|
# @since 0.0.0
|
20
20
|
module BSON
|
21
21
|
|
22
|
+
# Create a new object id from a string using ObjectId.from_string
|
23
|
+
#
|
24
|
+
# @example Create an object id from the string.
|
25
|
+
# BSON::ObjectId(id)
|
26
|
+
#
|
27
|
+
# @param [ String ] string The string to create the id from.
|
28
|
+
#
|
29
|
+
# @raise [ BSON::ObjectId::Invalid ] If the provided string is invalid.
|
30
|
+
#
|
31
|
+
# @return [ BSON::ObjectId ] The new object id.
|
32
|
+
#
|
33
|
+
# @see ObjectId.from_string
|
34
|
+
def self.ObjectId(string)
|
35
|
+
self::ObjectId.from_string(string)
|
36
|
+
end
|
37
|
+
|
22
38
|
# Constant for binary string encoding.
|
23
39
|
#
|
24
40
|
# @since 2.0.0
|
data/lib/bson/binary.rb
CHANGED
@@ -134,7 +134,7 @@ module BSON
|
|
134
134
|
encode_binary_data_with_placeholder(encoded) do |encoded|
|
135
135
|
encoded << SUBTYPES.fetch(type)
|
136
136
|
encoded << data.bytesize.to_bson if type == :old
|
137
|
-
encoded << data.
|
137
|
+
encoded << data.force_encoding(BINARY)
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
data/lib/bson/object_id.rb
CHANGED
data/lib/bson/version.rb
CHANGED
data/spec/bson/object_id_spec.rb
CHANGED
@@ -390,7 +390,11 @@ describe BSON::ObjectId do
|
|
390
390
|
end
|
391
391
|
|
392
392
|
it "returns the inspection with the object id to_s" do
|
393
|
-
expect(object_id.inspect).to eq("
|
393
|
+
expect(object_id.inspect).to eq("BSON::ObjectId('#{object_id.to_s}')")
|
394
|
+
end
|
395
|
+
|
396
|
+
it "returns a string that evaluates into an equivalent object id" do
|
397
|
+
expect(eval object_id.inspect).to eq object_id
|
394
398
|
end
|
395
399
|
end
|
396
400
|
|
data/spec/bson_spec.rb
CHANGED
@@ -16,6 +16,16 @@ require "spec_helper"
|
|
16
16
|
|
17
17
|
describe BSON do
|
18
18
|
|
19
|
+
describe ".ObjectId" do
|
20
|
+
|
21
|
+
let(:string) { "4e4d66343b39b68407000001" }
|
22
|
+
|
23
|
+
it "returns an BSON::ObjectId from given string" do
|
24
|
+
expect(described_class::ObjectId(string)).to be_a BSON::ObjectId
|
25
|
+
expect(described_class::ObjectId(string)).to eq BSON::ObjectId.from_string(string)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
19
29
|
describe "::BINARY" do
|
20
30
|
|
21
31
|
it "returns BINARY" do
|
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.
|
4
|
+
version: 3.2.0
|
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-07-
|
37
|
+
date: 2015-07-22 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
|