Class: Embulk::Guess::Bzip2GuessPlugin
- Inherits:
-
Embulk::GuessPlugin
- Object
- Embulk::GuessPlugin
- Embulk::Guess::Bzip2GuessPlugin
- Defined in:
- lib/embulk/guess/bzip2.rb
Constant Summary collapse
- BZIP2_HEADER_PATTERN =
/BZh[1-9]#{Regexp.quote(block_magic)}/n
Instance Method Summary collapse
Methods inherited from Embulk::GuessPlugin
Instance Method Details
#guess(config, sample_buffer) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/embulk/guess/bzip2.rb', line 14 def guess(config, sample_buffer) if sample_buffer[0,10] =~ BZIP2_HEADER_PATTERN return {"decoders" => [{"type" => "bzip2"}]} end return {} end |