Skip to content

Commit 2c4a370

Browse files
committed
Fixing yard docs
1 parent e390ea2 commit 2c4a370

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+60
-59
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
.yardoc
1414
coverage
1515
data
16-
doc
16+
docs
1717
Gemfile.lock
1818
.ruby-gemset
1919
.ruby-version

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
22

33
gemspec
44
gem 'rake'
5+
gem 'yard'
56

67
platforms :rbx do
78
gem 'racc'

Rakefile

+12
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,15 @@ task :release => :spec do
3535
system "gem push mongo-#{Mongo::VERSION}.gem"
3636
system "rm mongo-#{Mongo::VERSION}.gem"
3737
end
38+
39+
desc "Generate all documentation"
40+
task :docs => 'docs:yard'
41+
42+
namespace :docs do
43+
desc "Generate yard documention"
44+
task :yard do
45+
out = File.join('docs', Mongo::VERSION)
46+
FileUtils.rm_rf(out)
47+
system "yardoc -o #{out} --title mongo-#{Mongo::VERSION}"
48+
end
49+
end

lib/mongo/auth.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ module Auth
5656
# Get the authorization strategy for the provided auth mechanism.
5757
#
5858
# @example Get the strategy.
59-
# Auth.get(:mongodb_cr)
59+
# Auth.get(user)
6060
#
61-
# @param [ Symbol ] mechanism The authorization mechanism.
61+
# @param [ Auth::User ] user The user object.
6262
#
6363
# @return [ CR, X509, LDAP, Kerberos ] The auth strategy.
6464
#

lib/mongo/cluster/topology/replica_set.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def display_name
5454
#
5555
# @param [ Server::Description ] description The description of the
5656
# elected primary.
57-
# @param [ Array<Server> ] server The list of known servers to the
57+
# @param [ Array<Server> ] servers The list of known servers to the
5858
# cluster.
5959
#
6060
# @return [ ReplicaSet ] The topology.

lib/mongo/cluster/topology/sharded.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def display_name
4545
#
4646
# @param [ Server::Description ] description The description of the
4747
# elected primary.
48-
# @param [ Array<Server> ] server The list of known servers to the
48+
# @param [ Array<Server> ] servers The list of known servers to the
4949
# cluster.
5050
#
5151
# @return [ Sharded ] The topology.

lib/mongo/cluster/topology/standalone.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def display_name
4545
#
4646
# @param [ Server::Description ] description The description of the
4747
# elected primary.
48-
# @param [ Array<Server> ] server The list of known servers to the
48+
# @param [ Array<Server> ] servers The list of known servers to the
4949
# cluster.
5050
#
5151
# @return [ Standalone ] The topology.

lib/mongo/cluster/topology/unknown.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def display_name
4949
#
5050
# @param [ Server::Description ] description The description of the
5151
# elected primary.
52-
# @param [ Array<Server> ] server The list of known servers to the
52+
# @param [ Array<Server> ] servers The list of known servers to the
5353
# cluster.
5454
#
5555
# @return [ Sharded, ReplicaSet ] The new topology.

lib/mongo/collection/view/readable.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def show_disk_loc(value = nil)
271271
# @example Set the number to skip.
272272
# view.skip(10)
273273
#
274-
# @param [ Integer ] skip Number of docs to skip.
274+
# @param [ Integer ] number Number of docs to skip.
275275
#
276276
# @return [ Integer, View ] Either the skip value or a
277277
# new +View+.

lib/mongo/collection/view/writable.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def find_one_and_delete
4545
# @example Find a document and replace it, returning the new document.
4646
# view.find_one_and_replace({ name: 'test' }, :return_document => :after)
4747
#
48-
# @param [ BSON::Document ] document The updates.
48+
# @param [ BSON::Document ] replacement The updates.
4949
# @param [ Hash ] opts The options.
5050
#
5151
# @option opts [ Symbol ] :return_document Either :before or :after.

lib/mongo/cursor.rb

-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ def inspect
7171
# ...
7272
# end
7373
#
74-
# @yield param [Hash] Each matching document.
75-
#
7674
# @return [ Enumerator ] The enumerator.
7775
#
7876
# @since 2.0.0

lib/mongo/error.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Error < StandardError
4040

4141
# The constant for the writeErrors array.
4242
#
43-
# @sicne 2.0.0
43+
# @since 2.0.0
4444
WRITE_ERRORS = 'writeErrors'.freeze
4545

4646
# The constant for write concern errors.

lib/mongo/error/bulk_write_failure.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class BulkWriteFailure < Error
2929
# @example Instantiate the exception.
3030
# Mongo::Error::BulkWriteFailure.new(response)
3131
#
32-
# @params [ Hash ] result A processed response from the server
32+
# @param [ Hash ] result A processed response from the server
3333
# reporting results of the operation.
3434
#
3535
# @since 2.0.0

lib/mongo/operation/aggregate.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Aggregate
5656
# server is not primary, the operation will be rerouted to the primary
5757
# with a warning.
5858
#
59-
# @params [ Mongo::Server::Context ] The context for this operation.
59+
# @param [ Server::Context ] context The context for this operation.
6060
#
6161
# @return [ Result ] The operation response, if there is one.
6262
#

