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
- Use Ruby version 3.3.3 or later.
- Include the
rfc822 gem in your project.
- 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)
Issue Description
The
rfc822gem is currently not compatible with the latest RubyRegexp.newAPI. The specific issue arises from the use of the third argument ('n') in theRegexp.newmethod, which is no longer supported in the latest Ruby versions.Steps to Reproduce
rfc822gem in your project.Error Message
Suggested Fix
To maintain compatibility with the latest Ruby versions, the
Regexp.newcalls should be updated as follows: