esse 0.0.3 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exec/esse +3 -1
- data/lib/esse/backend/index/aliases.rb +8 -4
- data/lib/esse/backend/index/close.rb +6 -5
- data/lib/esse/backend/index/create.rb +20 -9
- data/lib/esse/backend/index/delete.rb +15 -14
- data/lib/esse/backend/index/documents.rb +2 -2
- data/lib/esse/backend/index/existance.rb +2 -3
- data/lib/esse/backend/index/open.rb +6 -5
- data/lib/esse/backend/index/refresh.rb +43 -0
- data/lib/esse/backend/index/reset.rb +33 -0
- data/lib/esse/backend/index/update.rb +37 -15
- data/lib/esse/backend/index.rb +18 -4
- data/lib/esse/backend/index_type/documents.rb +53 -42
- data/lib/esse/backend/index_type.rb +7 -2
- data/lib/esse/cli/event_listener.rb +87 -0
- data/lib/esse/cli/generate.rb +9 -4
- data/lib/esse/cli/index/base_operation.rb +76 -0
- data/lib/esse/cli/index/close.rb +26 -0
- data/lib/esse/cli/index/create.rb +26 -0
- data/lib/esse/cli/index/delete.rb +26 -0
- data/lib/esse/cli/index/import.rb +26 -0
- data/lib/esse/cli/index/open.rb +26 -0
- data/lib/esse/cli/index/reset.rb +26 -0
- data/lib/esse/cli/index/update_aliases.rb +32 -0
- data/lib/esse/cli/index/update_mapping.rb +33 -0
- data/lib/esse/cli/index/update_settings.rb +26 -0
- data/lib/esse/cli/index.rb +78 -2
- data/lib/esse/cli/templates/config.rb.erb +20 -0
- data/lib/esse/cli/templates/index.rb.erb +76 -11
- data/lib/esse/cli/templates/type_collection.rb.erb +41 -0
- data/lib/esse/cli/templates/{mappings.json → type_mappings.json} +0 -0
- data/lib/esse/cli/templates/type_serializer.rb.erb +23 -0
- data/lib/esse/cli.rb +75 -3
- data/lib/esse/cluster.rb +22 -6
- data/lib/esse/config.rb +39 -5
- data/lib/esse/core.rb +18 -36
- data/lib/esse/errors.rb +47 -0
- data/lib/esse/events/bus.rb +103 -0
- data/lib/esse/events/event.rb +64 -0
- data/lib/esse/events/publisher.rb +119 -0
- data/lib/esse/events.rb +49 -0
- data/lib/esse/index/backend.rb +2 -1
- data/lib/esse/index/base.rb +4 -6
- data/lib/esse/index/mappings.rb +2 -3
- data/lib/esse/index/settings.rb +7 -8
- data/lib/esse/index.rb +2 -1
- data/lib/esse/index_mapping.rb +2 -2
- data/lib/esse/index_setting.rb +8 -4
- data/lib/esse/index_type/actions.rb +2 -1
- data/lib/esse/index_type/backend.rb +2 -1
- data/lib/esse/index_type/mappings.rb +2 -2
- data/lib/esse/index_type.rb +6 -1
- data/lib/esse/logging.rb +19 -0
- data/lib/esse/object_document_mapper.rb +96 -0
- data/lib/esse/primitives/hash_utils.rb +40 -0
- data/lib/esse/primitives/hstring.rb +4 -3
- data/lib/esse/primitives/output.rb +64 -0
- data/lib/esse/primitives.rb +1 -0
- data/lib/esse/template_loader.rb +1 -1
- data/lib/esse/version.rb +1 -1
- data/lib/esse.rb +12 -3
- metadata +124 -21
- data/.gitignore +0 -12
- data/.rubocop.yml +0 -128
- data/CHANGELOG.md +0 -0
- data/Gemfile +0 -7
- data/Gemfile.lock +0 -60
- data/LICENSE.txt +0 -21
- data/README.md +0 -52
- data/Rakefile +0 -4
- data/bin/console +0 -22
- data/bin/setup +0 -8
- data/esse.gemspec +0 -39
- data/lib/esse/cli/templates/serializer.rb.erb +0 -14
- data/lib/esse/index_type/serializer.rb +0 -87
| @@ -0,0 +1,96 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Esse
         | 
| 4 | 
            +
              module ObjectDocumentMapper
         | 
| 5 | 
            +
                # Convert ruby object to json. Arguments will be same of passed through the
         | 
| 6 | 
            +
                # collection. It's allowed a block or a class with the `to_h` instance method.
         | 
| 7 | 
            +
                # Example with block
         | 
| 8 | 
            +
                #   serializer do |model, **context|
         | 
| 9 | 
            +
                #     {
         | 
| 10 | 
            +
                #       id: model.id,
         | 