lib/mongo/operation/batchable.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module Batchable
2626

2727
# Slices this operation into the specified number of children operations.
2828
#
29-
# @params [ Integer ] n_batches The number of children operations to split
29+
# @param [ Integer ] n_batches The number of children operations to split
3030
# this one into.
3131
#
3232
# @return [ Array ] An array of children operations.
@@ -64,7 +64,7 @@ def batch(n_batches)
6464
# Merge another operation with this one.
6565
# Requires that the collection and database of the two ops are the same.
6666
#
67-
# @params[ Mongo::Operation ] The other operation.
67+
# @param[ Mongo::Operation ] The other operation.
6868
#
6969
# @return [ self ] This operation merged with the other one.
7070
#
@@ -81,7 +81,7 @@ def merge!(other)
8181

8282
# Determine if the batch size exceeds a given maximum.
8383
#
84-
# @params[ Integer ] The max batch size.
84+
# @param[ Integer ] The max batch size.
8585
#
8686
# @return [ true, false ] If this operation exceeds the given batch size.
8787
#

lib/mongo/operation/command.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Command
4141
# @example Execute the operation.
4242
# operation.execute(context)
4343
#
44-
# @params [ Mongo::Server::Context ] The context for this operation.
44+
# @param [ Server::Context ] context The context for this operation.
4545
#
4646
# @return [ Result ] The operation result.
4747
#

lib/mongo/operation/executable.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module Executable
2525
# The context gets a connection on which the operation
2626
# is sent in the block.
2727
#
28-
# @params [ Mongo::Server::Context ] The context for this operation.
28+
# @param [ Mongo::Server::Context ] context The context for this operation.
2929
#
3030
# @return [ Result ] The operation response, if there is one.
3131
#
@@ -39,7 +39,7 @@ def execute(context)
3939
# Merge this operation with another operation, returning a new one.
4040
# Requires that the collection and database of the two ops are the same.
4141
#
42-
# @params[ Object ] The other operation.
42+
# @param[ Object ] The other operation.
4343
#
4444
# @return [ Object ] A new operation merging this one and another.
4545
#
@@ -67,7 +67,7 @@ def namespace
6767
# If an operation including this module doesn't define #merge!, neither
6868
# #merge nor #merge! will be allowed.
6969
#
70-
# @params[ Object ] The other operation.
70+
# @param[ Object ] The other operation.
7171
#
7272
# @raise [ Exception ] Merging is not supported for this operation.
7373
#

lib/mongo/operation/list_collections/result.rb

-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ def documents
9191
# @example Validate the result.
9292
# result.validate!
9393
#
94-
# @param [ Hash ] spec The spec used to run the command.
95-
#
9694
# @return [ Result ] Self if successful.
9795
#
9896
# @since 2.0.0

lib/mongo/operation/map_reduce.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class MapReduce
5757
# @example Execute the operation.
5858
# operation.execute(context)
5959
#
60-
# @params [ Mongo::Server::Context ] The context for this operation.
60+
# @param [ Server::Context ] context The context for this operation.
6161
#
6262
# @return [ Result ] The operation response, if there is one.
6363
#

lib/mongo/operation/read/collections_info.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CollectionsInfo
3737
# The context gets a connection on which the operation
3838
# is sent in the block.
3939
#
40-
# @params [ Mongo::Server::Context ] The context for this operation.
40+
# @param [ Mongo::Server::Context ] context The context for this operation.
4141
#
4242
# @return [ Result ] The operation response, if there is one.
4343
#

lib/mongo/operation/read/get_more.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class GetMore
4545
# @example Execute the operation.
4646
# operation.execute(context)
4747
#
48-
# @params [ Mongo::Server::Context ] The context for this operation.
48+
# @param [ Mongo::Server::Context ] context The context for this operation.
4949
#
5050
# @return [ Result ] The operation response, if there is one.
5151
#

lib/mongo/operation/read/indexes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Indexes
3838
# The context gets a connection on which the operation
3939
# is sent in the block.
4040
#
41-
# @params [ Mongo::Server::Context ] The context for this operation.
41+
# @param [ Mongo::Server::Context ] context The context for this operation.
4242
#
4343
# @return [ Result ] The indexes operation response.
4444
#

lib/mongo/operation/read/list_collections.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ListCollections
4343
# @example Execute the operation.
4444
# operation.execute(context)
4545
#
46-
# @params [ Mongo::Server::Context ] The context for this operation.
46+
# @param [ Mongo::Server::Context ] context The context for this operation.
4747
#
4848
# @return [ Result ] The operation result.
4949
#

lib/mongo/operation/read/list_indexes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ListIndexes
4545
# @example Execute the operation.
4646
# operation.execute(context)
4747
#
48-
# @params [ Mongo::Server::Context ] The context for this operation.
48+
# @param [ Mongo::Server::Context ] context The context for this operation.
4949
#
5050
# @return [ Result ] The operation result.
5151
#

