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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47f064976e34a90ffdc62d9b0f43264ada242462
4
- data.tar.gz: 48151e4c94187076bfa4711c49059d501aa69d23
3
+ metadata.gz: 19d09e81d696c4a6863f598446eb739a217bde9f
4
+ data.tar.gz: a20b9d91deb782700be8a71955453845979169e0
5
5
  SHA512:
6
- metadata.gz: 0e5fa3e317570ec74882f92db96ed317bed5af33ead6fd7cc586f3c978a538a401c0e61019ba118e68ecd81835bc092e036776d85987982f0ff9e7674d4b8773
7
- data.tar.gz: f6010bed96f29ff857e67145c4af598578757836d03a27370dbcf42ab2da0584b6cfcba5e3830707971813ee68be7fea6664755d215de6b9bf8f60dbf76ad598
6
+ metadata.gz: 3db38b183fd903072f8206f4082a6c89aa8d96258d5f7e9dfbbcd03b2391c8389b36e88e664680b49f2ed9ff64542646f92c7e336830840af81110fd16396e3b
7
+ data.tar.gz: dce6d904c7734e893ccbde2dc9a7498552ccee055dcde74ac3773647ce678b14b2a85579d6c39aa75bb9f4c3baba2a2bda082bcd22d705e75b9bfe21fd661387
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,6 +1,12 @@
1
1
  BSON Changelog
2
2
  ==============
3
3
 
4
+ ## 3.1.1
5
+
6
+ ### Bug Fixes
7
+
8
+ * Fixed argument errors when delegating to regex objects. (Tom Scott)
9
+
4
10
  ## 3.1.0
5
11
 
6
12
  ### New Features
@@ -50,7 +50,7 @@ module BSON
50
50
  #
51
51
  # @since 2.0.0
52
52
  def [](key)
53
- super(key.to_bson_normalized_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.to_bson_normalized_key, value.to_bson_normalized_value)
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.to_bson_normalized_key, self[key], value.to_bson_normalized_value) if block_given?
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
@@ -135,7 +135,7 @@ module BSON
135
135
 
136
136
  def method_missing(method, *arguments)
137
137
  return super unless respond_to?(method)
138
- compile.send(method)
138
+ compile.send(method, *arguments)
139
139
  end
140
140
  end
141
141
 
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module BSON
16
- VERSION = "3.1.0"
16
+ VERSION = "3.1.1"
17
17
  end
@@ -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
- described_class.from_bson(io).compile
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(result.match('6')).not_to be_nil
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.0
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-11 00:00:00.000000000 Z
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
- 7z���~Ȏ��a��ha" :�Zк�o'��ө�u tзY�h�Z<˥܈�`�\+,���%��r����$f��M 8��V�U��a�=�ctQ��(������rm����ɕ�=��&�ͫ���p(��&%h�7e�&,��9�}����r�V1zà���{UB/��ݮ��39IR��R3z�V[�N�cQ�|����l7��N���7�ո�[�0Tu^�,��Q?�>}�4~��(v���1��
1
+ s2E�;��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
+ [