Skip to content

Commit 29d6ccc

Browse files
RUBY-3160 fix all parse errors except bson-tutorials (mongodb#2672) (mongodb#2764)
Co-authored-by: Neil Shweky <[email protected]>
1 parent 36d334c commit 29d6ccc

11 files changed

+98
-57
lines changed

docs/contribute.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Contribute Code
5858
The MongoDB Ruby driver source is located
5959
`at GitHub <https://github.com/mongodb/mongo-ruby-driver>`_.
6060

61-
The list of known issues in the driver is available
61+
The list of known issues in the driver is available
6262
`in JIRA <https://jira.mongodb.org/browse/RUBY>`_.
6363

6464
We recommend creating a JIRA ticket before starting work on a bug fix or
@@ -73,7 +73,7 @@ the changes to the stable branches, if needed.
7373
A MongoDB deployment is required to run the tests. Setup procedures and
7474
recommendations for various deployments, as well as how to configure the
7575
driver's test suite for the deployments, are covered in the `spec
76-
readme <https://github.com/mongodb/mongo-ruby-driver/blob/master/spec/README.md>`.
76+
readme <https://github.com/mongodb/mongo-ruby-driver/blob/master/spec/README.md>`__.
7777

7878
The driver is tested on `Evergreen <https://github.com/evergreen-ci/evergreen>`_,
7979
MongoDB's in-house continuous integration platform. After a pull request

docs/reference/client-side-encryption.txt

+34-11
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ enterprise-only feature. If you only intend to use explicit encryption, you may
7474
skip this step.
7575

7676
Mongocryptd comes pre-packaged with enterprise builds of the MongoDB server
77-
(versions 4.2 and newer). For installation instructions, see
78-
`the MongoDB manual <https://docs.mongodb.com/manual/reference/security-client-side-encryption-appendix/#installation>`_.
77+
(versions 4.2 and newer). For installation instructions, see the
78+
`MongoDB manual <https://mongodb.com/docs/manual/reference/security-client-side-encryption-appendix/#installation>`_.
7979

8080
In order to configure mongocryptd (for example, which port it listens on or the
8181
path used to spawn the daemon), it is necessary to pass different options to the
82-
``Mongo::Client`` performing automatic encryption. See the `:extra_options`_
82+
``Mongo::Client`` performing automatic encryption. See the :ref:`:extra_options <cse-extra-options>`
8383
section of this tutorial for more information.
8484

8585
Automatic Encryption
@@ -202,11 +202,12 @@ The example above demonstrates using automatic encryption with a local master ke
202202
For more information about using the AWS Key Management Service to create a
203203
master key and create data keys, see the following sections of this tutorial:
204204

205-
- `Creating A Master Key`_
206-
- `Creating A Data Key`_
205+
- :ref:`Creating A Master Key <creating-a-master-key>`
206+
- :ref:`Creating A Data Key <creating-a-data-key>`
207207

208208
Explicit Encryption
209209
===================
210+
210211
Explicit encryption is a feature that allows users to encrypt and decrypt
211212
individual pieces of data such as strings, integers, or symbols. Explicit
212213
encryption is a community feature and does not require an enterprise build
@@ -296,8 +297,8 @@ The example above demonstrates using explicit encryption with a local master key
296297
For more information about using the AWS Key Management Service to create a
297298
master key and create data keys, see the following sections of this tutorial:
298299

299-
- `Creating A Master Key`_,
300-
- `Creating A Data Key`_,
300+
- :ref:`Creating A Master Key <creating-a-master-key>`
301+
- :ref:`Creating A Data Key <creating-a-data-key>`
301302

302303
Creating a Master Key
303304
=====================
@@ -307,8 +308,11 @@ user data. The master key can be generated in one of two ways: by creating a
307308
local key, or by creating a key in the Amazon Web Services Key Management
308309
Service (AWS KMS).
309310

311+
.. _local-master-key:
312+
310313
Local Master Key
311314
~~~~~~~~~~~~~~~~
315+
312316
A local master key is a 96-byte binary string. It should be persisted
313317
on your machine as an environment variable or in a text file.
314318

@@ -329,14 +333,25 @@ AWS Master Key
329333
It is recommended that you use Amazon's Key Management Service to create and
330334
store your master key. To do so, follow steps 1 and 2 of the
331335
:drivers:`"Convert to a Remote Master Key" section</security/client-side-field-level-encryption-local-key-to-kms/#convert-to-a-remote-master-key>`
336+
.. _remote-master-key:
337+
338+
Remote Master Key
339+
~~~~~~~~~~~~~~~~~
340+
It is recommended that you use a remote Key Management Service to create and
341+
store your master key. To do so, follow steps of the
342+
`"Set up a Remote Master Key" <https://www.mongodb.com/docs/manual/core/csfle/tutorials/#set-up-a-remote-master-key>`_
332343
in the MongoDB Client-Side Encryption documentation.
333344

334345
For more information about creating a master key, see the
335346
:drivers:`Create a Master Key </security/client-side-field-level-encryption-guide/#a-create-a-master-key>`
347+
`Create a Master Key <https://www.mongodb.com/docs/manual/core/csfle/#a.-create-a-master-key>`_
336348
section of the MongoDB manual.
337349

350+
.. _creating-a-data-key:
351+
338352
Creating a Data Key
339353
===================
354+
340355
Once you have created a master key, create a data key by calling the
341356
``#create_data_key`` method on an instance of the ``Mongo::ClientEncryption``
342357
class. This method generates a new data key and inserts it into the key vault
@@ -376,8 +391,8 @@ key with the following code snippet:
376391
data_key_id = client_encryption.create_data_key('local')
377392
# => <BSON::Binary... type=ciphertext...>
378393

379-
See the `Local Master Key`_ section for more information about generating a new
380-
local master key.
394+
See the :ref:`Local Master Key <local-master-key>` section for more information
395+
about generating a new local master key.
381396

382397
Create a Data Key Using an AWS Master Key
383398
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -423,18 +438,20 @@ generating a new master key on AWS and finding the information you need to
423438
create data keys.
424439

425440
For more information about creating a data key, see the
426-
:drivers:`Create a Data Encryption Key </security/client-side-field-level-encryption-guide/#b-create-a-data-encryption-key>`
441+
`Create a Data Encryption Key <https://www.mongodb.com/docs/manual/core/csfle/#b.-create-a-data-encryption-key>`_
427442
section of the MongoDB manual.
428443

429444
Auto-Encryption Options
430445
=======================
446+
431447
Automatic encryption can be configured on a ``Mongo::Client`` using the
432448
``auto_encryption_options`` option ``Hash``. This section provides an overview
433449
of the fields inside ``auto_encryption_options`` and explains how to choose their
434450
values.
435451

436452
``:key_vault_client``
437453
~~~~~~~~~~~~~~~~~~~~~
454+
438455
The key vault client is a ``Mongo::Client`` instance that will be used to connect
439456
to the MongoDB collection containing your encryption data keys. For example, if
440457
your key vault was hosted on a MongoDB instance at ``localhost:30000``:
@@ -456,6 +473,7 @@ to insert and fetch data keys.
456473

457474
``:key_vault_namespace``
458475
~~~~~~~~~~~~~~~~~~~~~~~~
476+
459477
The key vault namespace is a ``String`` in the format ``"database_name.collection_name"``,
460478
where ``database_name`` and ``collection_name`` are the name of the database and
461479
collection in which you would like to store your data keys. For example, if your data
@@ -474,6 +492,7 @@ There is no default key vault namespace, and this option must be provided.
474492

475493
``:schema_map``
476494
~~~~~~~~~~~~~~~
495+
477496
A schema map is a Hash with information about which fields to automatically
478497
encrypt and decrypt.
479498

@@ -549,11 +568,12 @@ When you intend to use your schema map, convert it to a Ruby ``Hash`` using the
549568

550569
.. seealso::
551570

552-
:drivers:`Specify Encrypted Fields Using JSON Schema</security/client-side-field-level-encryption-guide/#c-specify-encrypted-fields-using-json-schema>`,
571+
`Specify Encrypted Fields Using JSON Schema <https://www.mongodb.com/docs/manual/core/csfle/#c-specify-encrypted-fields-using-json-schema>`_,
553572
:manual:`Automatic Encryption Rules</reference/security-client-side-automatic-json-schema/>`
554573

555574
``:bypass_auto_encryption``
556575
~~~~~~~~~~~~~~~~~~~~~~~~~~~
576+
557577
The ``:bypass_auto_encryption`` option is a ``Boolean`` that specifies whether the
558578
``Mongo::Client`` should skip encryption when writing to the database. If
559579
``:bypass_auto_encryption`` is ``true``, the client will still perform automatic
@@ -568,8 +588,11 @@ decryption of any previously-encrypted data.
568588
}
569589
)
570590

