Sha256: 0ef977033e28965b4ebcedb376888b0390b5bc437044af31bd89979d12cdfd2b

Contents?: true

Size: 361 Bytes

Versions: 6

Compression:

Stored size: 361 Bytes

Contents

module ElasticHelper
  def index_exist?(index_name)
    out, err, status = Open3.capture3("curl -XGET '#{elastic_url}/#{index_name}/'")
    !out.include?('index_not_found_exception')
  end

  def remove_index(index_name)
    system("curl -XDELETE '#{elastic_url}/#{index_name}/' > /dev/null 2>&1")
  end

  def elastic_url
    'http://localhost:9200/'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gitlab-elasticsearch-git-0.0.15 spec/support/elastic_helper.rb
gitlab-elasticsearch-git-0.0.14 spec/support/elastic_helper.rb
gitlab-elasticsearch-git-0.0.13 spec/support/elastic_helper.rb
gitlab-elasticsearch-git-0.0.12 spec/support/elastic_helper.rb
gitlab-elasticsearch-git-0.0.11 spec/support/elastic_helper.rb
gitlab-elasticsearch-git-0.0.10 spec/support/elastic_helper.rb