decouplio 1.0.0alpha7 → 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 (143) 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 +34 -74
  5. data/lib/decouplio/action_state_printer.rb +34 -0
  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 +1 -165
  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 +37 -0
  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 +337 -107
  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 -33
  71. data/lib/decouplio/steps/inner_action_pass.rb +12 -30
  72. data/lib/decouplio/steps/inner_action_step.rb +1 -33
  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 +32 -55
  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 -116
  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 -691
  112. data/lib/decouplio/const/colors.rb +0 -25
  113. data/lib/decouplio/const/doby_aide_options.rb +0 -16
  114. data/lib/decouplio/const/results.rb +0 -15
  115. data/lib/decouplio/const/step_options.rb +0 -16
  116. data/lib/decouplio/const/validations/aide.rb +0 -38
  117. data/lib/decouplio/const/validations/doby.rb +0 -36
  118. data/lib/decouplio/default_error_handler.rb +0 -39
  119. data/lib/decouplio/errors/aide_can_not_be_first_step_error.rb +0 -18
  120. data/lib/decouplio/errors/aide_controversial_keys_error.rb +0 -26
  121. data/lib/decouplio/errors/aide_finish_him_error.rb +0 -26
  122. data/lib/decouplio/errors/doby_controversial_keys_error.rb +0 -26
  123. data/lib/decouplio/errors/doby_finish_him_error.rb +0 -26
  124. data/lib/decouplio/errors/extra_key_for_fail_error.rb +0 -26
  125. data/lib/decouplio/errors/extra_key_for_octo_error.rb +0 -26
  126. data/lib/decouplio/errors/extra_key_for_resq_error.rb +0 -29
  127. data/lib/decouplio/errors/extra_key_for_step_error.rb +0 -23
  128. data/lib/decouplio/errors/extra_key_for_wrap_error.rb +0 -23
  129. data/lib/decouplio/errors/palp_is_not_defined_error.rb +0 -26
  130. data/lib/decouplio/errors/step_is_not_defined_for_aide_error.rb +0 -26
  131. data/lib/decouplio/errors/step_is_not_defined_for_doby_error.rb +0 -27
  132. data/lib/decouplio/flow.rb +0 -17
  133. data/lib/decouplio/options_validator.rb +0 -716
  134. data/lib/decouplio/processor.rb +0 -20
  135. data/lib/decouplio/steps/aide.rb +0 -37
  136. data/lib/decouplio/steps/doby.rb +0 -37
  137. data/lib/decouplio/steps/octo.rb +0 -27
  138. data/lib/decouplio/steps/service_fail.rb +0 -41
  139. data/lib/decouplio/steps/service_pass.rb +0 -41
  140. data/lib/decouplio/steps/service_step.rb +0 -41
  141. data/lib/decouplio/steps/shared/fail_resolver.rb +0 -40
  142. data/lib/decouplio/steps/shared/step_resolver.rb +0 -43
  143. data/lib/decouplio/validators/condition.rb +0 -59
@@ -8,179 +8,15 @@ 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
- DOBY_TYPE = :doby
17
- AIDE_TYPE = :aide
18
- ACTION_TYPE_STEP = :action_step
19
- ACTION_TYPE_FAIL = :action_fail
20
- ACTION_TYPE_PASS = :action_pass
21
- SERVICE_TYPE_STEP = :service_step
22
- SERVICE_TYPE_FAIL = :service_fail
23
- SERVICE_TYPE_PASS = :service_pass
24
12
  WRAP_TYPE = :wrap
25
13
  RESQ_TYPE = :resq