| 11 | 
            +
                #       admin: context[:is_admin],
         | 
| 12 | 
            +
                #     }
         | 
| 13 | 
            +
                #   end
         | 
| 14 | 
            +
                # Example with serializer class
         | 
| 15 | 
            +
                #   serializer UserSerializer
         | 
| 16 | 
            +
                def serializer(klass = nil, &block)
         | 
| 17 | 
            +
                  if block
         | 
| 18 | 
            +
                    @serializer_proc = block
         | 
| 19 | 
            +
                  elsif klass.is_a?(Class) && klass.instance_methods.include?(:to_h)
         | 
| 20 | 
            +
                    @serializer_proc = proc { |*args, **kwargs| klass.new(*args, **kwargs).to_h }
         | 
| 21 | 
            +
                  elsif klass.is_a?(Class) && klass.instance_methods.include?(:as_json) # backward compatibility
         | 
| 22 | 
            +
                    @serializer_proc = proc { |*args, **kwargs| klass.new(*args, **kwargs).as_json }
         | 
| 23 | 
            +
                  elsif klass.is_a?(Class) && klass.instance_methods.include?(:call)
         | 
| 24 | 
            +
                    @serializer_proc = proc { |*args, **kwargs| klass.new(*args, **kwargs).call }
         | 
| 25 | 
            +
                  else
         | 
| 26 | 
            +
                    msg = format('%<arg>p is not a valid serializer. The serializer should ' \
         | 
| 27 | 
            +
                                  'respond with `to_h` instance method.', arg: klass,)
         | 
| 28 | 
            +
                    raise ArgumentError, msg
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                def serialize(model, *args, **kwargs)
         | 
| 33 | 
            +
                  unless @serializer_proc
         | 
| 34 | 
            +
                    raise NotImplementedError, format('there is no serializer defined for the %<k>p index', k: to_s)
         | 
| 35 | 
            +
                  end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                  @serializer_proc.call(model, *args, **kwargs)
         | 
| 38 | 
            +
                end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                # Used to define the source of data. A block is required. And its
         | 
| 41 | 
            +
                # content should yield an array of each object that should be serialized.
         | 
| 42 | 
            +
                # The list of arguments will be passed throught the serializer method.
         | 
| 43 | 
            +
                #
         | 
| 44 | 
            +
                # Here is an example of how this should work:
         | 
| 45 | 
            +
                #   collection do |conditions, &block|
         | 
| 46 | 
            +
                #     User.where(conditions).find_in_batches(batch_size: 5000) do |batch|
         | 
| 47 | 
            +
                #       block.call(batch, conditions)
         | 
| 48 | 
            +
                #     end
         | 
| 49 | 
            +
                #   end
         | 
| 50 | 
            +
                def collection(collection_class = nil, &block)
         | 
| 51 | 
            +
                  raise ArgumentError, 'a collection class or a block is required' if block.nil? && collection_class.nil?
         | 
| 52 | 
            +
             | 
| 53 | 
            +
                  if block.nil? && collection_class.is_a?(Class) && !collection_class.include?(Enumerable)
         | 
| 54 | 
            +
                    msg = '%<arg>p is not a valid collection class.' \
         | 
| 55 | 
            +
                          ' Collections should implement the Enumerable interface'
         | 
| 56 | 
            +
                    raise ArgumentError, format(msg, arg: collection_class)
         | 
| 57 | 
            +
                  end
         | 
| 58 | 
            +
             | 
| 59 | 
            +
                  @collection_proc = collection_class || block
         | 
| 60 | 
            +
                end
         | 
| 61 | 
            +
             | 
| 62 | 
            +
                # Used to fetch all batch of data defined on the collection model.
         | 
| 63 | 
            +
                # Arguments can be anything. They will just be passed through the block.
         | 
| 64 | 
            +
                # Useful when the collection depends on scope or any other conditions
         | 
| 65 | 
            +
                # Example
         | 
| 66 | 
            +
                #   each_batch(active: true) do |data, _opts|
         | 
| 67 | 
            +
                #     puts data.size
         | 
| 68 | 
            +
                #   end
         | 
| 69 | 
            +
                def each_batch(*args, **kwargs, &block)
         | 
| 70 | 
            +
                  unless @collection_proc
         | 
| 71 | 
            +
                    raise NotImplementedError, format('there is no collection defined for the %<k>p index', k: to_s)
         | 
| 72 | 
            +
                  end
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                  case @collection_proc
         | 
| 75 | 
            +
                  when Class
         | 
| 76 | 
            +
                    @collection_proc.new(*args, **kwargs).each(&block)
         | 
| 77 | 
            +
                  else
         | 
| 78 | 
            +
                    @collection_proc.call(*args, **kwargs, &block)
         | 
| 79 | 
            +
                  end
         | 
| 80 | 
            +
                rescue LocalJumpError
         | 
