Sha256: efd4c6ce2062c905c228f422873811eb3346077e798239167da0205e89720209

Contents?: true

Size: 566 Bytes

Versions: 7

Compression:

Stored size: 566 Bytes

Contents

# encoding: utf-8

require_relative "yaml_visitor"

module LogStash module Filters module Dictionary
  class YamlFile < File

    protected

    def initialize_for_file_type
      @visitor = YamlVisitor.create
    end

    def read_file_into_dictionary
      # low level YAML read that tries to create as
      # few intermediate objects as possible
      # this overwrites the value at key
      @visitor.accept_with_dictionary(
        @dictionary, Psych.parse_stream(
          IO.read(@dictionary_path, :mode => 'r:bom|utf-8')
      ))
    end
  end
end end end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
logstash-filter-translate-3.4.0 lib/logstash/filters/dictionary/yaml_file.rb
logstash-filter-translate-3.3.1 lib/logstash/filters/dictionary/yaml_file.rb
logstash-filter-translate-3.3.0 lib/logstash/filters/dictionary/yaml_file.rb
logstash-filter-translate-3.2.3 lib/logstash/filters/dictionary/yaml_file.rb
logstash-filter-translate-3.2.2 lib/logstash/filters/dictionary/yaml_file.rb
logstash-filter-translate-3.2.1 lib/logstash/filters/dictionary/yaml_file.rb
logstash-filter-translate-3.2.0 lib/logstash/filters/dictionary/yaml_file.rb