26
- RESQ_TYPE_STEP = :resq_step
27
- RESQ_TYPE_FAIL = :resq_fail
28
- RESQ_TYPE_PASS = :resq_pass
29
- STEP_TYPE_TO_CONDITION_TYPE = {
30
- STEP_TYPE => {
31
- IF_TYPE => IF_TYPE_PASS,
32
- UNLESS_TYPE => UNLESS_TYPE_PASS
33
- },
34
- FAIL_TYPE => {
35
- IF_TYPE => IF_TYPE_FAIL,
36
- UNLESS_TYPE => UNLESS_TYPE_FAIL
37
- },
38
- PASS_TYPE => {
39
- IF_TYPE => IF_TYPE_PASS,
40
- UNLESS_TYPE => UNLESS_TYPE_PASS
41
- },
42
- OCTO_TYPE => {
43
- IF_TYPE => IF_TYPE_PASS,
44
- UNLESS_TYPE => UNLESS_TYPE_PASS
45
- },
46
- WRAP_TYPE => {
47
- IF_TYPE => IF_TYPE_PASS,
48
- UNLESS_TYPE => UNLESS_TYPE_PASS
49
- },
50
- RESQ_TYPE_STEP => {
51
- IF_TYPE => IF_TYPE_PASS,
52
- UNLESS_TYPE => UNLESS_TYPE_PASS
53
- },
54
- RESQ_TYPE_FAIL => {
55
- IF_TYPE => IF_TYPE_FAIL,
56
- UNLESS_TYPE => UNLESS_TYPE_FAIL
57
- },
58
- RESQ_TYPE_PASS => {
59
- IF_TYPE => IF_TYPE_PASS,
60
- UNLESS_TYPE => UNLESS_TYPE_PASS
61
- },
62
- ACTION_TYPE_STEP => {
63
- IF_TYPE => IF_TYPE_PASS,
64
- UNLESS_TYPE => UNLESS_TYPE_PASS
65
- },
66
- ACTION_TYPE_FAIL => {
67
- IF_TYPE => IF_TYPE_FAIL,
68
- UNLESS_TYPE => UNLESS_TYPE_FAIL
69
- },
70
- ACTION_TYPE_PASS => {
71
- IF_TYPE => IF_TYPE_PASS,
72
- UNLESS_TYPE => UNLESS_TYPE_PASS
73
- },
74
- SERVICE_TYPE_STEP => {
75
- IF_TYPE => IF_TYPE_PASS,
76
- UNLESS_TYPE => UNLESS_TYPE_PASS
77
- },
78
- SERVICE_TYPE_FAIL => {
79
- IF_TYPE => IF_TYPE_FAIL,
80
- UNLESS_TYPE => UNLESS_TYPE_FAIL
81
- },
82
- SERVICE_TYPE_PASS => {
83
- IF_TYPE => IF_TYPE_PASS,
84
- UNLESS_TYPE => UNLESS_TYPE_PASS
85
- },
86
- DOBY_TYPE => {
87
- IF_TYPE => IF_TYPE_PASS,
88
- UNLESS_TYPE => UNLESS_TYPE_PASS
89
- },
90
- AIDE_TYPE => {
91
- IF_TYPE => IF_TYPE_FAIL,
92
- UNLESS_TYPE => UNLESS_TYPE_FAIL
93
- }
94
- }.freeze
95
- STEP_TYPE_TO_RESQ_TYPE = {
96
- STEP_TYPE => RESQ_TYPE_STEP,
97
- FAIL_TYPE => RESQ_TYPE_FAIL,
98
- PASS_TYPE => RESQ_TYPE_PASS,
99
- OCTO_TYPE => RESQ_TYPE_STEP,
100
- WRAP_TYPE => RESQ_TYPE_STEP,
101
- IF_TYPE_PASS => RESQ_TYPE_STEP,
102
- UNLESS_TYPE_PASS => RESQ_TYPE_STEP,
103
- IF_TYPE_FAIL => RESQ_TYPE_FAIL,
104
- UNLESS_TYPE_FAIL => RESQ_TYPE_FAIL,
105
- DOBY_TYPE => RESQ_TYPE_STEP,
106
- AIDE_TYPE => RESQ_TYPE_FAIL
107
- }.freeze
108
- STEP_TYPE_TO_INNER_TYPE = {
109
- STEP_TYPE => ACTION_TYPE_STEP,
110
- FAIL_TYPE => ACTION_TYPE_FAIL,
111
- PASS_TYPE => ACTION_TYPE_PASS,
112
- RESQ_TYPE_STEP => ACTION_TYPE_STEP,
113
- RESQ_TYPE_FAIL => ACTION_TYPE_FAIL,
114
- RESQ_TYPE_PASS => ACTION_TYPE_PASS
115
- }.freeze
116
- STEP_TYPE_TO_SERVICE_TYPE = {
117
- STEP_TYPE => SERVICE_TYPE_STEP,
118
- FAIL_TYPE => SERVICE_TYPE_FAIL,
119
- PASS_TYPE => SERVICE_TYPE_PASS,
120
- RESQ_TYPE_STEP => SERVICE_TYPE_STEP,
121
- RESQ_TYPE_FAIL => SERVICE_TYPE_FAIL,
122
- RESQ_TYPE_PASS => SERVICE_TYPE_PASS
123
- }.freeze
124
- ACTION_NOT_ALLOWED_STEPS = [
125
- OCTO_TYPE,
126
- WRAP_TYPE,
127
- RESQ_TYPE,
128
- DOBY_TYPE,
129
- AIDE_TYPE
130
- ].freeze
131
- PASS_FLOW = [
132
- STEP_TYPE,
133
- PASS_TYPE,
134
- OCTO_TYPE,
135
- WRAP_TYPE,
136
- IF_TYPE_PASS,
137
- UNLESS_TYPE_PASS,
138
- ACTION_TYPE_PASS,
139
- ACTION_TYPE_STEP,
140
- SERVICE_TYPE_STEP,
141
- SERVICE_TYPE_PASS,
142
- DOBY_TYPE
143
- ].freeze
144
- FAIL_FLOW = [
145
- FAIL_TYPE,
146
- IF_TYPE_FAIL,
147
- UNLESS_TYPE_FAIL,
148
- ACTION_TYPE_FAIL,
149
- SERVICE_TYPE_FAIL,
150
- AIDE_TYPE
151
- ].freeze
152
14
 
