#!/usr/bin/env ruby

$LOAD_PATH.unshift(File.expand_path('../../elasticsearch/lib', __dir__))
$LOAD_PATH.unshift(File.expand_path('../../elasticsearch-api/lib', __dir__))
$LOAD_PATH.unshift(File.expand_path('../../elasticsearch/lib/elasticsearch/helpers', __dir__))

require 'elasticsearch'
require 'elasticsearch-api'
require 'elasticsearch/helpers/bulk_helper'

include Elasticsearch

begin
  require 'pry'
rescue LoadError
end

begin
  require 'irb'
rescue LoadError
end

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