Sha256: 99f440e5afd4b0c291dd4c9981d5a1fd1de82d7e2172ffc33c3a0f047576437c

Contents?: true

Size: 1.82 KB

Versions: 42

Compression:

Stored size: 1.82 KB

Contents

module Embulk
  module Guess

    # TODO implement guess plugin to make this command work:
    #      $ embulk guess -g "${name}" partial-config.yml
    #
    #      Depending on the file format the plugin uses, you can use choose
    #      one of binary guess (GuessPlugin), text guess (TextGuessPlugin),
    #      or line guess (LineGuessPlugin).
#if (${language} == "ruby")

    # require "embulk/${embulkCategory}/${name}.rb"
#end

    # class ${rubyGuessClassName} < GuessPlugin
    #   Plugin.register_guess("${name}", self)
    #
    #   def guess(config, sample_buffer)
    #     if sample_buffer[0,2] == GZIP_HEADER
    #       guessed = {}
    #       guessed["type"] = "${name}"
    #       guessed["property1"] = "guessed-value"
    #       return {"parser" => guessed}
    #     else
    #       return {}
    #     end
    #   end
    # end

    # class ${rubyGuessClassName} < TextGuessPlugin
    #   Plugin.register_guess("${name}", self)
    #
    #   def guess_text(config, sample_text)
    #     js = JSON.parse(sample_text) rescue nil
    #     if js && js["mykeyword"] == "keyword"
    #       guessed = {}
    #       guessed["type"] = "${name}"
    #       guessed["property1"] = "guessed-value"
    #       return {"parser" => guessed}
    #     else
    #       return {}
    #     end
    #   end
    # end

    # class ${rubyGuessClassName} < LineGuessPlugin
    #   Plugin.register_guess("${name}", self)
    #
    #   def guess_lines(config, sample_lines)
    #     all_line_matched = sample_lines.all? do |line|
    #       line =~ /mypattern/
    #     end
    #     if all_line_matched
    #       guessed = {}
    #       guessed["type"] = "${name}"
    #       guessed["property1"] = "guessed-value"
    #       return {"parser" => guessed}
    #     else
    #       return {}
    #     end
    #   end
    # end

  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
embulk-0.8.39 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.39-java lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.38 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.38-java lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.37 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.37-java lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.36 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.36-java lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.35 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.35-java lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.34 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.34-java lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.33 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.33-java lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.32 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.32-java lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.31 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.31-java lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.30 lib/embulk/data/new/ruby/parser_guess.rb.vm
embulk-0.8.30-java lib/embulk/data/new/ruby/parser_guess.rb.vm