153
15
  MAIN_FLOW_TYPES = [
154
16
  STEP_TYPE,
155
17
  FAIL_TYPE,
156
18
  PASS_TYPE,
157
- WRAP_TYPE,
158
- DOBY_TYPE,
159
- AIDE_TYPE
160
- ].freeze
161
- SUCCESS_TRACK_STEP_TYPES = [
162
- STEP_TYPE,
163
- PASS_TYPE,
164
- IF_TYPE_PASS,
165
- UNLESS_TYPE_PASS,
166
- WRAP_TYPE,
167
- ACTION_TYPE_STEP,
168
- ACTION_TYPE_PASS,
169
- SERVICE_TYPE_STEP,
170
- SERVICE_TYPE_PASS,
171
- RESQ_TYPE_STEP,
172
- RESQ_TYPE_PASS,
173
- OCTO_TYPE,
174
- DOBY_TYPE
175
- ].freeze
176
- FAILURE_TRACK_STEP_TYPES = [
177
- FAIL_TYPE,
178
- IF_TYPE_FAIL,
179
- UNLESS_TYPE_FAIL,
180
- RESQ_TYPE_FAIL,
181
- ACTION_TYPE_FAIL,
182
- SERVICE_TYPE_FAIL,
183
- AIDE_TYPE
19
+ WRAP_TYPE
184
20
  ].freeze
185
21
  end
186
22
  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
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decouplio
4
+ class DefaultMetaStore
5
+ attr_accessor :status, :errors
6
+
7
+ def initialize
8
+ @errors = {}
9
+ @status = nil
10
+ end
11
+
12
+ def add_error(key, messages)
13
+ @errors.store(
14
+ key,
15
+ (@errors[key] || []) + [messages].flatten
16
+ )
17
+ end
18
+
19
+ def to_s
20
+ <<~METASTORE
21
+ Status: #{@status ? @status.inspect : 'NONE'}
22
+ Errors:
23
+ #{errors_string}
24
+ METASTORE
25
+ end
26
+
27
+ private
28
+
29
+ def errors_string
30
+ return 'NONE' if @errors.empty?
31
+
32
+ @errors.map do |k, v|
33
+ "#{k.inspect} => #{v.inspect}"
34
+ end.join("\n ")
35
+ end
36
+ end
37
+ end
@@ -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