switchyard 7.0.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 +7 -0
- data/.github/workflows/project-build.yml +71 -0
- data/.gitignore +24 -0
- data/.rspec +3 -0
- data/.rubocop.yml +101 -0
- data/.solargraph.yml +11 -0
- data/Appraisals +7 -0
- data/CHANGELOG.md +303 -0
- data/CODE_OF_CONDUCT.md +22 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +1663 -0
- data/Rakefile +12 -0
- data/VERSION +1 -0
- data/audit/bench.rb +99 -0
- data/audit/verify_findings.rb +172 -0
- data/gemfiles/dry_inflector_0_2_1.gemfile +5 -0
- data/gemfiles/i18n_1_8_11.gemfile +5 -0
- data/lib/switchyard/action.rb +145 -0
- data/lib/switchyard/configuration.rb +36 -0
- data/lib/switchyard/context/key_verifier.rb +124 -0
- data/lib/switchyard/context.rb +208 -0
- data/lib/switchyard/deprecations.rb +26 -0
- data/lib/switchyard/errors.rb +9 -0
- data/lib/switchyard/functional/enum.rb +286 -0
- data/lib/switchyard/functional/maybe.rb +21 -0
- data/lib/switchyard/functional/monad.rb +77 -0
- data/lib/switchyard/functional/null.rb +88 -0
- data/lib/switchyard/functional/option.rb +100 -0
- data/lib/switchyard/functional/result.rb +129 -0
- data/lib/switchyard/functional/sequencer.rb +144 -0
- data/lib/switchyard/i18n/localization_adapter.rb +50 -0
- data/lib/switchyard/localization_adapter.rb +39 -0
- data/lib/switchyard/localization_map.rb +9 -0
- data/lib/switchyard/organizer/execute.rb +16 -0
- data/lib/switchyard/organizer/iterate.rb +30 -0
- data/lib/switchyard/organizer/reduce_case.rb +50 -0
- data/lib/switchyard/organizer/reduce_if.rb +19 -0
- data/lib/switchyard/organizer/reduce_if_else.rb +23 -0
- data/lib/switchyard/organizer/reduce_until.rb +22 -0
- data/lib/switchyard/organizer/reduce_while.rb +31 -0
- data/lib/switchyard/organizer/scoped_reducable.rb +15 -0
- data/lib/switchyard/organizer/with_callback.rb +28 -0
- data/lib/switchyard/organizer/with_reducer.rb +81 -0
- data/lib/switchyard/organizer/with_reducer_factory.rb +20 -0
- data/lib/switchyard/organizer/with_reducer_log_decorator.rb +111 -0
- data/lib/switchyard/organizer.rb +129 -0
- data/lib/switchyard/testing/context_factory.rb +48 -0
- data/lib/switchyard/testing.rb +3 -0
- data/lib/switchyard/version.rb +5 -0
- data/lib/switchyard.rb +36 -0
- data/resources/fail_actions.png +0 -0
- data/resources/light-service.png +0 -0
- data/resources/organizer_and_actions.png +0 -0
- data/resources/skip_actions.png +0 -0
- data/spec/acceptance/add_numbers_spec.rb +11 -0
- data/spec/acceptance/after_actions_spec.rb +87 -0
- data/spec/acceptance/around_each_spec.rb +19 -0
- data/spec/acceptance/before_actions_spec.rb +115 -0
- data/spec/acceptance/custom_log_from_organizer_spec.rb +61 -0
- data/spec/acceptance/deprecation_warnings_spec.rb +82 -0
- data/spec/acceptance/fail_spec.rb +52 -0
- data/spec/acceptance/log_from_organizer_spec.rb +154 -0
- data/spec/acceptance/message_localization_spec.rb +119 -0
- data/spec/acceptance/organizer/add_aliases_spec.rb +28 -0
- data/spec/acceptance/organizer/add_to_context_spec.rb +54 -0
- data/spec/acceptance/organizer/around_each_with_reduce_if_spec.rb +42 -0
- data/spec/acceptance/organizer/context_failure_and_skipping_spec.rb +90 -0
- data/spec/acceptance/organizer/execute_spec.rb +67 -0
- data/spec/acceptance/organizer/iterate_spec.rb +44 -0
- data/spec/acceptance/organizer/reduce_case_spec.rb +65 -0
- data/spec/acceptance/organizer/reduce_if_else_spec.rb +60 -0
- data/spec/acceptance/organizer/reduce_if_spec.rb +89 -0
- data/spec/acceptance/organizer/reduce_until_spec.rb +49 -0
- data/spec/acceptance/organizer/reduce_while_spec.rb +96 -0
- data/spec/acceptance/organizer/with_callback_spec.rb +113 -0
- data/spec/acceptance/organizer_entry_point_spec.rb +35 -0
- data/spec/acceptance/rollback_spec.rb +183 -0
- data/spec/acceptance/skip_all_remaining_spec.rb +139 -0
- data/spec/acceptance/testing/context_factory_spec.rb +54 -0
- data/spec/action_expected_keys_spec.rb +63 -0
- data/spec/action_expects_and_promises_spec.rb +97 -0
- data/spec/action_optional_expected_keys_spec.rb +107 -0
- data/spec/action_promised_keys_spec.rb +126 -0
- data/spec/action_spec.rb +97 -0
- data/spec/context/inspect_spec.rb +52 -0
- data/spec/context_spec.rb +301 -0
- data/spec/examples/amount_spec.rb +77 -0
- data/spec/examples/controller_spec.rb +63 -0
- data/spec/examples/validate_address_spec.rb +38 -0
- data/spec/i18n_localization_adapter_spec.rb +83 -0
- data/spec/lib/deterministic/class_mixin_spec.rb +24 -0
- data/spec/lib/deterministic/currify_spec.rb +90 -0
- data/spec/lib/deterministic/monad_axioms.rb +46 -0
- data/spec/lib/deterministic/monad_spec.rb +47 -0
- data/spec/lib/deterministic/null_spec.rb +65 -0
- data/spec/lib/deterministic/option_spec.rb +140 -0
- data/spec/lib/deterministic/result/failure_spec.rb +65 -0
- data/spec/lib/deterministic/result/result_map_spec.rb +155 -0
- data/spec/lib/deterministic/result/result_shared.rb +25 -0
- data/spec/lib/deterministic/result/success_spec.rb +41 -0
- data/spec/lib/deterministic/result_spec.rb +63 -0
- data/spec/lib/deterministic/sequencer_spec.rb +506 -0
- data/spec/lib/edge_cases_spec.rb +156 -0
- data/spec/lib/enum_spec.rb +114 -0
- data/spec/lib/native_pattern_matching_spec.rb +74 -0
- data/spec/localization_adapter_spec.rb +66 -0
- data/spec/organizer/with_reducer_spec.rb +56 -0
- data/spec/organizer_key_aliases_spec.rb +29 -0
- data/spec/organizer_spec.rb +115 -0
- data/spec/readme_spec.rb +45 -0
- data/spec/sample/calculates_order_tax_action_spec.rb +16 -0
- data/spec/sample/calculates_tax_spec.rb +30 -0
- data/spec/sample/looks_up_tax_percentage_action_spec.rb +55 -0
- data/spec/sample/provides_free_shipping_action_spec.rb +25 -0
- data/spec/sample/tax/calculates_order_tax_action.rb +10 -0
- data/spec/sample/tax/calculates_tax.rb +11 -0
- data/spec/sample/tax/looks_up_tax_percentage_action.rb +28 -0
- data/spec/sample/tax/provides_free_shipping_action.rb +11 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/support.rb +1 -0
- data/spec/test_doubles.rb +656 -0
- data/spec/testing/context_factory/iterate_spec.rb +39 -0
- data/spec/testing/context_factory/reduce_if_spec.rb +40 -0
- data/spec/testing/context_factory/reduce_until_spec.rb +40 -0
- data/spec/testing/context_factory/with_callback_spec.rb +38 -0
- data/spec/testing/context_factory_spec.rb +76 -0
- data/switchyard.gemspec +35 -0
- metadata +351 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'test_doubles'
|
|
3
|
+
|
|
4
|
+
RSpec.describe 'ContextFactory - used with ReduceIfOrganizer' do
|
|
5
|
+
let(:organizer) { TestDoubles::ReduceIfOrganizer }
|
|
6
|
+
|
|
7
|
+
context 'when called with a truthy argument action' do
|
|
8
|
+
it 'executes a context up-to the callback action' do
|
|
9
|
+
ctx =
|
|
10
|
+
Switchyard::Testing::ContextFactory
|
|
11
|
+
.make_from(organizer)
|
|
12
|
+
.for(TestDoubles::AddsThreeAction)
|
|
13
|
+
.with(:number => 1)
|
|
14
|
+
|
|
15
|
+
expect(ctx.number).to eq(4)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it 'creates a context up-to action with empty context steps' do
|
|
19
|
+
ctx =
|
|
20
|
+
Switchyard::Testing::ContextFactory
|
|
21
|
+
.make_from(organizer)
|
|
22
|
+
.for(TestDoubles::AddsTwoAction)
|
|
23
|
+
.with(:number => 1)
|
|
24
|
+
|
|
25
|
+
expect(ctx.number).to eq(2)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
context 'when called with a false argument action' do
|
|
30
|
+
it 'does not execute the steps' do
|
|
31
|
+
ctx =
|
|
32
|
+
Switchyard::Testing::ContextFactory
|
|
33
|
+
.make_from(organizer)
|
|
34
|
+
.for(TestDoubles::AddsThreeAction)
|
|
35
|
+
.with(:number => 0)
|
|
36
|
+
|
|
37
|
+
expect(ctx.number).to eq(1)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'test_doubles'
|
|
3
|
+
|
|
4
|
+
RSpec.describe 'ContextFactory - used with ReduceUntilOrganizer' do
|
|
5
|
+
let(:organizer) { TestDoubles::ReduceUntilOrganizer }
|
|
6
|
+
|
|
7
|
+
context 'when called with truthy block' do
|
|
8
|
+
it 'creates a context up-to the action defined before the iteration' do
|
|
9
|
+
ctx =
|
|
10
|
+
Switchyard::Testing::ContextFactory
|
|
11
|
+
.make_from(organizer)
|
|
12
|
+
.for(TestDoubles::AddsTwoAction)
|
|
13
|
+
.with(:number => 1)
|
|
14
|
+
|
|
15
|
+
expect(ctx[:number]).to eq(2)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it 'creates a context only to the first step of the loop' do
|
|
19
|
+
ctx =
|
|
20
|
+
Switchyard::Testing::ContextFactory
|
|
21
|
+
.make_from(organizer)
|
|
22
|
+
.for(TestDoubles::AddsThreeAction)
|
|
23
|
+
.with(:number => 1)
|
|
24
|
+
|
|
25
|
+
expect(ctx.number).to eq(4)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
context 'when called with falsey block' do
|
|
30
|
+
it 'creates a context up-to the first step' do
|
|
31
|
+
ctx =
|
|
32
|
+
Switchyard::Testing::ContextFactory
|
|
33
|
+
.make_from(organizer)
|
|
34
|
+
.for(TestDoubles::AddsThreeAction)
|
|
35
|
+
.with(:number => 7)
|
|
36
|
+
|
|
37
|
+
expect(ctx[:number]).to eq(10)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'test_doubles'
|
|
3
|
+
|
|
4
|
+
RSpec.describe 'ContextFactory - used with CallbackOrganizer' do
|
|
5
|
+
let(:organizer) { TestDoubles::CallbackOrganizer }
|
|
6
|
+
|
|
7
|
+
context 'when called with the callback action' do
|
|
8
|
+
it 'creates a context up-to the callback action' do
|
|
9
|
+
ctx =
|
|
10
|
+
Switchyard::Testing::ContextFactory
|
|
11
|
+
.make_from(organizer)
|
|
12
|
+
.for(TestDoubles::AddTenCallbackAction)
|
|
13
|
+
.with(:number => 1)
|
|
14
|
+
|
|
15
|
+
expect(ctx.number).to eq(2)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it 'creates a context up-to callback action with empty context steps' do
|
|
19
|
+
ctx =
|
|
20
|
+
Switchyard::Testing::ContextFactory
|
|
21
|
+
.make_from(organizer)
|
|
22
|
+
.for(TestDoubles::AddsTwoAction)
|
|
23
|
+
.with(:number => 1)
|
|
24
|
+
|
|
25
|
+
expect(ctx.number).to eq(12)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'creates a context up-to the action defined in context steps' do
|
|
29
|
+
ctx =
|
|
30
|
+
Switchyard::Testing::ContextFactory
|
|
31
|
+
.make_from(organizer)
|
|
32
|
+
.for(TestDoubles::AddsThreeAction)
|
|
33
|
+
.with(:number => 1)
|
|
34
|
+
|
|
35
|
+
expect(ctx.number).to eq(14)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
require "test_doubles"
|
|
3
|
+
|
|
4
|
+
describe "ContextFactory - used with AdditionOrganizer" do
|
|
5
|
+
let(:organizer) { TestDoubles::AdditionOrganizer }
|
|
6
|
+
|
|
7
|
+
after do
|
|
8
|
+
TestDoubles::AdditionOrganizer.before_actions = nil
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
context "when called with the first action" do
|
|
12
|
+
it "does not alter the context" do
|
|
13
|
+
ctx = Switchyard::Testing::ContextFactory
|
|
14
|
+
.make_from(organizer)
|
|
15
|
+
.for(TestDoubles::AddsOneAction)
|
|
16
|
+
.with(1)
|
|
17
|
+
|
|
18
|
+
expect(ctx[:number]).to eq(1)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
context "when called with the second action" do
|
|
23
|
+
it "adds one to the number provided" do
|
|
24
|
+
ctx = Switchyard::Testing::ContextFactory
|
|
25
|
+
.make_from(organizer)
|
|
26
|
+
.for(TestDoubles::AddsTwoAction)
|
|
27
|
+
.with(1)
|
|
28
|
+
|
|
29
|
+
expect(ctx.number).to eq(2)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
context "when called with third action" do
|
|
34
|
+
it "creates a context up-to the action defined" do
|
|
35
|
+
ctx = Switchyard::Testing::ContextFactory
|
|
36
|
+
.make_from(organizer)
|
|
37
|
+
.for(TestDoubles::AddsThreeAction)
|
|
38
|
+
.with(1)
|
|
39
|
+
|
|
40
|
+
expect(ctx.number).to eq(4)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
context "when there are already before_actions" do
|
|
45
|
+
it "only appends before_actions" do
|
|
46
|
+
TestDoubles::AdditionOrganizer.before_actions = [
|
|
47
|
+
->(ctx) { ctx[:number] += 1 if ctx.current_action == TestDoubles::AddsTwoAction }
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
context = Switchyard::Testing::ContextFactory
|
|
51
|
+
.make_from(TestDoubles::AdditionOrganizer)
|
|
52
|
+
.for(TestDoubles::AddsThreeAction)
|
|
53
|
+
.with(4) # Context is a "glorified" hash
|
|
54
|
+
|
|
55
|
+
expect(context.number).to eq(8)
|
|
56
|
+
expect(context[:_before_actions].length).to eq(1)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
context "when used repeatedly" do
|
|
61
|
+
it "does not leave its temporary hook on the organizer class" do
|
|
62
|
+
2.times do
|
|
63
|
+
Switchyard::Testing::ContextFactory
|
|
64
|
+
.make_from(organizer)
|
|
65
|
+
.for(TestDoubles::AddsTwoAction)
|
|
66
|
+
.with(1)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
hooks = organizer.instance_variable_get(:@before_actions)
|
|
70
|
+
expect(hooks.nil? || hooks.empty?).to be(true)
|
|
71
|
+
|
|
72
|
+
# e l'organizer continua a funzionare normalmente
|
|
73
|
+
expect(organizer.call(1).fetch(:number)).to eq(7)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
data/switchyard.gemspec
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require File.expand_path('../lib/switchyard/version', __FILE__)
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |gem|
|
|
4
|
+
gem.authors = ["Boscolo Michele"]
|
|
5
|
+
gem.email = ["miboscol@gmail.com"]
|
|
6
|
+
gem.description = %q{Switchyard combines the Organizer/Action/Context pattern of LightService with functional programming constructs (Result/Option monads, pattern matching) inspired by Deterministic: complex workflows are organized into small single-purpose actions with functional error handling.}
|
|
7
|
+
gem.summary = %q{A service skeleton with an emphasis on simplicity with a pinch a functional programming}
|
|
8
|
+
gem.homepage = "https://github.com/sphynx79/switchyard"
|
|
9
|
+
gem.license = "MIT"
|
|
10
|
+
|
|
11
|
+
gem.files = `git ls-files`.split($\)
|
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
13
|
+
gem.name = "switchyard"
|
|
14
|
+
gem.require_paths = ["lib"]
|
|
15
|
+
gem.version = Switchyard::VERSION
|
|
16
|
+
gem.required_ruby_version = '>= 3.1.0'
|
|
17
|
+
|
|
18
|
+
gem.add_runtime_dependency("dry-inflector", ">= 0.2.1", "< 2")
|
|
19
|
+
# logger non e' piu una default gem da Ruby 3.5/4.0: senza questa
|
|
20
|
+
# dichiarazione `require 'logger'` fallisce sotto Bundler
|
|
21
|
+
gem.add_runtime_dependency("logger", "~> 1.5")
|
|
22
|
+
|
|
23
|
+
# i18n e' opzionale a runtime: l'adapter I18n viene usato solo se
|
|
24
|
+
# l'applicazione ospite carica la gem (vedi Configuration)
|
|
25
|
+
gem.add_development_dependency("i18n", "~> 1.8", ">= 1.8.11")
|
|
26
|
+
gem.add_development_dependency("rake", "~> 13.0")
|
|
27
|
+
gem.add_development_dependency("rspec", "~> 3.13")
|
|
28
|
+
gem.add_development_dependency("simplecov", "~> 0.22")
|
|
29
|
+
gem.add_development_dependency("simplecov-cobertura", "~> 3.0")
|
|
30
|
+
gem.add_development_dependency("rubocop", "~> 1.75")
|
|
31
|
+
gem.add_development_dependency("rubocop-performance", "~> 1.20")
|
|
32
|
+
gem.add_development_dependency("pry", "~> 0.15")
|
|
33
|
+
gem.add_development_dependency("solargraph", "~> 0.50")
|
|
34
|
+
gem.add_development_dependency("benchmark-ips", "~> 2.13")
|
|
35
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: switchyard
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 7.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Boscolo Michele
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: dry-inflector
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: 0.2.1
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '2'
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: 0.2.1
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '2'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: logger
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - "~>"
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '1.5'
|
|
39
|
+
type: :runtime
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - "~>"
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '1.5'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: i18n
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - "~>"
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '1.8'
|
|
53
|
+
- - ">="
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: 1.8.11
|
|
56
|
+
type: :development
|
|
57
|
+
prerelease: false
|
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
59
|
+
requirements:
|
|
60
|
+
- - "~>"
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '1.8'
|
|
63
|
+
- - ">="
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: 1.8.11
|
|
66
|
+
- !ruby/object:Gem::Dependency
|
|
67
|
+
name: rake
|
|
68
|
+
requirement: !ruby/object:Gem::Requirement
|
|
69
|
+
requirements:
|
|
70
|
+
- - "~>"
|
|
71
|
+
- !ruby/object:Gem::Version
|
|
72
|
+
version: '13.0'
|
|
73
|
+
type: :development
|
|
74
|
+
prerelease: false
|
|
75
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
76
|
+
requirements:
|
|
77
|
+
- - "~>"
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: '13.0'
|
|
80
|
+
- !ruby/object:Gem::Dependency
|
|
81
|
+
name: rspec
|
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - "~>"
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: '3.13'
|
|
87
|
+
type: :development
|
|
88
|
+
prerelease: false
|
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
90
|
+
requirements:
|
|
91
|
+
- - "~>"
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: '3.13'
|
|
94
|
+
- !ruby/object:Gem::Dependency
|
|
95
|
+
name: simplecov
|
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
|
97
|
+
requirements:
|
|
98
|
+
- - "~>"
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
version: '0.22'
|
|
101
|
+
type: :development
|
|
102
|
+
prerelease: false
|
|
103
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
104
|
+
requirements:
|
|
105
|
+
- - "~>"
|
|
106
|
+
- !ruby/object:Gem::Version
|
|
107
|
+
version: '0.22'
|
|
108
|
+
- !ruby/object:Gem::Dependency
|
|
109
|
+
name: simplecov-cobertura
|
|
110
|
+
requirement: !ruby/object:Gem::Requirement
|
|
111
|
+
requirements:
|
|
112
|
+
- - "~>"
|
|
113
|
+
- !ruby/object:Gem::Version
|
|
114
|
+
version: '3.0'
|
|
115
|
+
type: :development
|
|
116
|
+
prerelease: false
|
|
117
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
118
|
+
requirements:
|
|
119
|
+
- - "~>"
|
|
120
|
+
- !ruby/object:Gem::Version
|
|
121
|
+
version: '3.0'
|
|
122
|
+
- !ruby/object:Gem::Dependency
|
|
123
|
+
name: rubocop
|
|
124
|
+
requirement: !ruby/object:Gem::Requirement
|
|
125
|
+
requirements:
|
|
126
|
+
- - "~>"
|
|
127
|
+
- !ruby/object:Gem::Version
|
|
128
|
+
version: '1.75'
|
|
129
|
+
type: :development
|
|
130
|
+
prerelease: false
|
|
131
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
132
|
+
requirements:
|
|
133
|
+
- - "~>"
|
|
134
|
+
- !ruby/object:Gem::Version
|
|
135
|
+
version: '1.75'
|
|
136
|
+
- !ruby/object:Gem::Dependency
|
|
137
|
+
name: rubocop-performance
|
|
138
|
+
requirement: !ruby/object:Gem::Requirement
|
|
139
|
+
requirements:
|
|
140
|
+
- - "~>"
|
|
141
|
+
- !ruby/object:Gem::Version
|
|
142
|
+
version: '1.20'
|
|
143
|
+
type: :development
|
|
144
|
+
prerelease: false
|
|
145
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
146
|
+
requirements:
|
|
147
|
+
- - "~>"
|
|
148
|
+
- !ruby/object:Gem::Version
|
|
149
|
+
version: '1.20'
|
|
150
|
+
- !ruby/object:Gem::Dependency
|
|
151
|
+
name: pry
|
|
152
|
+
requirement: !ruby/object:Gem::Requirement
|
|
153
|
+
requirements:
|
|
154
|
+
- - "~>"
|
|
155
|
+
- !ruby/object:Gem::Version
|
|
156
|
+
version: '0.15'
|
|
157
|
+
type: :development
|
|
158
|
+
prerelease: false
|
|
159
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
160
|
+
requirements:
|
|
161
|
+
- - "~>"
|
|
162
|
+
- !ruby/object:Gem::Version
|
|
163
|
+
version: '0.15'
|
|
164
|
+
- !ruby/object:Gem::Dependency
|
|
165
|
+
name: solargraph
|
|
166
|
+
requirement: !ruby/object:Gem::Requirement
|
|
167
|
+
requirements:
|
|
168
|
+
- - "~>"
|
|
169
|
+
- !ruby/object:Gem::Version
|
|
170
|
+
version: '0.50'
|
|
171
|
+
type: :development
|
|
172
|
+
prerelease: false
|
|
173
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
174
|
+
requirements:
|
|
175
|
+
- - "~>"
|
|
176
|
+
- !ruby/object:Gem::Version
|
|
177
|
+
version: '0.50'
|
|
178
|
+
- !ruby/object:Gem::Dependency
|
|
179
|
+
name: benchmark-ips
|
|
180
|
+
requirement: !ruby/object:Gem::Requirement
|
|
181
|
+
requirements:
|
|
182
|
+
- - "~>"
|
|
183
|
+
- !ruby/object:Gem::Version
|
|
184
|
+
version: '2.13'
|
|
185
|
+
type: :development
|
|
186
|
+
prerelease: false
|
|
187
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
188
|
+
requirements:
|
|
189
|
+
- - "~>"
|
|
190
|
+
- !ruby/object:Gem::Version
|
|
191
|
+
version: '2.13'
|
|
192
|
+
description: 'Switchyard combines the Organizer/Action/Context pattern of LightService
|
|
193
|
+
with functional programming constructs (Result/Option monads, pattern matching)
|
|
194
|
+
inspired by Deterministic: complex workflows are organized into small single-purpose
|
|
195
|
+
actions with functional error handling.'
|
|
196
|
+
email:
|
|
197
|
+
- miboscol@gmail.com
|
|
198
|
+
executables: []
|
|
199
|
+
extensions: []
|
|
200
|
+
extra_rdoc_files: []
|
|
201
|
+
files:
|
|
202
|
+
- ".github/workflows/project-build.yml"
|
|
203
|
+
- ".gitignore"
|
|
204
|
+
- ".rspec"
|
|
205
|
+
- ".rubocop.yml"
|
|
206
|
+
- ".solargraph.yml"
|
|
207
|
+
- Appraisals
|
|
208
|
+
- CHANGELOG.md
|
|
209
|
+
- CODE_OF_CONDUCT.md
|
|
210
|
+
- Gemfile
|
|
211
|
+
- LICENSE
|
|
212
|
+
- README.md
|
|
213
|
+
- Rakefile
|
|
214
|
+
- VERSION
|
|
215
|
+
- audit/bench.rb
|
|
216
|
+
- audit/verify_findings.rb
|
|
217
|
+
- gemfiles/dry_inflector_0_2_1.gemfile
|
|
218
|
+
- gemfiles/i18n_1_8_11.gemfile
|
|
219
|
+
- lib/switchyard.rb
|
|
220
|
+
- lib/switchyard/action.rb
|
|
221
|
+
- lib/switchyard/configuration.rb
|
|
222
|
+
- lib/switchyard/context.rb
|
|
223
|
+
- lib/switchyard/context/key_verifier.rb
|
|
224
|
+
- lib/switchyard/deprecations.rb
|
|
225
|
+
- lib/switchyard/errors.rb
|
|
226
|
+
- lib/switchyard/functional/enum.rb
|
|
227
|
+
- lib/switchyard/functional/maybe.rb
|
|
228
|
+
- lib/switchyard/functional/monad.rb
|
|
229
|
+
- lib/switchyard/functional/null.rb
|
|
230
|
+
- lib/switchyard/functional/option.rb
|
|
231
|
+
- lib/switchyard/functional/result.rb
|
|
232
|
+
- lib/switchyard/functional/sequencer.rb
|
|
233
|
+
- lib/switchyard/i18n/localization_adapter.rb
|
|
234
|
+
- lib/switchyard/localization_adapter.rb
|
|
235
|
+
- lib/switchyard/localization_map.rb
|
|
236
|
+
- lib/switchyard/organizer.rb
|
|
237
|
+
- lib/switchyard/organizer/execute.rb
|
|
238
|
+
- lib/switchyard/organizer/iterate.rb
|
|
239
|
+
- lib/switchyard/organizer/reduce_case.rb
|
|
240
|
+
- lib/switchyard/organizer/reduce_if.rb
|
|
241
|
+
- lib/switchyard/organizer/reduce_if_else.rb
|
|
242
|
+
- lib/switchyard/organizer/reduce_until.rb
|
|
243
|
+
- lib/switchyard/organizer/reduce_while.rb
|
|
244
|
+
- lib/switchyard/organizer/scoped_reducable.rb
|
|
245
|
+
- lib/switchyard/organizer/with_callback.rb
|
|
246
|
+
- lib/switchyard/organizer/with_reducer.rb
|
|
247
|
+
- lib/switchyard/organizer/with_reducer_factory.rb
|
|
248
|
+
- lib/switchyard/organizer/with_reducer_log_decorator.rb
|
|
249
|
+
- lib/switchyard/testing.rb
|
|
250
|
+
- lib/switchyard/testing/context_factory.rb
|
|
251
|
+
- lib/switchyard/version.rb
|
|
252
|
+
- resources/fail_actions.png
|
|
253
|
+
- resources/light-service.png
|
|
254
|
+
- resources/organizer_and_actions.png
|
|
255
|
+
- resources/skip_actions.png
|
|
256
|
+
- spec/acceptance/add_numbers_spec.rb
|
|
257
|
+
- spec/acceptance/after_actions_spec.rb
|
|
258
|
+
- spec/acceptance/around_each_spec.rb
|
|
259
|
+
- spec/acceptance/before_actions_spec.rb
|
|
260
|
+
- spec/acceptance/custom_log_from_organizer_spec.rb
|
|
261
|
+
- spec/acceptance/deprecation_warnings_spec.rb
|
|
262
|
+
- spec/acceptance/fail_spec.rb
|
|
263
|
+
- spec/acceptance/log_from_organizer_spec.rb
|
|
264
|
+
- spec/acceptance/message_localization_spec.rb
|
|
265
|
+
- spec/acceptance/organizer/add_aliases_spec.rb
|
|
266
|
+
- spec/acceptance/organizer/add_to_context_spec.rb
|
|
267
|
+
- spec/acceptance/organizer/around_each_with_reduce_if_spec.rb
|
|
268
|
+
- spec/acceptance/organizer/context_failure_and_skipping_spec.rb
|
|
269
|
+
- spec/acceptance/organizer/execute_spec.rb
|
|
270
|
+
- spec/acceptance/organizer/iterate_spec.rb
|
|
271
|
+
- spec/acceptance/organizer/reduce_case_spec.rb
|
|
272
|
+
- spec/acceptance/organizer/reduce_if_else_spec.rb
|
|
273
|
+
- spec/acceptance/organizer/reduce_if_spec.rb
|
|
274
|
+
- spec/acceptance/organizer/reduce_until_spec.rb
|
|
275
|
+
- spec/acceptance/organizer/reduce_while_spec.rb
|
|
276
|
+
- spec/acceptance/organizer/with_callback_spec.rb
|
|
277
|
+
- spec/acceptance/organizer_entry_point_spec.rb
|
|
278
|
+
- spec/acceptance/rollback_spec.rb
|
|
279
|
+
- spec/acceptance/skip_all_remaining_spec.rb
|
|
280
|
+
- spec/acceptance/testing/context_factory_spec.rb
|
|
281
|
+
- spec/action_expected_keys_spec.rb
|
|
282
|
+
- spec/action_expects_and_promises_spec.rb
|
|
283
|
+
- spec/action_optional_expected_keys_spec.rb
|
|
284
|
+
- spec/action_promised_keys_spec.rb
|
|
285
|
+
- spec/action_spec.rb
|
|
286
|
+
- spec/context/inspect_spec.rb
|
|
287
|
+
- spec/context_spec.rb
|
|
288
|
+
- spec/examples/amount_spec.rb
|
|
289
|
+
- spec/examples/controller_spec.rb
|
|
290
|
+
- spec/examples/validate_address_spec.rb
|
|
291
|
+
- spec/i18n_localization_adapter_spec.rb
|
|
292
|
+
- spec/lib/deterministic/class_mixin_spec.rb
|
|
293
|
+
- spec/lib/deterministic/currify_spec.rb
|
|
294
|
+
- spec/lib/deterministic/monad_axioms.rb
|
|
295
|
+
- spec/lib/deterministic/monad_spec.rb
|
|
296
|
+
- spec/lib/deterministic/null_spec.rb
|
|
297
|
+
- spec/lib/deterministic/option_spec.rb
|
|
298
|
+
- spec/lib/deterministic/result/failure_spec.rb
|
|
299
|
+
- spec/lib/deterministic/result/result_map_spec.rb
|
|
300
|
+
- spec/lib/deterministic/result/result_shared.rb
|
|
301
|
+
- spec/lib/deterministic/result/success_spec.rb
|
|
302
|
+
- spec/lib/deterministic/result_spec.rb
|
|
303
|
+
- spec/lib/deterministic/sequencer_spec.rb
|
|
304
|
+
- spec/lib/edge_cases_spec.rb
|
|
305
|
+
- spec/lib/enum_spec.rb
|
|
306
|
+
- spec/lib/native_pattern_matching_spec.rb
|
|
307
|
+
- spec/localization_adapter_spec.rb
|
|
308
|
+
- spec/organizer/with_reducer_spec.rb
|
|
309
|
+
- spec/organizer_key_aliases_spec.rb
|
|
310
|
+
- spec/organizer_spec.rb
|
|
311
|
+
- spec/readme_spec.rb
|
|
312
|
+
- spec/sample/calculates_order_tax_action_spec.rb
|
|
313
|
+
- spec/sample/calculates_tax_spec.rb
|
|
314
|
+
- spec/sample/looks_up_tax_percentage_action_spec.rb
|
|
315
|
+
- spec/sample/provides_free_shipping_action_spec.rb
|
|
316
|
+
- spec/sample/tax/calculates_order_tax_action.rb
|
|
317
|
+
- spec/sample/tax/calculates_tax.rb
|
|
318
|
+
- spec/sample/tax/looks_up_tax_percentage_action.rb
|
|
319
|
+
- spec/sample/tax/provides_free_shipping_action.rb
|
|
320
|
+
- spec/spec_helper.rb
|
|
321
|
+
- spec/support.rb
|
|
322
|
+
- spec/test_doubles.rb
|
|
323
|
+
- spec/testing/context_factory/iterate_spec.rb
|
|
324
|
+
- spec/testing/context_factory/reduce_if_spec.rb
|
|
325
|
+
- spec/testing/context_factory/reduce_until_spec.rb
|
|
326
|
+
- spec/testing/context_factory/with_callback_spec.rb
|
|
327
|
+
- spec/testing/context_factory_spec.rb
|
|
328
|
+
- switchyard.gemspec
|
|
329
|
+
homepage: https://github.com/sphynx79/switchyard
|
|
330
|
+
licenses:
|
|
331
|
+
- MIT
|
|
332
|
+
metadata: {}
|
|
333
|
+
rdoc_options: []
|
|
334
|
+
require_paths:
|
|
335
|
+
- lib
|
|
336
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
337
|
+
requirements:
|
|
338
|
+
- - ">="
|
|
339
|
+
- !ruby/object:Gem::Version
|
|
340
|
+
version: 3.1.0
|
|
341
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
342
|
+
requirements:
|
|
343
|
+
- - ">="
|
|
344
|
+
- !ruby/object:Gem::Version
|
|
345
|
+
version: '0'
|
|
346
|
+
requirements: []
|
|
347
|
+
rubygems_version: 4.0.3
|
|
348
|
+
specification_version: 4
|
|
349
|
+
summary: A service skeleton with an emphasis on simplicity with a pinch a functional
|
|
350
|
+
programming
|
|
351
|
+
test_files: []
|