lib/mongo/operation/read/query.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Query
4545
# The context gets a connection on which the operation
4646
# is sent in the block.
4747
#
48-
# @params [ Mongo::Server::Context ] The context for this operation.
48+
# @param [ Server::Context ] context The context for this operation.
4949
#
5050
# @return [ Result ] The operation response, if there is one.
5151
#

lib/mongo/operation/write/bulk_delete.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class BulkDelete
5656
# @example Execute the operation.
5757
# operation.execute(context)
5858
#
59-
# @params [ Mongo::Server::Context ] The context for this operation.
59+
# @param [ Mongo::Server::Context ] context The context for this operation.
6060
#
6161
# @return [ Result ] The result.
6262
#
@@ -74,7 +74,7 @@ def execute(context)
7474
# @example Set a write concern.
7575
# new_op = operation.write_concern(:w => 2)
7676
#
77-
# @params [ Hash ] The write concern.
77+
# @param [ Hash ] wc The write concern.
7878
#
7979
# @since 2.0.0
8080
def write_concern(wc = nil)
@@ -87,8 +87,6 @@ def write_concern(wc = nil)
8787

8888
# The index of each delete as it was added onto the bulk object.
8989
#
90-
# @params [ Integer ] The index of each delete.
91-
#
9290
# @since 2.0.0
9391
def indexes
9492
@spec[:indexes] || []

lib/mongo/operation/write/bulk_insert.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class BulkInsert
5555
# @example Execute the operation.
5656
# operation.execute(context)
5757
#
58-
# @params [ Mongo::Server::Context ] The context for this operation.
58+
# @param [ Mongo::Server::Context ] context The context for this operation.
5959
#
6060
# @return [ Result ] The operation result.
6161
#
@@ -73,7 +73,7 @@ def execute(context)
7373
# @example Set a write concern.
7474
# new_op = operation.write_concern(:w => 2)
7575
#
76-
# @params [ Hash ] The write concern.
76+
# @param [ Hash ] wc The write concern.
7777
#
7878
# @since 2.0.0
7979
def write_concern(wc = nil)
@@ -86,8 +86,6 @@ def write_concern(wc = nil)
8686

8787
# The index of each document as it was added onto the bulk object.
8888
#
89-
# @params [ Integer ] The index of each document.
90-
#
9189
# @since 2.0.0
9290
def indexes
9391
@spec[:indexes] || []

lib/mongo/operation/write/bulk_update.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class BulkUpdate
6363
# @example Execute the operation.
6464
# operation.execute(context)
6565
#
66-
# @params [ Mongo::Server::Context ] The context for this operation.
66+
# @param [ Mongo::Server::Context ] context The context for this operation.
6767
#
6868
# @return [ Result ] The operation result.
6969
#
@@ -81,7 +81,7 @@ def execute(context)
8181
# @example Set a write concern.
8282
# new_op = operation.write_concern(:w => 2)
8383
#
84-
# @params [ Hash ] The write concern.
84+
# @param [ Hash ] wc The write concern.
8585
#
8686
# @since 2.0.0
8787
def write_concern(wc = nil)
@@ -94,8 +94,6 @@ def write_concern(wc = nil)
9494

9595
# The index of each update as it was added onto the bulk object.
9696
#
97-
# @params [ Integer ] The index of each update.
98-
#
9997
# @since 2.0.0
10098
def indexes
10199
@spec[:indexes] || []

lib/mongo/operation/write/create_index.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class EnsureIndex
4949
# @example Execute the operation.
5050
# operation.execute(context)
5151
#
52-
# @params [ Mongo::Server::Context ] The context for this operation.
52+
# @param [ Mongo::Server::Context ] context The context for this operation.
5353
#
5454
# @return [ Result ] The result of the operation.
5555
#

lib/mongo/operation/write/create_user.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class CreateUser
4040
# @example Execute the operation.
4141
# operation.execute(context)
4242
#
43-
# @param [ Mongo::Server::Context ] The context for this operation.
43+
# @param [ Mongo::Server::Context ] context The context for this operation.
4444
#
4545
# @return [ Result ] The operation result.
4646
#

lib/mongo/operation/write/delete.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Delete
5353
# @example Execute the operation.
5454
# operation.execute(context)
5555
#
56-
# @params [ Mongo::Server::Context ] The context for this operation.
56+
# @param [ Mongo::Server::Context ] context The context for this operation.
5757
#
5858
# @return [ Result ] The result.
5959
#

lib/mongo/operation/write/drop_index.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DropIndex
4242
# @example Execute the operation.
4343
# operation.execute(context)
4444
#
45-
# @params [ Mongo::Server::Context ] The context for this operation.
45+
# @param [ Mongo::Server::Context ] context The context for this operation.
4646
#
4747
# @return [ Result ] The result of the operation.
4848
#

lib/mongo/operation/write/insert.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Insert
4848
# @example Execute the operation.
4949
# operation.execute(context)
5050
#
51-
# @params [ Mongo::Server::Context ] The context for this operation.
51+
# @param [ Mongo::Server::Context ] context The context for this operation.
5252
#
5353
# @return [ Result ] The operation result.
5454
#

0 commit comments

Comments
 (0)