decouplio 1.0.0alpha4 → 1.0.0alpha8
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 +6 -11
- data/.ruby-version +1 -1
- data/decouplio.gemspec +1 -1
- data/lib/decouplio/action.rb +16 -42
- data/lib/decouplio/action_state_printer.rb +37 -0
- data/lib/decouplio/composer.rb +3 -76
- data/lib/decouplio/const/{doby_aide_options.rb → step_options.rb} +2 -1
- data/lib/decouplio/const/types.rb +7 -27
- data/lib/decouplio/default_meta_store.rb +39 -0
- data/lib/decouplio/logic_dsl.rb +53 -35
- data/lib/decouplio/options_validator.rb +1 -110
- data/lib/decouplio/steps/inner_action_fail.rb +5 -3
- data/lib/decouplio/steps/inner_action_pass.rb +7 -5
- data/lib/decouplio/steps/inner_action_step.rb +5 -3
- data/lib/decouplio/steps/service_fail.rb +4 -2
- data/lib/decouplio/steps/service_pass.rb +4 -2
- data/lib/decouplio/steps/service_step.rb +4 -2
- data/lib/decouplio/validators/condition.rb +0 -10
- data/lib/decouplio/version.rb +1 -1
- metadata +8 -18
- data/lib/decouplio/const/validations/aide.rb +0 -38
- data/lib/decouplio/const/validations/doby.rb +0 -36
- data/lib/decouplio/default_error_handler.rb +0 -24
- data/lib/decouplio/errors/aide_can_not_be_first_step_error.rb +0 -18
- data/lib/decouplio/errors/aide_controversial_keys_error.rb +0 -26
- data/lib/decouplio/errors/aide_finish_him_error.rb +0 -26
- data/lib/decouplio/errors/doby_controversial_keys_error.rb +0 -26
- data/lib/decouplio/errors/doby_finish_him_error.rb +0 -26
- data/lib/decouplio/errors/step_is_not_defined_for_aide_error.rb +0 -26
- data/lib/decouplio/errors/step_is_not_defined_for_doby_error.rb +0 -27
- data/lib/decouplio/steps/aide.rb +0 -37
- data/lib/decouplio/steps/doby.rb +0 -37
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'base_error'
|
4
|
-
require_relative '../const/validations/fail'
|
5
|
-
|
6
|
-
module Decouplio
|
7
|
-
module Errors
|
8
|
-
class StepIsNotDefinedForAideError < Decouplio::Errors::BaseError
|
9
|
-
def template
|
10
|
-
Decouplio::Const::Validations::Aide::VALIDATION_ERROR_MESSAGE
|
11
|
-
end
|
12
|
-
|
13
|
-
def interpolation_values
|
14
|
-
[
|
15
|
-
@errored_option,
|
16
|
-
format(
|
17
|
-
Decouplio::Const::Validations::Common::STEP_IS_NOT_DEFINED,
|
18
|
-
@details
|
19
|
-
),
|
20
|
-
Decouplio::Const::Validations::Aide::ALLOWED_OPTIONS_MESSAGE,
|
21
|
-
Decouplio::Const::Validations::Aide::MANUAL_URL
|
22
|
-
]
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'base_error'
|
4
|
-
require_relative '../const/validations/doby'
|
5
|
-
require_relative '../const/validations/common'
|
6
|
-
|
7
|
-
module Decouplio
|
8
|
-
module Errors
|
9
|
-
class StepIsNotDefinedForDobyError < Decouplio::Errors::BaseError
|
10
|
-
def template
|
11
|
-
Decouplio::Const::Validations::Doby::VALIDATION_ERROR_MESSAGE
|
12
|
-
end
|
13
|
-
|
14
|
-
def interpolation_values
|
15
|
-
[
|
16
|
-
@errored_option,
|
17
|
-
format(
|
18
|
-
Decouplio::Const::Validations::Common::STEP_IS_NOT_DEFINED,
|
19
|
-
@details
|
20
|
-
),
|
21
|
-
Decouplio::Const::Validations::Doby::ALLOWED_OPTIONS_MESSAGE,
|
22
|
-
Decouplio::Const::Validations::Doby::MANUAL_URL
|
23
|
-
]
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/lib/decouplio/steps/aide.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'base_step'
|
4
|
-
|
5
|
-
module Decouplio
|
6
|
-
module Steps
|
7
|
-
class Aide < Decouplio::Steps::BaseStep
|
8
|
-
def initialize(name:, aide_class:, aide_options:, on_success_type:, on_failure_type:)
|
9
|
-
super()
|
10
|
-
@name = name
|
11
|
-
@aide_class = aide_class
|
12
|
-
@aide_options = aide_options
|
13
|
-
@on_success_type = on_success_type
|
14
|
-
@on_failure_type = on_failure_type
|
15
|
-
end
|
16
|
-
|
17
|
-
def process(instance:)
|
18
|
-
instance.append_railway_flow(@name)
|
19
|
-
result = @aide_class.call(
|
20
|
-
ctx: instance.ctx,
|
21
|
-
error_store: instance.error_store,
|
22
|
-
**@aide_options
|
23
|
-
)
|
24
|
-
resolve(instance: instance, result: result)
|
25
|
-
end
|
26
|
-
|
27
|
-
def resolve(instance:, result:)
|
28
|
-
Decouplio::Steps::Shared::FailResolver.call(
|
29
|
-
instance: instance,
|
30
|
-
result: result,
|
31
|
-
on_success_type: @on_success_type,
|
32
|
-
on_failure_type: @on_failure_type
|
33
|
-
)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/lib/decouplio/steps/doby.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'base_step'
|
4
|
-
|
5
|
-
module Decouplio
|
6
|
-
module Steps
|
7
|
-
class Doby < Decouplio::Steps::BaseStep
|
8
|
-
def initialize(name:, doby_class:, doby_options:, on_success_type:, on_failure_type:)
|
9
|
-
super()
|
10
|
-
@name = name
|
11
|
-
@doby_class = doby_class
|
12
|
-
@doby_options = doby_options
|
13
|
-
@on_success_type = on_success_type
|
14
|
-
@on_failure_type = on_failure_type
|
15
|
-
end
|
16
|
-
|
17
|
-
def process(instance:)
|
18
|
-
instance.append_railway_flow(@name)
|
19
|
-
result = @doby_class.call(
|
20
|
-
ctx: instance.ctx,
|
21
|
-
error_store: instance.error_store,
|
22
|
-
**@doby_options
|
23
|
-
)
|
24
|
-
resolve(result: result, instance: instance)
|
25
|
-
end
|
26
|
-
|
27
|
-
def resolve(result:, instance:)
|
28
|
-
Decouplio::Steps::Shared::StepResolver.call(
|
29
|
-
instance: instance,
|
30
|
-
result: result,
|
31
|
-
on_success_type: @on_success_type,
|
32
|
-
on_failure_type: @on_failure_type
|
33
|
-
)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|