mongo 2.4.2 → 2.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/LICENSE +1 -1
  5. data/README.md +1 -1
  6. data/lib/mongo.rb +1 -1
  7. data/lib/mongo/address.rb +23 -8
  8. data/lib/mongo/address/ipv4.rb +5 -5
  9. data/lib/mongo/address/ipv6.rb +5 -5
  10. data/lib/mongo/address/unix.rb +3 -3
  11. data/lib/mongo/auth.rb +1 -1
  12. data/lib/mongo/auth/cr.rb +1 -1
  13. data/lib/mongo/auth/ldap.rb +1 -1
  14. data/lib/mongo/auth/roles.rb +1 -1
  15. data/lib/mongo/auth/user.rb +1 -1
  16. data/lib/mongo/auth/user/view.rb +1 -1
  17. data/lib/mongo/auth/x509.rb +1 -1
  18. data/lib/mongo/bson.rb +1 -1
  19. data/lib/mongo/bulk_write.rb +1 -1
  20. data/lib/mongo/bulk_write/combineable.rb +1 -1
  21. data/lib/mongo/bulk_write/ordered_combiner.rb +1 -1
  22. data/lib/mongo/bulk_write/result.rb +1 -1
  23. data/lib/mongo/bulk_write/result_combiner.rb +1 -1
  24. data/lib/mongo/bulk_write/transformable.rb +1 -1
  25. data/lib/mongo/bulk_write/unordered_combiner.rb +1 -1
  26. data/lib/mongo/bulk_write/validatable.rb +1 -1
  27. data/lib/mongo/client.rb +1 -1
  28. data/lib/mongo/cluster.rb +2 -2
  29. data/lib/mongo/cluster/topology.rb +1 -1
  30. data/lib/mongo/cluster/topology/replica_set.rb +1 -1
  31. data/lib/mongo/cluster/topology/sharded.rb +1 -1
  32. data/lib/mongo/cluster/topology/single.rb +1 -1
  33. data/lib/mongo/cluster/topology/unknown.rb +1 -1
  34. data/lib/mongo/collection.rb +1 -1
  35. data/lib/mongo/collection/view.rb +1 -1
  36. data/lib/mongo/collection/view/aggregation.rb +1 -1
  37. data/lib/mongo/collection/view/builder.rb +1 -1
  38. data/lib/mongo/collection/view/builder/aggregation.rb +3 -2
  39. data/lib/mongo/collection/view/builder/find_command.rb +1 -1
  40. data/lib/mongo/collection/view/builder/flags.rb +1 -1
  41. data/lib/mongo/collection/view/builder/map_reduce.rb +1 -1
  42. data/lib/mongo/collection/view/builder/modifiers.rb +1 -1
  43. data/lib/mongo/collection/view/builder/op_query.rb +1 -1
  44. data/lib/mongo/collection/view/explainable.rb +1 -1
  45. data/lib/mongo/collection/view/immutable.rb +1 -1
  46. data/lib/mongo/collection/view/iterable.rb +1 -1
  47. data/lib/mongo/collection/view/map_reduce.rb +1 -1
  48. data/lib/mongo/collection/view/readable.rb +1 -1
  49. data/lib/mongo/collection/view/writable.rb +1 -1
  50. data/lib/mongo/cursor.rb +1 -1
  51. data/lib/mongo/cursor/builder.rb +1 -1
  52. data/lib/mongo/cursor/builder/get_more_command.rb +1 -1
  53. data/lib/mongo/cursor/builder/kill_cursors_command.rb +1 -1
  54. data/lib/mongo/cursor/builder/op_get_more.rb +1 -1
  55. data/lib/mongo/cursor/builder/op_kill_cursors.rb +1 -1
  56. data/lib/mongo/database.rb +1 -1
  57. data/lib/mongo/database/view.rb +1 -1
  58. data/lib/mongo/dbref.rb +1 -1
  59. data/lib/mongo/error.rb +1 -1
  60. data/lib/mongo/error/bulk_write_error.rb +1 -1
  61. data/lib/mongo/error/closed_stream.rb +1 -1
  62. data/lib/mongo/error/extra_file_chunk.rb +1 -1
  63. data/lib/mongo/error/file_not_found.rb +1 -1
  64. data/lib/mongo/error/invalid_bulk_operation.rb +1 -1
  65. data/lib/mongo/error/invalid_bulk_operation_type.rb +1 -1
  66. data/lib/mongo/error/invalid_collection_name.rb +1 -1
  67. data/lib/mongo/error/invalid_database_name.rb +1 -1
  68. data/lib/mongo/error/invalid_document.rb +1 -1
  69. data/lib/mongo/error/invalid_file.rb +1 -1
  70. data/lib/mongo/error/invalid_file_revision.rb +1 -1
  71. data/lib/mongo/error/invalid_min_pool_size.rb +1 -1
  72. data/lib/mongo/error/invalid_nonce.rb +1 -1
  73. data/lib/mongo/error/invalid_replacement_document.rb +1 -1
  74. data/lib/mongo/error/invalid_server_preference.rb +1 -1
  75. data/lib/mongo/error/invalid_signature.rb +1 -1
  76. data/lib/mongo/error/invalid_update_document.rb +1 -1
  77. data/lib/mongo/error/invalid_uri.rb +1 -1
  78. data/lib/mongo/error/invalid_write_concern.rb +1 -1
  79. data/lib/mongo/error/max_bson_size.rb +1 -1
  80. data/lib/mongo/error/max_message_size.rb +1 -1
  81. data/lib/mongo/error/missing_file_chunk.rb +1 -1
  82. data/lib/mongo/error/multi_index_drop.rb +1 -1
  83. data/lib/mongo/error/need_primary_server.rb +1 -1
  84. data/lib/mongo/error/no_server_available.rb +1 -1
  85. data/lib/mongo/error/operation_failure.rb +1 -1
  86. data/lib/mongo/error/parser.rb +1 -1
  87. data/lib/mongo/error/socket_error.rb +1 -1
  88. data/lib/mongo/error/socket_timeout_error.rb +1 -1
  89. data/lib/mongo/error/unchangeable_collection_option.rb +1 -1
  90. data/lib/mongo/error/unexpected_chunk_length.rb +1 -1
  91. data/lib/mongo/error/unexpected_response.rb +1 -1
  92. data/lib/mongo/error/unsupported_collation.rb +1 -1
  93. data/lib/mongo/error/unsupported_features.rb +1 -1
  94. data/lib/mongo/event.rb +1 -1
  95. data/lib/mongo/event/description_changed.rb +1 -1
  96. data/lib/mongo/event/publisher.rb +1 -1
  97. data/lib/mongo/event/subscriber.rb +1 -1
  98. data/lib/mongo/grid.rb +1 -1
  99. data/lib/mongo/grid/file.rb +1 -1
  100. data/lib/mongo/grid/file/chunk.rb +1 -1
  101. data/lib/mongo/grid/file/info.rb +1 -1
  102. data/lib/mongo/grid/fs_bucket.rb +1 -1
  103. data/lib/mongo/grid/stream.rb +1 -1
  104. data/lib/mongo/grid/stream/read.rb +1 -1
  105. data/lib/mongo/grid/stream/write.rb +1 -1
  106. data/lib/mongo/index.rb +1 -1
  107. data/lib/mongo/index/view.rb +1 -1
  108. data/lib/mongo/loggable.rb +1 -1
  109. data/lib/mongo/logger.rb +1 -1
  110. data/lib/mongo/monitoring.rb +1 -1
  111. data/lib/mongo/operation.rb +1 -1
  112. data/lib/mongo/operation/commands.rb +1 -1
  113. data/lib/mongo/operation/commands/aggregate.rb +1 -1
  114. data/lib/mongo/operation/commands/aggregate/result.rb +1 -1
  115. data/lib/mongo/operation/commands/collections_info.rb +1 -1
  116. data/lib/mongo/operation/commands/collections_info/result.rb +1 -1
  117. data/lib/mongo/operation/commands/command.rb +1 -1
  118. data/lib/mongo/operation/commands/create.rb +1 -1
  119. data/lib/mongo/operation/commands/drop.rb +1 -1
  120. data/lib/mongo/operation/commands/drop_database.rb +1 -1
  121. data/lib/mongo/operation/commands/indexes.rb +1 -1
  122. data/lib/mongo/operation/commands/list_collections.rb +1 -1
  123. data/lib/mongo/operation/commands/list_collections/result.rb +1 -1
  124. data/lib/mongo/operation/commands/list_indexes.rb +1 -1
  125. data/lib/mongo/operation/commands/list_indexes/result.rb +1 -1
  126. data/lib/mongo/operation/commands/map_reduce.rb +1 -1
  127. data/lib/mongo/operation/commands/map_reduce/result.rb +1 -1
  128. data/lib/mongo/operation/commands/user_query.rb +1 -1
  129. data/lib/mongo/operation/commands/users_info.rb +1 -1
  130. data/lib/mongo/operation/commands/users_info/result.rb +1 -1
  131. data/lib/mongo/operation/executable.rb +1 -1
  132. data/lib/mongo/operation/kill_cursors.rb +1 -1
  133. data/lib/mongo/operation/limited.rb +1 -1
  134. data/lib/mongo/operation/read.rb +1 -1
  135. data/lib/mongo/operation/read/get_more.rb +1 -1
  136. data/lib/mongo/operation/read/query.rb +1 -1
  137. data/lib/mongo/operation/read/query/result.rb +1 -1
  138. data/lib/mongo/operation/read_preference.rb +1 -1
  139. data/lib/mongo/operation/result.rb +1 -1
  140. data/lib/mongo/operation/specifiable.rb +1 -1
  141. data/lib/mongo/operation/takes_write_concern.rb +1 -1
  142. data/lib/mongo/operation/write.rb +1 -1
  143. data/lib/mongo/operation/write/bulk.rb +1 -1
  144. data/lib/mongo/operation/write/bulk/bulkable.rb +1 -1
  145. data/lib/mongo/operation/write/bulk/delete.rb +1 -1
  146. data/lib/mongo/operation/write/bulk/delete/result.rb +1 -1
  147. data/lib/mongo/operation/write/bulk/insert.rb +1 -1
  148. data/lib/mongo/operation/write/bulk/insert/result.rb +1 -1
  149. data/lib/mongo/operation/write/bulk/legacy_mergable.rb +1 -1
  150. data/lib/mongo/operation/write/bulk/mergable.rb +1 -1
  151. data/lib/mongo/operation/write/bulk/update.rb +1 -1
  152. data/lib/mongo/operation/write/bulk/update/result.rb +1 -1
  153. data/lib/mongo/operation/write/command.rb +1 -1
  154. data/lib/mongo/operation/write/command/create_index.rb +1 -1
  155. data/lib/mongo/operation/write/command/create_user.rb +1 -1
  156. data/lib/mongo/operation/write/command/delete.rb +1 -1
  157. data/lib/mongo/operation/write/command/drop_index.rb +1 -1
  158. data/lib/mongo/operation/write/command/insert.rb +1 -1
  159. data/lib/mongo/operation/write/command/remove_user.rb +1 -1
  160. data/lib/mongo/operation/write/command/update.rb +1 -1
  161. data/lib/mongo/operation/write/command/update_user.rb +1 -1
  162. data/lib/mongo/operation/write/command/writable.rb +1 -1
  163. data/lib/mongo/operation/write/create_index.rb +1 -1
  164. data/lib/mongo/operation/write/create_user.rb +1 -1
  165. data/lib/mongo/operation/write/delete.rb +1 -1
  166. data/lib/mongo/operation/write/delete/result.rb +1 -1
  167. data/lib/mongo/operation/write/drop_index.rb +1 -1
  168. data/lib/mongo/operation/write/gle.rb +1 -1
  169. data/lib/mongo/operation/write/idable.rb +1 -1
  170. data/lib/mongo/operation/write/insert.rb +1 -1
  171. data/lib/mongo/operation/write/insert/result.rb +1 -1
  172. data/lib/mongo/operation/write/remove_user.rb +1 -1
  173. data/lib/mongo/operation/write/update.rb +1 -1
  174. data/lib/mongo/operation/write/update/result.rb +1 -1
  175. data/lib/mongo/operation/write/update_user.rb +1 -1
  176. data/lib/mongo/operation/write/write_command_enabled.rb +1 -1
  177. data/lib/mongo/protocol/bit_vector.rb +1 -1
  178. data/lib/mongo/protocol/delete.rb +1 -1
  179. data/lib/mongo/protocol/get_more.rb +1 -1
  180. data/lib/mongo/protocol/insert.rb +1 -1
  181. data/lib/mongo/protocol/kill_cursors.rb +1 -1
  182. data/lib/mongo/protocol/message.rb +1 -1
  183. data/lib/mongo/protocol/query.rb +2 -2
  184. data/lib/mongo/protocol/reply.rb +1 -1
  185. data/lib/mongo/protocol/serializers.rb +1 -1
  186. data/lib/mongo/protocol/update.rb +1 -1
  187. data/lib/mongo/server.rb +6 -1
  188. data/lib/mongo/server/connectable.rb +1 -13
  189. data/lib/mongo/server/connection.rb +17 -3
  190. data/lib/mongo/server/connection_pool.rb +1 -1
  191. data/lib/mongo/server/connection_pool/queue.rb +1 -1
  192. data/lib/mongo/server/context.rb +1 -1
  193. data/lib/mongo/server/description.rb +2 -2
  194. data/lib/mongo/server/description/features.rb +1 -1
  195. data/lib/mongo/server/description/inspector/description_changed.rb +1 -1
  196. data/lib/mongo/server/monitor.rb +1 -1
  197. data/lib/mongo/server/monitor/connection.rb +15 -9
  198. data/lib/mongo/server_selector.rb +1 -1
  199. data/lib/mongo/server_selector/nearest.rb +1 -1
  200. data/lib/mongo/server_selector/primary.rb +1 -1
  201. data/lib/mongo/server_selector/primary_preferred.rb +1 -1
  202. data/lib/mongo/server_selector/secondary.rb +1 -1
  203. data/lib/mongo/server_selector/secondary_preferred.rb +1 -1
  204. data/lib/mongo/server_selector/selectable.rb +1 -1
  205. data/lib/mongo/socket.rb +1 -1
  206. data/lib/mongo/socket/ssl.rb +4 -4
  207. data/lib/mongo/socket/tcp.rb +4 -4
  208. data/lib/mongo/socket/unix.rb +3 -3
  209. data/lib/mongo/uri.rb +1 -1
  210. data/lib/mongo/version.rb +2 -2
  211. data/lib/mongo/write_concern/acknowledged.rb +1 -1
  212. data/lib/mongo/write_concern/normalizable.rb +1 -1
  213. data/lib/mongo/write_concern/unacknowledged.rb +1 -1
  214. data/mongo.gemspec +0 -1
  215. data/spec/mongo/address_spec.rb +8 -7
  216. data/spec/mongo/client_spec.rb +1 -1
  217. data/spec/mongo/collection/view/aggregation_spec.rb +11 -0
  218. data/spec/mongo/collection_spec.rb +11 -0
  219. data/spec/mongo/server/connection_spec.rb +108 -2
  220. data/spec/mongo/server/description_spec.rb +5 -1
  221. data/spec/mongo/server/monitor/connection_spec.rb +116 -0
  222. data/spec/mongo/socket/ssl_spec.rb +14 -12
  223. data/spec/support/authorization.rb +4 -2
  224. data/spec/support/command_monitoring.rb +1 -1
  225. data/spec/support/connection_string.rb +1 -1
  226. data/spec/support/connection_string_tests/invalid-uris.yml +32 -0
  227. data/spec/support/connection_string_tests/valid-auth.yml +4 -19
  228. data/spec/support/connection_string_tests/valid-db-with-dotted-name.yml +77 -0
  229. data/spec/support/connection_string_tests/valid-options.yml +0 -13
  230. data/spec/support/connection_string_tests/valid-unix_socket-absolute.yml +6 -6
  231. data/spec/support/connection_string_tests/valid-unix_socket-relative.yml +4 -4
  232. data/spec/support/crud.rb +1 -1
  233. data/spec/support/crud/read.rb +3 -3
  234. data/spec/support/crud/write.rb +8 -3
  235. data/spec/support/gridfs.rb +1 -1
  236. metadata +6 -2
  237. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3730fbcd3d5fa8d756b32b8004613c056760607a
