Sha256: 1a8316803cfef3506d08dfa2af1a1b0d91b8e7c7f32fdef8435d0955b56b93dd

Contents?: true

Size: 1.2 KB

Versions: 35

Compression:

Stored size: 1.2 KB

Contents

module Mail
  module Parsers
    module Ragel
      module Ruby
        def self.silence_warnings
          old, $VERBOSE = $VERBOSE, nil
          yield
        ensure
          $VERBOSE = old
        end

        # Ragel-generated parsers give a lot of warnings
        # and may cause logs to balloon in size
        silence_warnings do
          Mail::Parsers::Ragel::FIELD_PARSERS.each do |field_parser|
            require "mail/parsers/ragel/ruby/machines/#{field_parser}_machine"
          end
        end

        MACHINE_LIST = {
          :address_lists => AddressListsMachine,
          :phrase_lists => PhraseListsMachine,
          :date_time => DateTimeMachine,
          :received => ReceivedMachine,
          :message_ids => MessageIdsMachine,
          :envelope_from => EnvelopeFromMachine,
          :mime_version => MimeVersionMachine,
          :content_type => ContentTypeMachine,
          :content_disposition => ContentDispositionMachine,
          :content_transfer_encoding => ContentTransferEncodingMachine,
          :content_location => ContentLocationMachine
        }

        def self.parse(machine, string)
          MACHINE_LIST[machine].parse(string)
        end
      end
    end
  end
end

Version data entries

35 entries across 32 versions & 10 rubygems

Version Path
tdiary-5.0.6 vendor/bundle/gems/mail-2.6.6/lib/mail/parsers/ragel/ruby.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
tdiary-5.0.5 vendor/bundle/gems/mail-2.6.6/lib/mail/parsers/ragel/ruby.rb
tdiary-5.0.5 vendor/bundle/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
mail-2.6.6 lib/mail/parsers/ragel/ruby.rb
mail-2.6.6.rc1 lib/mail/parsers/ragel/ruby.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/mail-2.6.5/lib/mail/parsers/ragel/ruby.rb
mail-2.6.5 lib/mail/parsers/ragel/ruby.rb
mail-2.6.5.rc1 lib/mail/parsers/ragel/ruby.rb
tdiary-5.0.4 vendor/bundle/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
abaci-0.3.0 vendor/bundle/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
tdiary-5.0.2 vendor/bundle/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb
tdiary-5.0.1 vendor/bundle/gems/mail-2.6.4/lib/mail/parsers/ragel/ruby.rb