mongo 1.9.0 → 1.9.1.rc0
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 +2 -2
- data/README.md +51 -18
- data/VERSION +1 -1
- data/lib/mongo/mongo_client.rb +2 -2
- data/lib/mongo/util/node.rb +2 -1
- data/lib/mongo/util/ssl_socket.rb +1 -1
- data/lib/mongo/util/tcp_socket.rb +1 -1
- metadata +7 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b10bd01b6c92afe768ec0a16f9d82534f9d9a25
|
4
|
+
data.tar.gz: abb35b1a01468f8bff5297698c2816d109f7da39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bed51feb4516d44aec3aac70e7df47a664b1d8ea12386b4756870437156c5d0220609b2ea8d810281a1452559835493175eea7ad854b905e6e3d5a4abb5a422
|
7
|
+
data.tar.gz: a4ebf1d5d4c9d3ffcaa199db0a977c5b12813962ca320c10dd7dcbc5cd5f814e68dd6a83ff70f6d77dd75c97b4fae45a2a10a8919306edcbedfe657956ee8e96
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
;�_�z�.�z�&_�{'V��:z�]�n%!_�H� �iw<��\q��=r�,�q����Ԡ�Sk{��
|
2
|
+
��!�fs�$�Q��b8�[�Ӌ���J�{�%6ΟLU뗾훧ݎ�Z�[��SZ�~������,S�J&ڝ�}�eI��+��,|O���1��!�:���b�L�>kFdz�`.���fM��C��b�n��t�n^��k?��Ll�X��o7E{v�Znj�gp#�X��9�@�
|
data/README.md
CHANGED
@@ -18,7 +18,9 @@ has a link to API Documentation for the current release.
|
|
18
18
|
|
19
19
|
If you have the source, you can generate the matching documentation by typing
|
20
20
|
|
21
|
-
|
21
|
+
```sh
|
22
|
+
$ rake docs
|
23
|
+
```
|
22
24
|
|
23
25
|
Once generated, the API documentation can be found in the docs/ folder.
|
24
26
|
|
@@ -73,16 +75,22 @@ Note that if you're on 1.8.7, be sure that you're using a patchlevel >= 249. The
|
|
73
75
|
|
74
76
|
### Gems
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
+
```sh
|
79
|
+
$ gem update --system
|
80
|
+
$ gem install mongo
|
81
|
+
```
|
78
82
|
|
79
83
|
For a significant performance boost, you'll want to install the C extension:
|
80
84
|
|
81
|
-
|
85
|
+
```sh
|
86
|
+
$ gem install bson_ext
|
87
|
+
```
|
82
88
|
|
83
89
|
Note that bson_ext isn't used with JRuby. Instead, we use some native Java extensions are bundled with the bson gem. If you ever need to modify these extensions, you can recompile with the following rake task:
|
84
90
|
|
85
|
-
|
91
|
+
```sh
|
92
|
+
$ rake compile:jbson
|
93
|
+
```
|
86
94
|
|
87
95
|
### From the GitHub source
|
88
96
|
|
@@ -91,7 +99,9 @@ You can either clone the git repository or download a tarball or zip file.
|
|
91
99
|
Once you have the source, you can use it from wherever you downloaded it or
|
92
100
|
you can install it as a gem from the source by typing:
|
93
101
|
|
94
|
-
|
102
|
+
```sh
|
103
|
+
$ rake install
|
104
|
+
```
|
95
105
|
|
96
106
|
# Examples
|
97
107
|
|
@@ -140,7 +150,7 @@ timeout for waiting for old connections to be released to the pool.
|
|
140
150
|
To set up a pooled connection to a single MongoDB instance:
|
141
151
|
|
142
152
|
```ruby
|
143
|
-
|
153
|
+
@client = MongoClient.new("localhost", 27017, :pool_size => 5, :pool_timeout => 5)
|
144
154
|
```
|
145
155
|
|
146
156
|
Though the pooling architecture will undoubtedly evolve, it currently owes much credit
|
@@ -208,6 +218,7 @@ database. The idea here is that whenever a record is inserted, the
|
|
208
218
|
returned will be inserted.
|
209
219
|
|
210
220
|
Here is a sample primary key factory, taken from the tests:
|
221
|
+
|
211
222
|
```ruby
|
212
223
|
class TestPKFactory
|
213
224
|
def create_pk(doc)
|
@@ -216,10 +227,12 @@ class TestPKFactory
|
|
216
227
|
end
|
217
228
|
end
|
218
229
|
```
|
230
|
+
|
219
231
|
Here's a slightly more sophisticated one that handles both symbol and string
|
220
232
|
keys. This is the PKFactory that comes with the MongoRecord code (an
|
221
233
|
ActiveRecord-like framework for non-Rails apps) and the AR Mongo adapter code
|
222
234
|
(for Rails):
|
235
|
+
|
223
236
|
```ruby
|
224
237
|
class PKFactory
|
225
238
|
def create_pk(doc)
|
@@ -286,44 +299,64 @@ request.
|
|
286
299
|
|
287
300
|
Before running the tests, make sure you install all test dependencies by running:
|
288
301
|
|
289
|
-
|
302
|
+
```sh
|
303
|
+
$ gem install bundler; bundle install
|
304
|
+
```
|
290
305
|
|
291
306
|
To run all default test suites (without the BSON extensions) just type:
|
292
307
|
|
293
|
-
|
308
|
+
```sh
|
309
|
+
$ rake test
|
310
|
+
```
|
294
311
|
|
295
312
|
If you want to run the default test suite using the BSON extensions:
|
296
313
|
|
297
|
-
|
314
|
+
```sh
|
315
|
+
$ rake test:ext
|
316
|
+
```
|
298
317
|
|
299
318
|
These will run both unit and functional tests. To run these tests alone:
|
300
319
|
|
301
|
-
|
302
|
-
|
320
|
+
```sh
|
321
|
+
$ rake test:unit
|
322
|
+
$ rake test:functional
|
323
|
+
```
|
303
324
|
|
304
325
|
To run any individual rake tasks with the BSON extension disabled, just pass BSON_EXT_DISABLED=true to the task:
|
305
326
|
|
306
|
-
|
327
|
+
```sh
|
328
|
+
$ rake test:unit BSON_EXT_DISABLED=true
|
329
|
+
```
|
307
330
|
|
308
331
|
If you want to test replica set, you can run the following task:
|
309
332
|
|
310
|
-
|
333
|
+
```sh
|
334
|
+
$ rake test:replica_set
|
335
|
+
```
|
311
336
|
|
312
337
|
To run a single test at the top level, add -Itest since we no longer modify LOAD_PATH:
|
313
338
|
|
314
|
-
|
339
|
+
```sh
|
340
|
+
$ ruby -Itest -Ilib test/bson/bson_test.rb
|
341
|
+
```
|
315
342
|
|
316
343
|
To run a single test from the test directory, add -I. since we no longer modify LOAD_PATH:
|
317
344
|
|
318
|
-
|
345
|
+
```sh
|
346
|
+
$ ruby -I. -I../lib bson/bson_test.rb
|
347
|
+
```
|
319
348
|
|
320
349
|
To run a single test from its subdirectory, add -I.. since we no longer modify LOAD_PATH:
|
321
350
|
|
322
|
-
|
351
|
+
```sh
|
352
|
+
$ ruby -I.. -I../../lib bson_test.rb
|
353
|
+
```
|
323
354
|
|
324
355
|
To fix the following error on Mac OS X - "/.../lib/bson_ext/cbson.bundle: [BUG] Segmentation fault":
|
325
356
|
|
326
|
-
|
357
|
+
```sh
|
358
|
+
$ rake compile
|
359
|
+
```
|
327
360
|
|
328
361
|
# Release Notes
|
329
362
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.
|
1
|
+
1.9.1.rc0
|
data/lib/mongo/mongo_client.rb
CHANGED
@@ -101,7 +101,7 @@ module Mongo
|
|
101
101
|
# logging negatively impacts performance; therefore, it should not be used for high-performance apps.
|
102
102
|
# @option opts [Integer] :pool_size (1) The maximum number of socket self.connections allowed per
|
103
103
|
# connection pool. Note: this setting is relevant only for multi-threaded applications.
|
104
|
-
# @option opts [Float] :
|
104
|
+
# @option opts [Float] :pool_timeout (5.0) When all of the self.connections a pool are checked out,
|
105
105
|
# this is the number of seconds to wait for a new connection to be released before throwing an exception.
|
106
106
|
# Note: this setting is relevant only for multi-threaded applications.
|
107
107
|
# @option opts [Float] :op_timeout (nil) The number of seconds to wait for a read operation to time out.
|
@@ -116,7 +116,7 @@ module Mongo
|
|
116
116
|
# MongoClient.new("localhost")
|
117
117
|
#
|
118
118
|
# @example localhost, 3000, max 5 self.connections, with max 5 seconds of wait time.
|
119
|
-
# MongoClient.new("localhost", 3000, :pool_size => 5, :
|
119
|
+
# MongoClient.new("localhost", 3000, :pool_size => 5, :pool_timeout => 5)
|
120
120
|
#
|
121
121
|
# @example localhost, 3000, where this node may be a slave
|
122
122
|
# MongoClient.new("localhost", 3000, :slave_ok => true)
|
data/lib/mongo/util/node.rb
CHANGED
@@ -65,7 +65,8 @@ module Mongo
|
|
65
65
|
@client.op_timeout,
|
66
66
|
@client.connect_timeout,
|
67
67
|
@client.socket_opts)
|
68
|
-
rescue OperationTimeout, ConnectionFailure, OperationFailure,
|
68
|
+
rescue ConnectionTimeoutError, OperationTimeout, ConnectionFailure, OperationFailure,
|
69
|
+
SocketError, SystemCallError, IOError => ex
|
69
70
|
@client.log(:debug, "Failed connection to #{host_string} with #{ex.class}, #{ex.message}.")
|
70
71
|
close
|
71
72
|
end
|
@@ -51,7 +51,7 @@ module Mongo
|
|
51
51
|
@socket = OpenSSL::SSL::SSLSocket.new(@tcp_socket, @context)
|
52
52
|
@socket.sync_close = true
|
53
53
|
connect
|
54
|
-
rescue SSLError
|
54
|
+
rescue OpenSSL::SSL::SSLError
|
55
55
|
raise ConnectionFailure, "SSL handshake failed. MongoDB may " +
|
56
56
|
"not be configured with SSL support."
|
57
57
|
end
|
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.9.
|
4
|
+
version: 1.9.1.rc0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Brock
|
@@ -33,7 +33,7 @@ cert_chain:
|
|
33
33
|
8v7zLF2XliYbfurYIwkcXs8yPn8ggApBIy9bX6VJxRs/l2+UvqzaHIFaFy/F8/GP
|
34
34
|
RNTuXsVG5NDACo7Q
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date: 2013-
|
36
|
+
date: 2013-07-02 00:00:00.000000000 Z
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: bson
|
@@ -41,14 +41,14 @@ dependencies:
|
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 1.9.
|
44
|
+
version: 1.9.1.rc0
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
49
|
- - ~>
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: 1.9.
|
51
|
+
version: 1.9.1.rc0
|
52
52
|
description: A Ruby driver for MongoDB. For more information about Mongo, see http://www.mongodb.org.
|
53
53
|
email: mongodb-dev@googlegroups.com
|
54
54
|
executables:
|
@@ -166,12 +166,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
166
166
|
version: '0'
|
167
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
168
|
requirements:
|
169
|
-
- - '
|
169
|
+
- - '>'
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version:
|
171
|
+
version: 1.3.1
|
172
172
|
requirements: []
|
173
173
|
rubyforge_project: mongo
|
174
|
-
rubygems_version: 2.0.
|
174
|
+
rubygems_version: 2.0.3
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: Ruby driver for MongoDB
|
metadata.gz.sig
CHANGED
Binary file
|