mongo 2.9.0.rc1 → 2.9.0
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CONTRIBUTING.md +33 -47
- data/lib/mongo/server.rb +2 -0
- data/lib/mongo/uri.rb +20 -9
- data/lib/mongo/uri/srv_protocol.rb +1 -2
- data/lib/mongo/version.rb +1 -1
- data/spec/mongo/server_spec.rb +14 -0
- data/spec/support/cluster_config.rb +5 -1
- data/spec/support/common_shortcuts.rb +17 -12
- data/spec/support/utils.rb +4 -13
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd46b61214fcac244d0cbec169da07133ded518cc61f6da7f93ae38005326efc
|
4
|
+
data.tar.gz: b9fde5cb3b1060705a04cdbf6656f0b30f183acc341b6c9ae2e74322675bf358
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 897c70fc6cdb9d4a839c7cce246c3ff588ccae10b574ab8da7cd62f91860fb792b4ab74a6cc317dd9d80c03384d38d843dcc9119bb6ce71b35cb87d271eed30f
|
7
|
+
data.tar.gz: 849350864e0f5d29dcc9f1c2b5b623e0fd0ec61d028a8270a980ebe1e2cb0a764706f984d63f2206794d0fefca5610dd0f9edcec734faece59b0a8e32f4e7d38
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CONTRIBUTING.md
CHANGED
@@ -1,64 +1,50 @@
|
|
1
|
-
|
1
|
+
# Contributing to the MongoDB Ruby Driver
|
2
2
|
|
3
3
|
Thank you for your interest in contributing to the MongoDB Ruby driver.
|
4
4
|
|
5
|
-
We are building this software together and
|
6
|
-
from the community
|
5
|
+
We are building this software together and appreciate and encourage
|
6
|
+
contributions from the community.
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
JIRA Tickets
|
9
|
+
------------
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
(https://jira.mongodb.org/secure/CreateIssue!default.jspa)
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
The Ruby driver team uses MongoDB JIRA to schedule and track work.
|
12
|
+
To report a problem with the driver, please [create a new
|
13
|
+
issue](https://jira.mongodb.org/secure/CreateIssue!default.jspa) in the Ruby
|
14
|
+
JIRA project. A ticket is appreciated, though not necessary, when submitting
|
15
|
+
a pull request.
|
16
|
+
|
17
|
+
Please consult [JIRA issues](https://jira.mongodb.org/browse/RUBY)
|
18
|
+
for existing known issues in the driver.
|
17
19
|
|
18
20
|
Environment
|
19
21
|
-----------
|
20
22
|
|
21
|
-
We
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
system) is simple. This practice is essential for ensuring the quality
|
26
|
-
of the driver.
|
27
|
-
|
28
|
-
Pull Requests
|
29
|
-
-------------
|
30
|
-
|
31
|
-
Pull requests should be made against the master (development)
|
32
|
-
branch and include relevant tests, if applicable. The driver follows
|
33
|
-
the Git-Flow branching model where the traditional master branch is
|
34
|
-
known as release and the master (default) branch is considered under
|
35
|
-
development.
|
23
|
+
We recommend using [rbenv](https://github.com/sstephenson/rbenv) to set up
|
24
|
+
the Ruby development and testing environments, though other tools like
|
25
|
+
[RVM](https://rvm.io/) will also work. The driver currently supports
|
26
|
+
MRI 1.9.3-2.6 and JRuby 9.1-9.2.
|
36
27
|
|
37
|
-
|
38
|
-
|
39
|
-
|
28
|
+
A MongoDB cluster is required to run the tests. Setup procedures and
|
29
|
+
recommendations for various clusters, as well as how to configure the
|
30
|
+
driver's test suite, are covered in the [spec
|
31
|
+
readme](https://github.com/mongodb/mongo-ruby-driver/blob/master/spec/README.md).
|
40
32
|
|
41
|
-
The
|
42
|
-
|
43
|
-
|
33
|
+
The driver is tested on [Evergreen](https://github.com/evergreen-ci/evergreen),
|
34
|
+
MongoDB's in house continuous integration platform. After a pull request
|
35
|
+
is created, one of the Ruby driver team engineers will schedule continous
|
36
|
+
integration builds on Evergreen.
|
44
37
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
If your bug fix or enhancement deals with Cluster or Replica Set
|
49
|
-
code, please run all relevant tests for those code subsets before
|
50
|
-
issuing the request.
|
51
|
-
|
52
|
-
* `rake test:sharded_cluster` for sharded clusters
|
53
|
-
* `rake test:replica_set` for replica sets
|
38
|
+
Pull Requests
|
39
|
+
-------------
|
54
40
|
|
55
|
-
|
56
|
-
|
57
|
-
|
41
|
+
Pull requests should be made against the master (development) branch and
|
42
|
+
include relevant tests, if applicable. The Ruby driver team will backport
|
43
|
+
the changes to the stable branches, if needed.
|
58
44
|
|
59
45
|
Talk To Us
|
60
46
|
----------
|
61
47
|
|
62
|
-
We love to hear from you. If you want to work on something or have
|
63
|
-
questions
|
64
|
-
|
48
|
+
We would love to hear from you. If you want to work on something or have
|
49
|
+
questions please reach out to us by creating a [question](https://jira.mongodb.org/secure/CreateIssue.jspa?pid=10005&issuetype=6)
|
50
|
+
in JIRA.
|
data/lib/mongo/server.rb
CHANGED
data/lib/mongo/uri.rb
CHANGED
@@ -378,13 +378,8 @@ module Mongo
|
|
378
378
|
raise_invalid_error!("Value for option #{key} contains the key/value delimiter (=): #{value}")
|
379
379
|
end
|
380
380
|
key = ::URI.decode(key)
|
381
|
-
|
382
|
-
|
383
|
-
log_warn("Unsupported URI option '#{key}' on URI '#{@string}'. It will be ignored.")
|
384
|
-
else
|
385
|
-
value = ::URI.decode(value)
|
386
|
-
add_uri_option(key, strategy, value, uri_options)
|
387
|
-
end
|
381
|
+
value = ::URI.decode(value)
|
382
|
+
add_uri_option(key, value, uri_options)
|
388
383
|
uri_options
|
389
384
|
end
|
390
385
|
end
|
@@ -527,6 +522,7 @@ module Mongo
|
|
527
522
|
uri_option 'appname', :app_name
|
528
523
|
uri_option 'compressors', :compressors, :type => :array
|
529
524
|
uri_option 'readconcernlevel', :level, group: :read_concern
|
525
|
+
uri_option 'retryreads', :retry_reads, :type => :retry_reads
|
530
526
|
uri_option 'retrywrites', :retry_writes, :type => :retry_writes
|
531
527
|
uri_option 'zlibcompressionlevel', :zlib_compression_level, :type => :zlib_compression_level
|
532
528
|
|
@@ -592,10 +588,15 @@ module Mongo
|
|
592
588
|
# Merges the option into the target.
|
593
589
|
#
|
594
590
|
# @param key [String] URI option name.
|
595
|
-
# @param strategy [Symbol] The strategy for this option.
|
596
591
|
# @param value [String] The value of the option.
|
597
592
|
# @param uri_options [Hash] The base option target.
|
598
|
-
def add_uri_option(key,
|
593
|
+
def add_uri_option(key, value, uri_options)
|
594
|
+
strategy = URI_OPTION_MAP[key.downcase]
|
595
|
+
if strategy.nil?
|
596
|
+
log_warn("Unsupported URI option '#{key}' on URI '#{@string}'. It will be ignored.")
|
597
|
+
return
|
598
|
+
end
|
599
|
+
|
599
600
|
target = select_target(uri_options, strategy[:group])
|
600
601
|
value = apply_transform(key, value, strategy[:type])
|
601
602
|
merge_uri_option(target, value, strategy[:name])
|
@@ -785,6 +786,16 @@ module Mongo
|
|
785
786
|
inverse_bool('tlsAllowInvalidHostnames', value)
|
786
787
|
end
|
787
788
|
|
789
|
+
# Parses the retryReads value.
|
790
|
+
#
|
791
|
+
# @param value [ String ] The retryReads value.
|
792
|
+
#
|
793
|
+
# @return [ true | false | nil ] The boolean value parsed out, otherwise nil (and a warning
|
794
|
+
# will be logged).
|
795
|
+
def retry_reads(value)
|
796
|
+
convert_bool('retryReads', value)
|
797
|
+
end
|
798
|
+
|
788
799
|
# Parses the retryWrites value.
|
789
800
|
#
|
790
801
|
# @param value [ String ] The retryWrites value.
|
@@ -170,8 +170,7 @@ module Mongo
|
|
170
170
|
raise Error::InvalidTXTRecord.new(INVALID_OPTS_VALUE_DELIM) unless opt.index(URI_OPTS_VALUE_DELIM)
|
171
171
|
key, value = opt.split(URI_OPTS_VALUE_DELIM)
|
172
172
|
raise Error::InvalidTXTRecord.new(INVALID_TXT_RECORD_OPTION) unless VALID_TXT_OPTIONS.include?(key.downcase)
|
173
|
-
|
174
|
-
add_uri_option(key, strategy, value, txt_options)
|
173
|
+
add_uri_option(key, value, txt_options)
|
175
174
|
txt_options
|
176
175
|
end
|
177
176
|
end
|
data/lib/mongo/version.rb
CHANGED
data/spec/mongo/server_spec.rb
CHANGED
@@ -380,5 +380,19 @@ describe Mongo::Server do
|
|
380
380
|
expect(server.summary).not_to include('replica_set')
|
381
381
|
end
|
382
382
|
end
|
383
|
+
|
384
|
+
context 'server is a mongos' do
|
385
|
+
let(:server) do
|
386
|
+
make_server(:mongos)
|
387
|
+
end
|
388
|
+
|
389
|
+
before do
|
390
|
+
expect(server).to be_mongos
|
391
|
+
end
|
392
|
+
|
393
|
+
it 'specifies the server is a mongos' do
|
394
|
+
expect(server.summary).to match(/MONGOS/)
|
395
|
+
end
|
396
|
+
end
|
383
397
|
end
|
384
398
|
end
|
@@ -46,18 +46,23 @@ module CommonShortcuts
|
|
46
46
|
tags = options[:tags] || {}
|
47
47
|
average_round_trip_time = options[:average_round_trip_time] || 0
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
49
|
+
if mode == :unknown
|
50
|
+
ismaster = {}
|
51
|
+
else
|
52
|
+
ismaster = {
|
53
|
+
'ismaster' => mode == :primary,
|
54
|
+
'secondary' => mode == :secondary,
|
55
|
+
'arbiterOnly' => mode == :arbiter,
|
56
|
+
'isreplicaset' => mode == :ghost,
|
57
|
+
'hidden' => mode == :other,
|
58
|
+
'msg' => mode == :mongos ? 'isdbgrid' : nil,
|
59
|
+
'tags' => tags,
|
60
|
+
'ok' => 1,
|
61
|
+
'minWireVersion' => 2, 'maxWireVersion' => 8,
|
62
|
+
}
|
63
|
+
if [:primary, :secondary, :arbiter, :other].include?(mode)
|
64
|
+
ismaster['setName'] = 'mongodb_set'
|
65
|
+
end
|
61
66
|
end
|
62
67
|
|
63
68
|
listeners = Mongo::Event::Listeners.new
|
data/spec/support/utils.rb
CHANGED
@@ -26,19 +26,10 @@ module Utils
|
|
26
26
|
# Converts camel case clientOptions, as used in spec tests,
|
27
27
|
# to Ruby driver underscore options.
|
28
28
|
def convert_client_options(spec_test_options)
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
when 'readPreference'
|
34
|
-
kv = [:read, { 'mode' => kv.last }]
|
35
|
-
when 'w'
|
36
|
-
kv = [:write, { w: kv.last }]
|
37
|
-
else
|
38
|
-
kv[0] = underscore(kv[0])
|
39
|
-
end
|
40
|
-
|
41
|
-
opts.tap { |o| o[kv.first] = kv.last }
|
29
|
+
uri = Mongo::URI.new('mongodb://localhost')
|
30
|
+
spec_test_options.reduce({}) do |opts, (name, value)|
|
31
|
+
uri.send(:add_uri_option, name, value.to_s, opts)
|
32
|
+
opts
|
42
33
|
end
|
43
34
|
end
|
44
35
|
module_function :convert_client_options
|
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: 2.9.0
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Brock
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
bMYVwXXhV8czdzgkQB/ZPWHSbEWXnmkze1mzvqWBCPOVXYrcnL9cnEl/RoxtS1hr
|
32
32
|
Db6Ac6mCUSYfYHBWpWqxjc45n70i5Xi1
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2019-06-
|
34
|
+
date: 2019-06-20 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bson
|
@@ -1088,9 +1088,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1088
1088
|
version: '0'
|
1089
1089
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1090
1090
|
requirements:
|
1091
|
-
- - "
|
1091
|
+
- - ">="
|
1092
1092
|
- !ruby/object:Gem::Version
|
1093
|
-
version:
|
1093
|
+
version: '0'
|
1094
1094
|
requirements: []
|
1095
1095
|
rubygems_version: 3.0.1
|
1096
1096
|
signing_key:
|
metadata.gz.sig
CHANGED
Binary file
|