Sha256: 98c4061733e203f938531c536b74db8ba461402b5e4292cf3753956e6cc6ca06

Contents?: true

Size: 1.73 KB

Versions: 12

Compression:

Stored size: 1.73 KB

Contents

module Embulk
  module Guess

    # TODO implement guess plugin to make this command work:
    #      $ embulk guess -g "poi_excel" 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).

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

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

    #class PoiExcel < LineGuessPlugin
    #  Plugin.register_guess("poi_excel", 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"] = "poi_excel"
    #      guessed["property1"] = "guessed-value"
    #      return {"parser" => guessed}
    #    else
    #      return {}
    #    end
    #  end
    #end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
embulk-parser-poi_excel-0.1.13 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.12 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.11 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.10 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.7 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.6 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.5 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.4 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.3 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.2 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.1 lib/embulk/guess/poi_excel.rb
embulk-parser-poi_excel-0.1.0 lib/embulk/guess/poi_excel.rb