591+
.. _cse-extra-options:
592+
571593
``:extra_options``
572594
~~~~~~~~~~~~~~~~~~
595+
573596
``:extra_options`` is a ``Hash`` of options related to spawning mongocryptd.
574597
Every option in this ``Hash`` has a default value, so it is only necessary to
575598
provide the options whose defaults you want to override.

docs/reference/connection-and-configuration.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ options the driver provides, including authentication.
1212
.. toctree::
1313
:titlesonly:
1414

15-
create-client
16-
authentication
17-
monitoring
18-
user-management
15+
/reference/create-client
16+
/reference/authentication
17+
/reference/monitoring
18+
/reference/user-management

docs/reference/create-client.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,7 @@ URI options are explained in detail in the :manual:`Connection URI reference
882882
</reference/connection-string/>`.
883883

884884
.. note::
885+
885886
Options that are set in **milliseconds** in the URI are
886887
represented as a ``float`` in Ruby and the units are **seconds**.
887888

@@ -1321,7 +1322,7 @@ It is also possible to remove hooks from ``Mongo.tls_context_hooks`` by storing
13211322
a reference to the Procs somewhere else in the application, and then using
13221323
``Array#delete_if`` to remove the desired hooks.
13231324

1324-
..warning ::
1325+
.. warning::
13251326

