decouplio 1.0.0alpha8 → 1.0.0rc

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 (130) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +313 -15
  3. data/decouplio.gemspec +8 -2
  4. data/lib/decouplio/action.rb +24 -40
  5. data/lib/decouplio/action_state_printer.rb +2 -5
  6. data/lib/decouplio/const/flows.rb +59 -0
  7. data/lib/decouplio/const/reserved_methods.rb +6 -13
  8. data/lib/decouplio/const/types.rb +0 -144
  9. data/lib/decouplio/const/validations/common.rb +10 -0
  10. data/lib/decouplio/const/validations/octo.rb +16 -0
  11. data/lib/decouplio/const/validations/resq.rb +12 -1
  12. data/lib/decouplio/ctx.rb +13 -0
  13. data/lib/decouplio/default_meta_store.rb +2 -4
  14. data/lib/decouplio/errors/action_class_error.rb +0 -3
  15. data/lib/decouplio/errors/base_error.rb +0 -3
  16. data/lib/decouplio/errors/execution_error.rb +0 -2
  17. data/lib/decouplio/errors/extra_key_for_pass_error.rb +0 -3
  18. data/lib/decouplio/errors/fail_can_not_be_first_step_error.rb +0 -3
  19. data/lib/decouplio/errors/fail_controversial_keys_error.rb +0 -3
  20. data/lib/decouplio/errors/fail_finish_him_error.rb +0 -3
  21. data/lib/decouplio/errors/invalid_error_class_error.rb +0 -3
  22. data/lib/decouplio/errors/invalid_options_for_resq_step.rb +18 -0
  23. data/lib/decouplio/errors/invalid_wrap_name_error.rb +0 -3
  24. data/lib/decouplio/errors/logic_is_not_defined_error.rb +0 -3
  25. data/lib/decouplio/errors/logic_redefinition_error.rb +0 -3
  26. data/lib/decouplio/errors/octo_block_is_not_defined_error.rb +0 -3
  27. data/lib/decouplio/errors/octo_case_is_not_defined_error.rb +19 -0
  28. data/lib/decouplio/errors/octo_controversial_keys_error.rb +0 -3
  29. data/lib/decouplio/errors/{error_store_error.rb → octo_finish_him_is_not_allowed_error.rb} +2 -4
  30. data/lib/decouplio/errors/options_validation_error.rb +13 -1
  31. data/lib/decouplio/errors/palp_block_is_not_defined_error.rb +0 -3
  32. data/lib/decouplio/errors/palp_validation_error.rb +0 -3
  33. data/lib/decouplio/errors/pass_controversial_keys_error.rb +0 -3
  34. data/lib/decouplio/errors/pass_finish_him_error.rb +0 -3
  35. data/lib/decouplio/errors/required_options_is_missing_for_octo_error.rb +0 -3
  36. data/lib/decouplio/errors/resq_definition_error.rb +0 -3
  37. data/lib/decouplio/errors/resq_error_class_error.rb +0 -3
  38. data/lib/decouplio/errors/resq_handler_method_error.rb +0 -3
  39. data/lib/decouplio/errors/step_controversial_keys_error.rb +0 -3
  40. data/lib/decouplio/errors/step_definition_error.rb +17 -0
  41. data/lib/decouplio/errors/step_finish_him_error.rb +0 -3
  42. data/lib/decouplio/errors/step_is_not_defined_for_fail_error.rb +0 -3
  43. data/lib/decouplio/errors/step_is_not_defined_for_pass_error.rb +0 -4
  44. data/lib/decouplio/errors/step_is_not_defined_for_step_error.rb +0 -4
  45. data/lib/decouplio/errors/step_is_not_defined_for_wrap_error.rb +0 -3
  46. data/lib/decouplio/errors/step_name_error.rb +0 -3
  47. data/lib/decouplio/errors/wrap_block_is_not_defined_error.rb +0 -3
  48. data/lib/decouplio/errors/wrap_controversial_keys_error.rb +0 -3
  49. data/lib/decouplio/errors/wrap_finish_him_error.rb +0 -3
  50. data/lib/decouplio/errors/wrap_klass_method_error.rb +0 -3
  51. data/lib/decouplio/graph.rb +9 -0
  52. data/lib/decouplio/logic_dsl.rb +340 -79
  53. data/lib/decouplio/new_flow.rb +283 -0
  54. data/lib/decouplio/octo_hash_case.rb +20 -5
  55. data/lib/decouplio/octo_options_validator.rb +10 -64
  56. data/lib/decouplio/step_validator.rb +200 -0
  57. data/lib/decouplio/steps/base_condition.rb +21 -0
  58. data/lib/decouplio/steps/base_if_condition.rb +11 -0
  59. data/lib/decouplio/steps/base_inner_action.rb +42 -0
  60. data/lib/decouplio/steps/base_octo.rb +26 -0
  61. data/lib/decouplio/steps/base_resq.rb +25 -28
  62. data/lib/decouplio/steps/base_resq_with_mapping.rb +34 -0
  63. data/lib/decouplio/steps/base_service_step.rb +39 -0
  64. data/lib/decouplio/steps/base_step.rb +33 -6
  65. data/lib/decouplio/steps/base_unless_condition.rb +11 -0
  66. data/lib/decouplio/steps/base_wrap.rb +27 -0
  67. data/lib/decouplio/steps/fail.rb +1 -28
  68. data/lib/decouplio/steps/if_condition_fail.rb +1 -21
  69. data/lib/decouplio/steps/if_condition_pass.rb +1 -19
  70. data/lib/decouplio/steps/inner_action_fail.rb +1 -35
  71. data/lib/decouplio/steps/inner_action_pass.rb +9 -29
  72. data/lib/decouplio/steps/inner_action_step.rb +1 -35
  73. data/lib/decouplio/steps/octo_by_key.rb +31 -0
  74. data/lib/decouplio/steps/octo_by_method.rb +31 -0
  75. data/lib/decouplio/steps/pass.rb +5 -26
  76. data/lib/decouplio/steps/resq_fail.rb +0 -2
  77. data/lib/decouplio/steps/resq_pass.rb +1 -3
  78. data/lib/decouplio/steps/resq_with_mapping_fail.rb +8 -0
  79. data/lib/decouplio/steps/resq_with_mapping_pass.rb +8 -0
  80. data/lib/decouplio/steps/service_as_fail.rb +8 -0
  81. data/lib/decouplio/steps/service_as_pass.rb +16 -0
  82. data/lib/decouplio/steps/service_as_step.rb +8 -0
  83. data/lib/decouplio/steps/step.rb +0 -24
  84. data/lib/decouplio/steps/unless_condition_fail.rb +1 -21
  85. data/lib/decouplio/steps/unless_condition_pass.rb +1 -19
  86. data/lib/decouplio/steps/wrap.rb +25 -37
  87. data/lib/decouplio/steps/wrap_with_class.rb +43 -0
  88. data/lib/decouplio/steps/wrap_with_class_method.rb +45 -0
  89. data/lib/decouplio/utils/prepare_resq_mappings.rb +17 -0
  90. data/lib/decouplio/version.rb +1 -1
  91. data/lib/decouplio.rb +93 -0
  92. metadata +30 -42
  93. data/.circleci/config.yml +0 -63
  94. data/.dockerignore +0 -12
  95. data/.gitignore +0 -13
  96. data/.rspec +0 -3
  97. data/.rubocop.yml +0 -108
  98. data/.rubocop_todo.yml +0 -147
  99. data/.ruby-version +0 -1
  100. data/.vscode/settings.json +0 -3
  101. data/Dockerfile +0 -12
  102. data/Gemfile +0 -8
  103. data/benchmarks/.ruby-version +0 -1
  104. data/benchmarks/Dockerfile +0 -12
  105. data/benchmarks/Gemfile +0 -12
  106. data/benchmarks/multi_step_benchmark.rb +0 -336
  107. data/benchmarks/single_step_benchmark.rb +0 -159
  108. data/bin/console +0 -15
  109. data/bin/setup +0 -8
  110. data/docker-compose.yml +0 -29
  111. data/lib/decouplio/composer.rb +0 -615
  112. data/lib/decouplio/const/colors.rb +0 -25
  113. data/lib/decouplio/const/results.rb +0 -15
  114. data/lib/decouplio/const/step_options.rb +0 -16
  115. data/lib/decouplio/errors/extra_key_for_fail_error.rb +0 -26
  116. data/lib/decouplio/errors/extra_key_for_octo_error.rb +0 -26
  117. data/lib/decouplio/errors/extra_key_for_resq_error.rb +0 -29
  118. data/lib/decouplio/errors/extra_key_for_step_error.rb +0 -23
  119. data/lib/decouplio/errors/extra_key_for_wrap_error.rb +0 -23
  120. data/lib/decouplio/errors/palp_is_not_defined_error.rb +0 -26
  121. data/lib/decouplio/flow.rb +0 -17
  122. data/lib/decouplio/options_validator.rb +0 -606
  123. data/lib/decouplio/processor.rb +0 -20
  124. data/lib/decouplio/steps/octo.rb +0 -27
  125. data/lib/decouplio/steps/service_fail.rb +0 -41
  126. data/lib/decouplio/steps/service_pass.rb +0 -41
  127. data/lib/decouplio/steps/service_step.rb +0 -41
  128. data/lib/decouplio/steps/shared/fail_resolver.rb +0 -40
  129. data/lib/decouplio/steps/shared/step_resolver.rb +0 -43
  130. data/lib/decouplio/validators/condition.rb +0 -49