4
- data.tar.gz: b0d53fb243bab427ae7b1be710aec139791c4952
3
+ metadata.gz: 2d433224b22b9fef9861385a7aa3bb1152c688e3
4
+ data.tar.gz: c238f0884125f4ec1b3a70b3f051fd0ad61e6d51
5
5
  SHA512:
6
- metadata.gz: 0d0da5cfbaaa055dbccd7f26c8a8ed1887ca81d18fb3ec13c12c86281a6dbc37edb8cdf986fd5d009264e9975b78ba4ba135c7159fd1784c57e6321e42f5ae15
7
- data.tar.gz: ae9f827422793dc99cf945c4464ac0431648e40a27572602c47d2401e9def79512e70238b79802ac0db7123c28d422d85fcb434ea7179eb9eaa92c74e8462724
6
+ metadata.gz: 898d76cdc7e59033be68aabae3f8591397577e8d15286de25f07327803c42581febbf40a874303766fdc204f5d617523e46f46e663e9b5d8567b34f96a87fd96
7
+ data.tar.gz: 71d59dd4c289346aedf2bf9e9ad0161f4a98830ee70cadc9d6c45be47eda5c84bc41bde1d261d2d53230fd82350c2bc2d16409656da84e5faaab23660b4190ed
Binary file
data.tar.gz.sig CHANGED
Binary file
data/LICENSE CHANGED
@@ -175,7 +175,7 @@
175
175
 
