Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ AllCops:
Exclude:
- 'bin/*'
NewCops: enable
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep the targeted version the same as the minimum version defined in our gemspec.


Bundler/GemComment:
Enabled: true
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.2
33 changes: 25 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,35 @@ arch:
- ppc64le

rvm:
- 2.5.0
- 2.5.8
- 2.6.0
- 2.6.10
- 2.7.0
- 2.7.6
- 3.0.1
- 2.7.7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep these older Ruby versions. I want to ensure that we are testing in the versions that would be used in Rails 3 projects.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to ensure that we are testing in the versions that would be used in Rails 3 projects.

OK

- 2.7.8
- 3.0.4
- 3.1.0
- 3.0.6
- 3.1.2
- 3.1.4
- 3.2.2
- ruby-head
- jruby-head

jobs:
exclude:
# ref: https://rubies.travis-ci.org/index.txt
Copy link
Author

@syguer syguer Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest versions aren't supported for ppc64le.
ref: https://rubies.travis-ci.org/index.txt

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like they are. Where are you seeing that they are not supported?

TravisCI show all of the Rubies that we are testing. https://rubies.travis-ci.org/ They support Ruby 3.1.2 on ppc64le. I don't think that 3.2 was released when I last updated the tested Ruby versions. We should include those newer versions in testing.

I removed Ruby 2.4 form testing because it was having build issues on Travis. Though, IIRC, it would still build and test locally in my VMs.

- rvm: 2.7.8
arch: ppc64le
- rvm: 3.0.6
arch: ppc64le
- rvm: 3.1.4
arch: ppc64le
- rvm: 3.2.2
arch: ppc64le

- rvm: 2.7.7
arch: amd64
- rvm: 3.0.4
arch: amd64
- rvm: 3.1.2
arch: amd64

notifications:
recipients:
- karl@kandrsoftware.com
Expand Down
13 changes: 5 additions & 8 deletions email_validator.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Gem::Specification.new do |s|
s.name = 'email_validator'
s.version = '2.2.4'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NOTICE]
You know, this version needs to bump up before gem push πŸ‘»

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the current version of this gem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why you are mentions this. Is there somewhere that I forgot up bump this? Did the automation fail somewhere? I don't understand why you are bringing this up.

s.authors = ['Brian Alexander', 'Karl Wilbur']
s.summary = 'An email validator for Rails 3+.'
s.description = 'An email validator for Rails 3+. See homepage for details: http://github.com/K-and-R/email_validator'
s.summary = 'An email validator for Rails.'
s.description = 'An email validator for Rails. See homepage for details: http://github.com/K-and-R/email_validator'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This is for "Rails 3+"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

s.email = 'karl@kandrsoftware.com'
s.homepage = 'https://github.com/K-and-R/email_validator'
s.licenses = ['MIT']
Expand All @@ -12,15 +12,12 @@ Gem::Specification.new do |s|
README.md
CHANGELOG.md
]
s.files = `git ls-files -- lib/*`.split("\n")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This backquote section occurs build error on JRuby.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a bug in JRuby? What does it cause a build error?

s.files = Dir['lib/**/*.rb']
s.require_paths = %w[lib]

s.test_files = `git ls-files -- spec/*`.split("\n")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_files is gone
ref: rubygems/guides#90

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this is correct. Please show me where test_files was removed. What commit?


# This gem will work with 2.4.0 or greater... but *should* work with 1.8.7+
s.required_ruby_version = '>= 2.4.0'
s.required_ruby_version = '>= 2.7.0'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This depends on the version of ActiveModel installed.

https://github.com/rails/rails/blob/3-0-stable/activemodel/activemodel.gemspec

This gem requires Ruby 2.4.


s.add_dependency('activemodel')

s.add_development_dependency('rubysl', '~> 2.0') if RUBY_ENGINE == 'rbx'
s.metadata['rubygems_mfa_required'] = 'true'
end
2 changes: 1 addition & 1 deletion lib/email_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def address_literal

def host_label_pattern
"#{label_is_correct_length}" \
"#{alnum}(?:#{alnumhy}{,61}#{alnum})?"
"#{alnum}(?:#{alnumhy}{,61}#{alnum})?"
end

