rack-mail_exception 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +22 -0
- data/LICENSE +20 -0
- data/README.rdoc +38 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/lib/rack/mail_exception.rb +103 -0
- data/test/helper.rb +13 -0
- data/test/test_rack_mail_exception.rb +93 -0
- data/vendor/mail/.bundle/config +2 -0
- data/vendor/mail/CHANGELOG.rdoc +370 -0
- data/vendor/mail/Dependencies.txt +3 -0
- data/vendor/mail/Gemfile +17 -0
- data/vendor/mail/README.rdoc +572 -0
- data/vendor/mail/ROADMAP +92 -0
- data/vendor/mail/Rakefile +41 -0
- data/vendor/mail/TODO.rdoc +9 -0
- data/vendor/mail/lib/mail.rb +76 -0
- data/vendor/mail/lib/mail/attachments_list.rb +99 -0
- data/vendor/mail/lib/mail/body.rb +287 -0
- data/vendor/mail/lib/mail/configuration.rb +67 -0
- data/vendor/mail/lib/mail/core_extensions/blank.rb +26 -0
- data/vendor/mail/lib/mail/core_extensions/nil.rb +11 -0
- data/vendor/mail/lib/mail/core_extensions/string.rb +27 -0
- data/vendor/mail/lib/mail/elements.rb +14 -0
- data/vendor/mail/lib/mail/elements/address.rb +306 -0
- data/vendor/mail/lib/mail/elements/address_list.rb +74 -0
- data/vendor/mail/lib/mail/elements/content_disposition_element.rb +30 -0
- data/vendor/mail/lib/mail/elements/content_location_element.rb +25 -0
- data/vendor/mail/lib/mail/elements/content_transfer_encoding_element.rb +24 -0
- data/vendor/mail/lib/mail/elements/content_type_element.rb +35 -0
- data/vendor/mail/lib/mail/elements/date_time_element.rb +26 -0
- data/vendor/mail/lib/mail/elements/envelope_from_element.rb +34 -0
- data/vendor/mail/lib/mail/elements/message_ids_element.rb +29 -0
- data/vendor/mail/lib/mail/elements/mime_version_element.rb +26 -0
- data/vendor/mail/lib/mail/elements/phrase_list.rb +21 -0
- data/vendor/mail/lib/mail/elements/received_element.rb +30 -0
- data/vendor/mail/lib/mail/encodings.rb +258 -0
- data/vendor/mail/lib/mail/encodings/7bit.rb +31 -0
- data/vendor/mail/lib/mail/encodings/8bit.rb +31 -0
- data/vendor/mail/lib/mail/encodings/base64.rb +33 -0
- data/vendor/mail/lib/mail/encodings/binary.rb +31 -0
- data/vendor/mail/lib/mail/encodings/quoted_printable.rb +38 -0
- data/vendor/mail/lib/mail/encodings/transfer_encoding.rb +58 -0
- data/vendor/mail/lib/mail/envelope.rb +35 -0
- data/vendor/mail/lib/mail/field.rb +223 -0
- data/vendor/mail/lib/mail/field_list.rb +33 -0
- data/vendor/mail/lib/mail/fields.rb +35 -0
- data/vendor/mail/lib/mail/fields/bcc_field.rb +56 -0
- data/vendor/mail/lib/mail/fields/cc_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/comments_field.rb +41 -0
- data/vendor/mail/lib/mail/fields/common/address_container.rb +16 -0
- data/vendor/mail/lib/mail/fields/common/common_address.rb +125 -0
- data/vendor/mail/lib/mail/fields/common/common_date.rb +42 -0
- data/vendor/mail/lib/mail/fields/common/common_field.rb +50 -0
- data/vendor/mail/lib/mail/fields/common/common_message_id.rb +43 -0
- data/vendor/mail/lib/mail/fields/common/parameter_hash.rb +52 -0
- data/vendor/mail/lib/mail/fields/content_description_field.rb +19 -0
- data/vendor/mail/lib/mail/fields/content_disposition_field.rb +69 -0
- data/vendor/mail/lib/mail/fields/content_id_field.rb +63 -0
- data/vendor/mail/lib/mail/fields/content_location_field.rb +42 -0
- data/vendor/mail/lib/mail/fields/content_transfer_encoding_field.rb +50 -0
- data/vendor/mail/lib/mail/fields/content_type_field.rb +185 -0
- data/vendor/mail/lib/mail/fields/date_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/from_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/in_reply_to_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/keywords_field.rb +44 -0
- data/vendor/mail/lib/mail/fields/message_id_field.rb +83 -0
- data/vendor/mail/lib/mail/fields/mime_version_field.rb +53 -0
- data/vendor/mail/lib/mail/fields/optional_field.rb +13 -0
- data/vendor/mail/lib/mail/fields/received_field.rb +67 -0
- data/vendor/mail/lib/mail/fields/references_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/reply_to_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/resent_bcc_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/resent_cc_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/resent_date_field.rb +35 -0
- data/vendor/mail/lib/mail/fields/resent_from_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/resent_message_id_field.rb +34 -0
- data/vendor/mail/lib/mail/fields/resent_sender_field.rb +62 -0
- data/vendor/mail/lib/mail/fields/resent_to_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/return_path_field.rb +64 -0
- data/vendor/mail/lib/mail/fields/sender_field.rb +67 -0
- data/vendor/mail/lib/mail/fields/structured_field.rb +51 -0
- data/vendor/mail/lib/mail/fields/subject_field.rb +16 -0
- data/vendor/mail/lib/mail/fields/to_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/unstructured_field.rb +166 -0
- data/vendor/mail/lib/mail/header.rb +262 -0
- data/vendor/mail/lib/mail/mail.rb +234 -0
- data/vendor/mail/lib/mail/message.rb +1867 -0
- data/vendor/mail/lib/mail/network.rb +9 -0
- data/vendor/mail/lib/mail/network/delivery_methods/file_delivery.rb +40 -0
- data/vendor/mail/lib/mail/network/delivery_methods/sendmail.rb +62 -0
- data/vendor/mail/lib/mail/network/delivery_methods/smtp.rb +110 -0
- data/vendor/mail/lib/mail/network/delivery_methods/test_mailer.rb +40 -0
- data/vendor/mail/lib/mail/network/retriever_methods/imap.rb +18 -0
- data/vendor/mail/lib/mail/network/retriever_methods/pop3.rb +149 -0
- data/vendor/mail/lib/mail/parsers/address_lists.rb +64 -0
- data/vendor/mail/lib/mail/parsers/address_lists.treetop +19 -0
- data/vendor/mail/lib/mail/parsers/content_disposition.rb +387 -0
- data/vendor/mail/lib/mail/parsers/content_disposition.treetop +46 -0
- data/vendor/mail/lib/mail/parsers/content_location.rb +139 -0
- data/vendor/mail/lib/mail/parsers/content_location.treetop +20 -0
- data/vendor/mail/lib/mail/parsers/content_transfer_encoding.rb +162 -0
- data/vendor/mail/lib/mail/parsers/content_transfer_encoding.treetop +20 -0
- data/vendor/mail/lib/mail/parsers/content_type.rb +539 -0
- data/vendor/mail/lib/mail/parsers/content_type.treetop +58 -0
- data/vendor/mail/lib/mail/parsers/date_time.rb +114 -0
- data/vendor/mail/lib/mail/parsers/date_time.treetop +11 -0
- data/vendor/mail/lib/mail/parsers/envelope_from.rb +194 -0
- data/vendor/mail/lib/mail/parsers/envelope_from.treetop +32 -0
- data/vendor/mail/lib/mail/parsers/message_ids.rb +45 -0
- data/vendor/mail/lib/mail/parsers/message_ids.treetop +15 -0
- data/vendor/mail/lib/mail/parsers/mime_version.rb +144 -0
- data/vendor/mail/lib/mail/parsers/mime_version.treetop +19 -0
- data/vendor/mail/lib/mail/parsers/phrase_lists.rb +45 -0
- data/vendor/mail/lib/mail/parsers/phrase_lists.treetop +15 -0
- data/vendor/mail/lib/mail/parsers/received.rb +71 -0
- data/vendor/mail/lib/mail/parsers/received.treetop +11 -0
- data/vendor/mail/lib/mail/parsers/rfc2045.rb +464 -0
- data/vendor/mail/lib/mail/parsers/rfc2045.treetop +36 -0
- data/vendor/mail/lib/mail/parsers/rfc2822.rb +5318 -0
- data/vendor/mail/lib/mail/parsers/rfc2822.treetop +410 -0
- data/vendor/mail/lib/mail/parsers/rfc2822_obsolete.rb +3757 -0
- data/vendor/mail/lib/mail/parsers/rfc2822_obsolete.treetop +241 -0
- data/vendor/mail/lib/mail/part.rb +102 -0
- data/vendor/mail/lib/mail/parts_list.rb +34 -0
- data/vendor/mail/lib/mail/patterns.rb +30 -0
- data/vendor/mail/lib/mail/utilities.rb +181 -0
- data/vendor/mail/lib/mail/version.rb +10 -0
- data/vendor/mail/lib/mail/version_specific/ruby_1_8.rb +97 -0
- data/vendor/mail/lib/mail/version_specific/ruby_1_9.rb +87 -0
- data/vendor/mail/lib/tasks/corpus.rake +125 -0
- data/vendor/mail/lib/tasks/treetop.rake +10 -0
- data/vendor/mail/mail.gemspec +20 -0
- data/vendor/mail/reference/US ASCII Table.txt +130 -0
- data/vendor/mail/reference/rfc1035 Domain Implementation and Specification.txt +3083 -0
- data/vendor/mail/reference/rfc1049 Content-Type Header Field for Internet Messages.txt +451 -0
- data/vendor/mail/reference/rfc1344 Implications of MIME for Internet Mail Gateways.txt +586 -0
- data/vendor/mail/reference/rfc1345 Character Mnemonics & Character Sets.txt +5761 -0
- data/vendor/mail/reference/rfc1524 A User Agent Configuration Mechanism For Multimedia Mail Format Information.txt +675 -0
- data/vendor/mail/reference/rfc1652 SMTP Service Extension for 8bit-MIMEtransport.txt +339 -0
- data/vendor/mail/reference/rfc1892 Multipart Report .txt +227 -0
- data/vendor/mail/reference/rfc1893 Mail System Status Codes.txt +843 -0
- data/vendor/mail/reference/rfc2045 Multipurpose Internet Mail Extensions (1).txt +1739 -0
- data/vendor/mail/reference/rfc2046 Multipurpose Internet Mail Extensions (2).txt +2467 -0
- data/vendor/mail/reference/rfc2047 Multipurpose Internet Mail Extensions (3).txt +843 -0
- data/vendor/mail/reference/rfc2048 Multipurpose Internet Mail Extensions (4).txt +1180 -0
- data/vendor/mail/reference/rfc2049 Multipurpose Internet Mail Extensions (5).txt +1347 -0
- data/vendor/mail/reference/rfc2111 Content-ID and Message-ID URLs.txt +283 -0
- data/vendor/mail/reference/rfc2183 Content-Disposition Header Field.txt +675 -0
- data/vendor/mail/reference/rfc2231 MIME Parameter Value and Encoded Word Extensions.txt +563 -0
- data/vendor/mail/reference/rfc2387 MIME Multipart-Related Content-type.txt +563 -0
- data/vendor/mail/reference/rfc2821 Simple Mail Transfer Protocol.txt +3711 -0
- data/vendor/mail/reference/rfc2822 Internet Message Format.txt +2859 -0
- data/vendor/mail/reference/rfc3462 Reporting of Mail System Administrative Messages.txt +396 -0
- data/vendor/mail/reference/rfc3696 Checking and Transformation of Names.txt +898 -0
- data/vendor/mail/reference/rfc4155 The application-mbox Media Type.txt +502 -0
- data/vendor/mail/reference/rfc4234 Augmented BNF for Syntax Specifications: ABNF.txt +899 -0
- data/vendor/mail/reference/rfc822 Standard for the Format of ARPA Internet Text Messages.txt +2900 -0
- data/vendor/mail/spec/environment.rb +15 -0
- data/vendor/mail/spec/features/making_a_new_message.feature +14 -0
- data/vendor/mail/spec/features/steps/env.rb +6 -0
- data/vendor/mail/spec/features/steps/making_a_new_message_steps.rb +11 -0
- data/vendor/mail/spec/fixtures/attachments/basic_email.eml +31 -0
- data/vendor/mail/spec/fixtures/attachments/test.gif +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.jpg +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.pdf +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.png +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.tiff +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.zip +0 -0
- data/vendor/mail/spec/fixtures/attachments//343/201/246/343/201/231/343/201/250.txt +2 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_content_disposition.eml +29 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_content_location.eml +32 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_message_rfc822.eml +92 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_only_email.eml +17 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_pdf.eml +70 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_with_encoded_name.eml +47 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_with_quoted_filename.eml +60 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/cant_parse_from.eml +33 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_7-bit.eml +231 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_empty.eml +33 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_plain.eml +148 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_qp_with_space.eml +53 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_spam.eml +44 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_text-html.eml +50 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_with_8bits.eml +770 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_with_semi_colon.eml +269 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_x_uuencode.eml +79 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/empty_group_lists.eml +162 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/header_fields_with_empty_values.eml +33 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/missing_body.eml +16 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/missing_content_disposition.eml +43 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/multiple_content_types.eml +25 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email11.eml +34 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email12.eml +32 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email2.eml +114 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email4.eml +59 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email7.eml +66 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_encoded_stack_level_too_deep.eml +53 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_illegal_boundary.eml +58 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_mimepart_without_content_type.eml +94 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_multipart_mixed_quoted_boundary.eml +50 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_nested_attachment.eml +100 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_quoted_illegal_boundary.eml +58 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/sig_only_email.eml +29 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/two_from_in_message.eml +42 -0
- data/vendor/mail/spec/fixtures/emails/multi_charset/japanese.eml +9 -0
- data/vendor/mail/spec/fixtures/emails/multi_charset/japanese_attachment.eml +27 -0
- data/vendor/mail/spec/fixtures/emails/multi_charset/japanese_attachment_long_name.eml +44 -0
- data/vendor/mail/spec/fixtures/emails/multipart_report_emails/multi_address_bounce1.eml +179 -0
- data/vendor/mail/spec/fixtures/emails/multipart_report_emails/multi_address_bounce2.eml +179 -0
- data/vendor/mail/spec/fixtures/emails/multipart_report_emails/report_422.eml +98 -0
- data/vendor/mail/spec/fixtures/emails/multipart_report_emails/report_530.eml +97 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/basic_email.eml +31 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email.eml +14 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email10.eml +20 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email5.eml +19 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email6.eml +20 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email8.eml +47 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_bad_time.eml +62 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_double_at_in_header.eml +14 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_incorrect_header.eml +28 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_multiple_from.eml +30 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_quoted_with_0d0a.eml +14 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_reply.eml +32 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_simple.eml +11 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_string_in_date_field.eml +17 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_trailing_dot.eml +21 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_with_bad_date.eml +48 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_with_partially_quoted_subject.eml +14 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example01.eml +8 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example02.eml +9 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example03.eml +7 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example04.eml +7 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example05.eml +8 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example06.eml +10 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example07.eml +9 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example08.eml +12 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example09.eml +15 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example10.eml +15 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example11.eml +6 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example12.eml +8 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example13.eml +10 -0
- data/vendor/mail/spec/fixtures/emails/sample_output_multipart +0 -0
- data/vendor/mail/spec/mail/attachments_list_spec.rb +214 -0
- data/vendor/mail/spec/mail/body_spec.rb +385 -0
- data/vendor/mail/spec/mail/configuration_spec.rb +19 -0
- data/vendor/mail/spec/mail/core_extensions/string_spec.rb +62 -0
- data/vendor/mail/spec/mail/core_extensions_spec.rb +99 -0
- data/vendor/mail/spec/mail/elements/address_list_spec.rb +109 -0
- data/vendor/mail/spec/mail/elements/address_spec.rb +609 -0
- data/vendor/mail/spec/mail/elements/date_time_element_spec.rb +20 -0
- data/vendor/mail/spec/mail/elements/envelope_from_element_spec.rb +31 -0
- data/vendor/mail/spec/mail/elements/message_ids_element_spec.rb +43 -0
- data/vendor/mail/spec/mail/elements/phrase_list_spec.rb +22 -0
- data/vendor/mail/spec/mail/elements/received_element_spec.rb +34 -0
- data/vendor/mail/spec/mail/encoding_spec.rb +189 -0
- data/vendor/mail/spec/mail/encodings/base64_spec.rb +25 -0
- data/vendor/mail/spec/mail/encodings/quoted_printable_spec.rb +25 -0
- data/vendor/mail/spec/mail/encodings_spec.rb +664 -0
- data/vendor/mail/spec/mail/example_emails_spec.rb +303 -0
- data/vendor/mail/spec/mail/field_list_spec.rb +33 -0
- data/vendor/mail/spec/mail/field_spec.rb +198 -0
- data/vendor/mail/spec/mail/fields/bcc_field_spec.rb +89 -0
- data/vendor/mail/spec/mail/fields/cc_field_spec.rb +79 -0
- data/vendor/mail/spec/mail/fields/comments_field_spec.rb +25 -0
- data/vendor/mail/spec/mail/fields/common/address_container_spec.rb +18 -0
- data/vendor/mail/spec/mail/fields/common/common_address_spec.rb +132 -0
- data/vendor/mail/spec/mail/fields/common/common_date_spec.rb +25 -0
- data/vendor/mail/spec/mail/fields/common/common_field_spec.rb +69 -0
- data/vendor/mail/spec/mail/fields/common/common_message_id_spec.rb +30 -0
- data/vendor/mail/spec/mail/fields/common/parameter_hash_spec.rb +56 -0
- data/vendor/mail/spec/mail/fields/content_description_field_spec.rb +39 -0
- data/vendor/mail/spec/mail/fields/content_disposition_field_spec.rb +55 -0
- data/vendor/mail/spec/mail/fields/content_id_field_spec.rb +117 -0
- data/vendor/mail/spec/mail/fields/content_location_field_spec.rb +46 -0
- data/vendor/mail/spec/mail/fields/content_transfer_encoding_field_spec.rb +113 -0
- data/vendor/mail/spec/mail/fields/content_type_field_spec.rb +678 -0
- data/vendor/mail/spec/mail/fields/date_field_spec.rb +73 -0
- data/vendor/mail/spec/mail/fields/envelope_spec.rb +48 -0
- data/vendor/mail/spec/mail/fields/from_field_spec.rb +89 -0
- data/vendor/mail/spec/mail/fields/in_reply_to_field_spec.rb +62 -0
- data/vendor/mail/spec/mail/fields/keywords_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/message_id_field_spec.rb +147 -0
- data/vendor/mail/spec/mail/fields/mime_version_field_spec.rb +166 -0
- data/vendor/mail/spec/mail/fields/received_field_spec.rb +44 -0
- data/vendor/mail/spec/mail/fields/references_field_spec.rb +35 -0
- data/vendor/mail/spec/mail/fields/reply_to_field_spec.rb +67 -0
- data/vendor/mail/spec/mail/fields/resent_bcc_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/resent_cc_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/resent_date_field_spec.rb +39 -0
- data/vendor/mail/spec/mail/fields/resent_from_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/resent_message_id_field_spec.rb +24 -0
- data/vendor/mail/spec/mail/fields/resent_sender_field_spec.rb +58 -0
- data/vendor/mail/spec/mail/fields/resent_to_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/return_path_field_spec.rb +52 -0
- data/vendor/mail/spec/mail/fields/sender_field_spec.rb +58 -0
- data/vendor/mail/spec/mail/fields/structured_field_spec.rb +72 -0
- data/vendor/mail/spec/mail/fields/to_field_spec.rb +92 -0
- data/vendor/mail/spec/mail/fields/unstructured_field_spec.rb +134 -0
- data/vendor/mail/spec/mail/header_spec.rb +578 -0
- data/vendor/mail/spec/mail/mail_spec.rb +34 -0
- data/vendor/mail/spec/mail/message_spec.rb +1409 -0
- data/vendor/mail/spec/mail/mime_messages_spec.rb +435 -0
- data/vendor/mail/spec/mail/multipart_report_spec.rb +112 -0
- data/vendor/mail/spec/mail/network/delivery_methods/file_delivery_spec.rb +79 -0
- data/vendor/mail/spec/mail/network/delivery_methods/sendmail_spec.rb +125 -0
- data/vendor/mail/spec/mail/network/delivery_methods/smtp_spec.rb +133 -0
- data/vendor/mail/spec/mail/network/delivery_methods/test_mailer_spec.rb +57 -0
- data/vendor/mail/spec/mail/network/retriever_methods/pop3_spec.rb +180 -0
- data/vendor/mail/spec/mail/network_spec.rb +359 -0
- data/vendor/mail/spec/mail/parsers/address_lists_parser_spec.rb +15 -0
- data/vendor/mail/spec/mail/parsers/content_transfer_encoding_parser_spec.rb +72 -0
- data/vendor/mail/spec/mail/part_spec.rb +129 -0
- data/vendor/mail/spec/mail/parts_list_spec.rb +12 -0
- data/vendor/mail/spec/mail/round_tripping_spec.rb +44 -0
- data/vendor/mail/spec/mail/utilities_spec.rb +327 -0
- data/vendor/mail/spec/mail/version_specific/escape_paren_1_8_spec.rb +32 -0
- data/vendor/mail/spec/matchers/break_down_to.rb +35 -0
- data/vendor/mail/spec/spec_helper.rb +163 -0
- metadata +442 -0
@@ -0,0 +1,139 @@
|
|
1
|
+
# Autogenerated from a Treetop grammar. Edits may be lost.
|
2
|
+
|
3
|
+
|
4
|
+
module Mail
|
5
|
+
module ContentLocation
|
6
|
+
include Treetop::Runtime
|
7
|
+
|
8
|
+
def root
|
9
|
+
@root ||= :primary
|
10
|
+
end
|
11
|
+
|
12
|
+
include RFC2822
|
13
|
+
|
14
|
+
include RFC2045
|
15
|
+
|
16
|
+
module Primary0
|
17
|
+
def CFWS1
|
18
|
+
elements[0]
|
19
|
+
end
|
20
|
+
|
21
|
+
def location
|
22
|
+
elements[1]
|
23
|
+
end
|
24
|
+
|
25
|
+
def CFWS2
|
26
|
+
elements[2]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def _nt_primary
|
31
|
+
start_index = index
|
32
|
+
if node_cache[:primary].has_key?(index)
|
33
|
+
cached = node_cache[:primary][index]
|
34
|
+
if cached
|
35
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
36
|
+
@index = cached.interval.end
|
37
|
+
end
|
38
|
+
return cached
|
39
|
+
end
|
40
|
+
|
41
|
+
i0, s0 = index, []
|
42
|
+
r1 = _nt_CFWS
|
43
|
+
s0 << r1
|
44
|
+
if r1
|
45
|
+
r2 = _nt_location
|
46
|
+
s0 << r2
|
47
|
+
if r2
|
48
|
+
r3 = _nt_CFWS
|
49
|
+
s0 << r3
|
50
|
+
end
|
51
|
+
end
|
52
|
+
if s0.last
|
53
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
54
|
+
r0.extend(Primary0)
|
55
|
+
else
|
56
|
+
@index = i0
|
57
|
+
r0 = nil
|
58
|
+
end
|
59
|
+
|
60
|
+
node_cache[:primary][start_index] = r0
|
61
|
+
|
62
|
+
r0
|
63
|
+
end
|
64
|
+
|
65
|
+
module Location0
|
66
|
+
def text_value
|
67
|
+
quoted_content.text_value
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def _nt_location
|
72
|
+
start_index = index
|
73
|
+
if node_cache[:location].has_key?(index)
|
74
|
+
cached = node_cache[:location][index]
|
75
|
+
if cached
|
76
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
77
|
+
@index = cached.interval.end
|
78
|
+
end
|
79
|
+
return cached
|
80
|
+
end
|
81
|
+
|
82
|
+
i0 = index
|
83
|
+
r1 = _nt_quoted_string
|
84
|
+
r1.extend(Location0)
|
85
|
+
if r1
|
86
|
+
r0 = r1
|
87
|
+
else
|
88
|
+
s2, i2 = [], index
|
89
|
+
loop do
|
90
|
+
i3 = index
|
91
|
+
r4 = _nt_token
|
92
|
+
if r4
|
93
|
+
r3 = r4
|
94
|
+
else
|
95
|
+
if has_terminal?('\G[\\x3d]', true, index)
|
96
|
+
r5 = true
|
97
|
+
@index += 1
|
98
|
+
else
|
99
|
+
r5 = nil
|
100
|
+
end
|
101
|
+
if r5
|
102
|
+
r3 = r5
|
103
|
+
else
|
104
|
+
@index = i3
|
105
|
+
r3 = nil
|
106
|
+
end
|
107
|
+
end
|
108
|
+
if r3
|
109
|
+
s2 << r3
|
110
|
+
else
|
111
|
+
break
|
112
|
+
end
|
113
|
+
end
|
114
|
+
if s2.empty?
|
115
|
+
@index = i2
|
116
|
+
r2 = nil
|
117
|
+
else
|
118
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
119
|
+
end
|
120
|
+
if r2
|
121
|
+
r0 = r2
|
122
|
+
else
|
123
|
+
@index = i0
|
124
|
+
r0 = nil
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
node_cache[:location][start_index] = r0
|
129
|
+
|
130
|
+
r0
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
class ContentLocationParser < Treetop::Runtime::CompiledParser
|
136
|
+
include ContentLocation
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Mail
|
2
|
+
grammar ContentLocation
|
3
|
+
|
4
|
+
include RFC2822
|
5
|
+
include RFC2045
|
6
|
+
|
7
|
+
rule primary
|
8
|
+
CFWS location CFWS
|
9
|
+
end
|
10
|
+
|
11
|
+
rule location
|
12
|
+
quoted_string {
|
13
|
+
def text_value
|
14
|
+
quoted_content.text_value
|
15
|
+
end
|
16
|
+
} / (token / [\x3d])+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,162 @@
|
|
1
|
+
# Autogenerated from a Treetop grammar. Edits may be lost.
|
2
|
+
|
3
|
+
|
4
|
+
module Mail
|
5
|
+
module ContentTransferEncoding
|
6
|
+
include Treetop::Runtime
|
7
|
+
|
8
|
+
def root
|
9
|
+
@root ||= :primary
|
10
|
+
end
|
11
|
+
|
12
|
+
include RFC2822
|
13
|
+
|
14
|
+
include RFC2045
|
15
|
+
|
16
|
+
module Primary0
|
17
|
+
def CFWS1
|
18
|
+
elements[0]
|
19
|
+
end
|
20
|
+
|
21
|
+
def encoding
|
22
|
+
elements[1]
|
23
|
+
end
|
24
|
+
|
25
|
+
def CFWS2
|
26
|
+
elements[2]
|
27
|
+
end
|
28
|
+
|
29
|
+
def CFWS3
|
30
|
+
elements[4]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def _nt_primary
|
35
|
+
start_index = index
|
36
|
+
if node_cache[:primary].has_key?(index)
|
37
|
+
cached = node_cache[:primary][index]
|
38
|
+
if cached
|
39
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
40
|
+
@index = cached.interval.end
|
41
|
+
end
|
42
|
+
return cached
|
43
|
+
end
|
44
|
+
|
45
|
+
i0, s0 = index, []
|
46
|
+
r1 = _nt_CFWS
|
47
|
+
s0 << r1
|
48
|
+
if r1
|
49
|
+
r2 = _nt_encoding
|
50
|
+
s0 << r2
|
51
|
+
if r2
|
52
|
+
r3 = _nt_CFWS
|
53
|
+
s0 << r3
|
54
|
+
if r3
|
55
|
+
if has_terminal?(";", false, index)
|
56
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
57
|
+
@index += 1
|
58
|
+
else
|
59
|
+
terminal_parse_failure(";")
|
60
|
+
r5 = nil
|
61
|
+
end
|
62
|
+
if r5
|
63
|
+
r4 = r5
|
64
|
+
else
|
65
|
+
r4 = instantiate_node(SyntaxNode,input, index...index)
|
66
|
+
end
|
67
|
+
s0 << r4
|
68
|
+
if r4
|
69
|
+
r6 = _nt_CFWS
|
70
|
+
s0 << r6
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
if s0.last
|
76
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
77
|
+
r0.extend(Primary0)
|
78
|
+
else
|
79
|
+
@index = i0
|
80
|
+
r0 = nil
|
81
|
+
end
|
82
|
+
|
83
|
+
node_cache[:primary][start_index] = r0
|
84
|
+
|
85
|
+
r0
|
86
|
+
end
|
87
|
+
|
88
|
+
module Encoding0
|
89
|
+
def ietf_token
|
90
|
+
elements[0]
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
module Encoding1
|
96
|
+
def text_value
|
97
|
+
ietf_token.text_value
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def _nt_encoding
|
102
|
+
start_index = index
|
103
|
+
if node_cache[:encoding].has_key?(index)
|
104
|
+
cached = node_cache[:encoding][index]
|
105
|
+
if cached
|
106
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
107
|
+
@index = cached.interval.end
|
108
|
+
end
|
109
|
+
return cached
|
110
|
+
end
|
111
|
+
|
112
|
+
i0 = index
|
113
|
+
i1, s1 = index, []
|
114
|
+
r2 = _nt_ietf_token
|
115
|
+
s1 << r2
|
116
|
+
if r2
|
117
|
+
if has_terminal?("s", false, index)
|
118
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
119
|
+
@index += 1
|
120
|
+
else
|
121
|
+
terminal_parse_failure("s")
|
122
|
+
r4 = nil
|
123
|
+
end
|
124
|
+
if r4
|
125
|
+
r3 = r4
|
126
|
+
else
|
127
|
+
r3 = instantiate_node(SyntaxNode,input, index...index)
|
128
|
+
end
|
129
|
+
s1 << r3
|
130
|
+
end
|
131
|
+
if s1.last
|
132
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
133
|
+
r1.extend(Encoding0)
|
134
|
+
r1.extend(Encoding1)
|
135
|
+
else
|
136
|
+
@index = i1
|
137
|
+
r1 = nil
|
138
|
+
end
|
139
|
+
if r1
|
140
|
+
r0 = r1
|
141
|
+
else
|
142
|
+
r5 = _nt_custom_x_token
|
143
|
+
if r5
|
144
|
+
r0 = r5
|
145
|
+
else
|
146
|
+
@index = i0
|
147
|
+
r0 = nil
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
node_cache[:encoding][start_index] = r0
|
152
|
+
|
153
|
+
r0
|
154
|
+
end
|
155
|
+
|
156
|
+
end
|
157
|
+
|
158
|
+
class ContentTransferEncodingParser < Treetop::Runtime::CompiledParser
|
159
|
+
include ContentTransferEncoding
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Mail
|
2
|
+
grammar ContentTransferEncoding
|
3
|
+
|
4
|
+
include RFC2822
|
5
|
+
include RFC2045
|
6
|
+
|
7
|
+
rule primary
|
8
|
+
CFWS encoding CFWS ";"? CFWS
|
9
|
+
end
|
10
|
+
|
11
|
+
rule encoding
|
12
|
+
ietf_token "s"? {
|
13
|
+
def text_value
|
14
|
+
ietf_token.text_value
|
15
|
+
end
|
16
|
+
} / custom_x_token
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,539 @@
|
|
1
|
+
# Autogenerated from a Treetop grammar. Edits may be lost.
|
2
|
+
|
3
|
+
|
4
|
+
module Mail
|
5
|
+
module ContentType
|
6
|
+
include Treetop::Runtime
|
7
|
+
|
8
|
+
def root
|
9
|
+
@root ||= :content_type
|
10
|
+
end
|
11
|
+
|
12
|
+
include RFC2822
|
13
|
+
|
14
|
+
include RFC2045
|
15
|
+
|
16
|
+
module ContentType0
|
17
|
+
def CFWS1
|
18
|
+
elements[0]
|
19
|
+
end
|
20
|
+
|
21
|
+
def parameter
|
22
|
+
elements[2]
|
23
|
+
end
|
24
|
+
|
25
|
+
def CFWS2
|
26
|
+
elements[3]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module ContentType1
|
31
|
+
def main_type
|
32
|
+
elements[0]
|
33
|
+
end
|
34
|
+
|
35
|
+
def sub_type
|
36
|
+
elements[2]
|
37
|
+
end
|
38
|
+
|
39
|
+
def param_hashes
|
40
|
+
elements[3]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
module ContentType2
|
45
|
+
def parameters
|
46
|
+
param_hashes.elements.map do |param|
|
47
|
+
param.parameter.param_hash
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def _nt_content_type
|
53
|
+
start_index = index
|
54
|
+
if node_cache[:content_type].has_key?(index)
|
55
|
+
cached = node_cache[:content_type][index]
|
56
|
+
if cached
|
57
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
58
|
+
@index = cached.interval.end
|
59
|
+
end
|
60
|
+
return cached
|
61
|
+
end
|
62
|
+
|
63
|
+
i0, s0 = index, []
|
64
|
+
r1 = _nt_main_type
|
65
|
+
s0 << r1
|
66
|
+
if r1
|
67
|
+
if has_terminal?("/", false, index)
|
68
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
69
|
+
@index += 1
|
70
|
+
else
|
71
|
+
terminal_parse_failure("/")
|
72
|
+
r2 = nil
|
73
|
+
end
|
74
|
+
s0 << r2
|
75
|
+
if r2
|
76
|
+
r3 = _nt_sub_type
|
77
|
+
s0 << r3
|
78
|
+
if r3
|
79
|
+
s4, i4 = [], index
|
80
|
+
loop do
|
81
|
+
i5, s5 = index, []
|
82
|
+
r6 = _nt_CFWS
|
83
|
+
s5 << r6
|
84
|
+
if r6
|
85
|
+
if has_terminal?(";", false, index)
|
86
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
87
|
+
@index += 1
|
88
|
+
else
|
89
|
+
terminal_parse_failure(";")
|
90
|
+
r8 = nil
|
91
|
+
end
|
92
|
+
if r8
|
93
|
+
r7 = r8
|
94
|
+
else
|
95
|
+
r7 = instantiate_node(SyntaxNode,input, index...index)
|
96
|
+
end
|
97
|
+
s5 << r7
|
98
|
+
if r7
|
99
|
+
r9 = _nt_parameter
|
100
|
+
s5 << r9
|
101
|
+
if r9
|
102
|
+
r10 = _nt_CFWS
|
103
|
+
s5 << r10
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
if s5.last
|
108
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
109
|
+
r5.extend(ContentType0)
|
110
|
+
else
|
111
|
+
@index = i5
|
112
|
+
r5 = nil
|
113
|
+
end
|
114
|
+
if r5
|
115
|
+
s4 << r5
|
116
|
+
else
|
117
|
+
break
|
118
|
+
end
|
119
|
+
end
|
120
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
121
|
+
s0 << r4
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
if s0.last
|
126
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
127
|
+
r0.extend(ContentType1)
|
128
|
+
r0.extend(ContentType2)
|
129
|
+
else
|
130
|
+
@index = i0
|
131
|
+
r0 = nil
|
132
|
+
end
|
133
|
+
|
134
|
+
node_cache[:content_type][start_index] = r0
|
135
|
+
|
136
|
+
r0
|
137
|
+
end
|
138
|
+
|
139
|
+
def _nt_main_type
|
140
|
+
start_index = index
|
141
|
+
if node_cache[:main_type].has_key?(index)
|
142
|
+
cached = node_cache[:main_type][index]
|
143
|
+
if cached
|
144
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
145
|
+
@index = cached.interval.end
|
146
|
+
end
|
147
|
+
return cached
|
148
|
+
end
|
149
|
+
|
150
|
+
i0 = index
|
151
|
+
r1 = _nt_discrete_type
|
152
|
+
if r1
|
153
|
+
r0 = r1
|
154
|
+
else
|
155
|
+
r2 = _nt_composite_type
|
156
|
+
if r2
|
157
|
+
r0 = r2
|
158
|
+
else
|
159
|
+
@index = i0
|
160
|
+
r0 = nil
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
node_cache[:main_type][start_index] = r0
|
165
|
+
|
166
|
+
r0
|
167
|
+
end
|
168
|
+
|
169
|
+
def _nt_discrete_type
|
170
|
+
start_index = index
|
171
|
+
if node_cache[:discrete_type].has_key?(index)
|
172
|
+
cached = node_cache[:discrete_type][index]
|
173
|
+
if cached
|
174
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
175
|
+
@index = cached.interval.end
|
176
|
+
end
|
177
|
+
return cached
|
178
|
+
end
|
179
|
+
|
180
|
+
i0 = index
|
181
|
+
if has_terminal?("text", false, index)
|
182
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
183
|
+
@index += 4
|
184
|
+
else
|
185
|
+
terminal_parse_failure("text")
|
186
|
+
r1 = nil
|
187
|
+
end
|
188
|
+
if r1
|
189
|
+
r0 = r1
|
190
|
+
else
|
191
|
+
if has_terminal?("image", false, index)
|
192
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 5))
|
193
|
+
@index += 5
|
194
|
+
else
|
195
|
+
terminal_parse_failure("image")
|
196
|
+
r2 = nil
|
197
|
+
end
|
198
|
+
if r2
|
199
|
+
r0 = r2
|
200
|
+
else
|
201
|
+
if has_terminal?("audio", false, index)
|
202
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 5))
|
203
|
+
@index += 5
|
204
|
+
else
|
205
|
+
terminal_parse_failure("audio")
|
206
|
+
r3 = nil
|
207
|
+
end
|
208
|
+
if r3
|
209
|
+
r0 = r3
|
210
|
+
else
|
211
|
+
if has_terminal?("video", false, index)
|
212
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 5))
|
213
|
+
@index += 5
|
214
|
+
else
|
215
|
+
terminal_parse_failure("video")
|
216
|
+
r4 = nil
|
217
|
+
end
|
218
|
+
if r4
|
219
|
+
r0 = r4
|
220
|
+
else
|
221
|
+
if has_terminal?("application", false, index)
|
222
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 11))
|
223
|
+
@index += 11
|
224
|
+
else
|
225
|
+
terminal_parse_failure("application")
|
226
|
+
r5 = nil
|
227
|
+
end
|
228
|
+
if r5
|
229
|
+
r0 = r5
|
230
|
+
else
|
231
|
+
r6 = _nt_extension_token
|
232
|
+
if r6
|
233
|
+
r0 = r6
|
234
|
+
else
|
235
|
+
@index = i0
|
236
|
+
r0 = nil
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
node_cache[:discrete_type][start_index] = r0
|
245
|
+
|
246
|
+
r0
|
247
|
+
end
|
248
|
+
|
249
|
+
def _nt_composite_type
|
250
|
+
start_index = index
|
251
|
+
if node_cache[:composite_type].has_key?(index)
|
252
|
+
cached = node_cache[:composite_type][index]
|
253
|
+
if cached
|
254
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
255
|
+
@index = cached.interval.end
|
256
|
+
end
|
257
|
+
return cached
|
258
|
+
end
|
259
|
+
|
260
|
+
i0 = index
|
261
|
+
if has_terminal?("message", false, index)
|
262
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
|
263
|
+
@index += 7
|
264
|
+
else
|
265
|
+
terminal_parse_failure("message")
|
266
|
+
r1 = nil
|
267
|
+
end
|
268
|
+
if r1
|
269
|
+
r0 = r1
|
270
|
+
else
|
271
|
+
if has_terminal?("multipart", false, index)
|
272
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 9))
|
273
|
+
@index += 9
|
274
|
+
else
|
275
|
+
terminal_parse_failure("multipart")
|
276
|
+
r2 = nil
|
277
|
+
end
|
278
|
+
if r2
|
279
|
+
r0 = r2
|
280
|
+
else
|
281
|
+
r3 = _nt_extension_token
|
282
|
+
if r3
|
283
|
+
r0 = r3
|
284
|
+
else
|
285
|
+
@index = i0
|
286
|
+
r0 = nil
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
node_cache[:composite_type][start_index] = r0
|
292
|
+
|
293
|
+
r0
|
294
|
+
end
|
295
|
+
|
296
|
+
def _nt_extension_token
|
297
|
+
start_index = index
|
298
|
+
if node_cache[:extension_token].has_key?(index)
|
299
|
+
cached = node_cache[:extension_token][index]
|
300
|
+
if cached
|
301
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
302
|
+
@index = cached.interval.end
|
303
|
+
end
|
304
|
+
return cached
|
305
|
+
end
|
306
|
+
|
307
|
+
i0 = index
|
308
|
+
r1 = _nt_ietf_token
|
309
|
+
if r1
|
310
|
+
r0 = r1
|
311
|
+
else
|
312
|
+
r2 = _nt_custom_x_token
|
313
|
+
if r2
|
314
|
+
r0 = r2
|
315
|
+
else
|
316
|
+
@index = i0
|
317
|
+
r0 = nil
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
node_cache[:extension_token][start_index] = r0
|
322
|
+
|
323
|
+
r0
|
324
|
+
end
|
325
|
+
|
326
|
+
def _nt_sub_type
|
327
|
+
start_index = index
|
328
|
+
if node_cache[:sub_type].has_key?(index)
|
329
|
+
cached = node_cache[:sub_type][index]
|
330
|
+
if cached
|
331
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
332
|
+
@index = cached.interval.end
|
333
|
+
end
|
334
|
+
return cached
|
335
|
+
end
|
336
|
+
|
337
|
+
i0 = index
|
338
|
+
r1 = _nt_extension_token
|
339
|
+
if r1
|
340
|
+
r0 = r1
|
341
|
+
else
|
342
|
+
r2 = _nt_iana_token
|
343
|
+
if r2
|
344
|
+
r0 = r2
|
345
|
+
else
|
346
|
+
@index = i0
|
347
|
+
r0 = nil
|
348
|
+
end
|
349
|
+
end
|
350
|
+
|
351
|
+
node_cache[:sub_type][start_index] = r0
|
352
|
+
|
353
|
+
r0
|
354
|
+
end
|
355
|
+
|
356
|
+
module Parameter0
|
357
|
+
def attr
|
358
|
+
elements[1]
|
359
|
+
end
|
360
|
+
|
361
|
+
def val
|
362
|
+
elements[3]
|
363
|
+
end
|
364
|
+
|
365
|
+
end
|
366
|
+
|
367
|
+
module Parameter1
|
368
|
+
def param_hash
|
369
|
+
{attr.text_value => val.text_value}
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
def _nt_parameter
|
374
|
+
start_index = index
|
375
|
+
if node_cache[:parameter].has_key?(index)
|
376
|
+
cached = node_cache[:parameter][index]
|
377
|
+
if cached
|
378
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
379
|
+
@index = cached.interval.end
|
380
|
+
end
|
381
|
+
return cached
|
382
|
+
end
|
383
|
+
|
384
|
+
i0, s0 = index, []
|
385
|
+
r2 = _nt_CFWS
|
386
|
+
if r2
|
387
|
+
r1 = r2
|
388
|
+
else
|
389
|
+
r1 = instantiate_node(SyntaxNode,input, index...index)
|
390
|
+
end
|
391
|
+
s0 << r1
|
392
|
+
if r1
|
393
|
+
r3 = _nt_attribute
|
394
|
+
s0 << r3
|
395
|
+
if r3
|
396
|
+
if has_terminal?("=", false, index)
|
397
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
398
|
+
@index += 1
|
399
|
+
else
|
400
|
+
terminal_parse_failure("=")
|
401
|
+
r4 = nil
|
402
|
+
end
|
403
|
+
s0 << r4
|
404
|
+
if r4
|
405
|
+
r5 = _nt_value
|
406
|
+
s0 << r5
|
407
|
+
if r5
|
408
|
+
r7 = _nt_CFWS
|
409
|
+
if r7
|
410
|
+
r6 = r7
|
411
|
+
else
|
412
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
413
|
+
end
|
414
|
+
s0 << r6
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|
419
|
+
if s0.last
|
420
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
421
|
+
r0.extend(Parameter0)
|
422
|
+
r0.extend(Parameter1)
|
423
|
+
else
|
424
|
+
@index = i0
|
425
|
+
r0 = nil
|
426
|
+
end
|
427
|
+
|
428
|
+
node_cache[:parameter][start_index] = r0
|
429
|
+
|
430
|
+
r0
|
431
|
+
end
|
432
|
+
|
433
|
+
def _nt_attribute
|
434
|
+
start_index = index
|
435
|
+
if node_cache[:attribute].has_key?(index)
|
436
|
+
cached = node_cache[:attribute][index]
|
437
|
+
if cached
|
438
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
439
|
+
@index = cached.interval.end
|
440
|
+
end
|
441
|
+
return cached
|
442
|
+
end
|
443
|
+
|
444
|
+
s0, i0 = [], index
|
445
|
+
loop do
|
446
|
+
r1 = _nt_token
|
447
|
+
if r1
|
448
|
+
s0 << r1
|
449
|
+
else
|
450
|
+
break
|
451
|
+
end
|
452
|
+
end
|
453
|
+
if s0.empty?
|
454
|
+
@index = i0
|
455
|
+
r0 = nil
|
456
|
+
else
|
457
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
458
|
+
end
|
459
|
+
|
460
|
+
node_cache[:attribute][start_index] = r0
|
461
|
+
|
462
|
+
r0
|
463
|
+
end
|
464
|
+
|
465
|
+
module Value0
|
466
|
+
def text_value
|
467
|
+
quoted_content.text_value
|
468
|
+
end
|
469
|
+
end
|
470
|
+
|
471
|
+
def _nt_value
|
472
|
+
start_index = index
|
473
|
+
if node_cache[:value].has_key?(index)
|
474
|
+
cached = node_cache[:value][index]
|
475
|
+
if cached
|
476
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
477
|
+
@index = cached.interval.end
|
478
|
+
end
|
479
|
+
return cached
|
480
|
+
end
|
481
|
+
|
482
|
+
i0 = index
|
483
|
+
r1 = _nt_quoted_string
|
484
|
+
r1.extend(Value0)
|
485
|
+
if r1
|
486
|
+
r0 = r1
|
487
|
+
else
|
488
|
+
s2, i2 = [], index
|
489
|
+
loop do
|
490
|
+
i3 = index
|
491
|
+
r4 = _nt_token
|
492
|
+
if r4
|
493
|
+
r3 = r4
|
494
|
+
else
|
495
|
+
if has_terminal?('\G[\\x3d]', true, index)
|
496
|
+
r5 = true
|
497
|
+
@index += 1
|
498
|
+
else
|
499
|
+
r5 = nil
|
500
|
+
end
|
501
|
+
if r5
|
502
|
+
r3 = r5
|
503
|
+
else
|
504
|
+
@index = i3
|
505
|
+
r3 = nil
|
506
|
+
end
|
507
|
+
end
|
508
|
+
if r3
|
509
|
+
s2 << r3
|
510
|
+
else
|
511
|
+
break
|
512
|
+
end
|
513
|
+
end
|
514
|
+
if s2.empty?
|
515
|
+
@index = i2
|
516
|
+
r2 = nil
|
517
|
+
else
|
518
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
519
|
+
end
|
520
|
+
if r2
|
521
|
+
r0 = r2
|
522
|
+
else
|
523
|
+
@index = i0
|
524
|
+
r0 = nil
|
525
|
+
end
|
526
|
+
end
|
527
|
+
|
528
|
+
node_cache[:value][start_index] = r0
|
529
|
+
|
530
|
+
r0
|
531
|
+
end
|
532
|
+
|
533
|
+
end
|
534
|
+
|
535
|
+
class ContentTypeParser < Treetop::Runtime::CompiledParser
|
536
|
+
include ContentType
|
537
|
+
end
|
538
|
+
|
539
|
+
end
|