bson 2.2.1-java → 2.2.2-java
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bson might be problematic. Click here for more details.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +12 -0
- data/lib/bson-ruby.jar +0 -0
- data/lib/bson/object_id.rb +4 -4
- data/lib/bson/time.rb +1 -1
- data/lib/bson/version.rb +1 -1
- data/spec/bson/time_spec.rb +16 -4
- 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: e407939a4b8e13a960f15fc9d8910df10fa7f27b
|
4
|
+
data.tar.gz: df201aaf41b3bb467851b7c4c41633371573807b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c702264504931eb1845ad07d10a64db8f07bc7a29caa61cc6c64b52bf5f69ce6d1dfb15403aafc684a5f5d1c6e623f2ee51f74db5143122acbe4bdac5368345
|
7
|
+
data.tar.gz: d546e6a01357b0271e598b05f8adc397443734855e74a37cf3bc85a24cf111d09765ab1880d04a1549085e13a217bb31455c1a25096c0e992e35fb063393196e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
BSON Changelog
|
2
2
|
==============
|
3
3
|
|
4
|
+
## 2.2.2
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* [#17](http://github.com/mongodb/bson-ruby/pull/17):
|
9
|
+
Fixed `BSON::ObjectId` counter increment on Ruby 2.1.0 since method names
|
10
|
+
can no longer override Ruby keywords.
|
11
|
+
|
12
|
+
* [#16](http://github.com/mongodb/bson-ruby/pull/16):
|
13
|
+
Fixed serialization of times when microseconds are causing `to_f` on time to
|
14
|
+
be 1 microsecond inaccurate. (Francois Bernier)
|
15
|
+
|
4
16
|
## 2.2.1
|
5
17
|
|
6
18
|
### Bug Fixes
|
data/lib/bson-ruby.jar
CHANGED
Binary file
|
data/lib/bson/object_id.rb
CHANGED
@@ -170,7 +170,7 @@ module BSON
|
|
170
170
|
# @since 2.0.0
|
171
171
|
def to_bson(encoded = ''.force_encoding(BINARY))
|
172
172
|
repair if defined?(@data)
|
173
|
-
@raw_data ||= @@generator.
|
173
|
+
@raw_data ||= @@generator.next_object_id
|
174
174
|
encoded << @raw_data
|
175
175
|
end
|
176
176
|
|
@@ -268,7 +268,7 @@ module BSON
|
|
268
268
|
#
|
269
269
|
# @since 2.0.0
|
270
270
|
def from_time(time, options = {})
|
271
|
-
from_data(options[:unique] ? @@generator.
|
271
|
+
from_data(options[:unique] ? @@generator.next_object_id(time.to_i) : [ time.to_i ].pack("Nx8"))
|
272
272
|
end
|
273
273
|
|
274
274
|
# Determine if the provided string is a legal object id.
|
@@ -337,14 +337,14 @@ module BSON
|
|
337
337
|
# object id counter. Will use the provided time if not nil.
|
338
338
|
#
|
339
339
|
# @example Get the next object id data.
|
340
|
-
# generator.
|
340
|
+
# generator.next_object_id
|
341
341
|
#
|
342
342
|
# @param [ Time ] time The optional time to generate with.
|
343
343
|
#
|
344
344
|
# @return [ String ] The raw object id bytes.
|
345
345
|
#
|
346
346
|
# @since 2.0.0
|
347
|
-
def
|
347
|
+
def next_object_id(time = nil)
|
348
348
|
@mutex.lock
|
349
349
|
begin
|
350
350
|
count = @counter = (@counter + 1) % 0xFFFFFF
|
data/lib/bson/time.rb
CHANGED
data/lib/bson/version.rb
CHANGED
data/spec/bson/time_spec.rb
CHANGED
@@ -24,11 +24,23 @@ describe Time do
|
|
24
24
|
|
25
25
|
context "when the time is post epoch" do
|
26
26
|
|
27
|
-
|
28
|
-
let(:bson) { [ (obj.to_f * 1000).to_i ].pack(BSON::Int64::PACK) }
|
27
|
+
context "when the time has no microseconds" do
|
29
28
|
|
30
|
-
|
31
|
-
|
29
|
+
let(:obj) { Time.utc(2012, 1, 1, 0, 0, 0) }
|
30
|
+
let(:bson) { [ (obj.to_i * 1000) + (obj.usec / 1000) ].pack(BSON::Int64::PACK) }
|
31
|
+
|
32
|
+
it_behaves_like "a serializable bson element"
|
33
|
+
it_behaves_like "a deserializable bson element"
|
34
|
+
end
|
35
|
+
|
36
|
+
context "when the time has microseconds" do
|
37
|
+
|
38
|
+
let(:obj) { Time.at(Time.utc(2014, 03, 22, 18, 05, 05).to_i, 505000).utc }
|
39
|
+
let(:bson) { [ (obj.to_i * 1000) + (obj.usec / 1000) ].pack(BSON::Int64::PACK) }
|
40
|
+
|
41
|
+
it_behaves_like "a serializable bson element"
|
42
|
+
it_behaves_like "a deserializable bson element"
|
43
|
+
end
|
32
44
|
end
|
33
45
|
|
34
46
|
context "when the time is pre epoch" 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: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Tyler Brock
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
JrZM8w8wGbIOeLtoQqa7HB/jOYbTahH7KMNh2LHAbOR93hNIJxVRa4iwxiMQ75tN
|
35
35
|
9WUIAJ4AEtjwRg1Bz0OwDo3aucPCBpx77+/FWhv7JYY=
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2014-
|
37
|
+
date: 2014-04-03 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
|