# splitting this up into separate regex pattern for performance; let's not
Expand Down
20 changes: 10 additions & 10 deletions spec/email_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class DefaultUserWithMessage < TestModel
"#{v}start-with-#{k}@valid-characters-in-local.dev"
]}).concat(valid_endable.map { |k, v| [
"end-with-#{k}-#{v}@valid-characters-in-local.dev"
]}).concat([
]}).push(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. I think we'll leave it unchanged for now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

'a+b@plus-in-local.com',
'a_b@underscore-in-local.com',
'user@example.com',
Expand Down Expand Up @@ -162,7 +162,7 @@ class DefaultUserWithMessage < TestModel
'jonh.doe@163.com',
'test@umlΓ€ut.com', # non-ASCII
'test@xn--umlut-ira.com' # ASCII-compatibale encoding of non-ASCII
]).flatten.each do |email|
).flatten.each do |email|
context 'when using defaults' do
it "'#{email}' should be valid" do
expect(DefaultUser.new(:email => email)).to be_valid
Expand Down Expand Up @@ -348,9 +348,9 @@ class DefaultUserWithMessage < TestModel
"#{v}-start-with-#{k}-user"
]}).concat(valid_endable.map { |k, v| [
"end-with-#{k}-#{v}"
]}).concat([
]}).push(
'user'
]).flatten.each do |email|
).flatten.each do |email|
context 'when using defaults' do
it "'#{email}' should not be valid" do
expect(DefaultUser.new(:email => email)).not_to be_valid
Expand Down Expand Up @@ -477,7 +477,7 @@ class DefaultUserWithMessage < TestModel
"end-with-#{k}@invalid-characters-in-domain#{v}.dev"
]}).concat(domain_invalid_includable.map { |k, v| [
"include-#{k}@invalid-characters-#{v}-in-domain.dev"
]}).concat([
]}).push(
'test@example.com@example.com',
'missing-sld@.com',
'missing-tld@sld.',
Expand All @@ -494,7 +494,7 @@ class DefaultUserWithMessage < TestModel
'the-local-part-is-invalid-if-it-is-longer-than-sixty-four-characters@sld.dev',
"domain-too-long@t#{".#{'o' * 63}" * 5}.long",
"user@example.com<script>alert('hello')</script>"
]).flatten.each do |email|
).flatten.each do |email|
context 'when using defaults' do
it "'#{email}' should be valid" do
expect(DefaultUser.new(:email => email)).to be_valid
Expand Down Expand Up @@ -554,7 +554,7 @@ class DefaultUserWithMessage < TestModel
context 'when given the invalid email with whitespace in parts' do
whitespace.map { |k, v| [
"include-#{v}-#{k}@invalid-characters-in-local.dev"
]}.concat([
]}.push(
'foo @bar.com',
"foo\t@bar.com",
"foo\n@bar.com",
Expand Down Expand Up @@ -587,7 +587,7 @@ class DefaultUserWithMessage < TestModel
"domain-with-trailing-whitespace-tab@example.com\t",
"domain-with-trailing-whitespace-newline@example.com
"
]).flatten.each do |email|
).flatten.each do |email|
context 'when using defaults' do
it "'#{email}' should not be valid" do
expect(DefaultUser.new(:email => email)).not_to be_valid
Expand Down Expand Up @@ -715,12 +715,12 @@ class DefaultUserWithMessage < TestModel
"#{v}start-with-#{k}@invalid-characters-in-local.dev"
]}).concat(strictly_invalid_endable.map { |k, v| [
"end-with-#{k}#{v}@invalid-characters-in-local.dev"
]}).concat([
]}).push(
'user..-with-double-dots@example.com',
'.user-beginning-with-dot@example.com',
'user-ending-with-dot.@example.com',
'fully-numeric-tld@example.123'
]).flatten.each do |email|
).flatten.each do |email|
context 'when using defaults' do
it "#{email.strip} in a model should be valid" do
expect(DefaultUser.new(:email => email)).to be_valid
Expand Down