176
176
  END OF TERMS AND CONDITIONS
177
177
 
178
- Copyright (C) 2009-2016 MongoDB, Inc.
178
+ Copyright (C) 2009-2017 MongoDB, Inc.
179
179
 
180
180
  Licensed under the Apache License, Version 2.0 (the "License");
181
181
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -63,7 +63,7 @@ Full release notes and release history are available [here](https://github.com/m
63
63
  License
64
64
  -----
65
65
 
66
- Copyright (C) 2009-2016 MongoDB, Inc.
66
+ Copyright (C) 2009-2017 MongoDB, Inc.
67
67
 
68
68
  Licensed under the Apache License, Version 2.0 (the "License");
69
69
  you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the 'License');
4
4
  # you may not use this file except in compliance with the License.
@@ -119,6 +119,7 @@ module Mongo
119
119
  def initialize(seed, options = {})
120
120
  @seed = seed
121
121
  @host, @port = parse_host_port
122
+ @options = options
122
123
  end
123
124
 
124
125
  # Get a pretty printed address inspection.
@@ -138,15 +139,15 @@ module Mongo
138
139
  # @example Get a socket.
139
140
  # address.socket(5, :ssl => true)
140
141
  #
141
- # @param [ Float ] timeout The socket timeout.
142
+ # @param [ Float ] socket_timeout The socket timeout.
142
143
  # @param [ Hash ] ssl_options SSL options.
