strum-service 0.1.2 → 0.2.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
2
  SHA256:
3
- metadata.gz: d3b57fcda6fa8662e4a8aa3184e7ae87c39dd56e51cbf11e7958dd61d041e658
4
- data.tar.gz: 46132e5ce26025e2f38ba7d538ca1d2ebcb4f11217f9b4a6c6036c3034c5e8b0
3
+ metadata.gz: 56dbe440b4e177f9174e1c99019e229175d6eba770e14743b0e18d5c42260b7b
4
+ data.tar.gz: 500764c4a7e8cf0e750fe2f5022c96de3258ef102f2c24ce3bf7cc0cef985ed0
5
5
  SHA512:
6
- metadata.gz: e891840754a5532e7a4c2d58116694cb38e7a12dab25e51503b72578bf7303721c870dda4a0920a08e572c640e8885fa7c7abbe7fdf1d0badf633f6fe7554893
7
- data.tar.gz: 43fadda3c343cdedab64fb4ae4d237c184f0f4847e7525d278b4a1fc4631fb5cc97572e49aa212bce96d01cfdd82343670e10152ce781fa6ab48616edd94b0bd
6
+ metadata.gz: a8ec17159999bb12ed05c5d5bbdaf243233197536f5d7f42358c4c412123ca789d22392fb1b3057c5afcbd27c07fb1e9337cf90f1221f95f5bd86c9045eb0d12
7
+ data.tar.gz: 245b4b5864b36285173d7d22224b06124812ec2a51987f73504ab0d6732f7a53039ab5d680a9f277397c5d1c977a542a71e7eec63fc8c0df99c0fa3e0fa78cd1
data/.gitignore CHANGED
@@ -6,6 +6,9 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /.rbenv-gemsets
10
+ /.ruby-version
11
+ spec/examples.txt
9
12
 
10
13
  # rspec failure tracking
11
14
  .rspec_status
data/Gemfile CHANGED
@@ -7,8 +7,8 @@ gemspec
7
7
 
8
8
  gem "rake", "~> 12.0"
9
9
 
