smtp_mock 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33e54a07175e2b3e8245c8934d9839082a28e02f51d958127135342187e87326
4
- data.tar.gz: cf9ff702f31049e1bc849bcde4f3cee662a5e76d77adf7f2404e634c35e9a53a
3
+ metadata.gz: 6609f9f6630224a07d5f7326e569a4dede87bd77d68a06ce5087a3aed8e2e7cb
4
+ data.tar.gz: 16f4fdd27fa57274e8768e4111c4710d04640c0624a9f34b6caf0e4bc07b82ab
5
5
  SHA512:
6
- metadata.gz: 4e13797075610d3a5d99917a8d4584014ef320bc8a522a2785061b24d1fe842dda34d9cee834af07918ae9b826de3566244bdd0b693ac632363bebe6302874dc
7
- data.tar.gz: 490d7e3e2688ef984bd2de0a90a90ee9946120ae0eb2b532eb561e4e8b102b0ef6e8e6d4cfe80df6edd111e4e15e03c84e58b7c1e0bd35186c19c89835e41a04
6
+ metadata.gz: 715a635bd7592994cd52a99b8b3cc638eec058720ebe6fd846d58d2ebfc73404908044f51149a5a9138e3fbf1ba595c1a03de1b64af228218d1a11e4ffdf7218
7
+ data.tar.gz: a2fe9ea5c0769b9796dd9117ff2290047a48f61b145276fc6bedb64e775ac1cc57c9fc56abe028adb5891b8021f0eda53e20162e86309617824152c444ba4a3f
data/.circleci/config.yml CHANGED
@@ -6,7 +6,7 @@ defaults: &defaults
6
6
  - image: cimg/ruby:<< parameters.ruby-version >>
7
7
 
8
8
  orbs:
9
- ruby: circleci/ruby@1.4.0
9
+ ruby: circleci/ruby@1.7.1
10
10
 
11
11
  references:
12
12
  restore_bundle_cache: &restore_bundle_cache
@@ -122,7 +122,7 @@ jobs:
122
122
  - checkout
123
123
  - <<: *use_compatible_gemspec
124
124
  - ruby/install-deps:
125
- bundler-version: "2.3.9"
125
+ bundler-version: "2.3.13"
126
126
  with-cache: false
127
127
  path: './vendor/custom_bundle'
128
128
  - <<: *system_dependencies
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_runtime_dependency 'dry-struct', '~> 1.4'
32
32
 
33
- spec.add_development_dependency 'ffaker', '~> 2.20'
33
+ spec.add_development_dependency 'ffaker', '~> 2.21'
34
34
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
35
35
  spec.add_development_dependency 'rspec', '~> 3.11'
36
36
  end
@@ -32,16 +32,16 @@ Gem::Specification.new do |spec|
32
32
  spec.add_runtime_dependency 'dry-struct', '~> 1.4'
33
33
 
34
34
  spec.add_development_dependency 'bundler-audit', '~> 0.9.0.1'
35
- spec.add_development_dependency 'fasterer', '~> 0.9.0'
36
- spec.add_development_dependency 'ffaker', '~> 2.20'
35
+ spec.add_development_dependency 'fasterer', '~> 0.10.0'
36
+ spec.add_development_dependency 'ffaker', '~> 2.21'
37
37
  spec.add_development_dependency 'net-smtp', '~> 0.3.1'
38
- spec.add_development_dependency 'overcommit', '~> 0.58.0'
38
+ spec.add_development_dependency 'overcommit', '~> 0.59.1'
39
39
  spec.add_development_dependency 'pry-byebug', '~> 3.9'
40
40
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
41
- spec.add_development_dependency 'reek', '~> 6.1'
41
+ spec.add_development_dependency 'reek', '~> 6.1', '>= 6.1.1'
42
42
  spec.add_development_dependency 'rspec', '~> 3.11'
43
- spec.add_development_dependency 'rubocop', '~> 1.26'
43
+ spec.add_development_dependency 'rubocop', '~> 1.29', '>= 1.29.1'
44
44
  spec.add_development_dependency 'rubocop-performance', '~> 1.13', '>= 1.13.3'
45
- spec.add_development_dependency 'rubocop-rspec', '~> 2.9'
45
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.10'
46
46
  spec.add_development_dependency 'simplecov', '~> 0.21.2'
47
47
  end
data/.codeclimate.yml CHANGED
@@ -7,7 +7,7 @@ checks:
7
7
  plugins:
8
8
  rubocop:
9
9
  enabled: true
10
- channel: rubocop-1-26
10
+ channel: rubocop-1-29
11
11
 
12
12
  reek:
13
13
  enabled: true
@@ -12,7 +12,7 @@ cd ruby-smtp-mock
12
12
  Configure latest Ruby environment:
13
13
 
14
14
  ```bash
15
- echo 'ruby-3.1.1' > .ruby-version
15
+ echo 'ruby-3.1.2' > .ruby-version
16
16
  cp .circleci/gemspec_latest smtp_mock.gemspec
17
17
  ```