| 81 | 
            +
                  raise(SyntaxError, 'block must be explicitly declared in the collection definition')
         | 
| 82 | 
            +
                end
         | 
| 83 | 
            +
             | 
| 84 | 
            +
                # Wrap collection data into serialized batches
         | 
| 85 | 
            +
                #
         | 
| 86 | 
            +
                # @param args [*Object] Any argument is allowed here. The collection will be called with same arguments.
         | 
| 87 | 
            +
                #   And the serializer will be initialized with those arguments too.
         | 
| 88 | 
            +
                # @yield [Array, *Object] serialized collection and method arguments
         | 
| 89 | 
            +
                def each_serialized_batch(*args, **kwargs, &block)
         | 
| 90 | 
            +
                  each_batch(*args, **kwargs) do |batch|
         | 
| 91 | 
            +
                    entries = batch.map { |entry| serialize(entry, *args, **kwargs) }.compact
         | 
| 92 | 
            +
                    block.call(entries, *args, **kwargs)
         | 
| 93 | 
            +
                  end
         | 
| 94 | 
            +
                end
         | 
| 95 | 
            +
              end
         | 
| 96 | 
            +
            end
         | 
| @@ -0,0 +1,40 @@ | |
| 1 | 
            +
            require 'forwardable'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Esse
         | 
| 4 | 
            +
              # The idea here is to add useful methods to the ruby standard objects without
         | 
| 5 | 
            +
              # monkey patching them
         | 
| 6 | 
            +
              module HashUtils
         | 
| 7 | 
            +
                module_function
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                def deep_transform_keys(hash, &block)
         | 
| 10 | 
            +
                  hash.each_with_object({}) do |(key, value), result|
         | 
| 11 | 
            +
                    result[yield(key)] = \
         | 
| 12 | 
            +
                      if value.is_a?(Hash)
         | 
| 13 | 
            +
                        deep_transform_keys(value, &block)
         | 
| 14 | 
            +
                      else
         | 
| 15 | 
            +
                        value
         | 
| 16 | 
            +
                      end
         | 
| 17 | 
            +
                  end
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                def deep_merge(target, source)
         | 
| 21 | 
            +
                  target.merge(source) do |key, oldval, newval|
         | 
| 22 | 
            +
                    if oldval.is_a?(Hash) && newval.is_a?(Hash)
         | 
| 23 | 
            +
                      deep_merge(oldval, newval)
         | 
| 24 | 
            +
                    else
         | 
| 25 | 
            +
                      newval
         | 
| 26 | 
            +
                    end
         | 
| 27 | 
            +
                  end
         | 
| 28 | 
            +
                end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                def deep_merge!(target, source)
         | 
| 31 | 
            +
                  target.merge!(source) do |key, oldval, newval|
         | 
| 32 | 
            +
                    if oldval.is_a?(Hash) && newval.is_a?(Hash)
         | 
| 33 | 
            +
                      deep_merge!(oldval, newval)
         | 
| 34 | 
            +
                    else
         | 
| 35 | 
            +
                      newval
         | 
| 36 | 
            +
                    end
         | 
| 37 | 
            +
                  end
         | 
| 38 | 
            +
                end
         | 
| 39 | 
            +
              end
         | 
| 40 | 
            +
            end
         | 
| @@ -9,7 +9,7 @@ module Esse | |
| 9 9 | 
             
              class Hstring
         | 
| 10 10 | 
             
                extend Forwardable
         | 
| 11 11 |  | 
| 12 | 
            -
                def_delegators :@value, :==, :eq, :to_s, :inspect, :sub, :capitalize
         | 
| 12 | 
            +
                def_delegators :@value, :==, :eq, :to_s, :to_sym, :inspect, :sub, :capitalize
         | 
| 13 13 | 
             
                attr_reader :value
         | 
| 14 14 |  | 
| 15 15 | 
             
                def self.def_conventional(bang_method, conv_method = nil)
         | 
| @@ -54,18 +54,19 @@ module Esse | |
| 54 54 | 
             
                def_conventional :demodulize!
         | 
| 55 55 |  | 
| 56 56 | 
             
                def modulize!
         | 
