mongo 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/docs/HISTORY.md +6 -0
- data/lib/mongo.rb +1 -1
- data/lib/mongo/connection.rb +2 -2
- data/test/bson/object_id_test.rb +6 -0
- data/test/connection_test.rb +6 -0
- data/test/replica_sets/connect_test.rb +1 -1
- data/test/rs.rb +6 -2
- metadata +4 -4
data/docs/HISTORY.md
CHANGED
data/lib/mongo.rb
CHANGED
data/lib/mongo/connection.rb
CHANGED
@@ -493,13 +493,13 @@ module Mongo
|
|
493
493
|
end
|
494
494
|
end
|
495
495
|
|
496
|
-
pick_secondary_for_read
|
496
|
+
pick_secondary_for_read if @read_secondary
|
497
497
|
|
498
498
|
raise ConnectionFailure, "failed to connect to any given host:port" unless connected?
|
499
499
|
end
|
500
500
|
|
501
501
|
def connecting?
|
502
|
-
|
502
|
+
@nodes_to_try.length > 0
|
503
503
|
end
|
504
504
|
|
505
505
|
# It's possible that we defined connected as all nodes being connected???
|
data/test/bson/object_id_test.rb
CHANGED
@@ -51,6 +51,12 @@ class ObjectIdTest < Test::Unit::TestCase
|
|
51
51
|
assert_equal 24, $1.length
|
52
52
|
end
|
53
53
|
|
54
|
+
def test_to_s2
|
55
|
+
@o = ObjectId.new([76, 244, 52, 174, 44, 84, 121, 76, 88, 0, 0, 3])
|
56
|
+
s = '4cf434ae2c54794c58000003'
|
57
|
+
assert_equal @o.to_s, s
|
58
|
+
end
|
59
|
+
|
54
60
|
def test_method
|
55
61
|
assert_equal ObjectId.from_string(@o.to_s), BSON::ObjectId(@o.to_s)
|
56
62
|
end
|
data/test/connection_test.rb
CHANGED
@@ -16,6 +16,12 @@ class TestConnection < Test::Unit::TestCase
|
|
16
16
|
@conn[MONGO_TEST_DB].get_last_error
|
17
17
|
end
|
18
18
|
|
19
|
+
def test_connection_failure
|
20
|
+
assert_raise Mongo::ConnectionFailure do
|
21
|
+
Mongo::Connection.new('localhost', 27347)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
19
25
|
def test_server_info
|
20
26
|
server_info = @conn.server_info
|
21
27
|
assert server_info.keys.include?("version")
|
@@ -10,7 +10,7 @@ class ConnectTest < Test::Unit::TestCase
|
|
10
10
|
def test_connect_bad_name
|
11
11
|
assert_raise_error(ReplicaSetConnectionError, "expected 'wrong-repl-set-name'") do
|
12
12
|
Mongo::Connection.multi([['localhost', 27017], ['localhost', 27018], ['localhost', 27019]],
|
13
|
-
:
|
13
|
+
:rs_name => "wrong-repl-set-name")
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
data/test/rs.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
1
4
|
require 'mongo'
|
2
5
|
|
3
6
|
START_PORT = 27017
|
4
7
|
N = 4
|
5
8
|
|
6
9
|
N.times do |n|
|
7
|
-
system("rm -rf /data/rs#{n}")
|
8
|
-
system("mkdir -p /data/rs#{n}")
|
10
|
+
system("sudo rm -rf /data/rs#{n}")
|
11
|
+
system("sudo mkdir -p /data/rs#{n}")
|
12
|
+
system("sudo chown kyle:kyle /data/rs#{n}")
|
9
13
|
system("mongod --replSet replica-set-foo --logpath '#{n}.log' --dbpath /data/rs#{n} --port #{START_PORT + n} --fork")
|
10
14
|
end
|
11
15
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 4
|
10
|
+
version: 1.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jim Menard
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-11-
|
20
|
+
date: 2010-11-30 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|