@@ -8,131 +8,9 @@ module Decouplio
8
8
  PASS_TYPE = :pass
9
9
  IF_TYPE = :if
10
10
  UNLESS_TYPE = :unless
11
- IF_TYPE_PASS = :if_pass
12
- UNLESS_TYPE_PASS = :unless_pass
13
- IF_TYPE_FAIL = :if_fail
14
- UNLESS_TYPE_FAIL = :unless_fail
15
11
  OCTO_TYPE = :octo
16
- ACTION_TYPE_STEP = :action_step
17
- ACTION_TYPE_FAIL = :action_fail
18
- ACTION_TYPE_PASS = :action_pass
19
- SERVICE_TYPE_STEP = :service_step
20
- SERVICE_TYPE_FAIL = :service_fail
21
- SERVICE_TYPE_PASS = :service_pass
22
12
  WRAP_TYPE = :wrap
23
13
  RESQ_TYPE = :resq
24
- RESQ_TYPE_STEP = :resq_step
25
- RESQ_TYPE_FAIL = :resq_fail
26
- RESQ_TYPE_PASS = :resq_pass
27
- STEP_TYPE_TO_CONDITION_TYPE = {
28
- STEP_TYPE => {
29
- IF_TYPE => IF_TYPE_PASS,
30
- UNLESS_TYPE => UNLESS_TYPE_PASS
31
- },
32
- FAIL_TYPE => {
33
- IF_TYPE => IF_TYPE_FAIL,
34
- UNLESS_TYPE => UNLESS_TYPE_FAIL
35
- },
36
- PASS_TYPE => {
37
- IF_TYPE => IF_TYPE_PASS,
38
- UNLESS_TYPE => UNLESS_TYPE_PASS
39
- },
40
- OCTO_TYPE => {
41
- IF_TYPE => IF_TYPE_PASS,
42
- UNLESS_TYPE => UNLESS_TYPE_PASS
43
- },
44
- WRAP_TYPE => {
45
- IF_TYPE => IF_TYPE_PASS,
46
- UNLESS_TYPE => UNLESS_TYPE_PASS
47
- },
48
- RESQ_TYPE_STEP => {
49
- IF_TYPE => IF_TYPE_PASS,
50
- UNLESS_TYPE => UNLESS_TYPE_PASS
51
- },
52
- RESQ_TYPE_FAIL => {
53
- IF_TYPE => IF_TYPE_FAIL,
54
- UNLESS_TYPE => UNLESS_TYPE_FAIL
55
- },
56
- RESQ_TYPE_PASS => {
57
- IF_TYPE => IF_TYPE_PASS,
58
- UNLESS_TYPE => UNLESS_TYPE_PASS
59
- },
60
- ACTION_TYPE_STEP => {
61
- IF_TYPE => IF_TYPE_PASS,
62
- UNLESS_TYPE => UNLESS_TYPE_PASS
63
- },
64
- ACTION_TYPE_FAIL => {
65
- IF_TYPE => IF_TYPE_FAIL,
66
- UNLESS_TYPE => UNLESS_TYPE_FAIL
67
- },
68
- ACTION_TYPE_PASS => {
69
- IF_TYPE => IF_TYPE_PASS,
70
- UNLESS_TYPE => UNLESS_TYPE_PASS
71
- },
72
- SERVICE_TYPE_STEP => {
73
- IF_TYPE => IF_TYPE_PASS,
74
- UNLESS_TYPE => UNLESS_TYPE_PASS
75
- },
76
- SERVICE_TYPE_FAIL => {
77
- IF_TYPE => IF_TYPE_FAIL,
78
- UNLESS_TYPE => UNLESS_TYPE_FAIL
79
- },
80
- SERVICE_TYPE_PASS => {
81
- IF_TYPE => IF_TYPE_PASS,
82
- UNLESS_TYPE => UNLESS_TYPE_PASS
83
- }
84
- }.freeze
85
- STEP_TYPE_TO_RESQ_TYPE = {
86
- STEP_TYPE => RESQ_TYPE_STEP,
87
- FAIL_TYPE => RESQ_TYPE_FAIL,
88
- PASS_TYPE => RESQ_TYPE_PASS,
89
- OCTO_TYPE => RESQ_TYPE_STEP,
90
- WRAP_TYPE => RESQ_TYPE_STEP,
91
- IF_TYPE_PASS => RESQ_TYPE_STEP,
92
- UNLESS_TYPE_PASS => RESQ_TYPE_STEP,
93
- IF_TYPE_FAIL => RESQ_TYPE_FAIL,
94
- UNLESS_TYPE_FAIL => RESQ_TYPE_FAIL
95
- }.freeze
96
- STEP_TYPE_TO_INNER_TYPE = {
97
- STEP_TYPE => ACTION_TYPE_STEP,
98
- FAIL_TYPE => ACTION_TYPE_FAIL,
99
- PASS_TYPE => ACTION_TYPE_PASS,
100
- RESQ_TYPE_STEP => ACTION_TYPE_STEP,
101
- RESQ_TYPE_FAIL => ACTION_TYPE_FAIL,
102
- RESQ_TYPE_PASS => ACTION_TYPE_PASS
103
- }.freeze
104
- STEP_TYPE_TO_SERVICE_TYPE = {
105
- STEP_TYPE => SERVICE_TYPE_STEP,
106
- FAIL_TYPE => SERVICE_TYPE_FAIL,
107
- PASS_TYPE => SERVICE_TYPE_PASS,
108
- RESQ_TYPE_STEP => SERVICE_TYPE_STEP,
109
- RESQ_TYPE_FAIL => SERVICE_TYPE_FAIL,
110
- RESQ_TYPE_PASS => SERVICE_TYPE_PASS
111
- }.freeze
112
- ACTION_NOT_ALLOWED_STEPS = [
113
- OCTO_TYPE,
114
- WRAP_TYPE,
115
- RESQ_TYPE
116
- ].freeze
117
- PASS_FLOW = [
118
- STEP_TYPE,
119
- PASS_TYPE,
120
- OCTO_TYPE,
121
- WRAP_TYPE,
122
- IF_TYPE_PASS,
123
- UNLESS_TYPE_PASS,
124
- ACTION_TYPE_PASS,
125
- ACTION_TYPE_STEP,
126
- SERVICE_TYPE_STEP,
127
- SERVICE_TYPE_PASS
128
- ].freeze
129
- FAIL_FLOW = [
130
- FAIL_TYPE,
131
- IF_TYPE_FAIL,
132
- UNLESS_TYPE_FAIL,
133
- ACTION_TYPE_FAIL,
134
- SERVICE_TYPE_FAIL
135
- ].freeze
136
14
 
