diff --git a/.codeclimate.yml b/.codeclimate.yml index 682047c..45a87ed 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -7,7 +7,7 @@ checks: plugins: rubocop: enabled: true - channel: rubocop-1-14 + channel: rubocop-1-16 reek: enabled: true diff --git a/.rubocop.yml b/.rubocop.yml index d3f0f6d..6454dd3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -154,6 +154,15 @@ Style/HashConversion: Style/StringChars: Enabled: true +Style/InPatternThen: + Enabled: true + +Style/MultilineInPatternThen: + Enabled: true + +Style/QuotedSymbols: + Enabled: true + Layout/LineLength: Max: 140 @@ -308,6 +317,9 @@ Lint/SymbolConversion: Lint/TripleQuotes: Enabled: true +Lint/EmptyInPattern: + Enabled: true + Gemspec/DateAssignment: Enabled: true @@ -388,3 +400,9 @@ RSpec/MultipleMemoizedHelpers: RSpec/StubbedMock: Enabled: false + +RSpec/IdenticalEqualityAssertion: + Enabled: true + +RSpec/Rails/AvoidSetupHook: + Enabled: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 97a9da6..7d6149b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.4.3] - 2021.06.15 + +### Updated + +- Updated gem development dependencies +- Updated Rubocop/Codeclimate config +- Updated gem documentation, version + ## [2.4.2] - 2021.05.13 ### Fixed diff --git a/Gemfile.lock b/Gemfile.lock index 1e4cde5..2e981e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - truemail (2.4.2) + truemail (2.4.3) simpleidn (~> 0.2.1) GEM @@ -14,16 +14,16 @@ GEM bundler (>= 1.2.0, < 3) thor (~> 1.0) byebug (11.1.3) - childprocess (4.0.0) + childprocess (4.1.0) coderay (1.1.3) colorize (0.8.1) - concurrent-ruby (1.1.8) + concurrent-ruby (1.1.9) crack (0.4.5) rexml diff-lcs (1.4.4) - dns_mock (1.2.3) + dns_mock (1.3.0) docile (1.4.0) - faker (2.17.0) + faker (2.18.0) i18n (>= 1.6, < 2) fasterer (0.9.0) colorize (~> 0.7) @@ -38,9 +38,10 @@ GEM json_schema (0.21.0) kwalify (0.7.2) method_source (1.0.0) - overcommit (0.57.0) + overcommit (0.58.0) childprocess (>= 0.6.3, < 5) iniparse (~> 1.4) + rexml (~> 3.2) parallel (1.20.1) parser (3.0.1.1) ast (~> 2.4.1) @@ -50,7 +51,7 @@ GEM pry-byebug (3.9.0) byebug (~> 11.0) pry (~> 0.13.0) - psych (3.3.1) + psych (3.3.2) public_suffix (4.0.6) rainbow (3.0.0) rake (13.0.3) @@ -74,27 +75,27 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) rspec-support (3.10.2) - rubocop (1.14.0) + rubocop (1.16.1) parallel (~> 1.10) parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.5.0, < 2.0) + rubocop-ast (>= 1.7.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.5.0) + rubocop-ast (1.7.0) parser (>= 3.0.1.1) rubocop-performance (1.11.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rspec (2.3.0) + rubocop-rspec (2.4.0) rubocop (~> 1.0) rubocop-ast (>= 1.1.0) ruby-progressbar (1.11.0) - ruby_parser (3.15.1) - sexp_processor (~> 4.9) - sexp_processor (4.15.2) + ruby_parser (3.16.0) + sexp_processor (~> 4.15, >= 4.15.1) + sexp_processor (4.15.3) simplecov (0.17.1) docile (~> 1.1) json (>= 1.8, < 3) @@ -111,33 +112,33 @@ GEM unf_ext unf_ext (0.0.7.7) unicode-display_width (2.0.0) - webmock (3.12.2) + webmock (3.13.0) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) PLATFORMS - x86_64-darwin-19 + x86_64-darwin-20 DEPENDENCIES - bundler (~> 2.2, >= 2.2.17) + bundler (~> 2.2, >= 2.2.20) bundler-audit (~> 0.8.0) - dns_mock (~> 1.2, >= 1.2.3) - faker (~> 2.17) + dns_mock (~> 1.3) + faker (~> 2.18) fasterer (~> 0.9.0) json_matchers (~> 0.11.1) - overcommit (~> 0.57.0) + overcommit (~> 0.58.0) pry-byebug (~> 3.9) rake (~> 13.0, >= 13.0.3) reek (~> 6.0, >= 6.0.4) rspec (~> 3.10) - rubocop (~> 1.14) + rubocop (~> 1.16, >= 1.16.1) rubocop-performance (~> 1.11, >= 1.11.3) - rubocop-rspec (~> 2.3) + rubocop-rspec (~> 2.4) simplecov (~> 0.17.1) truemail! truemail-rspec (~> 0.6) - webmock (~> 3.12, >= 3.12.2) + webmock (~> 3.13) BUNDLED WITH - 2.2.17 + 2.2.20 diff --git a/README.md b/README.md index c0aede1..8814970 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ Truemail.configure do |config| # Optional parameter. Validation of email which contains whitelisted domain always will # return true. Other validations will not processed even if it was defined in validation_type_for # It is equal to empty array by default. - config.whitelisted_domains = ['somedomain1.com', 'somedomain2.com'] + config.whitelisted_domains = %w[somedomain1.com somedomain2.com] # Optional parameter. With this option Truemail will validate email which contains whitelisted # domain only, i.e. if domain whitelisted, validation will passed to Regex, MX or SMTP validators. @@ -204,18 +204,18 @@ Truemail.configure do |config| # Optional parameter. Validation of email which contains blacklisted domain always will # return false. Other validations will not processed even if it was defined in validation_type_for # It is equal to empty array by default. - config.blacklisted_domains = ['somedomain3.com', 'somedomain4.com'] + config.blacklisted_domains = %w[somedomain3.com somedomain4.com] # Optional parameter. With this option Truemail will filter out unwanted mx servers via # predefined list of ip addresses. It can be used as a part of DEA (disposable email # address) validations. It is equal to empty array by default. - config.blacklisted_mx_ip_addresses = ['1.1.1.1', '2.2.2.2'] + config.blacklisted_mx_ip_addresses = %w[1.1.1.1 2.2.2.2] # Optional parameter. This option will provide to use custom DNS gateway when Truemail # interacts with DNS. Valid port numbers are in the range 1-65535. If you won't specify # nameserver's ports Truemail will use default DNS TCP/UDP port 53. By default Truemail # uses DNS gateway from system settings and this option is equal to empty array. - config.dns = ['10.0.0.1', '10.0.0.2:54'] + config.dns = %w[10.0.0.1 10.0.0.2:54] # Optional parameter. This option will provide to use not RFC MX lookup flow. # It means that MX and Null MX records will be cheked on the DNS validation layer only. @@ -351,8 +351,8 @@ require 'truemail' Truemail.configure do |config| config.verifier_email = 'verifier@example.com' - config.whitelisted_domains = ['white-domain.com', 'somedomain.com'] - config.blacklisted_domains = ['black-domain.com', 'somedomain.com'] + config.whitelisted_domains = %w[white-domain.com somedomain.com] + config.blacklisted_domains = %w[black-domain.com somedomain.com] config.validation_type_for = { 'somedomain.com' => :mx } end ``` @@ -400,7 +400,7 @@ require 'truemail' Truemail.configure do |config| config.verifier_email = 'verifier@example.com' - config.whitelisted_domains = ['white-domain.com'] + config.whitelisted_domains = %w[white-domain.com] config.whitelist_validation = true end ``` @@ -768,7 +768,7 @@ require 'truemail' Truemail.configure do |config| config.verifier_email = 'verifier@example.com' - config.blacklisted_mx_ip_addresses = ['127.0.1.2'] + config.blacklisted_mx_ip_addresses = %w[127.0.1.2] end Truemail.validate('email@example.com', with: :mx_blacklist) diff --git a/lib/truemail/version.rb b/lib/truemail/version.rb index 7cca255..9c83d04 100644 --- a/lib/truemail/version.rb +++ b/lib/truemail/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Truemail - VERSION = '2.4.2' + VERSION = '2.4.3' end diff --git a/spec/truemail/validate/domain_list_match_spec.rb b/spec/truemail/validate/domain_list_match_spec.rb index 3a8fe07..f9fa613 100644 --- a/spec/truemail/validate/domain_list_match_spec.rb +++ b/spec/truemail/validate/domain_list_match_spec.rb @@ -67,10 +67,7 @@ before { allow(configuration_instance).to receive(:whitelisted_domains).and_return([domain]) } context 'when email domain in white list' do - specify do - allow(configuration_instance).to receive(:blacklisted_domains).and_return([]) - expect { domain_list_match_validator }.not_to change(result_instance, :success) - end + specify { expect { domain_list_match_validator }.not_to change(result_instance, :success) } end context 'when email domain exists on both lists' do diff --git a/truemail.gemspec b/truemail.gemspec index b84f410..008b667 100644 --- a/truemail.gemspec +++ b/truemail.gemspec @@ -33,21 +33,21 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency 'simpleidn', '~> 0.2.1' - spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.17' + spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.20' spec.add_development_dependency 'bundler-audit', '~> 0.8.0' - spec.add_development_dependency 'dns_mock', '~> 1.2', '>= 1.2.3' - spec.add_development_dependency 'faker', '~> 2.17' + spec.add_development_dependency 'dns_mock', '~> 1.3' + spec.add_development_dependency 'faker', '~> 2.18' spec.add_development_dependency 'fasterer', '~> 0.9.0' spec.add_development_dependency 'json_matchers', '~> 0.11.1' - spec.add_development_dependency 'overcommit', '~> 0.57.0' + spec.add_development_dependency 'overcommit', '~> 0.58.0' spec.add_development_dependency 'pry-byebug', '~> 3.9' spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.3' spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.4' spec.add_development_dependency 'rspec', '~> 3.10' - spec.add_development_dependency 'rubocop', '~> 1.14' + spec.add_development_dependency 'rubocop', '~> 1.16', '>= 1.16.1' spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.3' - spec.add_development_dependency 'rubocop-rspec', '~> 2.3' + spec.add_development_dependency 'rubocop-rspec', '~> 2.4' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'truemail-rspec', '~> 0.6' - spec.add_development_dependency 'webmock', '~> 3.12', '>= 3.12.2' + spec.add_development_dependency 'webmock', '~> 3.13' end