yaso 1.3.2 → 1.4.0
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 +4 -4
- data/.rubocop.yml +18 -25
- data/.ruby-version +1 -1
- data/.simplecov +2 -4
- data/.tool-versions +1 -0
- data/Gemfile +21 -3
- data/README.md +12 -8
- data/Rakefile +3 -5
- data/benchmark/Gemfile +12 -21
- data/benchmark/gemfiles/ruby_2/Gemfile +1 -0
- data/benchmark/gemfiles/ruby_3/Gemfile +1 -0
- data/benchmark/index.rb +31 -30
- data/benchmark/shared/active_interaction_service.rb +0 -2
- data/benchmark/shared/callable_step.rb +0 -2
- data/benchmark/shared/decouplio_service.rb +0 -2
- data/benchmark/shared/interactor_service.rb +0 -2
- data/benchmark/shared/pure_service.rb +0 -2
- data/benchmark/shared/simple_command_service.rb +0 -2
- data/benchmark/shared/simple_logic_step_service.rb +2 -0
- data/benchmark/shared/trailblazer_service.rb +0 -2
- data/benchmark/shared/yaso_service.rb +0 -2
- data/benchmark/step/active_interaction.rb +0 -2
- data/benchmark/step/benchmark.rb +22 -21
- data/benchmark/step/decouplio.rb +1 -3
- data/benchmark/step/dry_transaction.rb +10 -12
- data/benchmark/step/interactor.rb +9 -11
- data/benchmark/step/pure.rb +0 -2
- data/benchmark/step/simple_command.rb +0 -2
- data/benchmark/step/simple_logic_step.rb +71 -0
- data/benchmark/step/trailblazer.rb +1 -3
- data/benchmark/step/yaso.rb +0 -2
- data/docker-compose.yml +2 -0
- data/gemfiles/ruby_2/Gemfile +8 -0
- data/gemfiles/ruby_3/Gemfile +8 -0
- data/gemfiles/ruby_3_0/Gemfile +8 -0
- data/lib/yaso/errors.rb +0 -2
- data/lib/yaso/{logic → flows}/classic.rb +6 -8
- data/lib/yaso/{logic → flows}/rollback.rb +7 -9
- data/lib/yaso/flows.rb +11 -0
- data/lib/yaso/invocable.rb +16 -14
- data/lib/yaso/service.rb +2 -4
- data/lib/yaso/step_builder.rb +63 -0
- data/lib/yaso/stepable.rb +1 -3
- data/lib/yaso/{logic → steps}/base.rb +1 -3
- data/lib/yaso/{logic → steps}/failure.rb +1 -3
- data/lib/yaso/{logic → steps}/pass.rb +1 -3
- data/lib/yaso/{logic → steps}/step.rb +1 -3
- data/lib/yaso/{logic → steps}/switch.rb +1 -3
- data/lib/yaso/{logic → steps}/wrap.rb +1 -3
- data/lib/yaso/steps.rb +11 -0
- data/lib/yaso/version.rb +1 -3
- data/lib/yaso.rb +8 -8
- metadata +28 -187
- data/Gemfile.lock +0 -83
- data/lib/yaso/logic/step_builder.rb +0 -63
- data/lib/yaso/logic.rb +0 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc341196c82939bab32058aa44ca8e1d3d26e24c473209c8ff1630d61021f6c1
|
|
4
|
+
data.tar.gz: cfb11b62003746dc95d675a6ecb417eff5c8801fce2d09322ae1788e46e1ab5d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd5e52ec455c904965c4269b95fc21d2bc922a184463362e3cac8edc55591a776eaee4684148c82b98c6e4ab68fc18e3754e660d157d8313c9ff27442c8c82d8
|
|
7
|
+
data.tar.gz: aa81e5d37fe4c851c7463dd5ba81651b08f05a647ca384bd44ca8e15b92088560c0741efb01f3a262d275ddbdf003908b6ee898f3a1a8ef9bd964f7b76b68059
|
data/.rubocop.yml
CHANGED
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
AllCops:
|
|
6
|
-
TargetRubyVersion: 2.5
|
|
7
|
-
SuggestExtensions: false
|
|
8
|
-
NewCops: enable
|
|
9
|
-
Exclude:
|
|
10
|
-
- vendor/bundle/**/*
|
|
11
|
-
- benchmark/vendor/bundle/**/*
|
|
1
|
+
inherit_mode:
|
|
2
|
+
merge:
|
|
3
|
+
- Exclude
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
require:
|
|
6
|
+
- standard
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
plugins:
|
|
9
|
+
- standard-custom
|
|
10
|
+
- standard-performance
|
|
11
|
+
- rubocop-performance
|
|
12
|
+
- rubocop-rspec
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
inherit_gem:
|
|
15
|
+
standard: config/base.yml
|
|
16
|
+
standard-performance: config/base.yml
|
|
17
|
+
standard-custom: config/base.yml
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
Exclude:
|
|
24
|
-
- '*.gemspec'
|
|
25
|
-
IgnoredMethods:
|
|
26
|
-
- describe
|
|
27
|
-
- context
|
|
19
|
+
inherit_from: []
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
AllCops:
|
|
22
|
+
NewCops: enable
|
|
23
|
+
SuggestExtensions: false
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.4.7
|
data/.simplecov
CHANGED
data/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby 3.4.7
|
data/Gemfile
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
source 'https://rubygems.org'
|
|
1
|
+
source "https://rubygems.org"
|
|
4
2
|
|
|
5
3
|
gemspec
|
|
4
|
+
|
|
5
|
+
version_parts = RUBY_VERSION.split(".")
|
|
6
|
+
minor_version_path = version_parts[..1].join("_")
|
|
7
|
+
|
|
8
|
+
if File.exist?("gemfiles/ruby_#{minor_version_path}/Gemfile")
|
|
9
|
+
eval_gemfile "gemfiles/ruby_#{minor_version_path}/Gemfile"
|
|
10
|
+
else
|
|
11
|
+
eval_gemfile "gemfiles/ruby_#{version_parts[0]}/Gemfile"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
group :development, :test do
|
|
15
|
+
gem "lefthook", "~> 2.0.4"
|
|
16
|
+
gem "pry", "~> 0.15.2"
|
|
17
|
+
gem "rake", "~> 13.3.1"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
group :test do
|
|
21
|
+
gem "rspec", "~> 3.13.2"
|
|
22
|
+
gem "simplecov", "~> 0.22.0"
|
|
23
|
+
end
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Yaso
|
|
2
|
-
[](https://github.com/ar2em1s/yaso/actions/workflows/main.yml)  [](https://github.com/ar2em1s/yaso/blob/master/LICENSE.txt)
|
|
3
3
|
|
|
4
|
-
That's my (Yet Another) ServiceObject pattern implementation. I made it fast ([
|
|
4
|
+
That's my (Yet Another) ServiceObject pattern implementation. I made it fast ([benchmarks](https://github.com/ar2em1s/yaso/wiki/Benchmarks)) and simple to use (I hope). I was inspired by those alternatives and I hope this will encourage them to be even better:
|
|
5
5
|
- [Trailblazer](https://github.com/trailblazer/trailblazer)
|
|
6
6
|
- [Decouplio](https://github.com/differencialx/decouplio)
|
|
7
7
|
|
|
@@ -10,28 +10,32 @@ That's my (Yet Another) ServiceObject pattern implementation. I made it fast ([t
|
|
|
10
10
|
Add this line to your application's Gemfile:
|
|
11
11
|
|
|
12
12
|
```ruby
|
|
13
|
-
gem
|
|
13
|
+
gem "yaso"
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
And then execute:
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
```bash
|
|
19
|
+
bundle install
|
|
20
|
+
```
|
|
19
21
|
|
|
20
22
|
Or install it yourself as:
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
```bash
|
|
25
|
+
gem install yaso
|
|
26
|
+
```
|
|
23
27
|
|
|
24
28
|
## Usage
|
|
25
29
|
|
|
26
|
-
All the information you can find in the gem [wiki](https://github.com/
|
|
30
|
+
All the information you can find in the gem [wiki](https://github.com/ar2em1s/yaso/wiki).
|
|
27
31
|
|
|
28
32
|
## Development
|
|
29
33
|
|
|
30
|
-
I don't think that someone would like to help me developing the gem but if so just fork a repository, do your dark business, open a pull request and assign me as a reviewer.
|
|
34
|
+
I don't think that someone would like to help me developing the gem but if so just fork a repository, do your dark business, open a pull request and assign me as a reviewer.
|
|
31
35
|
|
|
32
36
|
## Contributing
|
|
33
37
|
|
|
34
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
38
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ar2em1s/yaso.
|
|
35
39
|
|
|
36
40
|
## License
|
|
37
41
|
|
data/Rakefile
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require 'bundler/gem_tasks'
|
|
4
|
-
require 'rspec/core/rake_task'
|
|
1
|
+
require "bundler/gem_tasks"
|
|
2
|
+
require "rspec/core/rake_task"
|
|
5
3
|
|
|
6
4
|
RSpec::Core::RakeTask.new(:spec)
|
|
7
5
|
|
|
8
|
-
require
|
|
6
|
+
require "rubocop/rake_task"
|
|
9
7
|
|
|
10
8
|
RuboCop::RakeTask.new
|
|
11
9
|
|
data/benchmark/Gemfile
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
source "https://rubygems.org"
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
eval_gemfile "gemfiles/ruby_#{RUBY_VERSION[0]}/Gemfile"
|
|
4
4
|
|
|
5
|
-
gem
|
|
5
|
+
gem "benchmark-ips", "~> 2.14.0"
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
gem
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}.freeze
|
|
16
|
-
gem 'dry-transaction', DRY_TRANSACTION.fetch(RUBY_VERSION.match(/\A\d+\.\d+/)[0], '~> 0.15.0')
|
|
17
|
-
gem 'interactor', '~> 3.1.2'
|
|
18
|
-
gem 'kalibera', '~> 0.1.2'
|
|
19
|
-
gem 'simple_command', RUBY_VERSION.include?('2.5') ? '~> 0.2.0' : '~> 1.0.1'
|
|
20
|
-
gem 'trailblazer', '~> 2.1.0'
|
|
21
|
-
gem 'yaso', path: '..'
|
|
7
|
+
gem "dry-container", "~> 0.11.0"
|
|
8
|
+
gem "interactor", "~> 3.2.0"
|
|
9
|
+
gem "kalibera", "~> 0.1.2"
|
|
10
|
+
gem "simple_command", "~> 1.0.1"
|
|
11
|
+
gem "simple_logic_step", "~> 0.1.0"
|
|
12
|
+
gem "trailblazer", "~> 2.1.3"
|
|
13
|
+
gem "active_interaction", "~> 5.5.0"
|
|
14
|
+
gem "decouplio", "~> 1.0.0rc"
|
|
22
15
|
|
|
23
|
-
gem
|
|
24
|
-
|
|
25
|
-
RUBY_VERSION.include?('2.5') || gem('decouplio', '~> 1.0.0rc')
|
|
16
|
+
gem "yaso", path: ".."
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gem "dry-transaction", "~> 0.15.0"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gem "dry-transaction", "~> 0.16.0"
|
data/benchmark/index.rb
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
require "bundler/setup"
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require "benchmark/ips"
|
|
4
|
+
require "decouplio"
|
|
5
|
+
require "interactor"
|
|
6
|
+
require "active_interaction"
|
|
7
|
+
require "trailblazer"
|
|
8
|
+
require "simple_command"
|
|
9
|
+
require "simple_logic_step"
|
|
10
|
+
require "yaso"
|
|
11
|
+
require "dry/container"
|
|
12
|
+
require "dry/transaction"
|
|
13
|
+
require "dry/transaction/operation"
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
require 'dry/transaction/operation'
|
|
15
|
+
require_relative "shared/yaso_service"
|
|
16
|
+
require_relative "shared/decouplio_service"
|
|
17
|
+
require_relative "shared/pure_service"
|
|
18
|
+
require_relative "shared/simple_command_service"
|
|
19
|
+
require_relative "shared/simple_logic_step_service"
|
|
20
|
+
require_relative "shared/interactor_service"
|
|
21
|
+
require_relative "shared/active_interaction_service"
|
|
22
|
+
require_relative "shared/trailblazer_service"
|
|
23
|
+
require_relative "shared/callable_step"
|
|
15
24
|
|
|
16
|
-
require_relative
|
|
17
|
-
|
|
18
|
-
require_relative
|
|
19
|
-
require_relative
|
|
20
|
-
require_relative
|
|
21
|
-
require_relative
|
|
22
|
-
require_relative
|
|
23
|
-
require_relative
|
|
24
|
-
|
|
25
|
-
require_relative
|
|
26
|
-
RUBY_VERSION.include?('2.5') || require_relative('step/decouplio')
|
|
27
|
-
require_relative 'step/pure'
|
|
28
|
-
require_relative 'step/simple_command'
|
|
29
|
-
require_relative 'step/interactor'
|
|
30
|
-
require_relative 'step/active_interaction'
|
|
31
|
-
require_relative 'step/trailblazer'
|
|
32
|
-
require_relative 'step/dry_transaction'
|
|
33
|
-
require_relative 'step/benchmark'
|
|
25
|
+
require_relative "step/yaso"
|
|
26
|
+
require_relative "step/decouplio"
|
|
27
|
+
require_relative "step/pure"
|
|
28
|
+
require_relative "step/simple_command"
|
|
29
|
+
require_relative "step/simple_logic_step"
|
|
30
|
+
require_relative "step/interactor"
|
|
31
|
+
require_relative "step/active_interaction"
|
|
32
|
+
require_relative "step/trailblazer"
|
|
33
|
+
require_relative "step/dry_transaction"
|
|
34
|
+
require_relative "step/benchmark"
|
data/benchmark/step/benchmark.rb
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
puts "Ruby: #{RUBY_DESCRIPTION}"
|
|
2
|
+
puts "Step Benchmark"
|
|
2
3
|
|
|
3
|
-
puts
|
|
4
|
-
|
|
5
|
-
puts 'Services with 10 simple steps'
|
|
4
|
+
puts "Services with 10 simple steps"
|
|
6
5
|
Benchmark.ips do |x|
|
|
7
6
|
x.config(stats: :bootstrap, confidence: 95)
|
|
8
7
|
|
|
9
|
-
x.report(
|
|
10
|
-
x.report(
|
|
11
|
-
x.report(
|
|
12
|
-
x.report(
|
|
13
|
-
x.report(
|
|
14
|
-
x.report(
|
|
15
|
-
x.report(
|
|
16
|
-
x.report(
|
|
8
|
+
x.report("Pure Service") { PureStepsService.call }
|
|
9
|
+
x.report("SimpleCommand") { SimpleCommandStepsService.call }
|
|
10
|
+
x.report("SimpleLogicStep") { SimpleLogicStepStepsService.call }
|
|
11
|
+
x.report("Yaso") { YasoStepsService.call }
|
|
12
|
+
x.report("Decouplio") { DecouplioStepsService.call }
|
|
13
|
+
x.report("Interactor") { InteractorStepsService.call }
|
|
14
|
+
x.report("ActiveInteraction") { ActiveInteractionStepsService.run }
|
|
15
|
+
x.report("Trailblazer") { TrailblazerStepsService.call }
|
|
16
|
+
x.report("DryTransaction") { DryTransactionStepsService.new.call({}) }
|
|
17
17
|
|
|
18
18
|
x.compare!
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
puts
|
|
21
|
+
puts "Services with 10 callable steps"
|
|
22
22
|
Benchmark.ips do |x|
|
|
23
23
|
x.config(stats: :bootstrap, confidence: 95)
|
|
24
24
|
|
|
25
|
-
x.report(
|
|
26
|
-
x.report(
|
|
27
|
-
x.report(
|
|
28
|
-
x.report(
|
|
29
|
-
x.report(
|
|
30
|
-
x.report(
|
|
31
|
-
x.report(
|
|
32
|
-
x.report(
|
|
25
|
+
x.report("Pure Service") { PureCallablesService.call }
|
|
26
|
+
x.report("SimpleCommand") { SimpleCommandCallablesService.call }
|
|
27
|
+
x.report("SimpleLogicStep") { SimpleLogicStepCallablesService.call }
|
|
28
|
+
x.report("Yaso") { YasoCallablesService.call }
|
|
29
|
+
x.report("Decouplio") { DecouplioCallablesService.call }
|
|
30
|
+
x.report("Interactor") { InteractorCallablesService.call }
|
|
31
|
+
x.report("ActiveInteraction") { ActiveInteractionCallablesService.run }
|
|
32
|
+
x.report("Trailblazer") { TrailblazerCallablesService.call }
|
|
33
|
+
x.report("DryTransaction") { DryTransactionCallablesService.new.call({}) }
|
|
33
34
|
|
|
34
35
|
x.compare!
|
|
35
36
|
end
|
data/benchmark/step/decouplio.rb
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
class DecouplioStepsService < DecouplioService
|
|
4
2
|
logic do
|
|
5
3
|
step :one
|
|
@@ -56,7 +54,7 @@ class DecouplioStepsService < DecouplioService
|
|
|
56
54
|
end
|
|
57
55
|
|
|
58
56
|
class DecouplioCallableStep
|
|
59
|
-
def self.call(ctx, _, key:, value
|
|
57
|
+
def self.call(ctx, _, key:, value:)
|
|
60
58
|
ctx[key] = value
|
|
61
59
|
end
|
|
62
60
|
end
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
class DryTransactionStepsService
|
|
4
2
|
include Dry::Transaction
|
|
5
3
|
|
|
@@ -100,14 +98,14 @@ end
|
|
|
100
98
|
class DryTransactionCallablesService
|
|
101
99
|
include Dry::Transaction(container: DryTransactionContainer)
|
|
102
100
|
|
|
103
|
-
step :one, with: :
|
|
104
|
-
step :two, with: :
|
|
105
|
-
step :three, with: :
|
|
106
|
-
step :four, with: :
|
|
107
|
-
step :five, with: :
|
|
108
|
-
step :six, with: :
|
|
109
|
-
step :seven, with: :
|
|
110
|
-
step :eight, with: :
|
|
111
|
-
step :nine, with: :
|
|
112
|
-
step :ten, with: :
|
|
101
|
+
step :one, with: :"callable.one"
|
|
102
|
+
step :two, with: :"callable.two"
|
|
103
|
+
step :three, with: :"callable.three"
|
|
104
|
+
step :four, with: :"callable.four"
|
|
105
|
+
step :five, with: :"callable.five"
|
|
106
|
+
step :six, with: :"callable.six"
|
|
107
|
+
step :seven, with: :"callable.seven"
|
|
108
|
+
step :eight, with: :"callable.eight"
|
|
109
|
+
step :nine, with: :"callable.nine"
|
|
110
|
+
step :ten, with: :"callable.ten"
|
|
113
111
|
end
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
class InteractorStepsService < InteractorService
|
|
4
2
|
def call
|
|
5
3
|
one
|
|
@@ -63,13 +61,13 @@ end
|
|
|
63
61
|
|
|
64
62
|
class InteractorCallablesService < InteractorOrganizer
|
|
65
63
|
organize InteractorCallableStep,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
InteractorCallableStep,
|
|
65
|
+
InteractorCallableStep,
|
|
66
|
+
InteractorCallableStep,
|
|
67
|
+
InteractorCallableStep,
|
|
68
|
+
InteractorCallableStep,
|
|
69
|
+
InteractorCallableStep,
|
|
70
|
+
InteractorCallableStep,
|
|
71
|
+
InteractorCallableStep,
|
|
72
|
+
InteractorCallableStep
|
|
75
73
|
end
|
data/benchmark/step/pure.rb
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
class SimpleLogicStepStepsService < SimpleLogicStepService
|
|
2
|
+
def process
|
|
3
|
+
one
|
|
4
|
+
two
|
|
5
|
+
three
|
|
6
|
+
four
|
|
7
|
+
five
|
|
8
|
+
six
|
|
9
|
+
seven
|
|
10
|
+
eight
|
|
11
|
+
nine
|
|
12
|
+
ten
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def one
|
|
16
|
+
ctx[:one] = true
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def two
|
|
20
|
+
ctx[:two] = true
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def three
|
|
24
|
+
ctx[:three] = true
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def four
|
|
28
|
+
ctx[:four] = true
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def five
|
|
32
|
+
ctx[:five] = true
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def six
|
|
36
|
+
ctx[:six] = true
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def seven
|
|
40
|
+
ctx[:seven] = true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def eight
|
|
44
|
+
ctx[:eight] = true
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def nine
|
|
48
|
+
ctx[:nine] = true
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def ten
|
|
52
|
+
ctx[:ten] = true
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
class SimpleLogicStepCallablesService < SimpleLogicStepService
|
|
57
|
+
# rubocop:disable Metrics/AbcSize
|
|
58
|
+
def process
|
|
59
|
+
CallableStep.call(ctx, key: :one, value: true)
|
|
60
|
+
CallableStep.call(ctx, key: :two, value: true)
|
|
61
|
+
CallableStep.call(ctx, key: :three, value: true)
|
|
62
|
+
CallableStep.call(ctx, key: :four, value: true)
|
|
63
|
+
CallableStep.call(ctx, key: :five, value: true)
|
|
64
|
+
CallableStep.call(ctx, key: :six, value: true)
|
|
65
|
+
CallableStep.call(ctx, key: :seven, value: true)
|
|
66
|
+
CallableStep.call(ctx, key: :eight, value: true)
|
|
67
|
+
CallableStep.call(ctx, key: :nine, value: true)
|
|
68
|
+
CallableStep.call(ctx, key: :ten, value: true)
|
|
69
|
+
end
|
|
70
|
+
# rubocop:enable Metrics/AbcSize
|
|
71
|
+
end
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
class TrailblazerStepsService < TrailblazerService
|
|
4
2
|
step :one
|
|
5
3
|
step :two
|
|
@@ -65,7 +63,7 @@ module TrailblazerMacro
|
|
|
65
63
|
false
|
|
66
64
|
end
|
|
67
65
|
task = Trailblazer::Activity::Circuit::TaskAdapter.for_step(step)
|
|
68
|
-
{
|
|
66
|
+
{task: task, id: id}
|
|
69
67
|
end
|
|
70
68
|
# rubocop:enable Naming/MethodName
|
|
71
69
|
end
|
data/benchmark/step/yaso.rb
CHANGED
data/docker-compose.yml
CHANGED