143
144
  #
144
145
  # @return [ Pool::Socket::SSL, Pool::Socket::TCP, Pool::Socket::Unix ] The socket.
145
146
  #
146
147
  # @since 2.0.0
147
- def socket(timeout, ssl_options = {})
148
- @resolver ||= initialize_resolver!(timeout, ssl_options)
149
- @resolver.socket(timeout, ssl_options)
148
+ def socket(socket_timeout, ssl_options = {})
149
+ @resolver ||= initialize_resolver!(ssl_options)
150
+ @resolver.socket(socket_timeout, ssl_options)
150
151
  end
151
152
 
152
153
  # Get the address as a string.
@@ -161,9 +162,23 @@ module Mongo
161
162
  port ? "#{host}:#{port}" : host
162
163
  end
163
164
 
165
+ # Connect a socket.
166
+ #
167
+ # @example Connect a socket.
168
+ # address.connect_socket!(socket)
169
+ #
170
+ # @since 2.4.3
171
+ def connect_socket!(socket)
172
+ socket.connect!(connect_timeout)
173
+ end
174
+
164
175
  private
165
176
 
166
- def initialize_resolver!(timeout, ssl_options)
177
+ def connect_timeout
178
+ @connect_timeout ||= @options[:connect_timeout] || Server::CONNECT_TIMEOUT
179
+ end
180
+
181
+ def initialize_resolver!(ssl_options)
167
182
  return Unix.new(seed.downcase) if seed.downcase =~ Unix::MATCH