| 57 | 
            -
                  @value = @value.split(%r{ | 
| 57 | 
            +
                  @value = @value.split(%r{::|\\|/}).map { |part| self.class.new(part).camelize.to_s }.join('::')
         | 
| 58 58 | 
             
                  self
         | 
| 59 59 | 
             
                end
         | 
| 60 60 | 
             
                def_conventional :modulize!
         | 
| 61 61 |  | 
| 62 62 | 
             
                def underscore!
         | 
| 63 63 | 
             
                  @value = @value
         | 
| 64 | 
            -
                    .sub( | 
| 64 | 
            +
                    .sub(/^::/, '')
         | 
| 65 65 | 
             
                    .gsub('::', '/')
         | 
| 66 66 | 
             
                    .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
         | 
| 67 67 | 
             
                    .gsub(/([a-z\d])([A-Z])/, '\1_\2')
         | 
| 68 68 | 
             
                    .tr('-', '_')
         | 
| 69 | 
            +
                    .tr('.', '_')
         | 
| 69 70 | 
             
                    .gsub(/\s/, '_')
         | 
| 70 71 | 
             
                    .gsub(/__+/, '_')
         | 
| 71 72 | 
             
                    .downcase
         | 
| @@ -0,0 +1,64 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            begin
         | 
| 4 | 
            +
              require 'rainbow'
         | 
| 5 | 
            +
            rescue LoadError
         | 
| 6 | 
            +
            end
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            module Esse
         | 
| 9 | 
            +
              module Output
         | 
| 10 | 
            +
                module_function
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                def formatted_runtime(number)
         | 
| 13 | 
            +
                  colorize(sprintf('%.3f ms', number), :lightgray)
         | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                def runtime_padding(number, extra = 2)
         | 
| 17 | 
            +
                  ' ' * (extra + sprintf('%.3f ms', number).size)
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                def colorize(text, *attributes)
         | 
| 21 | 
            +
                  if defined? Rainbow
         | 
| 22 | 
            +
                    attributes.reduce(Rainbow(text)) { |p, a| p.public_send(a) }
         | 
| 23 | 
            +
                  else
         | 
| 24 | 
            +
                    text
         | 
| 25 | 
            +
                  end
         | 
| 26 | 
            +
                end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                def print_error(message_or_error, backtrace: false, **options)
         | 
| 29 | 
            +
                  options[:level] ||= :error
         | 
| 30 | 
            +
                  message = message_or_error.to_s
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                  print_message(message, output: :stderr, **options)
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                  if message_or_error.is_a?(Exception) && backtrace
         | 
| 35 | 
            +
                    limit = backtrace.is_a?(Integer) ? backtrace : -1
         | 
| 36 | 
            +
                    print_backtrace(message_or_error, limit: limit, level: options[:level])
         | 
| 37 | 
            +
                  end
         | 
| 38 | 
            +
                end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                def print_backtrace(error, limit: -1, **options)
         | 
| 41 | 
            +
                  return unless error.respond_to?(:backtrace)
         | 
| 42 | 
            +
                  return if error.backtrace.nil?
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                  error.backtrace[0..limit].each { |frame| print_error(frame, **options) }
         | 
| 45 | 
            +
                end
         | 
| 46 | 
            +
             | 
| 47 | 
            +
                def print_message(message, level: :info, output: $stdout, newline: true, **fields)
         | 
| 48 | 
            +
                  output = \
         | 
| 49 | 
            +
                    case output
         | 
| 50 | 
            +
                    when :stdout, 'stdout'
         | 
| 51 | 
            +
                      $stdout
         | 
| 52 | 
            +
                    when :stderr, 'stderr'
         | 
| 53 | 
            +
                      $stderr
         | 
| 54 | 
            +
                    when IO, StringIO
         | 
| 55 | 
            +
                      output
         | 
| 56 | 
            +
                    else
         | 
| 57 | 
            +
                      raise ArgumentError, "Invalid output #{output.inspect}"
         | 
| 58 | 
            +
                    end
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                  message = format(message, **fields)
         | 
| 61 | 
            +
                  newline ? output.puts(message) : output.print(message)
         | 
| 62 | 
            +
                end
         | 
| 63 | 
            +
              end
         | 
| 64 | 
            +
            end
         | 
    
        data/lib/esse/primitives.rb
    CHANGED
    
    
    
        data/lib/esse/template_loader.rb
    CHANGED
    
    | @@ -24,7 +24,7 @@ module Esse | |
| 24 24 | 
             
                  path = nil
         | 
| 25 25 | 
             
                  @directories.each do |dir|
         | 
| 26 26 | 
             
                    patterns.find do |pattern|
         | 
| 27 | 
            -
                      path = Dir[dir.join("#{pattern}.{#{@extensions.join( | 
| 27 | 
            +
                      path = Dir[dir.join("#{pattern}.{#{@extensions.join(",")}}")].first
         | 
| 28 28 | 
             
                      break if path
         | 
| 29 29 | 
             
                    end
         | 
| 30 30 | 
             
                    break if path
         | 
    
        data/lib/esse/version.rb
    CHANGED
    
    
    
        data/lib/esse.rb
    CHANGED
    
    | @@ -1,10 +1,19 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            require_relative 'esse/core'
         | 
| 4 | 
            +
            require_relative 'esse/errors'
         | 
| 5 | 
            +
            require_relative 'esse/index'
         | 
| 4 6 |  | 
| 5 7 | 
             
            module Esse
         | 
| 6 8 | 
             
              SETTING_ROOT_KEY = 'settings'
         | 
| 7 9 | 
             
              MAPPING_ROOT_KEY = 'mappings'
         | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            +
              CLI_IGNORE_OPTS = %i[
         | 
| 11 | 
            +
                require
         | 
| 12 | 
            +
                silent
         | 
| 13 | 
            +
              ].freeze
         | 
| 14 | 
            +
              CLI_CONFIG_PATHS = %w[
         | 
| 15 | 
            +
                Essefile
         | 
| 16 | 
            +
                config/esse.rb
         | 
| 17 | 
            +
                config/initializers/esse.rb
         | 
| 18 | 
            +
              ].freeze
         | 
| 10 19 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: esse
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.1.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Marcos G. Zimmermann
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 | 
            -
            bindir:  | 
| 9 | 
            +
            bindir: exec
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2022-01-31 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: elasticsearch
         | 
| @@ -53,7 +53,7 @@ dependencies: | |
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 54 | 
             
                    version: '0.19'
         | 
| 55 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            -
              name:  | 
| 56 | 
            +
              name: awesome_print
         | 
| 57 57 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 58 | 
             
                requirements:
         | 
| 59 59 | 
             
                - - ">="
         | 
| @@ -67,7 +67,7 @@ dependencies: | |
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 68 | 
             
                    version: '0'
         | 
| 69 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            -
              name:  | 
| 70 | 
            +
              name: dotenv
         | 
| 71 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 72 | 
             
                requirements:
         | 
| 73 73 | 
             
                - - ">="
         | 
| @@ -122,26 +122,106 @@ dependencies: | |
| 122 122 | 
             
                - - "~>"
         | 
| 123 123 | 
             
                  - !ruby/object:Gem::Version
         | 
| 124 124 | 
             
                    version: '3.0'
         | 
| 125 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 126 | 
            +
              name: webmock
         | 
| 127 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 128 | 
            +
                requirements:
         | 
| 129 | 
            +
                - - "~>"
         | 
| 130 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 131 | 
            +
                    version: '3.14'
         | 
| 132 | 
            +
              type: :development
         | 
| 133 | 
            +
              prerelease: false
         | 
| 134 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 135 | 
            +
                requirements:
         | 
| 136 | 
            +
                - - "~>"
         | 
| 137 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 138 | 
            +
                    version: '3.14'
         | 
| 139 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 140 | 
            +
              name: yard
         | 
| 141 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 142 | 
            +
                requirements:
         | 
| 143 | 
            +
                - - "~>"
         | 
| 144 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 145 | 
            +
                    version: 0.9.20
         | 
| 146 | 
            +
              type: :development
         | 
| 147 | 
            +
              prerelease: false
         | 
| 148 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 149 | 
            +
                requirements:
         | 
| 150 | 
            +
                - - "~>"
         | 
| 151 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 152 | 
            +
                    version: 0.9.20
         | 
| 153 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 154 | 
            +
              name: standard
         | 
| 155 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 156 | 
            +
                requirements:
         | 
| 157 | 
            +
                - - "~>"
         | 
| 158 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 159 | 
            +
                    version: '1.3'
         | 
| 160 | 
            +
              type: :development
         | 
| 161 | 
            +
              prerelease: false
         | 
| 162 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 163 | 
            +
                requirements:
         | 
| 164 | 
            +
                - - "~>"
         | 
| 165 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 166 | 
            +
                    version: '1.3'
         | 
| 167 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 168 | 
            +
              name: rubocop
         | 
| 169 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 170 | 
            +
                requirements:
         | 
| 171 | 
            +
                - - "~>"
         | 
| 172 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 173 | 
            +
                    version: '1.20'
         | 
| 174 | 
            +
              type: :development
         | 
| 175 | 
            +
              prerelease: false
         | 
| 176 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 177 | 
            +
                requirements:
         | 
| 178 | 
            +
                - - "~>"
         | 
| 179 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 180 | 
            +
                    version: '1.20'
         | 
| 181 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 182 | 
            +
              name: rubocop-performance
         | 
| 183 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 184 | 
            +
                requirements:
         | 
| 185 | 
            +
                - - "~>"
         | 
| 186 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 187 | 
            +
                    version: '1.11'
         | 
| 188 | 
            +
                - - ">="
         | 
| 189 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 190 | 
            +
                    version: 1.11.5
         | 
| 191 | 
            +
              type: :development
         | 
| 192 | 
            +
              prerelease: false
         | 
| 193 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 194 | 
            +
                requirements:
         | 
| 195 | 
            +
                - - "~>"
         | 
| 196 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 197 | 
            +
                    version: '1.11'
         | 
| 198 | 
            +
                - - ">="
         | 
| 199 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 200 | 
            +
                    version: 1.11.5
         | 
| 201 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 202 | 
            +
              name: rubocop-rspec
         | 
| 203 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 204 | 
            +
                requirements:
         | 
| 205 | 
            +
                - - "~>"
         | 
| 206 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 207 | 
            +
                    version: '2.4'
         | 
| 208 | 
            +
              type: :development
         | 
| 209 | 
            +
              prerelease: false
         | 
| 210 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 211 | 
            +
                requirements:
         | 
| 212 | 
            +
                - - "~>"
         | 
| 213 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 214 | 
            +
                    version: '2.4'
         | 
| 125 215 | 
             
            description: All the elegance of ruby with the elasticsearch flexibility. This gem
         | 
| 126 216 | 
             
              is a pretty simple but excential helpers to deal with mapping, indexing, serialization
         | 
| 127 217 | 
             
              and search.
         | 
| 128 218 | 
             
            email:
         | 
| 129 219 | 
             
            - mgzmaster@gmail.com
         | 
| 130 | 
            -
            executables: | 
| 220 | 
            +
            executables:
         | 
| 221 | 
            +
            - esse
         | 
| 131 222 | 
             
            extensions: []
         | 
| 132 223 | 
             
            extra_rdoc_files: []
         | 
| 133 224 | 
             
            files:
         | 
| 134 | 
            -
            - ".gitignore"
         | 
| 135 | 
            -
            - ".rubocop.yml"
         | 
| 136 | 
            -
            - CHANGELOG.md
         | 
| 137 | 
            -
            - Gemfile
         | 
| 138 | 
            -
            - Gemfile.lock
         | 
| 139 | 
            -
            - LICENSE.txt
         | 
| 140 | 
            -
            - README.md
         | 
| 141 | 
            -
            - Rakefile
         | 
| 142 | 
            -
            - bin/console
         | 
| 143 | 
            -
            - bin/setup
         | 
| 144 | 
            -
            - esse.gemspec
         | 
| 145 225 | 
             
            - exec/esse
         | 
| 146 226 | 
             
            - lib/esse.rb
         | 
| 147 227 | 
             
            - lib/esse/backend/index.rb
         | 
| @@ -152,19 +232,39 @@ files: | |
| 152 232 | 
             
            - lib/esse/backend/index/documents.rb
         | 
| 153 233 | 
             
            - lib/esse/backend/index/existance.rb
         | 
| 154 234 | 
             
            - lib/esse/backend/index/open.rb
         | 
| 235 | 
            +
            - lib/esse/backend/index/refresh.rb
         | 
| 236 | 
            +
            - lib/esse/backend/index/reset.rb
         | 
| 155 237 | 
             
            - lib/esse/backend/index/update.rb
         | 
| 156 238 | 
             
            - lib/esse/backend/index_type.rb
         | 
| 157 239 | 
             
            - lib/esse/backend/index_type/documents.rb
         | 
| 158 240 | 
             
            - lib/esse/cli.rb
         | 
| 159 241 | 
             
            - lib/esse/cli/base.rb
         | 
| 242 | 
            +
            - lib/esse/cli/event_listener.rb
         | 
| 160 243 | 
             
            - lib/esse/cli/generate.rb
         | 
| 161 244 | 
             
            - lib/esse/cli/index.rb
         | 
| 245 | 
            +
            - lib/esse/cli/index/base_operation.rb
         | 
| 246 | 
            +
            - lib/esse/cli/index/close.rb
         | 
| 247 | 
            +
            - lib/esse/cli/index/create.rb
         | 
| 248 | 
            +
            - lib/esse/cli/index/delete.rb
         | 
| 249 | 
            +
            - lib/esse/cli/index/import.rb
         | 
| 250 | 
            +
            - lib/esse/cli/index/open.rb
         | 
| 251 | 
            +
            - lib/esse/cli/index/reset.rb
         | 
| 252 | 
            +
            - lib/esse/cli/index/update_aliases.rb
         | 
| 253 | 
            +
            - lib/esse/cli/index/update_mapping.rb
         | 
| 254 | 
            +
            - lib/esse/cli/index/update_settings.rb
         | 
| 255 | 
            +
            - lib/esse/cli/templates/config.rb.erb
         | 
| 162 256 | 
             
            - lib/esse/cli/templates/index.rb.erb
         | 
| 163 | 
            -
            - lib/esse/cli/templates/ | 
| 164 | 
            -
            - lib/esse/cli/templates/ | 
| 257 | 
            +
            - lib/esse/cli/templates/type_collection.rb.erb
         | 
| 258 | 
            +
            - lib/esse/cli/templates/type_mappings.json
         | 
| 259 | 
            +
            - lib/esse/cli/templates/type_serializer.rb.erb
         | 
| 165 260 | 
             
            - lib/esse/cluster.rb
         | 
| 166 261 | 
             
            - lib/esse/config.rb
         | 
| 167 262 | 
             
            - lib/esse/core.rb
         | 
| 263 | 
            +
            - lib/esse/errors.rb
         | 
| 264 | 
            +
            - lib/esse/events.rb
         | 
| 265 | 
            +
            - lib/esse/events/bus.rb
         | 
| 266 | 
            +
            - lib/esse/events/event.rb
         | 
| 267 | 
            +
            - lib/esse/events/publisher.rb
         | 
| 168 268 | 
             
            - lib/esse/index.rb
         | 
| 169 269 | 
             
            - lib/esse/index/actions.rb
         | 
| 170 270 | 
             
            - lib/esse/index/backend.rb
         | 
| @@ -181,9 +281,12 @@ files: | |
| 181 281 | 
             
            - lib/esse/index_type/actions.rb
         | 
| 182 282 | 
             
            - lib/esse/index_type/backend.rb
         | 
| 183 283 | 
             
            - lib/esse/index_type/mappings.rb
         | 
| 184 | 
            -
            - lib/esse/ | 
| 284 | 
            +
            - lib/esse/logging.rb
         | 
| 285 | 
            +
            - lib/esse/object_document_mapper.rb
         | 
| 185 286 | 
             
            - lib/esse/primitives.rb
         | 
| 287 | 
            +
            - lib/esse/primitives/hash_utils.rb
         | 
| 186 288 | 
             
            - lib/esse/primitives/hstring.rb
         | 
| 289 | 
            +
            - lib/esse/primitives/output.rb
         | 
| 187 290 | 
             
            - lib/esse/template_loader.rb
         | 
| 188 291 | 
             
            - lib/esse/version.rb
         | 
| 189 292 | 
             
            homepage: https://github.com/marcosgz/esse
         | 
| @@ -208,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 208 311 | 
             
                - !ruby/object:Gem::Version
         | 
| 209 312 | 
             
                  version: '0'
         | 
| 210 313 | 
             
            requirements: []
         | 
| 211 | 
            -
            rubygems_version: 3.1 | 
| 314 | 
            +
            rubygems_version: 3.0.3.1
         | 
| 212 315 | 
             
            signing_key: 
         | 
| 213 316 | 
             
            specification_version: 4
         | 
| 214 317 | 
             
            summary: Pure Ruby toolkit based on official elasticsearch-ruby library. (No! It isn't
         | 
    
        data/.gitignore
    DELETED
    
    
    
        data/.rubocop.yml
    DELETED
    
    | @@ -1,128 +0,0 @@ | |
| 1 | 
            -
            AllCops:
         | 
| 2 | 
            -
              Exclude:
         | 
| 3 | 
            -
                - 'bin/**/*'
         | 
| 4 | 
            -
                - 'log/**/*'
         | 
| 5 | 
            -
                - 'tmp/**/*'
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            Layout/HashAlignment:
         | 
| 8 | 
            -
              Enabled: true
         | 
| 9 | 
            -
              EnforcedLastArgumentHashStyle: always_ignore
         | 
| 10 | 
            -
             | 
| 11 | 
            -
            Layout/ParameterAlignment:
         | 
| 12 | 
            -
              EnforcedStyle: with_fixed_indentation
         | 
| 13 | 
            -
             | 
| 14 | 
            -
            Layout/CaseIndentation:
         | 
| 15 | 
            -
              EnforcedStyle: end
         | 
| 16 | 
            -
             | 
| 17 | 
            -
            Layout/FirstHashElementIndentation:
         | 
| 18 | 
            -
              Enabled: false
         | 
| 19 | 
            -
             | 
| 20 | 
            -
            Layout/MultilineMethodCallIndentation:
         | 
| 21 | 
            -
              EnforcedStyle: indented
         | 
| 22 | 
            -
             | 
| 23 | 
            -
            Layout/MultilineOperationIndentation:
         | 
| 24 | 
            -
              EnforcedStyle: indented
         | 
| 25 | 
            -
             | 
| 26 | 
            -
            Layout/SpaceInsideHashLiteralBraces:
         | 
| 27 | 
            -
              Enabled: false
         | 
| 28 | 
            -
             | 
| 29 | 
            -
            Metrics/AbcSize:
         | 
| 30 | 
            -
              Max: 20
         | 
| 31 | 
            -
             | 
| 32 | 
            -
            Metrics/BlockLength:
         | 
| 33 | 
            -
              Exclude:
         | 
| 34 | 
            -
                - '**/*.rake'
         | 
| 35 | 
            -
                - 'spec/**/*.rb'
         | 
| 36 | 
            -
             | 
| 37 | 
            -
            Metrics/ClassLength:
         | 
| 38 | 
            -
              Max: 100
         | 
| 39 | 
            -
             | 
| 40 | 
            -
            Layout/LineLength:
         | 
| 41 | 
            -
              Max: 130
         | 
| 42 | 
            -
             | 
| 43 | 
            -
            Metrics/MethodLength:
         | 
| 44 | 
            -
              CountComments: false
         | 
| 45 | 
            -
              Max: 20
         | 
| 46 | 
            -
             | 
| 47 | 
            -
            Metrics/ModuleLength:
         | 
| 48 | 
            -
              Max: 100
         | 
| 49 | 
            -
             | 
| 50 | 
            -
            Style/AsciiComments:
         | 
| 51 | 
            -
              Enabled: false
         | 
| 52 | 
            -
             | 
| 53 | 
            -
            Style/BlockDelimiters:
         | 
| 54 | 
            -
              Exclude:
         | 
| 55 | 
            -
                - spec/**/*_spec.rb
         | 
| 56 | 
            -
             | 
| 57 | 
            -
            Style/TrailingCommaInHashLiteral:
         | 
| 58 | 
            -
              EnforcedStyleForMultiline: consistent_comma
         | 
| 59 | 
            -
             | 
| 60 | 
            -
            Layout/SpaceAroundMethodCallOperator:
         | 
| 61 | 
            -
              Enabled: true
         | 
| 62 | 
            -
             | 
| 63 | 
            -
            Lint/RaiseException:
         | 
| 64 | 
            -
              Enabled: true
         | 
| 65 | 
            -
             | 
| 66 | 
            -
            Lint/StructNewOverride:
         | 
| 67 | 
            -
              Enabled: true
         | 
| 68 | 
            -
             | 
| 69 | 
            -
            Style/ExponentialNotation:
         | 
| 70 | 
            -
              Enabled: true
         | 
| 71 | 
            -
             | 
| 72 | 
            -
            Style/HashEachMethods:
         | 
| 73 | 
            -
              Enabled: true
         | 
| 74 | 
            -
             | 
| 75 | 
            -
            Style/HashTransformKeys:
         | 
| 76 | 
            -
              Enabled: true
         | 
| 77 | 
            -
             | 
| 78 | 
            -
            Style/HashTransformValues:
         | 
| 79 | 
            -
              Enabled: true
         | 
| 80 | 
            -
             | 
| 81 | 
            -
            Style/CollectionMethods:
         | 
| 82 | 
            -
              Enabled: true
         | 
| 83 | 
            -
              PreferredMethods:
         | 
| 84 | 
            -
                  collect: map
         | 
| 85 | 
            -
                  collect!: map!
         | 
| 86 | 
            -
                  detect: find
         | 
| 87 | 
            -
                  find_all: select
         | 
| 88 | 
            -
                  inject: reduce
         | 
| 89 | 
            -
                  length: size
         | 
| 90 | 
            -
             | 
| 91 | 
            -
            Style/Documentation:
         | 
| 92 | 
            -
              Enabled: false
         | 
| 93 | 
            -
             | 
| 94 | 
            -
            Style/FormatString:
         | 
| 95 | 
            -
              EnforcedStyle: format
         | 
| 96 | 
            -
             | 
| 97 | 
            -
            Style/StringLiterals:
         | 
| 98 | 
            -
              EnforcedStyle: single_quotes
         | 
| 99 | 
            -
             | 
| 100 | 
            -
            Style/GuardClause:
         | 
| 101 | 
            -
              Enabled: false
         | 
| 102 | 
            -
             | 
| 103 | 
            -
            Style/IfUnlessModifier:
         | 
| 104 | 
            -
              Enabled: false
         | 
| 105 | 
            -
             | 
| 106 | 
            -
            Style/Lambda:
         | 
| 107 | 
            -
              Enabled: false
         | 
| 108 | 
            -
             | 
| 109 | 
            -
            Style/RaiseArgs:
         | 
| 110 | 
            -
              Enabled: false
         | 
| 111 | 
            -
             | 
| 112 | 
            -
            Style/SignalException:
         | 
| 113 | 
            -
              Enabled: false
         | 
| 114 | 
            -
             | 
| 115 | 
            -
            Style/SingleLineBlockParams:
         | 
| 116 | 
            -
              Enabled: false
         | 
| 117 | 
            -
             | 
| 118 | 
            -
            Style/TrailingCommaInArguments:
         | 
| 119 | 
            -
              EnforcedStyleForMultiline: consistent_comma
         | 
| 120 | 
            -
             | 
| 121 | 
            -
            Style/TrivialAccessors:
         | 
| 122 | 
            -
              AllowPredicates: true
         | 
| 123 | 
            -
             | 
| 124 | 
            -
            Style/WordArray:
         | 
| 125 | 
            -
              Enabled: false
         | 
| 126 | 
            -
             | 
| 127 | 
            -
            Layout/EndAlignment:
         | 
| 128 | 
            -
              EnforcedStyleAlignWith: variable
         | 
    
        data/CHANGELOG.md
    DELETED
    
    | 
            File without changes
         |