13261327
TLS context hooks are global and will affect every instance of ``Mongo::Client``.
13271328
Any library that allows applications to enable these hooks should expose methods to

docs/reference/crud-operations.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ underscore one that Ruby driver uses.
967967
A Note about the BSON Symbol type
968968
=================================
969969

970-
Because the BSON specification deprecated the BSON symbol type, the `bson` gem
970+
Because the BSON specification deprecated the BSON symbol type, the ``bson`` gem
971971
will serialize Ruby symbols into BSON strings when used on its own. However, in
972972
order to maintain backwards compatibility with older datasets, the Ruby driver
973973
overrides this behavior to serialize Ruby symbols as BSON symbols. This is

docs/reference/gridfs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ by default into the ``fs.chunks`` collection and file metadata is inserted into
252252

253253
client.database.fs.insert_one(file)
254254

255-
To insert into collections with a name prefix other than `fs`, access the
255+
To insert into collections with a name prefix other than ``fs``, access the
256256
filesystem with a ``:fs_name`` option.
257257

258258
.. code-block:: ruby

docs/reference/monitoring.txt

+18-18
Original file line numberDiff line numberDiff line change
@@ -137,35 +137,35 @@ can look like the following:
137137
format("SDAM | %s".freeze, message)
138138
end
139139
end
140-
140+
141141
class TopologyOpeningLogSubscriber < SDAMLogSubscriber
142142
private
143-
143+
144144
def format_event(event)
145145
"Topology type '#{event.topology.display_name}' initializing."
146146
end
147147
end
148-
148+
149149
class ServerOpeningLogSubscriber < SDAMLogSubscriber
150150
private
151-
151+
152152
def format_event(event)
153153
"Server #{event.address} initializing."
154154
end
155155
end
156-
156+
157157
class ServerDescriptionChangedLogSubscriber < SDAMLogSubscriber
158158
private
159-
159+
160160
def format_event(event)
161161
"Server description for #{event.address} changed from " +
162162
"'#{event.previous_description.server_type}' to '#{event.new_description.server_type}'."
163163
end
164164
end
165-
165+
166166
class TopologyChangedLogSubscriber < SDAMLogSubscriber
167167
private
168-
168+
169169
def format_event(event)
170170
if event.previous_topology != event.new_topology
171171
"Topology type '#{event.previous_topology.display_name}' changed to " +
@@ -176,18 +176,18 @@ can look like the following:
176176
end
177177
end
178178
end
179-
179+
180180
class ServerClosedLogSubscriber < SDAMLogSubscriber
181181
private
182-
182+
183183
def format_event(event)
184184
"Server #{event.address} connection closed."
185185
end
186186
end
187-
187+
188188
class TopologyClosedLogSubscriber < SDAMLogSubscriber
189189
private
190-
190+
191191
def format_event(event)
192192
"Topology type '#{event.topology.display_name}' closed."
193193
end
@@ -228,7 +228,7 @@ since the events may be published during the client's construction:
228228
topology_changed_subscriber = TopologyChangedLogSubscriber.new
229229
server_closed_subscriber = ServerClosedLogSubscriber.new
230230
topology_closed_subscriber = TopologyClosedLogSubscriber.new
231-
231+
232232
sdam_proc = Proc.new do |client|
233233
client.subscribe(Mongo::Monitoring::TOPOLOGY_OPENING,
234234
topology_opening_subscriber)
@@ -287,9 +287,9 @@ Server Heartbeats
287287