10
- gem "rspec", "~> 3.10"
11
- gem "rubocop", "~> 1.5"
12
- gem "rubocop-ast", "~> 1.3"
13
- gem "rubocop-rake", "~> 0.5.1"
14
- gem "rubocop-rspec", "~> 2.0.0"
10
+ gem "rspec", "~> 3.11.0"
11
+ gem "rubocop", "~> 1.25.1"
12
+ gem "rubocop-ast", "~> 1.16.0"
13
+ gem "rubocop-rake", "~> 0.6.0"
14
+ gem "rubocop-rspec", "~> 2.9.0"
data/Gemfile.lock CHANGED
@@ -1,63 +1,62 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strum-service (0.1.2)
4
+ strum-service (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
- diff-lcs (1.4.4)
11
- parallel (1.20.1)
12
- parser (3.0.1.1)
10
+ diff-lcs (1.5.0)
11
+ parallel (1.21.0)
12
+ parser (3.1.1.0)
13
13
  ast (~> 2.4.1)
14
- rainbow (3.0.0)
14
+ rainbow (3.1.1)
15
15
  rake (12.3.3)
16
- regexp_parser (2.1.1)
16
+ regexp_parser (2.2.1)
17
17
  rexml (3.2.5)
18
- rspec (3.10.0)
19
- rspec-core (~> 3.10.0)
20
- rspec-expectations (~> 3.10.0)
21
- rspec-mocks (~> 3.10.0)
22
- rspec-core (3.10.1)
23
- rspec-support (~> 3.10.0)
24
- rspec-expectations (3.10.1)
18
+ rspec (3.11.0)
19
+ rspec-core (~> 3.11.0)
20
+ rspec-expectations (~> 3.11.0)
21
+ rspec-mocks (~> 3.11.0)
22
+ rspec-core (3.11.0)
23
+ rspec-support (~> 3.11.0)
24
+ rspec-expectations (3.11.0)
25
25
  diff-lcs (>= 1.2.0, < 2.0)
26
- rspec-support (~> 3.10.0)
27
- rspec-mocks (3.10.2)
26
+ rspec-support (~> 3.11.0)
27
+ rspec-mocks (3.11.0)
28
28
  diff-lcs (>= 1.2.0, < 2.0)
29
- rspec-support (~> 3.10.0)
30
- rspec-support (3.10.2)
31
- rubocop (1.15.0)
29
+ rspec-support (~> 3.11.0)
30
+ rspec-support (3.11.0)
31
+ rubocop (1.25.1)
32
32
  parallel (~> 1.10)
33
- parser (>= 3.0.0.0)
33
+ parser (>= 3.1.0.0)
34
34
  rainbow (>= 2.2.2, < 4.0)
35
35
  regexp_parser (>= 1.8, < 3.0)
36
36
  rexml
37
- rubocop-ast (>= 1.5.0, < 2.0)
37
+ rubocop-ast (>= 1.15.1, < 2.0)
38
38
  ruby-progressbar (~> 1.7)
39
39
  unicode-display_width (>= 1.4.0, < 3.0)
40
- rubocop-ast (1.5.0)
41
- parser (>= 3.0.1.1)
42
- rubocop-rake (0.5.1)
43
- rubocop
44
- rubocop-rspec (2.0.1)
40
+ rubocop-ast (1.16.0)
41
+ parser (>= 3.1.1.0)
42
+ rubocop-rake (0.6.0)
45
43
  rubocop (~> 1.0)
46
- rubocop-ast (>= 1.1.0)
44
+ rubocop-rspec (2.9.0)
45
+ rubocop (~> 1.19)
47
46
  ruby-progressbar (1.11.0)
48
- unicode-display_width (2.0.0)
47
+ unicode-display_width (2.1.0)
49
48
 
50
49
  PLATFORMS
51
50
  ruby
52
51
 
53
52
  DEPENDENCIES
54
53
  rake (~> 12.0)
55
- rspec (~> 3.10)
56
- rubocop (~> 1.5)
57
- rubocop-ast (~> 1.3)
58
- rubocop-rake (~> 0.5.1)
59
- rubocop-rspec (~> 2.0.0)
54
+ rspec (~> 3.11.0)
55
+ rubocop (~> 1.25.1)
56
+ rubocop-ast (~> 1.16.0)
57
+ rubocop-rake (~> 0.6.0)
58
+ rubocop-rspec (~> 2.9.0)
60
59
  strum-service!
61
60
 
62
61
  BUNDLED WITH
63
- 2.2.15
62
+ 2.3.8
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Strum
4
4
  module Service
5
- VERSION = "0.1.2"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
data/lib/strum/service.rb CHANGED
@@ -25,13 +25,15 @@ module Strum
25
25
 
26
26
  # Internal: Interactor class methods.
27
27
  module ClassMethods
28
- def call(main_input, **args, &block)
28
+ def call(main_input, args = {}, &block)
29
+ raise ArgumentError, "Only Hash are allowed for args" unless args.is_a?(Hash)
30
+
29
31
  new(main_input, **args).execute(&block)
30
32
  end
31
33
  end
32
34
 
33
35
  # Instance methods
34
- def initialize(main_input, **args)
36
+ def initialize(main_input, args = {})
35
37
  self.strum_errors = {}
36
38
  self.service_handlers = { on: {}, success: {}, failure: {} }
37
39
  self.outputs = {}
@@ -43,8 +45,8 @@ module Strum
43
45
 
44
46
  def execute
45
47
  catch(:exit) do
46
- audit
47
48
  yield(self) if block_given?
49
+ audit
48
50
  call if valid?
49
51
  end
50
52
  valid? ? valid_result : invalid_result
@@ -75,14 +77,15 @@ module Strum
75
77
  end
76
78
 
77
79
  def method_missing(method_name, *args, &_block)
78
- (args.count.zero? &&
79
- (input.is_a?(Hash) && input[method_name.to_sym]) ||
80
- inputs[method_name.to_sym]) ||
81
- super
80
+ if args.count.zero? && (input.is_a?(Hash) && input.keys.include?(method_name.to_sym))
81
+ input[method_name.to_sym]
82
+ else
83
+ inputs[method_name.to_sym] || super
84
+ end
82
85
  end
83
86
 
84
87
  def respond_to_missing?(method_name, include_private = false)
85
- input.is_a?(Hash) && input[method_name.to_sym] || super
88
+ (input.is_a?(Hash) && input[method_name.to_sym]) || super
86
89
  end
87
90
 
88
91
  protected
@@ -24,9 +24,10 @@ Gem::Specification.new do |spec|
24
24
  # Specify which files should be added to the gem when it is released.
25
25
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
26
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
27
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ `git ls-files -z`.split("\x0").reject { |f| f.match(/^(test|spec|features|\.ruby-version)/) }
28
28
  end
29
29
  spec.bindir = "exe"
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
+ spec.metadata["rubygems_mfa_required"] = "false"
32
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strum-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhiy Nazarov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
11
+ date: 2022-03-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Strum Service
14
14
  email:
@@ -42,6 +42,7 @@ metadata:
42
42
  source_code_uri: https://gitlab.com/strum-rb/strum-service
43
43
  changelog_uri: https://gitlab.com/strum-rb/strum-service/-/blob/master/CHANGELOG.md
44
44
  bug_tracker_uri: https://gitlab.com/strum-rb/strum-service/issues
45
+ rubygems_mfa_required: 'false'
45
46
  post_install_message:
46
47
  rdoc_options: []
47
48
  require_paths: