validates_email_format_of 1.6.3 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 473a6ecf75f1a602abc00714b86b075545d9e2a7
4
- data.tar.gz: 2988b649b8aaa152f177757bd38e4dc2588dc2aa
2
+ SHA256:
3
+ metadata.gz: 6220bc1f3cb06d9af63e0bcf8ccfcc6e1dc795a59a5c08cd817ac921a057585b
4
+ data.tar.gz: 6c0f414549308510ad6434c71b3a1d0cabd88c4fc18cb3a3fb02135b862f3f5b
5
5
  SHA512:
6
- metadata.gz: 645502e19a3a3abb8c3d5eef6bc6d2c864bb7e9d5fd2d6467219222806e6604b7b48aa199141d03c104de2ac9a0cb3476e508274b2068cc8be8e3a3b63739bf7
7
- data.tar.gz: b361147b9c4f5220cf4b50922f710ee0e604041e78301320f5d668d5cf61b6fa646a26e20e9f36d6a4d38b70010dcc4aff9c62a6113bf27139dd045a52b8cf47
6
+ metadata.gz: 91e1f3eb18440c304f144d81b346134d9c6d7bc747e43fe464edeebb9e3a02e972e7fa4b4283d7b9eed6e4556f37a578d11bb4a9bb0328e93f5f2f2658625a30
7
+ data.tar.gz: 2e3c8cc64f8d860c0fb1e7771197942901a4fae28b166376b613bbef6262275003bbad62b23e244a3a9887ecb99c5f1dad7bc3f3b973150beaa5774782baed2d
@@ -0,0 +1,67 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ name: "Ruby ${{ matrix.ruby }}, Rails ${{ matrix.gemfile }}"
15
+
16
+ runs-on: ubuntu-latest
17
+
18
+ strategy:
19
+ matrix:
20
+ ruby: ["2.6", "2.7", "3.0", "3.1"]
21
+ gemfile: ["4.2", "5.0", "5.1", "5.2", "6.0", "6.1", "7.0"]
22
+ exclude:
23
+ - gemfile: "4.2"
24
+ ruby: "3.0"
25
+ - gemfile: "4.2"
26
+ ruby: "3.1"
27
+ - gemfile: "5.0"
28
+ ruby: "3.0"
29
+ - gemfile: "5.0"
30
+ ruby: "3.1"
31
+ - gemfile: "5.1"
32
+ ruby: "3.0"
33
+ - gemfile: "5.1"
34
+ ruby: "3.1"
35
+ - gemfile: "5.2"
36
+ ruby: "3.0"
37
+ - gemfile: "5.2"
38
+ ruby: "3.1"
39
+ - gemfile: "7.0"
40
+ ruby: "2.5"
41
+ - gemfile: "7.0"
42
+ ruby: "2.6"
43
+ - gemfile: "7.0"
44
+ ruby: "2.7"
45
+
46
+ env:
47
+ BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.gemfile }}.gemfile
48
+ RAILS_ENV: test
49
+
50
+ steps:
51
+ - uses: actions/checkout@v3
52
+
53
+ - name: "Install Ruby ${{ matrix.ruby }}"
54
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
55
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
56
+ # uses: ruby/setup-ruby@v1
57
+ uses: ruby/setup-ruby@v1
58
+ with:
59
+ bundler: 1
60
+ ruby-version: ${{ matrix.ruby }}
61
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
62
+
63
+ - name: Run specs
64
+ run: bundle exec rspec
65
+
66
+ - name: Run standard.rb
67
+ run: bundle exec rake standard
data/.gitignore CHANGED
@@ -6,3 +6,5 @@ Gemfile.lock
6
6
  *.sqlite3
7
7
  *.swp
8
8
  .ruby-version
