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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +18 -25
  3. data/.ruby-version +1 -1
  4. data/.simplecov +2 -4
  5. data/.tool-versions +1 -0
  6. data/Gemfile +21 -3
  7. data/README.md +12 -8
  8. data/Rakefile +3 -5
  9. data/benchmark/Gemfile +12 -21
  10. data/benchmark/gemfiles/ruby_2/Gemfile +1 -0
  11. data/benchmark/gemfiles/ruby_3/Gemfile +1 -0
  12. data/benchmark/index.rb +31 -30
  13. data/benchmark/shared/active_interaction_service.rb +0 -2
  14. data/benchmark/shared/callable_step.rb +0 -2
  15. data/benchmark/shared/decouplio_service.rb +0 -2
  16. data/benchmark/shared/interactor_service.rb +0 -2
  17. data/benchmark/shared/pure_service.rb +0 -2
  18. data/benchmark/shared/simple_command_service.rb +0 -2
  19. data/benchmark/shared/simple_logic_step_service.rb +2 -0
  20. data/benchmark/shared/trailblazer_service.rb +0 -2
  21. data/benchmark/shared/yaso_service.rb +0 -2
  22. data/benchmark/step/active_interaction.rb +0 -2
  23. data/benchmark/step/benchmark.rb +22 -21
  24. data/benchmark/step/decouplio.rb +1 -3
  25. data/benchmark/step/dry_transaction.rb +10 -12
  26. data/benchmark/step/interactor.rb +9 -11
  27. data/benchmark/step/pure.rb +0 -2
  28. data/benchmark/step/simple_command.rb +0 -2
  29. data/benchmark/step/simple_logic_step.rb +71 -0
  30. data/benchmark/step/trailblazer.rb +1 -3
  31. data/benchmark/step/yaso.rb +0 -2
  32. data/docker-compose.yml +2 -0
  33. data/gemfiles/ruby_2/Gemfile +8 -0
  34. data/gemfiles/ruby_3/Gemfile +8 -0
  35. data/gemfiles/ruby_3_0/Gemfile +8 -0
  36. data/lib/yaso/errors.rb +0 -2
  37. data/lib/yaso/{logic → flows}/classic.rb +6 -8
  38. data/lib/yaso/{logic → flows}/rollback.rb +7 -9
  39. data/lib/yaso/flows.rb +11 -0
  40. data/lib/yaso/invocable.rb +16 -14
  41. data/lib/yaso/service.rb +2 -4
  42. data/lib/yaso/step_builder.rb +63 -0
  43. data/lib/yaso/stepable.rb +1 -3
  44. data/lib/yaso/{logic → steps}/base.rb +1 -3
  45. data/lib/yaso/{logic → steps}/failure.rb +1 -3
  46. data/lib/yaso/{logic → steps}/pass.rb +1 -3
  47. data/lib/yaso/{logic → steps}/step.rb +1 -3
  48. data/lib/yaso/{logic → steps}/switch.rb +1 -3
  49. data/lib/yaso/{logic → steps}/wrap.rb +1 -3
  50. data/lib/yaso/steps.rb +11 -0
  51. data/lib/yaso/version.rb +1 -3
  52. data/lib/yaso.rb +8 -8
  53. metadata +28 -187
  54. data/Gemfile.lock +0 -83
  55. data/lib/yaso/logic/step_builder.rb +0 -63
  56. data/lib/yaso/logic.rb +0 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb519a1032563c51304fc6d3d456317966964555f0e93f3589197c3d1b215aeb
4
- data.tar.gz: d2959131be6cfad72331c0104419e031f8d6cbf4b42ec2b559c318acc41f5756
3
+ metadata.gz: dc341196c82939bab32058aa44ca8e1d3d26e24c473209c8ff1630d61021f6c1
4
+ data.tar.gz: cfb11b62003746dc95d675a6ecb417eff5c8801fce2d09322ae1788e46e1ab5d
5
5
  SHA512:
6
- metadata.gz: 5afe8940444e11435fd6d263a42beeaafa782cbb21956d7d74e45883a09d2de3a23bf2c2883ef0c562a2c06de8366921b90f022dc23ef7def9903fb5ba2a78b2
7
- data.tar.gz: 2305191823546b18b088289c738d5b1e2a6c0f7b2152e826271aee66a444c8d6ab7e605639eac43ee38b8682b6272f80611d3270ad631d212d3ccc8237aca08c
6
+ metadata.gz: bd5e52ec455c904965c4269b95fc21d2bc922a184463362e3cac8edc55591a776eaee4684148c82b98c6e4ab68fc18e3754e660d157d8313c9ff27442c8c82d8
7
+ data.tar.gz: aa81e5d37fe4c851c7463dd5ba81651b08f05a647ca384bd44ca8e15b92088560c0741efb01f3a262d275ddbdf003908b6ee898f3a1a8ef9bd964f7b76b68059
data/.rubocop.yml CHANGED
@@ -1,30 +1,23 @@
1
- require:
2
- - rubocop-rspec
3
- - rubocop-performance
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
- Gemspec/RequiredRubyVersion:
14
- Enabled: false
5
+ require:
6
+ - standard
15
7
 
