Sha256: e6798003ba2fb90702dd032839056965290c8faeae60d106e2bf3b7f9a61796b

Contents?: true

Size: 732 Bytes

Versions: 18

Compression:

Stored size: 732 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

module ClientRegistryMacros
  def new_local_client(address, options=nil, &block)
    ClientRegistry.instance.new_local_client(address, options, &block)
  end

  def new_local_client_nmio(address, options=nil, &block)
    # Avoid type converting options.
    base_options = {monitoring_io: false}
    if BSON::Document === options || options&.keys&.any? { |key| String === key }
      base_options = Mongo::Options::Redacted.new(base_options)
    end
    options = if options
      base_options.merge(options)
    else
      base_options
    end
    new_local_client(address, options, &block)
  end

  def close_local_clients
    ClientRegistry.instance.close_local_clients
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mongo-2.16.4 spec/support/client_registry_macros.rb
mongo-2.17.4 spec/support/client_registry_macros.rb
mongo-2.18.3 spec/support/client_registry_macros.rb
mongo-2.18.2 spec/support/client_registry_macros.rb
mongo-2.17.3 spec/support/client_registry_macros.rb
mongo-2.18.1 spec/support/client_registry_macros.rb
mongo-2.18.0 spec/support/client_registry_macros.rb
mongo-2.17.2 spec/support/client_registry_macros.rb
mongo-2.16.3 spec/support/client_registry_macros.rb
mongo-2.18.0.beta1 spec/support/client_registry_macros.rb
mongo-2.16.2 spec/support/client_registry_macros.rb
mongo-2.17.1 spec/support/client_registry_macros.rb
mongo-2.16.1 spec/support/client_registry_macros.rb
mongo-2.17.0 spec/support/client_registry_macros.rb
mongo-2.16.0 spec/support/client_registry_macros.rb
mongo-2.15.1 spec/support/client_registry_macros.rb
mongo-2.16.0.alpha1 spec/support/client_registry_macros.rb
mongo-2.15.0 spec/support/client_registry_macros.rb