288288
The application can be notified of each server heartbeat by subscribing
289289
to SERVER_HEARTBEAT topic. A server heartbeat listener must implement
290-
three methods: `started`, `succeeded` and `failed`. Each heartbeat invokes
291-
the `started` method on the listener, and then either `succeeded` or `failed`
292-
method depending on the outcome of the heartbeat.
290+
three methods: ``started``, ``succeeded`` and ``failed``. Each heartbeat
291+
invokes the ``started`` method on the listener, and then either ``succeeded``
292+
or ``failed`` method depending on the outcome of the heartbeat.
293293

294294
All heartbeat events contain the address of the server that the heartbeat
295295
was sent to. Succeeded and failed events contain the round trip time for
@@ -316,9 +316,9 @@ The following is an example logging heartbeat event subscriber:
316316
def failed(event)
317317
log_debug("#{event.address} | FAILED | #{event.error.class}: #{event.error.message} | #{event.duration}s")
318318
end
319-
319+
320320
private
321-
321+
322322
def logger
323323
Mongo::Logger.logger
324324
end

docs/reference/schema-operations.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ including managing databases, collections, indexes and users.
1212
.. toctree::
1313
:titlesonly:
1414

15-
database-tasks
16-
collection-tasks
17-
indexing
18-
collations
15+
/reference/database-tasks
16+
/reference/collection-tasks
17+
/reference/indexing
18+
/reference/collations

docs/reference/working-with-data.txt

+13-13
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ implements for inserting, updating and retrieving data from MongoDB.
1212
.. toctree::
1313
:titlesonly:
1414

15-
crud-operations
16-
bulk-operations
17-
projection
18-
aggregation
19-
map-reduce
20-
text-search
21-
geospatial-search
22-
query-cache
23-
gridfs
24-
change-streams
25-
sessions
26-
transactions
27-
client-side-encryption
15+
/reference/crud-operations
16+
/reference/bulk-operations
17+
/reference/projection
18+
/reference/aggregation
19+
/reference/map-reduce
20+
/reference/text-search
21+
/reference/geospatial-search
22+
/reference/query-cache
23+
/reference/gridfs
24+
/reference/change-streams
25+
/reference/sessions
26+
/reference/transactions
27+
/reference/client-side-encryption

0 commit comments

Comments
 (0)