168
183
 
169
184
  family = (host == LOCALHOST) ? ::Socket::AF_INET : ::Socket::AF_UNSPEC
@@ -171,9 +186,9 @@ module Mongo
171
186
  ::Socket.getaddrinfo(host, nil, family, ::Socket::SOCK_STREAM).each do |info|
172
187
  begin
173
188
  res = FAMILY_MAP[info[4]].new(info[3], port, host)
174
- res.socket(timeout, ssl_options).connect!.close
189
+ res.socket(connect_timeout, ssl_options).connect!(connect_timeout).close
175
190
  return res
176
- rescue IOError, SystemCallError, Error::SocketError => e
191
+ rescue IOError, SystemCallError, Error::SocketTimeoutError, Error::SocketError => e
177
192
  error = e
178
193
  end
179
194
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the 'License');
4
4
  # you may not use this file except in compliance with the License.
@@ -77,17 +77,17 @@ module Mongo
77
77
  # @example Get an IPv4 socket.
78
78
  # ipv4.socket(5, :ssl => true)
79
79
  #
80
- # @param [ Float ] timeout The socket timeout.
80
+ # @param [ Float ] socket_timeout The socket timeout.
81
81
  # @param [ Hash ] ssl_options SSL options.
82
82
  #
83
83
  # @return [ Pool::Socket::SSL, Pool::Socket::TCP ] The socket.
