Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ Lint/IncompatibleIoSelectWithFiberScheduler:
- 'lib/mongo/socket/ssl.rb'
- 'lib/mongo/socket/tcp.rb'

# Offense count: 31
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
Enabled: false

# Offense count: 1
Lint/MixedRegexpCaptureTypes:
Exclude:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class ConnectionCheckOutFailed < Base
# @since 2.9.0
# @api private
def initialize(address, reason)
super()
@reason = reason
@address = address
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ConnectionCheckOutStarted < Base
# @since 2.9.0
# @api private
def initialize(address)
super()
@address = address
end

Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/cmap/connection_checked_in.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ConnectionCheckedIn < Base
# @since 2.9.0
# @api private
def initialize(address, id, pool)
super()
@address = address
@connection_id = id
@pool = pool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class ConnectionCheckedOut < Base
# @since 2.9.0
# @api private
def initialize(address, id, pool)
super()
@address = address
@connection_id = id
@pool = pool
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/cmap/connection_closed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class ConnectionClosed < Base
# @since 2.9.0
# @api private
def initialize(address, id, reason)
super()
@reason = reason
@address = address
@connection_id = id
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/cmap/connection_created.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ConnectionCreated < Base
# @since 2.9.0
# @api private
def initialize(address, id)
super()
@address = address
@connection_id = id
end
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/cmap/connection_ready.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ConnectionReady < Base
# @since 2.9.0
# @api private
def initialize(address, id)
super()
@address = address
@connection_id = id
end
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/cmap/pool_cleared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class PoolCleared < Base
#
# @api private
def initialize(address, service_id: nil, interrupt_in_use_connections: nil)
super()
@address = address
@service_id = service_id
@options = {}
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/cmap/pool_closed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class PoolClosed < Base
# @since 2.9.0
# @api private
def initialize(address, pool)
super()
@address = address
@pool = pool
end
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/cmap/pool_created.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class PoolCreated < Base
# @since 2.9.0
# @api private
def initialize(address, options, pool)
super()
@address = address
@options = options.dup.freeze
@pool = pool
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/cmap/pool_ready.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class PoolReady < Base
# @since 2.9.0
# @api private
def initialize(address, options, pool)
super()
@address = address
@options = options.dup.freeze
@pool = pool
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/command_failed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class CommandFailed < Mongo::Event::Base
def initialize(command_name, database_name, address,
request_id, operation_id, message, failure, duration,
started_event:, server_connection_id: nil, service_id: nil)
super()
@command_name = command_name.to_s
@database_name = database_name
@address = address
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/command_started.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def initialize(command_name, database_name, address, request_id,
operation_id, command, socket_object_id: nil, connection_id: nil,
connection_generation: nil, server_connection_id: nil,
service_id: nil)
super()
@command_name = command_name.to_s
@database_name = database_name
@address = address
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/command_succeeded.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class CommandSucceeded < Mongo::Event::Base
def initialize(command_name, database_name, address, request_id,
operation_id, reply, duration, started_event:,
server_connection_id: nil, service_id: nil)
super()
@command_name = command_name.to_s
@database_name = database_name
@address = address
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/server_closed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ServerClosed < Mongo::Event::Base
#
# @since 2.4.0
def initialize(address, topology)
super()
@address = address
@topology = topology
end
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/server_description_changed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def awaited?
# @api private
def initialize(address, topology, previous_description, new_description,
awaited: false)
super()
@address = address
@topology = topology
@previous_description = previous_description
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/server_heartbeat_failed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ServerHeartbeatFailed < Mongo::Event::Base
# @since 2.7.0
# @api private
def initialize(address, round_trip_time, error, started_event:, awaited: false)
super()
@address = address
@round_trip_time = round_trip_time
@error = error
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/server_heartbeat_started.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def awaited?
# @since 2.7.0
# @api private
def initialize(address, awaited: false)
super()
@address = address
@awaited = !!awaited
end
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/server_heartbeat_succeeded.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ServerHeartbeatSucceeded < Mongo::Event::Base
# @since 2.7.0
# @api private
def initialize(address, round_trip_time, started_event:, awaited: false)
super()
@address = address
@round_trip_time = round_trip_time
@awaited = !!awaited
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/server_opening.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ServerOpening < Mongo::Event::Base
#
# @since 2.4.0
def initialize(address, topology)
super()
@address = address
@topology = topology
end
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/topology_changed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class TopologyChanged < Mongo::Event::Base
#
# @since 2.4.0
def initialize(previous_topology, new_topology)
super()
@previous_topology = previous_topology
@new_topology = new_topology
end
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/topology_closed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class TopologyClosed < Mongo::Event::Base
#
# @since 2.4.0
def initialize(topology)
super()
@topology = topology
end

