mongo 1.3.0.rc0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +25 -20
- data/docs/HISTORY.md +9 -9
- data/lib/mongo.rb +1 -1
- data/lib/mongo/test.rb +20 -0
- data/test/async/collection_test.rb +224 -0
- data/test/async/connection_test.rb +24 -0
- data/test/async/cursor_test.rb +162 -0
- data/test/async/worker_pool_test.rb +99 -0
- data/test/bson/byte_buffer_test.rb +7 -0
- data/test/load/resque/load.rb +21 -0
- data/test/load/resque/processor.rb +26 -0
- data/test/load/unicorn/unicorn.rb +29 -0
- data/test/tools/load.rb +58 -0
- data/test/tools/sharding_manager.rb +202 -0
- data/test/tools/test.rb +4 -0
- metadata +142 -113
- data/docs/1.0_UPGRADE.md +0 -21
- data/lib/mongo/util/timeout.rb +0 -42
- data/test/bson/bson_string_test.rb +0 -30
- data/test/pool_test.rb +0 -21
- data/test/timeout_test.rb +0 -14
data/test/tools/test.rb
ADDED
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 1.3.0
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Jim Menard
|
@@ -12,7 +17,7 @@ autorequire:
|
|
12
17
|
bindir: bin
|
13
18
|
cert_chain: []
|
14
19
|
|
15
|
-
date: 2011-
|
20
|
+
date: 2011-04-04 00:00:00 -04:00
|
16
21
|
default_executable:
|
17
22
|
dependencies:
|
18
23
|
- !ruby/object:Gem::Dependency
|
@@ -23,7 +28,12 @@ dependencies:
|
|
23
28
|
requirements:
|
24
29
|
- - ">="
|
25
30
|
- !ruby/object:Gem::Version
|
26
|
-
|
31
|
+
hash: 27
|
32
|
+
segments:
|
33
|
+
- 1
|
34
|
+
- 3
|
35
|
+
- 0
|
36
|
+
version: 1.3.0
|
27
37
|
type: :runtime
|
28
38
|
version_requirements: *id001
|
29
39
|
description: A Ruby driver for MongoDB. For more information about Mongo, see http://www.mongodb.org.
|
@@ -40,93 +50,99 @@ files:
|
|
40
50
|
- mongo.gemspec
|
41
51
|
- LICENSE.txt
|
42
52
|
- lib/mongo.rb
|
43
|
-
- lib/mongo/collection.rb
|
44
|
-
- lib/mongo/connection.rb
|
45
53
|
- lib/mongo/cursor.rb
|
46
|
-
- lib/mongo/
|
54
|
+
- lib/mongo/collection.rb
|
47
55
|
- lib/mongo/exceptions.rb
|
56
|
+
- lib/mongo/connection.rb
|
57
|
+
- lib/mongo/repl_set_connection.rb
|
58
|
+
- lib/mongo/test.rb
|
59
|
+
- lib/mongo/gridfs/grid_io.rb
|
60
|
+
- lib/mongo/gridfs/grid_file_system.rb
|
48
61
|
- lib/mongo/gridfs/grid.rb
|
49
62
|
- lib/mongo/gridfs/grid_ext.rb
|
50
|
-
- lib/mongo/gridfs/grid_file_system.rb
|
51
|
-
- lib/mongo/gridfs/grid_io.rb
|
52
63
|
- lib/mongo/gridfs/grid_io_fix.rb
|
53
|
-
- lib/mongo/repl_set_connection.rb
|
54
64
|
- lib/mongo/util/conversions.rb
|
55
|
-
- lib/mongo/util/
|
65
|
+
- lib/mongo/util/support.rb
|
56
66
|
- lib/mongo/util/pool.rb
|
67
|
+
- lib/mongo/util/core_ext.rb
|
57
68
|
- lib/mongo/util/server_version.rb
|
58
|
-
- lib/mongo/util/support.rb
|
59
|
-
- lib/mongo/util/timeout.rb
|
60
69
|
- lib/mongo/util/uri_parser.rb
|
61
|
-
-
|
70
|
+
- lib/mongo/db.rb
|
71
|
+
- docs/HISTORY.md
|
72
|
+
- docs/TUTORIAL.md
|
62
73
|
- docs/CREDITS.md
|
63
74
|
- docs/FAQ.md
|
64
|
-
- docs/GridFS.md
|
65
|
-
- docs/HISTORY.md
|
66
|
-
- docs/RELEASES.md
|
67
75
|
- docs/REPLICA_SETS.md
|
68
|
-
- docs/
|
76
|
+
- docs/RELEASES.md
|
77
|
+
- docs/GridFS.md
|
69
78
|
- docs/WRITE_CONCERN.md
|
70
79
|
- bin/mongo_console
|
71
|
-
- test/
|
80
|
+
- test/grid_file_system_test.rb
|
81
|
+
- test/unit/db_test.rb
|
82
|
+
- test/unit/repl_set_connection_test.rb
|
83
|
+
- test/unit/collection_test.rb
|
84
|
+
- test/unit/cursor_test.rb
|
85
|
+
- test/unit/grid_test.rb
|
86
|
+
- test/unit/connection_test.rb
|
87
|
+
- test/unit/pool_test.rb
|
88
|
+
- test/unit/safe_test.rb
|
89
|
+
- test/db_test.rb
|
90
|
+
- test/collection_test.rb
|
91
|
+
- test/async/collection_test.rb
|
92
|
+
- test/async/cursor_test.rb
|
93
|
+
- test/async/connection_test.rb
|
94
|
+
- test/async/worker_pool_test.rb
|
95
|
+
- test/cursor_test.rb
|
96
|
+
- test/load/unicorn/unicorn.rb
|
97
|
+
- test/load/unicorn/load.rb
|
98
|
+
- test/load/resque/processor.rb
|
99
|
+
- test/load/resque/load.rb
|
100
|
+
- test/load/thin/load.rb
|
101
|
+
- test/grid_test.rb
|
102
|
+
- test/db_api_test.rb
|
103
|
+
- test/auxillary/slave_connection_test.rb
|
104
|
+
- test/auxillary/threaded_authentication_test.rb
|
72
105
|
- test/auxillary/authentication_test.rb
|
73
|
-
- test/auxillary/autoreconnect_test.rb
|
74
106
|
- test/auxillary/fork_test.rb
|
107
|
+
- test/auxillary/autoreconnect_test.rb
|
75
108
|
- test/auxillary/repl_set_auth_test.rb
|
76
|
-
- test/auxillary/
|
77
|
-
- test/
|
78
|
-
- test/
|
79
|
-
- test/
|
80
|
-
- test/
|
109
|
+
- test/auxillary/1.4_features.rb
|
110
|
+
- test/conversions_test.rb
|
111
|
+
- test/connection_test.rb
|
112
|
+
- test/uri_test.rb
|
113
|
+
- test/cursor_message_test.rb
|
114
|
+
- test/tools/test.rb
|
115
|
+
- test/tools/repl_set_manager.rb
|
116
|
+
- test/tools/auth_repl_set_manager.rb
|
117
|
+
- test/tools/load.rb
|
118
|
+
- test/tools/sharding_manager.rb
|
119
|
+
- test/cursor_fail_test.rb
|
120
|
+
- test/threading/threading_with_large_pool_test.rb
|
121
|
+
- test/test_helper.rb
|
122
|
+
- test/grid_io_test.rb
|
81
123
|
- test/bson/byte_buffer_test.rb
|
82
|
-
- test/bson/
|
83
|
-
- test/bson/json_test.rb
|
124
|
+
- test/bson/binary_test.rb
|
84
125
|
- test/bson/object_id_test.rb
|
85
|
-
- test/bson/
|
126
|
+
- test/bson/json_test.rb
|
86
127
|
- test/bson/timestamp_test.rb
|
87
|
-
- test/
|
88
|
-
- test/
|
89
|
-
- test/
|
90
|
-
- test/
|
91
|
-
- test/
|
92
|
-
- test/cursor_test.rb
|
93
|
-
- test/db_api_test.rb
|
128
|
+
- test/bson/bson_test.rb
|
129
|
+
- test/bson/ordered_hash_test.rb
|
130
|
+
- test/bson/hash_with_indifferent_access_test.rb
|
131
|
+
- test/support/keys.rb
|
132
|
+
- test/support/hash_with_indifferent_access.rb
|
94
133
|
- test/db_connection_test.rb
|
95
|
-
- test/
|
96
|
-
- test/grid_file_system_test.rb
|
97
|
-
- test/grid_io_test.rb
|
98
|
-
- test/grid_test.rb
|
99
|
-
- test/load/thin/load.rb
|
100
|
-
- test/load/unicorn/load.rb
|
101
|
-
- test/pool_test.rb
|
102
|
-
- test/replica_sets/connect_test.rb
|
103
|
-
- test/replica_sets/connection_string_test.rb
|
104
|
-
- test/replica_sets/count_test.rb
|
105
|
-
- test/replica_sets/insert_test.rb
|
134
|
+
- test/replica_sets/rs_test_helper.rb
|
106
135
|
- test/replica_sets/pooled_insert_test.rb
|
136
|
+
- test/replica_sets/count_test.rb
|
137
|
+
- test/replica_sets/replication_ack_test.rb
|
107
138
|
- test/replica_sets/query_secondaries.rb
|
108
139
|
- test/replica_sets/query_test.rb
|
109
|
-
- test/replica_sets/
|
110
|
-
- test/replica_sets/
|
140
|
+
- test/replica_sets/connection_string_test.rb
|
141
|
+
- test/replica_sets/insert_test.rb
|
142
|
+
- test/replica_sets/connect_test.rb
|
111
143
|
- test/safe_test.rb
|
112
|
-
- test/support/hash_with_indifferent_access.rb
|
113
|
-
- test/support/keys.rb
|
114
144
|
- test/support_test.rb
|
115
|
-
- test/test_helper.rb
|
116
|
-
- test/threading/threading_with_large_pool_test.rb
|
117
145
|
- test/threading_test.rb
|
118
|
-
- test/timeout_test.rb
|
119
|
-
- test/tools/auth_repl_set_manager.rb
|
120
|
-
- test/tools/repl_set_manager.rb
|
121
|
-
- test/unit/collection_test.rb
|
122
|
-
- test/unit/connection_test.rb
|
123
|
-
- test/unit/cursor_test.rb
|
124
|
-
- test/unit/db_test.rb
|
125
|
-
- test/unit/grid_test.rb
|
126
|
-
- test/unit/pool_test.rb
|
127
|
-
- test/unit/repl_set_connection_test.rb
|
128
|
-
- test/unit/safe_test.rb
|
129
|
-
- test/uri_test.rb
|
130
146
|
has_rdoc: true
|
131
147
|
homepage: http://www.mongodb.org
|
132
148
|
licenses: []
|
@@ -143,77 +159,90 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
159
|
requirements:
|
144
160
|
- - ">="
|
145
161
|
- !ruby/object:Gem::Version
|
162
|
+
hash: 3
|
163
|
+
segments:
|
164
|
+
- 0
|
146
165
|
version: "0"
|
147
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
167
|
none: false
|
149
168
|
requirements:
|
150
|
-
- - "
|
169
|
+
- - ">="
|
151
170
|
- !ruby/object:Gem::Version
|
152
|
-
|
171
|
+
hash: 3
|
172
|
+
segments:
|
173
|
+
- 0
|
174
|
+
version: "0"
|
153
175
|
requirements: []
|
154
176
|
|
155
177
|
rubyforge_project:
|
156
|
-
rubygems_version: 1.
|
178
|
+
rubygems_version: 1.4.1
|
157
179
|
signing_key:
|
158
180
|
specification_version: 3
|
159
181
|
summary: Ruby driver for the MongoDB
|
160
182
|
test_files:
|
161
|
-
- test/
|
183
|
+
- test/grid_file_system_test.rb
|
184
|
+
- test/unit/db_test.rb
|
185
|
+
- test/unit/repl_set_connection_test.rb
|
186
|
+
- test/unit/collection_test.rb
|
187
|
+
- test/unit/cursor_test.rb
|
188
|
+
- test/unit/grid_test.rb
|
189
|
+
- test/unit/connection_test.rb
|
190
|
+
- test/unit/pool_test.rb
|
191
|
+
- test/unit/safe_test.rb
|
192
|
+
- test/db_test.rb
|
193
|
+
- test/collection_test.rb
|
194
|
+
- test/async/collection_test.rb
|
195
|
+
- test/async/cursor_test.rb
|
196
|
+
- test/async/connection_test.rb
|
197
|
+
- test/async/worker_pool_test.rb
|
198
|
+
- test/cursor_test.rb
|
199
|
+
- test/load/unicorn/unicorn.rb
|
200
|
+
- test/load/unicorn/load.rb
|
201
|
+
- test/load/resque/processor.rb
|
202
|
+
- test/load/resque/load.rb
|
203
|
+
- test/load/thin/load.rb
|
204
|
+
- test/grid_test.rb
|
205
|
+
- test/db_api_test.rb
|
206
|
+
- test/auxillary/slave_connection_test.rb
|
207
|
+
- test/auxillary/threaded_authentication_test.rb
|
162
208
|
- test/auxillary/authentication_test.rb
|
163
|
-
- test/auxillary/autoreconnect_test.rb
|
164
209
|
- test/auxillary/fork_test.rb
|
210
|
+
- test/auxillary/autoreconnect_test.rb
|
165
211
|
- test/auxillary/repl_set_auth_test.rb
|
166
|
-
- test/auxillary/
|
167
|
-
- test/
|
168
|
-
- test/
|
169
|
-
- test/
|
170
|
-
- test/
|
212
|
+
- test/auxillary/1.4_features.rb
|
213
|
+
- test/conversions_test.rb
|
214
|
+
- test/connection_test.rb
|
215
|
+
- test/uri_test.rb
|
216
|
+
- test/cursor_message_test.rb
|
217
|
+
- test/tools/test.rb
|
218
|
+
- test/tools/repl_set_manager.rb
|
219
|
+
- test/tools/auth_repl_set_manager.rb
|
220
|
+
- test/tools/load.rb
|
221
|
+
- test/tools/sharding_manager.rb
|
222
|
+
- test/cursor_fail_test.rb
|
223
|
+
- test/threading/threading_with_large_pool_test.rb
|
224
|
+
- test/test_helper.rb
|
225
|
+
- test/grid_io_test.rb
|
171
226
|
- test/bson/byte_buffer_test.rb
|
172
|
-
- test/bson/
|
173
|
-
- test/bson/json_test.rb
|
227
|
+
- test/bson/binary_test.rb
|
174
228
|
- test/bson/object_id_test.rb
|
175
|
-
- test/bson/
|
229
|
+
- test/bson/json_test.rb
|
176
230
|
- test/bson/timestamp_test.rb
|
177
|
-
- test/
|
178
|
-
- test/
|
179
|
-
- test/
|
180
|
-
- test/
|
181
|
-
- test/
|
182
|
-
- test/cursor_test.rb
|
183
|
-
- test/db_api_test.rb
|
231
|
+
- test/bson/bson_test.rb
|
232
|
+
- test/bson/ordered_hash_test.rb
|
233
|
+
- test/bson/hash_with_indifferent_access_test.rb
|
234
|
+
- test/support/keys.rb
|
235
|
+
- test/support/hash_with_indifferent_access.rb
|
184
236
|
- test/db_connection_test.rb
|
185
|
-
- test/
|
186
|
-
- test/grid_file_system_test.rb
|
187
|
-
- test/grid_io_test.rb
|
188
|
-
- test/grid_test.rb
|
189
|
-
- test/load/thin/load.rb
|
190
|
-
- test/load/unicorn/load.rb
|
191
|
-
- test/pool_test.rb
|
192
|
-
- test/replica_sets/connect_test.rb
|
193
|
-
- test/replica_sets/connection_string_test.rb
|
194
|
-
- test/replica_sets/count_test.rb
|
195
|
-
- test/replica_sets/insert_test.rb
|
237
|
+
- test/replica_sets/rs_test_helper.rb
|
196
238
|
- test/replica_sets/pooled_insert_test.rb
|
239
|
+
- test/replica_sets/count_test.rb
|
240
|
+
- test/replica_sets/replication_ack_test.rb
|
197
241
|
- test/replica_sets/query_secondaries.rb
|
198
242
|
- test/replica_sets/query_test.rb
|
199
|
-
- test/replica_sets/
|
200
|
-
- test/replica_sets/
|
243
|
+
- test/replica_sets/connection_string_test.rb
|
244
|
+
- test/replica_sets/insert_test.rb
|
245
|
+
- test/replica_sets/connect_test.rb
|
201
246
|
- test/safe_test.rb
|
202
|
-
- test/support/hash_with_indifferent_access.rb
|
203
|
-
- test/support/keys.rb
|
204
247
|
- test/support_test.rb
|
205
|
-
- test/test_helper.rb
|
206
|
-
- test/threading/threading_with_large_pool_test.rb
|
207
248
|
- test/threading_test.rb
|
208
|
-
- test/timeout_test.rb
|
209
|
-
- test/tools/auth_repl_set_manager.rb
|
210
|
-
- test/tools/repl_set_manager.rb
|
211
|
-
- test/unit/collection_test.rb
|
212
|
-
- test/unit/connection_test.rb
|
213
|
-
- test/unit/cursor_test.rb
|
214
|
-
- test/unit/db_test.rb
|
215
|
-
- test/unit/grid_test.rb
|
216
|
-
- test/unit/pool_test.rb
|
217
|
-
- test/unit/repl_set_connection_test.rb
|
218
|
-
- test/unit/safe_test.rb
|
219
|
-
- test/uri_test.rb
|
data/docs/1.0_UPGRADE.md
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
You can upgrade freely from v0.20 to v1.0.
|
2
|
-
|
3
|
-
However, if you're running a version < 0.20, upgrade to 0.20
|
4
|
-
before upgrading to 1.0.
|
5
|
-
|
6
|
-
The upgrade to 0.20 requires some minor code upgrades.
|
7
|
-
|
8
|
-
1. Note the exception changes in HISTORY. Certain exceptions are now scoped under the BSON
|
9
|
-
module; if you're catching these, you will need to modify your code.
|
10
|
-
|
11
|
-
2. The BSON types are now scoped under the BSON module.
|
12
|
-
|
13
|
-
3. Note that mongo_ext no longer exists. The new gems are bson and bson_ext.
|
14
|
-
|
15
|
-
4. Indexes on GridFS chunks collections should be unique. If you have existing GridFS
|
16
|
-
collections, you should drop the current index and replace with a unique one. Before you do this,
|
17
|
-
make sure that index doesn't exist; no need to go through process unnecessarily.
|
18
|
-
If you do need to create the index, once you have the chunks collection, here are the commands you can run:
|
19
|
-
|
20
|
-
@chunks.drop_index('files_id_1_n_1')
|
21
|
-
@chunks.create_index([['files_id', Mongo::ASCENDING], ['n', Mongo::ASCENDING]], :unique => true)
|
data/lib/mongo/util/timeout.rb
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
# --
|
4
|
-
# Copyright (C) 2008-2011 10gen Inc.
|
5
|
-
#
|
6
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
# you may not use this file except in compliance with the License.
|
8
|
-
# You may obtain a copy of the License at
|
9
|
-
#
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
12
|
-
# Unless required by applicable law or agreed to in writing, software
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
# See the License for the specific language governing permissions and
|
16
|
-
# limitations under the License.
|
17
|
-
# ++
|
18
|
-
module Mongo #:nodoc:
|
19
|
-
module TimeoutWrapper
|
20
|
-
extend self
|
21
|
-
|
22
|
-
def timeout_lib=(lib)
|
23
|
-
@@timeout_lib = lib
|
24
|
-
end
|
25
|
-
|
26
|
-
def timeout_lib
|
27
|
-
@@timeout_lib
|
28
|
-
end
|
29
|
-
|
30
|
-
def timeout(delay, &block)
|
31
|
-
if timeout_lib
|
32
|
-
begin
|
33
|
-
timeout_lib.timeout(delay, &block)
|
34
|
-
rescue ::Timeout::Error
|
35
|
-
raise Mongo::OperationTimeout
|
36
|
-
end
|
37
|
-
else
|
38
|
-
yield
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# encoding:utf-8
|
2
|
-
require './test/test_helper'
|
3
|
-
require 'complex'
|
4
|
-
require 'bigdecimal'
|
5
|
-
require 'rational'
|
6
|
-
|
7
|
-
class BSONTest < Test::Unit::TestCase
|
8
|
-
|
9
|
-
include BSON
|
10
|
-
|
11
|
-
def setup
|
12
|
-
@encoder = BSON::BSON_CODER
|
13
|
-
end
|
14
|
-
|
15
|
-
def assert_doc_pass(doc, options={})
|
16
|
-
bson = @encoder.serialize(doc)
|
17
|
-
if options[:debug]
|
18
|
-
puts "DEBUGGING DOC:"
|
19
|
-
p bson.to_a
|
20
|
-
puts "DESERIALIZES TO:"
|
21
|
-
end
|
22
|
-
assert_equal @encoder.serialize(doc).to_a, bson.to_a
|
23
|
-
assert_equal doc, @encoder.deserialize(bson)
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_string
|
27
|
-
assert_doc_pass({:a => "hello"})
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
data/test/pool_test.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require './test/test_helper'
|
2
|
-
require 'logger'
|
3
|
-
require 'stringio'
|
4
|
-
require 'thread'
|
5
|
-
|
6
|
-
class TestPool < Test::Unit::TestCase
|
7
|
-
|
8
|
-
include Mongo
|
9
|
-
include BSON
|
10
|
-
|
11
|
-
def setup
|
12
|
-
@conn = standard_connection
|
13
|
-
end
|
14
|
-
|
15
|
-
def teardown
|
16
|
-
@conn[MONGO_TEST_DB].get_last_error
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_foo
|
20
|
-
end
|
21
|
-
end
|