84
84
  #
85
85
  # @since 2.0.0
86
- def socket(timeout, ssl_options = {})
86
+ def socket(socket_timeout, ssl_options = {})
87
87
  unless ssl_options.empty?
88
- Socket::SSL.new(host, port, host_name, timeout, Socket::PF_INET, ssl_options)
88
+ Socket::SSL.new(host, port, host_name, socket_timeout, Socket::PF_INET, ssl_options)
89
89
  else
90
- Socket::TCP.new(host, port, timeout, Socket::PF_INET)
90
+ Socket::TCP.new(host, port, socket_timeout, Socket::PF_INET)
91
91
  end
92
92
  end
93
93
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the 'License');
4
4
  # you may not use this file except in compliance with the License.
@@ -72,17 +72,17 @@ module Mongo
72
72
  # @example Get an IPv6 socket.
73
73
  # ipv4.socket(5, :ssl => true)
74
74
  #
75
- # @param [ Float ] timeout The socket timeout.
75
+ # @param [ Float ] socket_timeout The socket timeout.
76
76
  # @param [ Hash ] ssl_options SSL options.
77
77
  #
78
78
  # @return [ Pool::Socket::SSL, Pool::Socket::TCP ] The socket.
79
79
  #
80
80
  # @since 2.0.0
81
- def socket(timeout, ssl_options = {})
81
+ def socket(socket_timeout, ssl_options = {})
82
82
  unless ssl_options.empty?
83
- Socket::SSL.new(host, port, host_name, timeout, Socket::PF_INET6, ssl_options)
83
+ Socket::SSL.new(host, port, host_name, socket_timeout, Socket::PF_INET6, ssl_options)
84
84
  else
85
- Socket::TCP.new(host, port, timeout, Socket::PF_INET6)
85
+ Socket::TCP.new(host, port, socket_timeout, Socket::PF_INET6)
86
86
  end
87
87
  end
88
88
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the 'License');
4
4
  # you may not use this file except in compliance with the License.
@@ -68,8 +68,8 @@ module Mongo
68
68
  # @return [ Pool::Socket::Unix ] The socket.
69
69
  #
70
70
  # @since 2.0.0
71
- def socket(timeout, ssl_options = {})
72
- Socket::Unix.new(host, timeout)
71
+ def socket(socket_timeout, ssl_options = {})
72
+ Socket::Unix.new(host, socket_timeout)
73
73
  end
74
74
  end
75
75
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB Inc.
1
+ # Copyright (C) 2014-2017 MongoDB Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB Inc.
1
+ # Copyright (C) 2014-2017 MongoDB Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB Inc.
1
+ # Copyright (C) 2014-2017 MongoDB Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB Inc.
1
+ # Copyright (C) 2014-2017 MongoDB Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the 'License');
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -96,7 +96,7 @@ module Mongo
96
96
  #
97
97
  # @since 2.0.0
98
98
  def add(host)
99
- address = Address.new(host)
99
+ address = Address.new(host, options)
100
100
  if !addresses.include?(address)
101
101
  if addition_allowed?(address)
102
102
  @update_lock.synchronize { @addresses.push(address) }
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -31,7 +31,8 @@ module Mongo
31
31
  :max_time_ms => 'maxTimeMS',
32
32
  :explain => 'explain',
33
33
  :bypass_document_validation => 'bypassDocumentValidation',
34
- :collation => 'collation'
34
+ :collation => 'collation',
35
+ :hint => 'hint'
35
36
  ).freeze
36
37
 
37
38
  def_delegators :@view, :collection, :database, :read, :write_concern
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 MongoDB, Inc.
1
+ # Copyright (C) 2015-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 MongoDB, Inc.
1
+ # Copyright (C) 2014-2017 MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.