Sha256: 16fc8dabfc449d2c171ea5d37119a908b546d4eecb3ba2e8f957ee73b24809c0

Contents?: true

Size: 608 Bytes

Versions: 1

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

require_relative 'base_operation'

module Esse
  module CLI
    class Index::Import < Index::BaseOperation
      def run
        validate_options!
        indices.each do |index|
          if (repo = @options[:repo])
            index.elasticsearch.import!(repo, **options)
          else
            index.elasticsearch.import!(**options)
          end
        end
      end

      private

      def options
        @options.slice(*@options.keys - CLI_IGNORE_OPTS - [:repo])
      end

      def validate_options!
        validate_indices_option!
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esse-0.2.2 lib/esse/cli/index/import.rb