137
15
  MAIN_FLOW_TYPES = [
138
16
  STEP_TYPE,
@@ -140,28 +18,6 @@ module Decouplio
140
18
  PASS_TYPE,
141
19
  WRAP_TYPE
142
20
  ].freeze
143
- SUCCESS_TRACK_STEP_TYPES = [
144
- STEP_TYPE,
145
- PASS_TYPE,
146
- IF_TYPE_PASS,
147
- UNLESS_TYPE_PASS,
148
- WRAP_TYPE,
149
- ACTION_TYPE_STEP,
150
- ACTION_TYPE_PASS,
151
- SERVICE_TYPE_STEP,
152
- SERVICE_TYPE_PASS,
153
- RESQ_TYPE_STEP,
154
- RESQ_TYPE_PASS,
155
- OCTO_TYPE
156
- ].freeze
157
- FAILURE_TRACK_STEP_TYPES = [
158
- FAIL_TYPE,
159
- IF_TYPE_FAIL,
160
- UNLESS_TYPE_FAIL,
161
- RESQ_TYPE_FAIL,
162
- ACTION_TYPE_FAIL,
163
- SERVICE_TYPE_FAIL
164
- ].freeze
165
21
  end
166
22
  end
167
23
  end
@@ -8,6 +8,16 @@ module Decouplio
8
8
  METHOD_IS_NOT_DEFINED = 'Method "%s" is not defined'