18
18
 
@@ -0,0 +1 @@
1
+ github: [bestwebua]
data/.reek.yml CHANGED
@@ -14,13 +14,13 @@ detectors:
14
14
  NestedIterators:
15
15
  exclude:
16
16
  - SmtpMock::CommandLineArgsBuilder#define_attribute
17
- - SmtpMock::Cli::Resolver#resolve
18
17
 
19
18
  TooManyStatements:
20
19
  exclude:
21
- - SmtpMock::Cli::Resolver#resolve
22
20
  - SmtpMock::Server#run
23
21
  - SmtpMock::ServerHelper#create_fake_servers
22
+ - SmtpMock::Cli::Resolver#install
23
+ - SmtpMock::Cli::Resolver#resolve
24
24
 
25
25
  TooManyInstanceVariables:
26
26
  exclude:
data/.rubocop.yml CHANGED
@@ -169,6 +169,18 @@ Style/OpenStructUse:
169
169
  Style/NestedFileDirname:
170
170
  Enabled: true
171
171
 
172
+ Style/EnvHome:
173
+ Enabled: true
174
+
175
+ Style/FetchEnvVar:
176
+ Enabled: true
177
+
178
+ Style/ObjectThen:
179
+ Enabled: true
180
+
181
+ Style/RedundantInitialize:
182
+ Enabled: true
183
+
172
184
  Layout/LineLength:
173
185
  Max: 150
174
186
 
@@ -284,6 +296,9 @@ Lint/IncompatibleIoSelectWithFiberScheduler:
284
296
  Lint/RequireRelativeSelfPath:
285
297
  Enabled: true
286
298
 
299
+ Lint/RefinementImportMethods:
300
+ Enabled: true
301
+
287
302
  Lint/UselessRuby2Keywords:
288
303
  Enabled: true
289
304
 
@@ -296,6 +311,9 @@ Gemspec/RequireMFA:
296
311
  Security/IoMethods:
297
312
  Enabled: true
298
313
 
314
+ Security/CompoundHash:
315
+ Enabled: true
316
+
299
317
  Performance/AncestorsInclude:
300
318
  Enabled: true
301
319
 
@@ -400,3 +418,6 @@ RSpec/BeEq:
400
418
 
401
419
  RSpec/BeNil:
402
420
  Enabled: true
421
+
422
+ RSpec/VerifiedDoubleReference:
423
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  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).
4
4
 
5
5
 
6
+ ## [1.1.0] - 2022-05-17
7
+
8
+ ### Added
9
+
10
+ - Ability to check `smtpmock` version from cli
11
+
12
+ ### Updated
13
+
14
+ - Updated gemspecs
15
+ - Updated codeclimate/circleci configs
16
+ - Updated gem development dependencies
17
+ - Updated gem version
18
+
6
19
  ## [1.0.1] - 2022-03-10
7
20
 
8
21
  ### Added
data/README.md CHANGED
@@ -80,6 +80,7 @@ This gem includes easy system dependency manager. Run `bundle exec smtp_mock` wi
80
80
  | `-i`, `--install=PATH` | Install `smtpmock` to the existing path | `bundle exec smtp_mock -i ~/existent_dir` |
81
81
  | `-u`, `--uninstall` | Uninstall `smtpmock` | `bundle exec smtp_mock -u` |
82
82
  | `-g`, `--upgrade` | Upgrade to latest version of `smtpmock` | `bundle exec smtp_mock -g` |
83
+ | `-v`, `--version` | Prints current version of `smtpmock` | `bundle exec smtp_mock -v` |
83
84
  | `-h`, `--help` | Prints help | `bundle exec smtp_mock -h` |
84
85
 
85
86
  ### DSL
@@ -8,45 +8,61 @@ module SmtpMock
8
8
  USE_CASE = 'Usage: smtp_mock [options], example: `bundle exec smtp_mock -s -i ~/existent_dir`'
9
9
  DOWNLOAD_SCRIPT = 'https://raw.githubusercontent.com/mocktools/go-smtp-mock/master/script/download.sh'
10
10
 
11
- def resolve(command_line_args) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
11
+ def resolve(command_line_args) # rubocop:disable Metrics/AbcSize
12
12
  opt_parser = ::OptionParser.new do |parser|
13
13
  parser.banner = SmtpMock::Cli::Resolver::USE_CASE
14
-
15
14
  parser.on('-s', '--sudo', 'Run command as sudo') { self.sudo = true }
15
+ parser.on('-iPATH', '--install=PATH', 'Install smtpmock to the existing path', &install)
16
+ parser.on('-u', '--uninstall', 'Uninstall smtpmock', &uninstall)
17
+ parser.on('-g', '--upgrade', 'Upgrade to latest version of smtpmock', &upgrade)
18
+ parser.on('-v', '--version', 'Prints current smtpmock version', &version)
19
+ parser.on('-h', '--help', 'Prints help') { self.message = parser.to_s }
16
20
 
