Sha256: 7b40a0c17856a7658d99dedb08ac86fe2ace7e02b21dfdda5a6921eb4a765521

Contents?: true

Size: 668 Bytes

Versions: 15

Compression:

Stored size: 668 Bytes

Contents

require 'database_cleaner/generic/base'

module DatabaseCleaner
  module Moped
    def self.available_strategies
      %w[truncation]
    end

    module Base
      include ::DatabaseCleaner::Generic::Base

      def db=(desired_db)
        @db = desired_db
      end

      def db
        @db ||= :default
      end

      def host_port=(desired_host)
        @host = desired_host
      end

      def host
        @host ||= '127.0.0.1:27017'
      end

      def db_version
        @db_version ||= session.command('buildinfo' => 1)['version']
      end

      private

      def session
        ::Moped::Session.new([host], database: db)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
database_cleaner-1.7.0 lib/database_cleaner/moped/base.rb
database_cleaner-1.6.2 lib/database_cleaner/moped/base.rb
database_cleaner-1.6.1 lib/database_cleaner/moped/base.rb
database_cleaner-1.6.0 lib/database_cleaner/moped/base.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/moped/base.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/moped/base.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/moped/base.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/moped/base.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/moped/base.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/moped/base.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/moped/base.rb
database_cleaner-1.5.3 lib/database_cleaner/moped/base.rb
database_cleaner-1.5.2 lib/database_cleaner/moped/base.rb
database_cleaner-1.5.1 lib/database_cleaner/moped/base.rb
database_cleaner-1.5.0 lib/database_cleaner/moped/base.rb