9
9
  STEP_IS_NOT_DEFINED = 'Step "%s" is not defined'
10
10
  STEP_NAME = '"%s" method is reserved by Decouplio, please another name.'
11
+ STEP_DEFINITION = <<~MESSAGE
12
+ %s is invalid attribute for step
13
+
14
+ Allowed values:
15
+ <symbol>
16
+ OR
17
+ <class inherited from Decouplio::Action>
18
+ OR
19
+ <class with implemented self.call(ctx, ms, **) method>
20
+ MESSAGE
11
21
  end
12
22
  end
13
23
  end
@@ -39,6 +39,22 @@ module Decouplio
39
39
  CONTROVERSIAL_KEYS = '"%s" option(s) is not allowed along with "%s" option(s)'
40
40
  PALPS_IS_NOT_DEFINED = 'Next palp(s): "%s" is not difined'
41
41
  OCTO_BLOCK = 'Block for "octo" is not defined'
42
+ FINISH_HIM_IS_NOT_ALLOWED = "'finish_him' option is not allowed for octo"
43
+
44
+ # PALP
45
+ PALP_ON_ERROR_MESSAGE = <<~ERROR_MESSAGE
46
+ Invalid options for "on":
47
+ %s
48
+
49
+ Allowed options are:
50
+ %s
51
+
52
+ Please read the manual about allowed options here:
53
+ %s
54
+ ERROR_MESSAGE
55
+ ON_ALLOWED_OPTIONS = <<~MESSAGE
56
+ on_success, on_failure, on_error
57
+ MESSAGE
42
58
  end
