#!/usr/bin/env ruby
# frozen_string_literal: true

$LOAD_PATH[0, 0] = File.join(File.dirname(__FILE__), '..', 'lib')

require 'mongo'
# include the mongo namespace so its constants are available unqualified
Object.include(Mongo)

begin
  require 'pry'
rescue LoadError
end

begin
  require 'irb'
rescue LoadError
end

if defined?(Pry)
  Pry.config.prompt_name = 'mongo'
  Pry.start
elsif defined?(IRB)
  IRB.start
else
  abort 'LoadError: mongo_console requires Pry or IRB'
end