17
- parser.on('-iPATH', '--install=PATH', 'Install smtpmock to the existing path') do |argument|
18
- self.install_path = argument
19
- return self.message = 'smtpmock is already installed' if ::File.exist?(binary_path)
20
-
21
- install_to(install_path)
22
- ::Kernel.system("#{as_sudo}ln -s #{binary_path} #{SmtpMock::Dependency::SYMLINK}")
23
- self.message = 'smtpmock was installed successfully'
24
- end
21
+ self.success = true
22
+ end
25
23
 
26
- parser.on('-u', '--uninstall', 'Uninstall smtpmock') do
27
- return if not_installed? # rubocop:disable Lint/NonLocalExitFromIterator
24
+ opt_parser.parse(command_line_args) # TODO: add error handler
25
+ end
28
26
 
29
- ::Kernel.system("#{as_sudo}unlink #{SmtpMock::Dependency::SYMLINK}")
30
- ::Kernel.system("rm #{current_smtpmock_path}")
31
- self.message = 'smtpmock was uninstalled successfully'
32
- end
27
+ private
33
28
 
34
- parser.on('-g', '--upgrade', 'Upgrade to latest version of smtpmock') do
35
- return if not_installed? # rubocop:disable Lint/NonLocalExitFromIterator
29
+ def install
30
+ lambda do |argument|
31
+ self.install_path = argument
32
+ return self.message = 'smtpmock is already installed' if ::File.exist?(binary_path)
36
33
 
37
- install_to(current_smtpmock_path[%r{(.+)/.+}, 1])
38
- self.message = 'smtpmock was upgraded successfully'
39
- end
34
+ install_to(install_path)
35
+ ::Kernel.system("#{as_sudo}ln -s #{binary_path} #{SmtpMock::Dependency::SYMLINK}")
36
+ self.message = 'smtpmock was installed successfully'
37
+ end
38
+ end
40
39
 
41
- parser.on('-h', '--help', 'Prints help') { self.message = parser.to_s }
40
+ def uninstall
41
+ lambda do |_|
42
+ return if not_installed?
42
43
 
43
- self.success = true
44
+ ::Kernel.system("#{as_sudo}unlink #{SmtpMock::Dependency::SYMLINK}")
45
+ ::Kernel.system("rm #{current_smtpmock_path}")
46
+ self.message = 'smtpmock was uninstalled successfully'
44
47
  end
48
+ end
45
49
 
46
- opt_parser.parse(command_line_args) # TODO: add error handler
50
+ def upgrade
51
+ lambda do |_|
52
+ return if not_installed?
53
+
54
+ install_to(current_smtpmock_path[%r{(.+)/.+}, 1])
55
+ self.message = 'smtpmock was upgraded successfully'
56
+ end
47
57
  end
48
58
 
49
- private
59
+ def version
60
+ lambda do |_|
61
+ return if not_installed?
62
+
63
+ self.message = SmtpMock::Dependency.version
64
+ end
65
+ end
50
66
 
51
67
  def binary_path
52
68
  "#{install_path}/smtpmock"
@@ -26,8 +26,6 @@ module SmtpMock
26
26
  "#{SmtpMock::Dependency::BINARY_SHORTCUT} #{command_line_args}".strip
27
27
  end
28
28
 
29
- private
30
-
31
29
  def version
32
30
  ::Kernel.public_send(
33
31
  :`,
@@ -35,6 +33,8 @@ module SmtpMock
35
33
  )[SmtpMock::Dependency::VERSION_REGEX_PATTERN, 1]
36
34
  end
37
35
 
36
+ private
37
+
38
38
  def minimal_version?(current_version)
39
39
  !!current_version && current_version >= SmtpMock::SMTPMOCK_MIN_VERSION
40
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmtpMock
4
- VERSION = '1.0.1'
4
+ VERSION = '1.1.0'
5
5
  end
data/smtp_mock.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_runtime_dependency 'dry-struct', '~> 1.4'
33
33
 
34
- spec.add_development_dependency 'ffaker', '~> 2.20'
34
+ spec.add_development_dependency 'ffaker', '~> 2.21'
35
35
  spec.add_development_dependency 'net-smtp', '~> 0.3.1' if ::RUBY_VERSION >= '3.1.0'
36
36
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
37
37
  spec.add_development_dependency 'rspec', '~> 3.11'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smtp_mock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Trotsenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-10 00:00:00.000000000 Z
11
+ date: 2022-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.20'
33
+ version: '2.21'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.20'
40
+ version: '2.21'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +87,7 @@ files:
87
87
  - ".codeclimate.yml"
88
88
  - ".github/BRANCH_NAMING_CONVENTION.md"
89
89
  - ".github/DEVELOPMENT_ENVIRONMENT_GUIDE.md"
90
+ - ".github/FUNDING.yml"
90
91
  - ".github/ISSUE_TEMPLATE/bug_report.md"
91
92
  - ".github/ISSUE_TEMPLATE/feature_request.md"
92
93
  - ".github/ISSUE_TEMPLATE/issue_report.md"