9
+ gemfiles/.bundle
10
+ gemfiles/*.gemfile.lock
data/Appraisals ADDED
@@ -0,0 +1,32 @@
1
+ # run `bundle exec appraisal install` after making changes here
2
+ appraise "rails-7.0" do
3
+ gem "rails", "~> 7.0"
4
+ end
5
+
6
+ appraise "rails-6.1" do
7
+ gem "rails", "~> 6.1.0"
8
+ end
9
+
10
+ appraise "rails-6.0" do
11
+ gem "rails", "~> 6.0.3", ">= 6.0.3.2"
12
+ end
13
+
14
+ appraise "rails-5.2" do
15
+ gem "rails", "~> 5.2.4", ">= 5.2.4.3"
16
+ gem "i18n", "< 1"
17
+ end
18
+
19
+ appraise "rails-5.1" do
20
+ gem "rails", "~> 5.1.7"
21
+ gem "i18n", "< 1"
22
+ end
23
+
24
+ appraise "rails-5.0" do
25
+ gem "rails", "~> 5.0.7", ">= 5.0.7.2"
26
+ gem "i18n", "< 1"
27
+ end
28
+
29
+ appraise "rails-4.2" do
30
+ gem "rails", "~> 4.2.0"
31
+ gem "i18n", "< 1"
32
+ end
data/CHANGELOG.md ADDED
@@ -0,0 +1,35 @@
1
+ # CHANGELOG
2
+
3
+ ## [Unreleased]
4
+
5
+ [Unreleased]: https://github.com/validates-email-format-of/validates_email_format_of/compare/v1.7.2...master
6
+
7
+ ## [1.7.2]
8
+
9
+ * Fix regression that disallowed domains starting with number - https://github.com/validates-email-format-of/validates_email_format_of/issues/88
10
+
11
+ [Unreleased]: https://github.com/validates-email-format-of/validates_email_format_of/compare/v1.7.1...v1.7.2
12
+
13
+ ## [1.7.1] (3 Aug 2022)
14
+
15
+ * Fix invalid symbols being allowed in the local part - https://github.com/validates-email-format-of/validates_email_format_of/issues/86
16
+ * Fix rspec_matcher when using a custom error message - https://github.com/validates-email-format-of/validates_email_format_of/pull/85 - thanks https://github.com/luuqnhu !
17
+
18
+ [1.7.1]: https://github.com/validates-email-format-of/validates_email_format_of/compare/v1.7.0...v1.7.1
19
+
20
+ ## [1.7.0] (29 July 2022)
21
+
22
+ * Use Standard.rb for internal code formatting - https://github.com/validates-email-format-of/validates_email_format_of/commit/db1b0a86af58e478b7f9f2f269bf93bf48dc13c1
23
+ * Add support for comments in the local part and improve quoted character handling - https://github.com/validates-email-format-of/validates_email_format_of/issues/69
24
+ * Improve grammar for parsing domain part and validate domain part lengths - https://github.com/validates-email-format-of/validates_email_format_of/commit/2554b55e547c1fae6599d13b0c99296752888c91
25
+ * Do not strip spaces before validating - https://github.com/validates-email-format-of/validates_email_format_of/issues/61 and https://github.com/validates-email-format-of/validates_email_format_of/issues/72
26
+ * Allow setting check_mx_timeout and reduce the default timeout to 3 seconds - https://github.com/validates-email-format-of/validates_email_format_of/issues/66
27
+ * Fix regex duplicate character warning - https://github.com/validates-email-format-of/validates_email_format_of/pull/71
28
+ * Update CI to include Ruby 2.6 to 3.1 and Rails 4.2 to 7.0
29
+
30
+ [1.7.0]: https://github.com/validates-email-format-of/validates_email_format_of/compare/v1.6.1...v1.7.0
31
+ ## [1.6.1] (8 Sept 2014)
32
+
33
+ * In a Rails context, this gem now uses ActiveModel's default logic for constructing I18n keys, to make it easier to override them on a model/attribute basis.
34
+
35
+ [1.6.1]: https://github.com/validates-email-format-of/validates_email_format_of/compare/v1.6.0...v1.6.1
data/README.rdoc CHANGED
@@ -40,6 +40,8 @@ Or in your Gemfile:
40
40
  String. A custom error message when the email format is invalid (default is: "does not appear to be a valid e-mail address")
41
41
  :check_mx
42
42
  Boolean. Check domain for a valid MX record (default is false)
43
+ :check_mx_timeout
44
+ Integer. Timeout in seconds for checking MX records before a `ResolvTimeout` is raised (default is 3).
43
45
  :mx_message
44
46
  String. A custom error message when the domain does not match a valid MX record (default is: "is not routable"). Ignored unless :check_mx option is true.
45
47
  :local_length
@@ -56,7 +58,7 @@ Or in your Gemfile:
56
58
 
57
59
  == Testing
58
60
 
59
- To execute the unit tests run <tt>rspec</tt>.
61
+ To execute the unit tests against [all the Rails versions we support run](gemfiles/) <tt>bundle exec appraisal rspec</tt> or run against an individual version with <tt>bundle exec appraisal rails-6.0 rspec</tt>.
60
62
 
61
63
  Tested in Ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1.2, JRuby and REE 1.8.7.
62
64
 
@@ -83,7 +85,7 @@ Yes, our Rspec syntax is that simple!
83
85
 
84
86
  == Credits
85
87
 
86
- Written by Alex Dunae (dunae.ca), 2006-11.
88
+ Written by Alex Dunae (dunae.ca), 2006-22.
87
89
 
88
90
  Many thanks to the plugin's recent contributors: https://github.com/alexdunae/validates_email_format_of/contributors
89
91
 
@@ -0,0 +1,8 @@
1
+ fr:
2
+ activemodel: &errors
3
+ errors:
4
+ messages:
5
+ invalid_email_address: "ne semble pas être une adresse email valide"
6
+ email_address_not_routable: "n'est pas routable"
7
+ activerecord:
8
+ <<: *errors
@@ -0,0 +1,8 @@
1
+ it:
2
+ activemodel: &errors
3
+ errors:
4
+ messages:
5
+ invalid_email_address: 'non sembra un indirizzo e-mail valido'
6
+ email_address_not_routable: 'dominio non raggiungibile'
7
+ activerecord:
8
+ <<: *errors
@@ -0,0 +1,8 @@
1
+ ja:
2
+ activemodel: &errors
3
+ errors:
4
+ messages:
5
+ invalid_email_address: 'は妥当なメールアドレスでは無いようです。'
6
+ email_address_not_routable: 'は到達不能です。'
7
+ activerecord:
8
+ <<: *errors
@@ -0,0 +1,8 @@
1
+ pt-BR:
2
+ activemodel: &errors
3
+ errors:
4
+ messages:
5
+ invalid_email_address: 'não parece ser um endereço de e-mail válido'
6
+ email_address_not_routable: 'não é acessível'
7
+ activerecord:
8
+ <<: *errors
@@ -0,0 +1,8 @@
1
+ pt:
2
+ activemodel: &errors
3
+ errors:
4
+ messages:
5
+ invalid_email_address: 'não parece ser um endereço de e-mail válido'
6
+ email_address_not_routable: 'não é acessível'
7
+ activerecord:
8
+ <<: *errors
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 4.2.0"
6
+ gem "i18n", "< 1"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 5.0.7", ">= 5.0.7.2"
6
+ gem "i18n", "< 1"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 5.1.7"
6
+ gem "i18n", "< 1"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 5.2.4", ">= 5.2.4.3"
6
+ gem "i18n", "< 1"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 6.0.3", ">= 6.0.3.2"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 6.1.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 7.0"
6
+
7
+ gemspec path: "../"
@@ -1,7 +1,7 @@
1
- require 'validates_email_format_of'
2
- require 'active_model'
1
+ require "validates_email_format_of"
2
+ require "active_model"
3
3
 
4
- if ActiveModel::VERSION::MAJOR < 2 || (2 == ActiveModel::VERSION::MAJOR && ActiveModel::VERSION::MINOR < 1)
4
+ if ActiveModel::VERSION::MAJOR < 2 || (ActiveModel::VERSION::MAJOR == 2 && ActiveModel::VERSION::MINOR < 1)
5
5
  puts "WARNING: ActiveModel validation helper methods in validates_email_format_of gem are not compatible with ActiveModel < 2.1.0. Please use ValidatesEmailFormatOf::validate_email_format(email, options) or upgrade ActiveModel"
6
6
  end
7
7
 
@@ -9,7 +9,7 @@ module ActiveModel
9
9
  module Validations
10
10
  class EmailFormatValidator < EachValidator
11
11
  def validate_each(record, attribute, value)
12
- (ValidatesEmailFormatOf::validate_email_format(value, options.merge(:generate_message => true)) || []).each do |error|
12
+ (ValidatesEmailFormatOf.validate_email_format(value, options.merge(generate_message: true)) || []).each do |error|
13
13
  record.errors.add(attribute, error)
14
14
  end
15
15
  end
@@ -1,7 +1,7 @@
1
1
  module ValidatesEmailFormatOf
2
2
  class Railtie < Rails::Railtie
3
- initializer 'validates_email_format_of.load_i18n_locales' do |app|
4
- ValidatesEmailFormatOf::load_i18n_locales
3
+ initializer "validates_email_format_of.load_i18n_locales" do |app|
4
+ ValidatesEmailFormatOf.load_i18n_locales
5
5
  end
6
6
  end
7
7
  end
@@ -6,7 +6,7 @@ RSpec::Matchers.define :validate_email_format_of do |attribute|
6
6
  actual.send(:"#{attribute}=", "invalid@example.")
7
7
  expect(actual).to be_invalid
8
8
  @expected_message ||= ValidatesEmailFormatOf.default_message
9
- expect(actual.errors.messages[attribute.to_sym]).to include(@expected_message)
9
+ expect(actual.errors.added?(attribute, @expected_message)).to be_truthy
10
10
  end
11
11
  chain :with_message do |message|
12
12
  @expected_message = message
@@ -1,3 +1,3 @@
1
1
  module ValidatesEmailFormatOf
2
- VERSION = '1.6.3'
2
+ VERSION = "1.7.2"
3
3
  end