bson 3.1.0 → 3.1.1
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 +6 -0
- data/lib/bson/document.rb +13 -3
- data/lib/bson/regexp.rb +1 -1
- data/lib/bson/version.rb +1 -1
- data/spec/bson/regexp_spec.rb +6 -2
- metadata +2 -2
- metadata.gz.sig +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19d09e81d696c4a6863f598446eb739a217bde9f
|
4
|
+
data.tar.gz: a20b9d91deb782700be8a71955453845979169e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3db38b183fd903072f8206f4082a6c89aa8d96258d5f7e9dfbbcd03b2391c8389b36e88e664680b49f2ed9ff64542646f92c7e336830840af81110fd16396e3b
|
7
|
+
data.tar.gz: dce6d904c7734e893ccbde2dc9a7498552ccee055dcde74ac3773647ce678b14b2a85579d6c39aa75bb9f4c3baba2a2bda082bcd22d705e75b9bfe21fd661387
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
data/lib/bson/document.rb
CHANGED
@@ -50,7 +50,7 @@ module BSON
|
|
50
50
|
#
|
51
51
|
# @since 2.0.0
|
52
52
|
def [](key)
|
53
|
-
super(key
|
53
|
+
super(convert_key(key))
|
54
54
|
end
|
55
55
|
|
56
56
|
# Set a value on the document. Will normalize symbol keys into strings.
|
@@ -65,7 +65,7 @@ module BSON
|
|
65
65
|
#
|
66
66
|
# @since 3.0.0
|
67
67
|
def []=(key, value)
|
68
|
-
super(key
|
68
|
+
super(convert_key(key), convert_value(value))
|
69
69
|
end
|
70
70
|
|
71
71
|
# Instantiate a new Document. Valid parameters for instantiation is a hash
|
@@ -110,12 +110,22 @@ module BSON
|
|
110
110
|
# @since 3.0.0
|
111
111
|
def merge!(other)
|
112
112
|
other.each_pair do |key, value|
|
113
|
-
value = yield(key
|
113
|
+
value = yield(convert_key(key), self[key], convert_value(value)) if block_given?
|
114
114
|
self[key] = value
|
115
115
|
end
|
116
116
|
self
|
117
117
|
end
|
118
118
|
|
119
119
|
alias :update :merge!
|
120
|
+
|
121
|
+
private
|
122
|
+
|
123
|
+
def convert_key(key)
|
124
|
+
key.to_bson_normalized_key
|
125
|
+
end
|
126
|
+
|
127
|
+
def convert_value(value)
|
128
|
+
value.to_bson_normalized_value
|
129
|
+
end
|
120
130
|
end
|
121
131
|
end
|
data/lib/bson/regexp.rb
CHANGED
data/lib/bson/version.rb
CHANGED
data/spec/bson/regexp_spec.rb
CHANGED
@@ -40,8 +40,12 @@ describe Regexp do
|
|
40
40
|
StringIO.new(bson)
|
41
41
|
end
|
42
42
|
|
43
|
+
let(:regex) do
|
44
|
+
described_class.from_bson(io)
|
45
|
+
end
|
46
|
+
|
43
47
|
let(:result) do
|
44
|
-
|
48
|
+
regex.compile
|
45
49
|
end
|
46
50
|
|
47
51
|
it_behaves_like "a bson element"
|
@@ -58,7 +62,7 @@ describe Regexp do
|
|
58
62
|
it_behaves_like "a serializable bson element"
|
59
63
|
|
60
64
|
it "runs the method on the Regexp object" do
|
61
|
-
expect(
|
65
|
+
expect(regex.match('6')).not_to be_nil
|
62
66
|
end
|
63
67
|
end
|
64
68
|
|
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.1.
|
4
|
+
version: 3.1.1
|
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-06-
|
37
|
+
date: 2015-06-23 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
@@ -1 +1,5 @@
|
|
1
|
-
|
1
|
+
s�2�E�;��aw�N0d?��ӳ����,Ev.���SH����W�����3�'�67КmrY��,����
|
2
|
+
Cw��
|
3
|
+
�8u�τ�yS�Ĉw���/4_�p����_soY�9�:+
|
4
|
+
�*�'�wg9ɢz�'a�� R��I9�"���W�5�p��qy=���:Y2��g:%�
|
5
|
+
[
|