16
- Layout/LineLength:
17
- Max: 120
8
+ plugins:
9
+ - standard-custom
10
+ - standard-performance
11
+ - rubocop-performance
12
+ - rubocop-rspec
18
13
 
19
- Style/Documentation:
20
- Enabled: false
14
+ inherit_gem:
15
+ standard: config/base.yml
16
+ standard-performance: config/base.yml
17
+ standard-custom: config/base.yml
21
18
 
22
- Metrics/BlockLength:
23
- Exclude:
24
- - '*.gemspec'
25
- IgnoredMethods:
26
- - describe
27
- - context
19
+ inherit_from: []
28
20
 
29
- RSpec/LetSetup:
30
- Enabled: false
21
+ AllCops:
22
+ NewCops: enable
23
+ SuggestExtensions: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.3
1
+ 3.4.7
data/.simplecov CHANGED
@@ -1,8 +1,6 @@
1
- # frozen_string_literal: true
2
-
3
1
  SimpleCov.start do
4
2
  enable_coverage :branch
5
3
 
6
- add_filter 'spec'
7
- add_filter 'benchmark'
4
+ add_filter "spec"
5
+ add_filter "benchmark"
8
6
  end
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.4.7
data/Gemfile CHANGED
@@ -1,5 +1,23 @@
1
- # frozen_string_literal: true
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
- [![Ruby](https://github.com/Ar2emis/yaso/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Ar2emis/yaso/actions/workflows/main.yml) ![gem](https://img.shields.io/gem/v/yaso) [![GitHub license](https://img.shields.io/github/license/Ar2emis/yaso)](https://github.com/Ar2emis/yaso/blob/master/LICENSE.txt)
2
+ [![Ruby](https://github.com/ar2em1s/yaso/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/ar2em1s/yaso/actions/workflows/main.yml) ![gem](https://img.shields.io/gem/v/yaso) [![GitHub license](https://img.shields.io/github/license/ar2em1s/yaso)](https://github.com/ar2em1s/yaso/blob/master/LICENSE.txt)
3
3
 
4
- That's my (Yet Another) ServiceObject pattern implementation. I made it fast ([the fastest of this kind actually](https://github.com/Ar2emis/yaso/wiki/Benchmarks); [simple_command](https://github.com/nebulab/simple_command), you got me this time) and simple to use (I hope). I was inspired by those alternatives and I hope this will encourage them to be even better:
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 'yaso'
13
+ gem "yaso"
14
14
  ```
15
15
 
16
16
  And then execute:
17
17
 
18
- $ bundle install
18
+ ```bash
19
+ bundle install
20
+ ```
19
21
 
20
22
  Or install it yourself as:
21
23
 
22
- $ gem install yaso
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/Ar2emis/yaso/wiki).
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/Ar2emis/yaso.
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
- # frozen_string_literal: true
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 'rubocop/rake_task'
6
+ require "rubocop/rake_task"
9
7
 
10
8
  RuboCop::RakeTask.new
11
9
 
data/benchmark/Gemfile CHANGED
@@ -1,25 +1,16 @@
1
- # frozen_string_literal: true
1
+ source "https://rubygems.org"
2
2
 
3
- source 'https://rubygems.org'
3
+ eval_gemfile "gemfiles/ruby_#{RUBY_VERSION[0]}/Gemfile"
4
4
 
5
- gem 'benchmark-ips', '~> 2.10.0'
5
+ gem "benchmark-ips", "~> 2.14.0"
6
6
 
7
- DRY_CONTAINER = {
8
- '2.5' => '~> 0.7.2',
9
- '2.6' => '~> 0.9.0'
10
- }.freeze
11
- gem 'dry-container', DRY_CONTAINER.fetch(RUBY_VERSION.match(/\A\d+\.\d+/)[0], '~> 0.11.0')
12
- DRY_TRANSACTION = {
13
- '2.5' => '~> 0.13.2',
14
- '2.6' => '~> 0.13.3'
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 'active_interaction', %w[2.5 2.6].any? { |version| RUBY_VERSION.include?(version) } ? '~> 4.1.0' : '~> 5.1.0'
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
- # frozen_string_literal: true
1
+ require "bundler/setup"
2
2
 
3
- require 'bundler/setup'
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
- require 'benchmark/ips'
6
- RUBY_VERSION.include?('2.5') || require('decouplio')
7
- require 'interactor'
8
- require 'active_interaction'
9
- require 'trailblazer'
10
- require 'simple_command'
11
- require 'yaso'
12
- require 'dry/container'
13
- require 'dry/transaction'
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 'shared/yaso_service'
17
- RUBY_VERSION.include?('2.5') || require_relative('shared/decouplio_service')
18
- require_relative 'shared/pure_service'
19
- require_relative 'shared/simple_command_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'
24
-
25
- require_relative 'step/yaso'
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"
@@ -1,4 +1,2 @@
1
- # frozen_string_literal: true
2
-
3
1
  class ActiveInteractionService < ActiveInteraction::Base
4
2
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class CallableStep
4
2
  def self.call(ctx, key:, value:, **)
5
3
  ctx[key] = value
@@ -1,4 +1,2 @@
1
- # frozen_string_literal: true
2
-
3
1
  class DecouplioService < Decouplio::Action
4
2
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class InteractorService
4
2
  include Interactor
5
3
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class PureService
4
2
  attr_reader :ctx
5
3
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class SimpleCommandService
4
2
  prepend SimpleCommand
5
3
 
@@ -0,0 +1,2 @@
1
+ class SimpleLogicStepService < SimpleLogicStep::Service
2
+ end
@@ -1,4 +1,2 @@
1
- # frozen_string_literal: true
2
-
3
1
  class TrailblazerService < Trailblazer::Operation
4
2
  end
@@ -1,4 +1,2 @@
1
- # frozen_string_literal: true
2
-
3
1
  class YasoService < Yaso::Service
4
2
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class ActiveInteractionStepsService < ActiveInteractionService
4
2
  hash :ctx, default: {}
5
3
 
@@ -1,35 +1,36 @@
1
- # frozen_string_literal: true
1
+ puts "Ruby: #{RUBY_DESCRIPTION}"
2
+ puts "Step Benchmark"
2
3
 
3
- puts 'Step Benchmark'
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('Pure Service') { PureStepsService.call }
10
- x.report('SimpleCommand') { SimpleCommandStepsService.call }
11
- x.report('Yaso') { YasoStepsService.call }
12
- x.report('Decouplio') { DecouplioStepsService.call } unless RUBY_VERSION.include?('2.5')
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({}) }
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 'Services with 10 callable steps'
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('Pure Service') { PureCallablesService.call }
26
- x.report('SimpleCommand') { SimpleCommandCallablesService.call }
27
- x.report('Yaso') { YasoCallablesService.call }
28
- x.report('Decouplio') { DecouplioCallablesService.call } unless RUBY_VERSION.include?('2.5')
29
- x.report('Interactor') { InteractorCallablesService.call }
30
- x.report('ActiveInteraction') { ActiveInteractionCallablesService.run }
31
- x.report('Trailblazer') { TrailblazerCallablesService.call }
32
- x.report('DryTransaction') { DryTransactionCallablesService.new.call({}) }
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
@@ -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: :'callable.one'
104
- step :two, with: :'callable.two'
105
- step :three, with: :'callable.three'
106
- step :four, with: :'callable.four'
107
- step :five, with: :'callable.five'
108
- step :six, with: :'callable.six'
109
- step :seven, with: :'callable.seven'
110
- step :eight, with: :'callable.eight'
111
- step :nine, with: :'callable.nine'
112
- step :ten, with: :'callable.ten'
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
- InteractorCallableStep,
67
- InteractorCallableStep,
68
- InteractorCallableStep,
69
- InteractorCallableStep,
70
- InteractorCallableStep,
71
- InteractorCallableStep,
72
- InteractorCallableStep,
73
- InteractorCallableStep,
74
- InteractorCallableStep
64
+ InteractorCallableStep,
65
+ InteractorCallableStep,
66
+ InteractorCallableStep,
67
+ InteractorCallableStep,
68
+ InteractorCallableStep,
69
+ InteractorCallableStep,
70
+ InteractorCallableStep,
71
+ InteractorCallableStep,
72
+ InteractorCallableStep
75
73
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class PureStepsService < PureService
4
2
  def call
5
3
  one
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class SimpleCommandStepsService < SimpleCommandService
4
2
  # rubocop:disable Metrics/MethodLength
5
3
  def call
@@ -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
- { task: task, id: id }
66
+ {task: task, id: id}
69
67
  end
70
68
  # rubocop:enable Naming/MethodName
71
69
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class YasoStepsService < YasoService
4
2
  step :one
5
3
  step :two
data/docker-compose.yml CHANGED
@@ -4,6 +4,8 @@ services:
4
4
  volumes:
5
5
  - .:/yaso
6
6
  - bundle:/bundle/cache
7
+ environment:
8
+ RUBYOPT: "${RUBYOPT:-}"
7
9
 
8
10
  volumes:
9
11
  bundle:
@@ -0,0 +1,8 @@
1
+ group :development, :test do
2
+ gem "standard", "~> 1.37.0"
3
+ gem "rubocop-rspec", "~> 3.4.0"
4
+ end
5
+
6
+ group :test do
7
+ gem "ffaker", "~> 2.21.0"
8
+ end
@@ -0,0 +1,8 @@
1
+ group :development, :test do
2
+ gem "standard", "~> 1.51.1"
3
+ gem "rubocop-rspec", "~> 3.7.0"
4
+ end
5
+
6
+ group :test do
7
+ gem "ffaker", "~> 2.25.0"
8
+ end
@@ -0,0 +1,8 @@
1
+ group :development, :test do
2
+ gem "standard", "~> 1.51.1"
3
+ gem "rubocop-rspec", "~> 3.7.0"
4
+ end
5
+
6
+ group :test do
7
+ gem "ffaker", "~> 2.24.0"
8
+ end
data/lib/yaso/errors.rb CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Yaso
4
2
  class Error < StandardError; end
5
3