Sha256: a6e09079e65d5a9e986854180f6c826e5def8d643a450e6bc13b63d846d6fe67

Contents?: true

Size: 408 Bytes

Versions: 1

Compression:

Stored size: 408 Bytes

Contents

class FormatParser::M3UParser
  include FormatParser::IOUtils

  HEADER = '#EXTM3U'

  def likely_match?(filename)
    filename =~ /\.m3u8?$/i
  end

  def call(io)
    io = FormatParser::IOConstraint.new(io)

    header = safe_read(io, 7)
    return unless HEADER.eql?(header)

    FormatParser::Text.new(
      format: :m3u
    )
  end
  FormatParser.register_parser new, natures: :text, formats: :m3u
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
format_parser-0.26.0 lib/parsers/m3u_parser.rb