Skip to content

Commit

Permalink
Feature/Ability to use multiple RCPT TO (#56)
Browse files Browse the repository at this point in the history
* Updated SmtpMock::Types::Bool, tests
* Updated codeclimate/circleci configs
* Updated gemspecs
* Updated gem runtime/development dependencies
* Updated gem documentation, version
  • Loading branch information
bestwebua committed Nov 19, 2022
1 parent c08e098 commit a9b27f6
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defaults: &defaults
- image: cimg/ruby:<< parameters.ruby-version >>

orbs:
ruby: circleci/ruby@1.8.0
ruby: circleci/ruby@2.0.0

references:
restore_bundle_cache: &restore_bundle_cache
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- checkout
- <<: *use_compatible_gemspec
- ruby/install-deps:
bundler-version: "2.3.23"
bundler-version: "2.3.26"
with-cache: false
path: './vendor/custom_bundle'
- <<: *system_dependencies
Expand Down
5 changes: 3 additions & 2 deletions .circleci/gemspec_compatible
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ Gem::Specification.new do |spec|
}

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', '~> 1.4'
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.11'
spec.add_development_dependency 'rspec', '~> 3.12'
end
12 changes: 6 additions & 6 deletions .circleci/gemspec_latest
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ Gem::Specification.new do |spec|
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.4'
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 'net-smtp', '~> 0.3.2'
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'
spec.add_development_dependency 'rspec', '~> 3.11'
spec.add_development_dependency 'rubocop', '~> 1.36'
spec.add_development_dependency 'rubocop-performance', '~> 1.15'
spec.add_development_dependency 'rubocop-rspec', '~> 2.13', '>= 2.13.2'
spec.add_development_dependency 'rspec', '~> 3.12'
spec.add_development_dependency 'rubocop', '~> 1.39'
spec.add_development_dependency 'rubocop-performance', '~> 1.15', '>= 1.15.1'
spec.add_development_dependency 'rubocop-rspec', '~> 2.15'
spec.add_development_dependency 'simplecov', '~> 0.21.2'
end
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ checks:
plugins:
rubocop:
enabled: true
channel: rubocop-1-36
channel: rubocop-1-39

reek:
enabled: true
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

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.0] - 2022-11-19

### Added

- Added ability to configure multiple `RCPT TO` receiving scenario

### Updated

- Updated `SmtpMock::Types::Bool`, tests
- Updated codeclimate/circleci configs
- Updated gemspecs
- Updated gem runtime/development dependencies
- Updated gem documentation, version

## [1.2.2] - 2022-10-05

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![CircleCI](https://circleci.com/gh/mocktools/ruby-smtp-mock/tree/master.svg?style=svg)](https://circleci.com/gh/mocktools/ruby-smtp-mock/tree/master)
[![Gem Version](https://badge.fury.io/rb/smtp_mock.svg)](https://badge.fury.io/rb/smtp_mock)
[![Downloads](https://img.shields.io/gem/dt/smtp_mock.svg?colorA=004d99&colorB=0073e6)](https://rubygems.org/gems/smtp_mock)
[![In Awesome Ruby](https://raw.githubusercontent.com/sindresorhus/awesome/main/media/mentioned-badge.svg)](https://github.com/markets/awesome-ruby)
[![GitHub](https://img.shields.io/github/license/mocktools/ruby-smtp-mock)](LICENSE.txt)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)

Expand Down Expand Up @@ -95,6 +96,7 @@ This gem includes easy system dependency manager. Run `bundle exec smtp_mock` wi
| `session_timeout: 60` | Session timeout in seconds. It's equal to 30 seconds by default |
| `shutdown_timeout: 5` | Graceful shutdown timeout in seconds. It's equal to 1 second by default |
| `fail_fast: true` | Enables fail fast scenario. Disabled by default |
| `multiple_rcptto: true` | Enables multiple `RCPT TO` receiving scenario. Disabled by default |
| `multiple_message_receiving: true` | Enables multiple message receiving scenario. Disabled by default |
| `blacklisted_helo_domains: %w[a.com b.com]` | Blacklisted `HELO` domains |
| `blacklisted_mailfrom_emails: %w[[email protected] [email protected]]` | Blacklisted `MAIL FROM` emails |
Expand Down
2 changes: 1 addition & 1 deletion lib/smtp_mock/command_line_args_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CommandLineArgsBuilder < Dry::Struct
blacklisted_rcptto_emails
not_registered_emails
].freeze,
SmtpMock::Types::Bool.constrained(eql: true) => %i[log fail_fast multiple_message_receiving].freeze,
SmtpMock::Types::Bool.constrained(eql: true) => %i[log fail_fast multiple_rcptto multiple_message_receiving].freeze,
SmtpMock::Types::Integer.constrained(gteq: 1) => %i[
port
session_timeout
Expand Down
2 changes: 1 addition & 1 deletion lib/smtp_mock/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SmtpMock
VERSION = '1.2.2'
VERSION = '1.3.0'
end
8 changes: 5 additions & 3 deletions smtp_mock.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ Gem::Specification.new do |spec|
}

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.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.4'
spec.add_runtime_dependency 'dry-struct', dry_struct_version

spec.add_development_dependency 'ffaker', '~> 2.21'
spec.add_development_dependency 'net-smtp', '~> 0.3.2' if ::RUBY_VERSION >= '3.1.0'
spec.add_development_dependency 'net-smtp', '~> 0.3.3' if current_ruby_version >= ::Gem::Version.new('3.1.0')
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
spec.add_development_dependency 'rspec', '~> 3.11'
spec.add_development_dependency 'rspec', '~> 3.12'
end
2 changes: 2 additions & 0 deletions spec/smtp_mock/command_line_args_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
session_timeout: session_timeout,
shutdown_timeout: shutdown_timeout,
fail_fast: true,
multiple_rcptto: true,
multiple_message_receiving: true,
msg_size_limit: msg_size_limit,
blacklisted_helo_domains: blacklisted_helo_domains,
Expand Down Expand Up @@ -96,6 +97,7 @@
-msgRsetReceived="v"
-msgSizeLimit=#{msg_size_limit}
-multipleMessageReceiving
-multipleRcptto
-notRegisteredEmails="#{not_registered_emails.join(',')}"
-port=#{port}
-sessionTimeout=#{session_timeout}
Expand Down

0 comments on commit a9b27f6

Please sign in to comment.