Skip to content

Incompatible with Ruby 3.3.3 #8

Description

@StephenVNelson

Issue Description

The rfc822 gem is currently not compatible with the latest Ruby Regexp.new API. The specific issue arises from the use of the third argument ('n') in the Regexp.new method, which is no longer supported in the latest Ruby versions.

Steps to Reproduce

  1. Use Ruby version 3.3.3 or later.
  2. Include the rfc822 gem in your project.
  3. Attempt to start your server or run your application.

Error Message

/path/to/gem/rfc822-0.1.5/lib/rfc822.rb:16
`initialize': wrong number of arguments (given 3, expected 1..2) (ArgumentError)
EMAIL_REGEXP_WHOLE = Regexp.new("\A#{ADDR_SPEC}\z", nil, 'n')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Suggested Fix

To maintain compatibility with the latest Ruby versions, the Regexp.new calls should be updated as follows:

EMAIL_REGEXP_WHOLE = Regexp.new("\\A#{ADDR_SPEC}\\z", Regexp::NOENCODING)
EMAIL_REGEXP_PART = Regexp.new("#{ADDR_SPEC}", Regexp::NOENCODING)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions