bson 2.2.0 → 2.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 078980f1ea9268424707f8092a03d37e994e4b57
4
- data.tar.gz: 0237ad595808006e2e6f676b52bdf03bc29d1623
3
+ metadata.gz: 2045b9e4dce7563fd9bca4db925085a6e3a2383e
4
+ data.tar.gz: 40f99133c083d133f9372852d814fb664815e325
5
5
  SHA512:
6
- metadata.gz: 29d9e1e82351f9abcca34eeb70faf469a07cbbf68ca9b1b8c55da8e629997247adb301adbcfda3fe866b74dbf44a184afcf719695c1a990a13fa82c5d8501546
7
- data.tar.gz: d5502ef3149262d3459558dc47e7082759f1caec153bf9b548e2c7ec1f365848a1c889169f8d4f40c9902e146f44a587fb0a36fb59e8a79bf487f18f3766c771
6
+ metadata.gz: 32a51a23ebb1739fdd77cdbc49eee0129ed510db433fbb9ecd2b8e64050302382267b3ea0d86e506bddb981b088899cce59b57ff78d2ee0f5834c0b2e9ed2ec7
7
+ data.tar.gz: 6f6c25e3fc1df79ad550699a8b48e77f5831c16d6c1bf1fb9f230d788ef140dcedf8a988e62d6b2eaf241e02d9a0eff42a328764d007921a834a56559f48c710
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1 @@
1
- `��;T*�W���6�L�|�ޔ��ol�ٮ�3p�1����<�dό����Ű�.���Ws�h=G�������1��u�q5���ة�y@� ���CZ)r|��=@��zIo
2
- Ȩ�xAM�?%��:Cgh�`����O'��_i_eR<���9���Sű&�&�z�
3
- ��l��z�s34�5Z�$k��~#��,.3S�{*�������h��;na����
1
+ J�6��0��w�Y1�뉎D0�޲F�3��P��c�oнK��s^d9�GC�;�x��T���k��C>�5��`� ]T���L��R6p�L���_��hCHi� cg���!�n��<i{�W�ݒ�_c9ۮ��w.�Q"��#�L��]��J�giX{��2� ��H�w6��<a���v9�n&P�#��0�/S�#���h�YsIo>F���K���1b�B��Gk��F��,�8�}p�Z��_�ad�m̀�g�*_q
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  BSON Changelog
2
2
  ==============
3
3
 
4
+ ## 2.2.1
5
+
6
+ ### Bug Fixes
7
+
8
+ * [#15](http://github.com/mongodb/bson-ruby/pull/15):
9
+ `Date` and `DateTime` instances now return the `Time` value for the BSON
10
+ type, so that they can be serialized inside hashes and arrays. (Michael Sell)
11
+
4
12
  ## 2.2.0
5
13
 
6
14
  ### Dependency Changes
@@ -11,13 +19,16 @@ BSON Changelog
11
19
 
12
20
  ### Bug Fixes
13
21
 
14
- * \#14: Fixed all 1.8 errors related to `DateTime` serialization.
22
+ * [#14](http://github.com/mongodb/bson-ruby/pull/14):
23
+ Fixed all 1.8 errors related to `DateTime` serialization.
15
24
 
16
25
  ## 2.1.1
17
26
 
18
27
  ### Bug Fixes
19
28
 
20
- * \#13 / RUBY-714: Require time in `DateTime` modules when using outside of
29
+ * [#13](http://github.com/mongodb/bson-ruby/pull/13) /
30
+ [RUBY-714](http://jira.mongodb.org/browse/RUBY-714):
31
+ Require time in `DateTime` modules when using outside of
21
32
  environments that don't already have time included.
22
33
 
23
34
  ## 2.1.0
data/lib/bson/date.rb CHANGED
@@ -35,6 +35,13 @@ module BSON
35
35
  def to_bson(encoded = ''.force_encoding(BINARY))
36
36
  ::Time.utc(year, month, day).to_bson(encoded)
37
37
  end
38
+
39
+ # Get the BSON type for the date.
40
+ #
41
+ # As the date is converted to a time, this returns the BSON type for time.
42
+ def bson_type
43
+ ::Time::BSON_TYPE
44
+ end
38
45
  end
39
46
 
40
47
  # Enrich the core Date class with this module.
data/lib/bson/version.rb CHANGED
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module BSON
16
- VERSION = "2.2.0"
16
+ VERSION = "2.2.1"
17
17
  end
@@ -16,6 +16,8 @@ require "spec_helper"
16
16
 
17
17
  describe Date do
18
18
 
19
+ it_behaves_like "a class which converts to Time"
20
+
19
21
  describe "#to_bson" do
20
22
 
21
23
  context "when the date is post epoch" do
@@ -16,6 +16,8 @@ require "spec_helper"
16
16
 
17
17
  describe DateTime do
18
18
 
19
+ it_behaves_like "a class which converts to Time"
20
+
19
21
  describe "#to_bson" do
20
22
 
21
23
  context "when the date time is post epoch" do
@@ -93,3 +93,10 @@ shared_examples_for "a document able to handle utf-8" do
93
93
  ).to eq(document)
94
94
  end
95
95
  end
96
+
97
+ shared_examples_for "a class which converts to Time" do
98
+
99
+ it "shares BSON type with Time" do
100
+ expect(described_class.new.bson_type).to eq(Time::BSON_TYPE)
101
+ end
102
+ end
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.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Brock
@@ -14,9 +14,9 @@ bindir: bin
14
14
  cert_chain:
15
15
  - |
16
16
  -----BEGIN CERTIFICATE-----
17
- MIIDODCCAiCgAwIBAgIBADANBgkqhkiG9w0BAQUFADBCMRQwEgYDVQQDDAtkcml2
17
+ MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQUFADBCMRQwEgYDVQQDDAtkcml2
18
18
  ZXItcnVieTEVMBMGCgmSJomT8ixkARkWBTEwZ2VuMRMwEQYKCZImiZPyLGQBGRYD
19
- Y29tMB4XDTEzMDIwMTE0MTEzN1oXDTE0MDIwMTE0MTEzN1owQjEUMBIGA1UEAwwL
19
+ Y29tMB4XDTE0MDIxOTE1MTEyNloXDTE1MDIxOTE1MTEyNlowQjEUMBIGA1UEAwwL
20
20
  ZHJpdmVyLXJ1YnkxFTATBgoJkiaJk/IsZAEZFgUxMGdlbjETMBEGCgmSJomT8ixk
21
21
  ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANFdSAa8fRm1
22
22
  bAM9za6Z0fA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NGZkjD
31
+ V3C4XjlI8rQZxalwQwcauacOGj9x94flWUXruEF7+rjUtig7OIrQK2+uVg86vl8r
32
+ xy1n2s1d31KsuazEVExe5o19tnVbI9+30P9qPkS+NgaellXpj5c5qnJUGn5BJtzo
33
+ 3D001zXpVnuZvCcE/A4fQ+BEM0zm0oOmA/gWIAFrufOL9oYg1881dRZ+kQytF/9c
34
+ JrZM8w8wGbIOeLtoQqa7HB/jOYbTahH7KMNh2LHAbOR93hNIJxVRa4iwxiMQ75tN
35
+ 9WUIAJ4AEtjwRg1Bz0OwDo3aucPCBpx77+/FWhv7JYY=
35
36
  -----END CERTIFICATE-----
36
- date: 2014-01-24 00:00:00.000000000 Z
37
+ date: 2014-02-19 00:00:00.000000000 Z
37
38
  dependencies: []
38
39
  description: A full featured BSON specification implementation, in Ruby
39
40
  email:
metadata.gz.sig CHANGED
Binary file