43
59
  end
44
60
  end
@@ -18,6 +18,8 @@ module Decouplio
18
18
  %s
19
19
  ERROR_MESSAGE
20
20
  ALLOWED_OPTIONS_MESSAGE = <<~ALLOWED_OPTIONS
21
+ <method name>
22
+ OR
21
23
  <method name> => <exception class>
22
24
  OR
23
25
  <method name> => [<excpetion class one>, <exception class two>]
@@ -26,7 +28,7 @@ module Decouplio
26
28
  logic do
27
29
  step :some_step
28
30
  resq first_handler: [NoMethodError, ArgumentError],
29
- second_handler: StandardError
31
+ second_handler: StandardError
30
32
  end
31
33
 
32
34
  def some_step(**)
@@ -52,6 +54,15 @@ module Decouplio
52
54
  %s
53
55
  ERROR
54
56
 
57
+ OPTIONS_DEFINITION_ERROR_MESSAGE = <<~ERROR
58
+ Details:
59
+ Invalid "resq" definition
60
+ %s
61
+
62
+ Please read the manual about allowed options here:
63
+ %s
64
+ ERROR
65
+
55
66
  DOES_NOT_ALLOW_OPTIONS = '"resq" does not allow "%s" option(s)'
56
67
  MANUAL_URL = 'https://stub.resq.manual.url'
57
68
  PLEASE_DEFINE_HANDLER_METHOD = 'Please define "%s" method'
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decouplio
4
+ class Ctx < Hash
5
+ def method_missing(method_name, *_args)
6
+ self[method_name] if key?(method_name)
7
+ end
8
+
9
+ def respond_to_missing?(method_name, include_private = false)
10
+ key?(method_name) || super
11
+ end
12
+ end
13
+ end
@@ -2,8 +2,7 @@
2
2
 
3
3
  module Decouplio
4
4
  class DefaultMetaStore
5
- attr_accessor :status
6
- attr_reader :errors
5
+ attr_accessor :status, :errors
7
6
 
8
7
  def initialize
9
8
  @errors = {}
@@ -19,8 +18,7 @@ module Decouplio
19
18
 
20
19
  def to_s
21
20
  <<~METASTORE
22
- Status: #{@status || 'NONE'}
23
-
21
+ Status: #{@status ? @status.inspect : 'NONE'}
24
22
  Errors:
25
23
  #{errors_string}
26
24
  METASTORE
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/action_option_class'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class ActionClassError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../const/colors'
4
- require_relative '../const/validations/common'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class BaseError < StandardError
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../const/error_messages'
4
-
5
3
  module Decouplio
6
4
  module Errors
