mongo 1.12.3 → 1.12.4

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: 30a88f87ff5e1b827c377ea9bfaee0d089463be6
4
- data.tar.gz: af50ecf2fabeeeb7bf92690e19b58ad6fa021c0d
3
+ metadata.gz: 1b6b30e9444e24523c41b601ac00a03bff9dab89
4
+ data.tar.gz: 631e4eaec073feb36592c90a107e7e7b4cf2a929
5
5
  SHA512:
6
- metadata.gz: 04837e7cc054db97d9dbff8c3e1e0da3cf7e90bef449efbedc1b6ef20a255c7627fb3dd58cb7ae750d2fe5eb96f9abdfc210fd66c4cc478c916c71aaa39f2b06
7
- data.tar.gz: fe2673d157610550030230c2169ff564089c104d0b23e18e9a9eb2f2a140f65cc6e755656a6bba6583807317b3b3f92f22d4e8e9d9e09402e1882fdc8431b333
6
+ metadata.gz: 76d017eb530274e2ca8ddd4d1f41f055491df133f187d52b71f9991a00fdbf2e82b525eab723d535ce49dd52f284a38815cbf04f27bb00457aa7ad89cce14729
7
+ data.tar.gz: 7a3d1e7b145218b191619cc3b0d84cd4089436b43639c7e92d4d36356d18e3ce2dd3c8c386fc2b07807527e153320ab442ae14cd5774075d2e4eae45633abdbe
Binary file
data.tar.gz.sig CHANGED
Binary file
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.12.3
1
+ 1.12.4
@@ -148,7 +148,8 @@ module Mongo
148
148
 
149
149
  def ping
150
150
  begin
151
- return self.client['admin'].command({:ping => 1}, :socket => @node.socket, :timeout => MAX_PING_TIME)
151
+ return self.client['admin'].command({:ping => 1}, :socket => @node.socket,
152
+ :timeout => client.op_timeout || MongoClient::DEFAULT_OP_TIMEOUT)
152
153
  rescue ConnectionFailure, OperationFailure, SocketError, SystemCallError, IOError
153
154
  return false
154
155
  end
@@ -453,6 +453,8 @@ module Mongo
453
453
  # @param [Integer, Hash] args any additional argument to be passed to the +code+ expression when
454
454
  # it's run on the server.
455
455
  #
456
+ # @note the eval command is deprecated in MongoDB 3.0 and will be removed in a future server version.
457
+ #
456
458
  # @return [String] the return value of the function.
457
459
  def eval(code, *args)
458
460
  unless code.is_a?(BSON::Code)
@@ -223,6 +223,16 @@ module Mongo
223
223
  end
224
224
  end
225
225
 
226
+ # Reconnect the replica set client.
227
+ #
228
+ # @return [Boolean] +true+ unless the refresh lock can't be acquired.
229
+ #
230
+ # @since 1.12.4
231
+ def reconnect
232
+ close
233
+ refresh
234
+ end
235
+
226
236
  # Determine whether a replica set refresh is
227
237
  # required. If so, run a hard refresh. You can
228
238
  # force a hard refresh by running
@@ -30,7 +30,7 @@ class Hash
30
30
  def assert_valid_keys(*valid_keys)
31
31
  unknown_keys = keys - [valid_keys].flatten
32
32
  raise(ArgumentError, "Unknown key(s): #{unknown_keys.join(", ")}") unless unknown_keys.empty?
33
- end
33
+ end unless instance_methods.include?(:assert_valid_keys)
34
34
 
35
35
  end
36
36
 
@@ -40,6 +40,21 @@ class ReplicaSetClientTest < Test::Unit::TestCase
40
40
  assert_equal @client.local_manager, manager
41
41
  end
42
42
 
43
+ def test_reconnect_method
44
+ @client = MongoReplicaSetClient.from_uri(@uri, :op_timeout => TEST_OP_TIMEOUT)
45
+ assert @client.connected?
46
+
47
+ manager = @client.local_manager
48
+
49
+ @client.close
50
+ assert !@client.connected?
51
+ assert !@client.local_manager
52
+
53
+ @client.reconnect
54
+ assert @client.connected?
55
+ assert_equal @client.local_manager, manager
56
+ end
57
+
43
58
  # TODO: test connect timeout.
44
59
 
45
60
  def test_connect_with_deprecated_multi
@@ -146,6 +146,18 @@ class ReplicaSetRefreshTest < Test::Unit::TestCase
146
146
  end
147
147
  end
148
148
 
149
+ def test_ping_with_op_timeout
150
+ [nil, 10].each do |op_timeout|
151
+ client = MongoReplicaSetClient.new(@rs.repl_set_seeds, :op_timeout => op_timeout)
152
+ pool = client.primary_pool
153
+ admin_db = pool.client['admin']
154
+ admin_db.expects(:command).with({:ping => 1}, :socket => pool.node.socket,
155
+ :timeout => op_timeout || MongoClient::DEFAULT_OP_TIMEOUT).returns({'ok' => 1})
156
+ client.expects(:[]).with('admin').returns(admin_db)
157
+ assert pool.ping
158
+ end
159
+ end
160
+
149
161
  =begin
150
162
  def test_automated_refresh_with_removed_node
151
163
  client = MongoReplicaSetClient.new(@rs.repl_set_seeds,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.3
4
+ version: 1.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emily Stolfo
@@ -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-04 00:00:00.000000000 Z
37
+ date: 2015-10-29 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: bson
@@ -42,14 +42,14 @@ dependencies:
42
42
  requirements:
43
43
  - - '='
44
44
  - !ruby/object:Gem::Version
45
- version: 1.12.3
45
+ version: 1.12.4
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - '='
51
51
  - !ruby/object:Gem::Version
52
- version: 1.12.3
52
+ version: 1.12.4
53
53
  description: A Ruby driver for MongoDB. For more information about Mongo, see http://www.mongodb.org.
54
54
  email: mongodb-dev@googlegroups.com
55
55
  executables:
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  requirements: []
189
189
  rubyforge_project: mongo
190
- rubygems_version: 2.4.7
190
+ rubygems_version: 2.4.6
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: Ruby driver for MongoDB
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- :�){.�� ���!ͪG���� ���.�G��
2
- z*�^���Q�("՛��^����vs�;� �]50����$Ƿ�H�u�2t7;c��UN��v��_��MmZ��?�0�7��&0�@=l�IQj�Y)
1
+ ���L�;��Ï`T<=1n��C�{D�z0PX:[(�o/�����M;  ��1�v/w�͎���8�1b��U�x��#��}�F�X�b�7�gN4U�����LZ+^hL���yH�G��XFF����$�ֽ