From bdf6806aea15078a4da465223c23245b98cbd945 Mon Sep 17 00:00:00 2001 From: Vladislav Trotsenko Date: Thu, 1 Dec 2022 13:24:57 +0100 Subject: [PATCH] Technical/Update CI/CD flow (#58) * Added new bunch of project linters * Added auto deploy to RubyGems * Added auto creating release notes on GitHub * Added lefthook config, removed overcommit * Updated gemspecs * Updated codeclimate/circleci configs * Updated gem development dependencies * Updated gem version, changelog --- .circleci/config.yml | 87 ++++++++++++++++--- .circleci/gemspec_compatible | 37 -------- .circleci/gemspecs/compatible | 27 ++++++ .circleci/{gemspec_latest => gemspecs/latest} | 20 +---- .circleci/linter_configs/.bundler-audit.yml | 4 + .circleci/linter_configs/.fasterer.yml | 4 + .circleci/linter_configs/.mdlrc | 7 ++ .../linter_configs/.rubocop.yml | 23 ++--- .circleci/linter_configs/.yamllint.yml | 7 ++ .circleci/scripts/release.sh | 63 ++++++++++++++ .../scripts/set_publisher_credentials.sh | 12 +++ .codeclimate.yml | 4 + .github/FUNDING.yml | 2 + .overcommit.yml | 32 ------- .reek.yml | 2 + CHANGELOG.md | 19 ++++ CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 14 ++- lefthook.yml | 22 +++++ lib/smtp_mock/version.rb | 2 +- smtp_mock.gemspec | 8 +- 22 files changed, 281 insertions(+), 119 deletions(-) delete mode 100644 .circleci/gemspec_compatible create mode 100644 .circleci/gemspecs/compatible rename .circleci/{gemspec_latest => gemspecs/latest} (62%) create mode 100644 .circleci/linter_configs/.bundler-audit.yml create mode 100644 .circleci/linter_configs/.fasterer.yml create mode 100644 .circleci/linter_configs/.mdlrc rename .rubocop.yml => .circleci/linter_configs/.rubocop.yml (88%) create mode 100644 .circleci/linter_configs/.yamllint.yml create mode 100755 .circleci/scripts/release.sh create mode 100755 .circleci/scripts/set_publisher_credentials.sh delete mode 100644 .overcommit.yml create mode 100644 lefthook.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 4942b86..f688f38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,5 @@ +--- + version: 2.1 defaults: &defaults @@ -13,19 +15,21 @@ references: restore_cache: keys: - ruby-smtp-mock-{{ checksum "smtp_mock.gemspec" }} + paths: + - ~/vendor/bundle bundle_install: &bundle_install run: name: Installing gems command: | - bundle config set --local path 'vendor/bundle' + bundle config set --local path '~/vendor/bundle' bundle install save_bundle_cache: &save_bundle_cache save_cache: key: ruby-smtp-mock-{{ checksum "smtp_mock.gemspec" }} paths: - - vendor/bundle + - ~/vendor/bundle system_dependencies: &system_dependencies run: @@ -33,6 +37,20 @@ references: command: | bundle exec smtp_mock -s -i ~ + install_yamllint: &install_yamllint + run: + name: Installing Yamllint + command: | + sudo apt-get update -y + sudo apt-get install -y yamllint + + install_lefthook: &install_lefthook + run: + name: Installing Lefthook + command: | + curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.deb.sh' | sudo -E bash + sudo apt-get install -y lefthook + install_codeclimate_reporter: &install_codeclimate_reporter run: name: Installing CodeClimate test reporter @@ -43,14 +61,12 @@ references: use_latest_gemspec: &use_latest_gemspec run: name: Using latest gemspec - command: | - cp .circleci/gemspec_latest smtp_mock.gemspec + command: cp .circleci/gemspecs/latest smtp_mock.gemspec use_compatible_gemspec: &use_compatible_gemspec run: name: Using compatible gemspec - command: | - cp .circleci/gemspec_compatible smtp_mock.gemspec + command: cp .circleci/gemspecs/compatible smtp_mock.gemspec jobs: linters-ruby: @@ -67,12 +83,23 @@ jobs: - <<: *restore_bundle_cache - <<: *bundle_install - <<: *save_bundle_cache + - <<: *install_yamllint + - <<: *install_lefthook + + - run: + name: Running code style linters + command: lefthook run code-style-linters - run: - name: Running Overcommit + name: Running code performance linters command: | - bundle exec overcommit -s - SKIP=AuthorEmail,AuthorName bundle exec overcommit -r + cp .circleci/linter_configs/.fasterer.yml .fasterer.yml + lefthook run code-performance-linters + rm .fasterer.yml + + - run: + name: Running code vulnerability linters + command: lefthook run code-vulnerability-linters tests-ruby: parameters: @@ -116,22 +143,45 @@ jobs: parameters: ruby-version: type: string - docker: - - image: cimg/ruby:<< parameters.ruby-version >> + + <<: *defaults + steps: - checkout + - <<: *use_compatible_gemspec + - ruby/install-deps: bundler-version: "2.3.26" with-cache: false - path: './vendor/custom_bundle' + path: '~/vendor/custom_bundle' + - <<: *system_dependencies + - run: name: Running compatibility tests command: bundle exec rspec + releasing-gem-from-ruby: + parameters: + ruby-version: + type: string + + <<: *defaults + + steps: + - checkout + + - add_ssh_keys: + fingerprints: + - "55:d3:88:af:10:c9:b1:9d:53:f4:d8:fc:79:4c:69:f7" + + - run: + name: Publishing new release + command: ./.circleci/scripts/release.sh + workflows: - build_and_test: + build_test_deploy: jobs: - linters-ruby: matrix: @@ -145,3 +195,14 @@ workflows: matrix: parameters: ruby-version: ["2.5", "2.6", "2.7", "3.0"] + - releasing-gem-from-ruby: + requires: + - linters-ruby + - tests-ruby + - compatibility-ruby + matrix: + parameters: + ruby-version: ["2.5"] + filters: + branches: + only: master diff --git a/.circleci/gemspec_compatible b/.circleci/gemspec_compatible deleted file mode 100644 index 9ddd225..0000000 --- a/.circleci/gemspec_compatible +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -require_relative 'lib/smtp_mock/version' - -Gem::Specification.new do |spec| - spec.name = 'smtp_mock' - spec.version = SmtpMock::VERSION - spec.authors = ['Vladislav Trotsenko'] - spec.email = ['admin@bestweb.com.ua'] - - spec.summary = %(smtp_mock) - spec.description = %(💎 Ruby SMTP mock. Mimic any SMTP server behaviour for your test environment.) - - spec.homepage = 'https://github.com/mocktools/ruby-smtp-mock' - spec.license = 'MIT' - - spec.metadata = { - 'homepage_uri' => 'https://github.com/mocktools/ruby-smtp-mock', - 'changelog_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/CHANGELOG.md', - 'source_code_uri' => 'https://github.com/mocktools/ruby-smtp-mock', - 'documentation_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/README.md', - 'bug_tracker_uri' => 'https://github.com/mocktools/ruby-smtp-mock/issues' - } - - spec.required_ruby_version = '>= 2.5.0' - dry_struct_version = ::Gem::Version.new(::RUBY_VERSION) >= ::Gem::Version.new('2.7.0') ? '~> 1.6' : '~> 1.4' - - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - spec.executables = %w[smtp_mock] - spec.require_paths = %w[lib] - - spec.add_runtime_dependency 'dry-struct', dry_struct_version - - spec.add_development_dependency 'ffaker', '~> 2.21' - spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6' - spec.add_development_dependency 'rspec', '~> 3.12' -end diff --git a/.circleci/gemspecs/compatible b/.circleci/gemspecs/compatible new file mode 100644 index 0000000..89b410d --- /dev/null +++ b/.circleci/gemspecs/compatible @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative 'lib/smtp_mock/version' + +Gem::Specification.new do |spec| + spec.name = 'smtp_mock' + spec.version = SmtpMock::VERSION + spec.authors = ['Vladislav Trotsenko'] + spec.email = %w[admin@bestweb.com.ua] + spec.summary = %(smtp_mock) + spec.description = %(💎 Ruby SMTP mock. Mimic any SMTP server behaviour for your test environment.) + spec.homepage = 'https://github.com/mocktools/ruby-smtp-mock' + spec.license = 'MIT' + + dry_struct_version = ::Gem::Version.new(::RUBY_VERSION) >= ::Gem::Version.new('2.7.0') ? '~> 1.6' : '~> 1.4' + + spec.required_ruby_version = '>= 2.5.0' + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.executables = %w[smtp_mock] + spec.require_paths = %w[lib] + + spec.add_runtime_dependency 'dry-struct', dry_struct_version + + spec.add_development_dependency 'ffaker' + spec.add_development_dependency 'rake' + spec.add_development_dependency 'rspec' +end diff --git a/.circleci/gemspec_latest b/.circleci/gemspecs/latest similarity index 62% rename from .circleci/gemspec_latest rename to .circleci/gemspecs/latest index 073328a..e385352 100644 --- a/.circleci/gemspec_latest +++ b/.circleci/gemspecs/latest @@ -6,36 +6,24 @@ Gem::Specification.new do |spec| spec.name = 'smtp_mock' spec.version = SmtpMock::VERSION spec.authors = ['Vladislav Trotsenko'] - spec.email = ['admin@bestweb.com.ua'] - + spec.email = %w[admin@bestweb.com.ua] spec.summary = %(smtp_mock) spec.description = %(💎 Ruby SMTP mock. Mimic any SMTP server behaviour for your test environment.) - spec.homepage = 'https://github.com/mocktools/ruby-smtp-mock' spec.license = 'MIT' - spec.metadata = { - 'homepage_uri' => 'https://github.com/mocktools/ruby-smtp-mock', - 'changelog_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/CHANGELOG.md', - 'source_code_uri' => 'https://github.com/mocktools/ruby-smtp-mock', - 'documentation_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/README.md', - 'bug_tracker_uri' => 'https://github.com/mocktools/ruby-smtp-mock/issues' - } - spec.required_ruby_version = '>= 2.5.0' - - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - spec.executables = %w[smtp_mock] + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.executables = %w[smtp_mock] spec.require_paths = %w[lib] - spec.post_install_message = 'smtpmock is required system dependency. For more details run: `bundle exec smtp_mock -h`' spec.add_runtime_dependency 'dry-struct', '~> 1.6' spec.add_development_dependency 'bundler-audit', '~> 0.9.1' spec.add_development_dependency 'fasterer', '~> 0.10.0' spec.add_development_dependency 'ffaker', '~> 2.21' + spec.add_development_dependency 'mdl', '~> 0.12.0' spec.add_development_dependency 'net-smtp', '~> 0.3.3' - spec.add_development_dependency 'overcommit', '~> 0.59.1' spec.add_development_dependency 'pry-byebug', '~> 3.10', '>= 3.10.1' spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6' spec.add_development_dependency 'reek', '~> 6.1', '>= 6.1.1' diff --git a/.circleci/linter_configs/.bundler-audit.yml b/.circleci/linter_configs/.bundler-audit.yml new file mode 100644 index 0000000..46f2b05 --- /dev/null +++ b/.circleci/linter_configs/.bundler-audit.yml @@ -0,0 +1,4 @@ +--- + +ignore: + - EXA-MPLE-XXXX diff --git a/.circleci/linter_configs/.fasterer.yml b/.circleci/linter_configs/.fasterer.yml new file mode 100644 index 0000000..8c1976b --- /dev/null +++ b/.circleci/linter_configs/.fasterer.yml @@ -0,0 +1,4 @@ +--- + +exclude_paths: + - '.circleci/**/*.rb' diff --git a/.circleci/linter_configs/.mdlrc b/.circleci/linter_configs/.mdlrc new file mode 100644 index 0000000..aa2313b --- /dev/null +++ b/.circleci/linter_configs/.mdlrc @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +all +rule 'MD013', line_length: 500 +rule 'MD029', style: :ordered +exclude_rule 'MD007' +exclude_rule 'MD024' diff --git a/.rubocop.yml b/.circleci/linter_configs/.rubocop.yml similarity index 88% rename from .rubocop.yml rename to .circleci/linter_configs/.rubocop.yml index 0c0265e..8645cc6 100644 --- a/.rubocop.yml +++ b/.circleci/linter_configs/.rubocop.yml @@ -1,11 +1,14 @@ +--- + require: - rubocop-rspec - rubocop-performance AllCops: - DisplayCopNames: true - DisplayStyleGuide: true - TargetRubyVersion: 2.5 + DisplayCopNames: true + DisplayStyleGuide: true + TargetRubyVersion: 2.5 + SuggestExtensions: false NewCops: enable # Metrics --------------------------------------------------------------------- @@ -66,13 +69,13 @@ Layout/ClassStructure: - prepend - extend ExpectedOrder: - - module_inclusion - - constants - - public_class_methods - - initializer - - public_methods - - protected_methods - - private_methods + - module_inclusion + - constants + - public_class_methods + - initializer + - public_methods + - protected_methods + - private_methods Layout/EmptyLineAfterGuardClause: Enabled: false diff --git a/.circleci/linter_configs/.yamllint.yml b/.circleci/linter_configs/.yamllint.yml new file mode 100644 index 0000000..10a4ecf --- /dev/null +++ b/.circleci/linter_configs/.yamllint.yml @@ -0,0 +1,7 @@ +--- + +extends: default + +rules: + line-length: + max: 200 diff --git a/.circleci/scripts/release.sh b/.circleci/scripts/release.sh new file mode 100755 index 0000000..41d641f --- /dev/null +++ b/.circleci/scripts/release.sh @@ -0,0 +1,63 @@ +# !/bin/sh +set -e + +GH_CLI_RELEASES_URL="https://github.com/cli/cli/releases" +FILE_NAME="gh" +BUILD_ARCHITECTURE="linux_amd64.deb" +DELIMETER="_" +PACKAGE_FILE="$FILE_NAME$DELIMETER$BUILD_ARCHITECTURE" + +gh_cli_latest_release() { + curl -sL -o /dev/null -w %{url_effective} "$GH_CLI_RELEASES_URL/latest" | rev | cut -f1 -d'/'| rev +} + +download_gh_cli() { + test -z "$VERSION" && VERSION="$(gh_cli_latest_release)" + test -z "$VERSION" && { + echo "Unable to get GitHub CLI release." >&2 + exit 1 + } + curl -s -L -o "$PACKAGE_FILE" "$GH_CLI_RELEASES_URL/download/$VERSION/$FILE_NAME$DELIMETER${VERSION:1}$DELIMETER$BUILD_ARCHITECTURE" +} + +install_gh_cli() { + sudo dpkg -i "$PACKAGE_FILE" + rm "$PACKAGE_FILE" +} + +get_release_candidate_version() { + echo $(ruby -r rubygems -e "puts Gem::Specification::load('$(ls *.gemspec)').version") +} + +release_candidate_tag="v$(get_release_candidate_version)" + +is_an_existing_github_release() { + git fetch origin "refs/tags/$release_candidate_tag" >/dev/null 2>&1 +} + +release_to_rubygems() { + echo "Setting RubyGems publisher credentials..." + ./.circleci/scripts/set_publisher_credentials.sh + echo "Preparation for release..." + git config --global user.email ${PUBLISHER_EMAIL} + git config --global user.name ${PUBLISHER_NAME} + git stash + git checkout develop + gem install yard gem-ctags + bundle install + echo "Publishing new gem release to RubyGems..." + rake release +} + +release_to_github() { + echo "Downloading and installing latest gh cli..." + download_gh_cli + install_gh_cli + echo "Publishing new release notes to GitHub..." + gh release create "$release_candidate_tag" --generate-notes +} + +if is_an_existing_github_release +then echo "Tag $release_candidate_tag already exists on GitHub. Skipping releasing flow..." +else release_to_rubygems; release_to_github +fi diff --git a/.circleci/scripts/set_publisher_credentials.sh b/.circleci/scripts/set_publisher_credentials.sh new file mode 100755 index 0000000..f3d725b --- /dev/null +++ b/.circleci/scripts/set_publisher_credentials.sh @@ -0,0 +1,12 @@ +# !/bin/sh +set -e +set +x +mkdir -p ~/.gem + +cat << EOF > ~/.gem/credentials +--- +:rubygems_api_key: ${RUBYGEMS_API_KEY} +EOF + +chmod 0600 ~/.gem/credentials +set -x diff --git a/.codeclimate.yml b/.codeclimate.yml index 4e01e4e..db21ad1 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,3 +1,5 @@ +--- + checks: argument-count: enabled: false @@ -8,6 +10,8 @@ plugins: rubocop: enabled: true channel: rubocop-1-39 + config: + file: .circleci/linter_configs/.rubocop.yml reek: enabled: true diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index ae2d9cf..0844874 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,3 @@ +--- + github: [bestwebua] diff --git a/.overcommit.yml b/.overcommit.yml deleted file mode 100644 index 071cbde..0000000 --- a/.overcommit.yml +++ /dev/null @@ -1,32 +0,0 @@ -PreCommit: - AuthorEmail: - enabled: true - required: false - - AuthorName: - enabled: false - - BundleAudit: - enabled: true - - Fasterer: - enabled: true - include: '**/*.rb' - - TrailingWhitespace: - enabled: true - - RuboCop: - enabled: true - flags: ['--format=emacs', '--force-exclusion', '--display-cop-names'] - - Reek: - enabled: true - flags: ['--force-exclusion'] - -PostCheckout: - ALL: - quiet: true - - IndexTags: - enabled: true diff --git a/.reek.yml b/.reek.yml index 9b7e802..2191a1c 100644 --- a/.reek.yml +++ b/.reek.yml @@ -1,3 +1,5 @@ +--- + detectors: IrresponsibleModule: enabled: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 34fccf0..602fedd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ 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). +## [1.3.1] - 2022-12-01 + +### Added + +- Added new bunch of project linters +- Added auto deploy to RubyGems +- Added auto creating release notes on GitHub + +### Updated + +- Updated gemspecs +- Updated codeclimate/circleci configs +- Updated gem development dependencies +- Updated gem version + +### Removed + +- Removed `overcommit` dependency + ## [1.3.0] - 2022-11-19 ### Added diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index ff7458d..f2ffd6f 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -23,7 +23,7 @@ include: Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or -advances + advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 78ee920..d52fed1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,4 +45,4 @@ Guidelines for pull requests: 5. Create a new branch 6. Read our [setup development environment guide](.github/DEVELOPMENT_ENVIRONMENT_GUIDE.md) 7. Make your changes. Please note that your PR should include tests for the new codebase! -9. Push to your fork and submit a pull request to `develop` branch +8. Push to your fork and submit a pull request to `develop` branch diff --git a/README.md b/README.md index becbcd6..98ce5e5 100644 --- a/README.md +++ b/README.md @@ -57,15 +57,21 @@ end And then execute: - $ bundle +```bash +bundle +``` Or install it yourself as: - $ gem install smtp_mock +```bash +gem install smtp_mock +``` Then install [`smtpmock`](https://github.com/mocktools/go-smtp-mock) as system dependency: - $ bundle exec smtp_mock -i ~ +```bash +bundle exec smtp_mock -i ~ +``` ## Usage @@ -242,7 +248,7 @@ SmtpMock::TestFramework::RSpec::Interface.clear_server! # clears current SmtpMoc ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/mocktools/ruby-smtp-mock. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. Please check the [open tickets](https://github.com/mocktools/ruby-smtp-mock/issues). Be sure to follow Contributor Code of Conduct below and our [Contributing Guidelines](CONTRIBUTING.md). +Bug reports and pull requests are welcome on GitHub at . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. Please check the [open tickets](https://github.com/mocktools/ruby-smtp-mock/issues). Be sure to follow Contributor Code of Conduct below and our [Contributing Guidelines](CONTRIBUTING.md). ## License diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 0000000..f43fb86 --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,22 @@ +--- + +skip_output: + - meta +code-style-linters: + commands: + markdownlint: + run: bundle exec mdl . -s './.circleci/linter_configs/.mdlrc' + reek: + run: bundle exec reek + rubocop: + run: bundle exec rubocop -c '.circleci/linter_configs/.rubocop.yml' + yamllint: + run: yamllint -c '.circleci/linter_configs/.yamllint.yml' . +code-performance-linters: + commands: + fasterer: + run: bundle exec fasterer +code-vulnerability-linters: + commands: + bundle-audit: + run: bundle exec bundle-audit check --update -c '.circleci/linter_configs/.bundler-audit.yml' diff --git a/lib/smtp_mock/version.rb b/lib/smtp_mock/version.rb index a622d6d..3b716df 100644 --- a/lib/smtp_mock/version.rb +++ b/lib/smtp_mock/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module SmtpMock - VERSION = '1.3.0' + VERSION = '1.3.1' end diff --git a/smtp_mock.gemspec b/smtp_mock.gemspec index 3e802c2..8022445 100644 --- a/smtp_mock.gemspec +++ b/smtp_mock.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |spec| spec.name = 'smtp_mock' spec.version = SmtpMock::VERSION spec.authors = ['Vladislav Trotsenko'] - spec.email = ['admin@bestweb.com.ua'] + spec.email = %w[admin@bestweb.com.ua] spec.summary = %(smtp_mock) spec.description = %(💎 Ruby SMTP mock. Mimic any SMTP server behaviour for your test environment.) @@ -22,12 +22,12 @@ Gem::Specification.new do |spec| 'bug_tracker_uri' => 'https://github.com/mocktools/ruby-smtp-mock/issues' } - spec.required_ruby_version = '>= 2.5.0' current_ruby_version = ::Gem::Version.new(::RUBY_VERSION) dry_struct_version = current_ruby_version >= ::Gem::Version.new('2.7.0') ? '~> 1.6' : '~> 1.4' - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - spec.executables = %w[smtp_mock] + spec.required_ruby_version = '>= 2.5.0' + spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(bin|lib|tmp)/|.ruby-version|smtp_mock.gemspec|LICENSE}) } + spec.executables = %w[smtp_mock] spec.require_paths = %w[lib] spec.post_install_message = 'smtpmock is required system dependency. For more details run: `bundle exec smtp_mock -h`'