7
5
  class ExecutionError < StandardError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/pass'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class ExtraKeyForPassError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/fail'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class FailCanNotBeFirstStepError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/fail'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class FailControversialKeysError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/fail'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class FailFinishHimError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/resq'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class InvalidErrorClassError < Decouplio::Errors::BaseError
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decouplio
4
+ module Errors
5
+ class InvalidOptionsForResqStep < Decouplio::Errors::BaseError
6
+ def template
7
+ Decouplio::Const::Validations::Resq::OPTIONS_DEFINITION_ERROR_MESSAGE
8
+ end
9
+
10
+ def interpolation_values
11
+ [
12
+ @errored_option,
13
+ Decouplio::Const::Validations::Resq::MANUAL_URL
14
+ ]
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/wrap'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class InvalidWrapNameError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/logic'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class LogicIsNotDefinedError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/logic'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class LogicRedefinitionError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/octo'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class OctoBlockIsNotDefinedError < Decouplio::Errors::BaseError
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decouplio
4
+ module Errors
5
+ class OctoCaseIsNotDefinedError < Decouplio::Errors::BaseError
6
+ def template
7
+ Decouplio::Const::Validations::Octo::PALP_ON_ERROR_MESSAGE
8
+ end
9
+
10
+ def interpolation_values
11
+ [
12
+ @errored_option,
13
+ Decouplio::Const::Validations::Octo::ON_ALLOWED_OPTIONS,
14
+ Decouplio::Const::Validations::Octo::MANUAL_URL
15
+ ]
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/octo'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class OctoControversialKeysError < Decouplio::Errors::BaseError
@@ -1,12 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
-
5
3
  module Decouplio
6
4
  module Errors
7
- class ErrorStoreError < Decouplio::Errors::BaseError
5
+ class OctoFinishHimIsNotAllowedError < Decouplio::Errors::BaseError
8
6
  def template
9
- 'Error store for action and inner action should be the same.'
7
+ Decouplio::Const::Validations::Octo::FINISH_HIM_IS_NOT_ALLOWED
10
8
  end
11
9
 
12
10
  def interpolation_values
@@ -2,6 +2,18 @@
2
2
 
3
3
  module Decouplio
4
4
  module Errors
5
- class OptionsValidationError < StandardError; end
5
+ class OptionsValidationError < Decouplio::Errors::BaseError
6
+ def template
7
+ Decouplio::Const::Validations::Octo::PALP_ON_ERROR_MESSAGE
8
+ end
9
+
10
+ def interpolation_values
11
+ [
12
+ @errored_option,
13
+ Decouplio::Const::Validations::Octo::ON_ALLOWED_OPTIONS,
14
+ Decouplio::Const::Validations::Octo::MANUAL_URL
15
+ ]
16
+ end
17
+ end
6
18
  end
7
19
  end
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/palp'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class PalpBlockIsNotDefinedError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/palp'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class PalpValidationError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/pass'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class PassControversialKeysError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/pass'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class PassFinishHimError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/octo'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class RequiredOptionsIsMissingForOctoError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/resq'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class ResqDefinitionError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/resq'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class ResqErrorClassError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/resq'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class ResqHandlerMethodError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/step'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class StepControversialKeysError < Decouplio::Errors::BaseError
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decouplio
4
+ module Errors
5
+ class StepDefinitionError < Decouplio::Errors::BaseError
6
+ def template
7
+ Decouplio::Const::Validations::Common::STEP_DEFINITION
8
+ end
9
+
10
+ def interpolation_values
11
+ [
12
+ @errored_option
13
+ ]
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/step'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class StepFinishHimError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/fail'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class StepIsNotDefinedForFailError < Decouplio::Errors::BaseError
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/pass'
5
- require_relative '../const/validations/common'
6
-
7
3
  module Decouplio
8
4
  module Errors
9
5
  class StepIsNotDefinedForPassError < Decouplio::Errors::BaseError
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/step'
5
- require_relative '../const/validations/common'
6
-
7
3
  module Decouplio
8
4
  module Errors
9
5
  class StepIsNotDefinedForStepError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/wrap'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class StepIsNotDefinedForWrapError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/common'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class StepNameError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/wrap'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class WrapBlockIsNotDefinedError < Decouplio::Errors::BaseError
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base_error'
4
- require_relative '../const/validations/wrap'
5
-
6
3
  module Decouplio
7
4
  module Errors
8
5
  class WrapControversialKeysError < Decouplio::Errors::BaseError