File: parsers.rb

package info (click to toggle)
ruby-mail 2.6.4%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,256 kB
  • ctags: 1,327
  • sloc: ruby: 44,678; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 1,155 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true
module Mail
  module Parsers

    # Low-level ragel based parsers
    require 'mail/parsers/ragel'

    AddressListStruct = Struct.new(:addresses, :group_names, :error)
    AddressStruct = Struct.new(:raw, :domain, :comments, :local,
                             :obs_domain_list, :display_name, :group, :error)
    ContentDispositionStruct = Struct.new(:disposition_type, :parameters, :error)
    ContentLocationStruct = Struct.new(:location, :error)
    ContentTransferEncodingStruct = Struct.new(:encoding, :error)
    ContentTypeStruct = Struct.new(:main_type, :sub_type, :parameters, :error)
    DateTimeStruct = Struct.new(:date_string, :time_string, :error)
    EnvelopeFromStruct = Struct.new(:address, :ctime_date, :error)
    MessageIdsStruct = Struct.new(:message_ids, :error)
    MimeVersionStruct = Struct.new(:major, :minor, :error)
    PhraseListsStruct = Struct.new(:phrases, :error)
    ReceivedStruct = Struct.new(:date, :time, :info, :error)

    require 'mail/parsers/ragel/parser_info'
    Ragel::FIELD_PARSERS.each do |field_parser|
      require "mail/parsers/#{field_parser}_parser"
    end
  end
end