Expand Down
1 change: 1 addition & 0 deletions lib/mongo/monitoring/event/topology_opening.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class TopologyOpening < Mongo::Event::Base
#
# @since 2.4.0
def initialize(topology)
super()
@topology = topology
end

Expand Down
4 changes: 1 addition & 3 deletions lib/mongo/operation/insert/bulk_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ class BulkResult < Operation::Result
# @since 2.0.0
# @api private
def initialize(replies, connection_description, connection_global_id, ids)
@replies = [ *replies ] if replies
@connection_description = connection_description
@connection_global_id = connection_global_id
super(replies, connection_description, connection_global_id)
if replies && replies.first && (doc = replies.first.documents.first)
if (errors = doc['writeErrors'])
# some documents were potentially inserted
Expand Down
3 changes: 3 additions & 0 deletions lib/mongo/protocol/compressed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ class Compressed < Message
#
# @since 2.5.0
def initialize(message, compressor, zlib_compression_level = nil)
super()
@original_message = message
@original_op_code = message.op_code
@uncompressed_size = 0
@compressor_id = COMPRESSOR_ID_MAP[compressor]
@compressed_message = ''
@zlib_compression_level = zlib_compression_level if zlib_compression_level && zlib_compression_level != -1
# A compressed message must reuse the wrapped message's request id,
# overriding the fresh id assigned by the superclass initializer.
@request_id = message.request_id
end

Expand Down
1 change: 1 addition & 0 deletions lib/mongo/server/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class Connection < ConnectionBase
#
# @since 2.0.0
def initialize(server, options = {})
super()
if server.load_balancer? && options[:generation]
raise ArgumentError, 'Generation cannot be set when server is a load balancer'
end
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/server/monitor/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Connection < Server::ConnectionCommon
#
# @since 2.0.0
def initialize(address, options = {})
super()
@address = address
@options = options.dup.freeze
raise ArgumentError, 'App metadata is required' unless (@app_metadata = options[:app_metadata])
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/server/pending_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class PendingConnection < ConnectionBase
extend Forwardable

def initialize(socket, server, monitoring, options = {})
super()
@socket = socket
@options = options
@server = server
Expand Down
1 change: 1 addition & 0 deletions spec/runners/change_streams/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module Mongo
module ChangeStreams
class ChangeStreamsTest < Mongo::CRUD::CRUDTestBase
def initialize(crud_spec, test, collection_name, collection2_name, database_name, database2_name)
super()
@spec = crud_spec
@description = test['description']

Expand Down
1 change: 1 addition & 0 deletions spec/runners/crud/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CRUDTest < CRUDTestBase
#
# @since 2.0.0
def initialize(crud_spec, data, test)
super()
@spec = crud_spec
@data = data
@description = test['description']
Expand Down
1 change: 1 addition & 0 deletions spec/runners/transactions/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class TransactionsTest < CRUD::CRUDTestBase
#
# @since 2.6.0
def initialize(crud_spec, data, test, expectations_bson_types: true)
super()
test = IceNine.deep_freeze(test)
@spec = crud_spec
@data = data || []
Expand Down
Loading