convenient_service 0.18.0 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -3
  3. data/lib/convenient_service/commands/is_service.rb +28 -0
  4. data/lib/convenient_service/commands/is_service_class.rb +30 -0
  5. data/lib/convenient_service/commands.rb +4 -0
  6. data/lib/convenient_service/common/plugins.rb +2 -3
  7. data/lib/convenient_service/core/concern/class_methods.rb +3 -0
  8. data/lib/convenient_service/core/entities/config/entities/concerns/entities/stack.rb +22 -0
  9. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern/instance_methods.rb +1 -1
  10. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities/event.rb +13 -15
  11. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands/normalize_env.rb +55 -0
  12. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands.rb +1 -0
  13. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/instance_methods.rb +3 -3
  14. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/classic.rb +14 -0
  15. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +22 -0
  16. data/lib/convenient_service/dependencies/built_in.rb +0 -7
  17. data/lib/convenient_service/dependencies/extractions/ds.rb +45 -0
  18. data/lib/convenient_service/dependencies/only_queries.rb +29 -0
  19. data/lib/convenient_service/dependencies/queries/gems/active_model.rb +38 -0
  20. data/lib/convenient_service/dependencies/queries/gems/logger.rb +39 -0
  21. data/lib/convenient_service/dependencies/queries/gems/paint.rb +39 -0
  22. data/lib/convenient_service/dependencies/queries/gems/rspec.rb +60 -0
  23. data/lib/convenient_service/dependencies/queries/ruby.rb +103 -0
  24. data/lib/convenient_service/dependencies/queries/version/null_version.rb +87 -0
  25. data/lib/convenient_service/dependencies/queries/version.rb +87 -0
  26. data/lib/convenient_service/dependencies/queries.rb +536 -0
  27. data/lib/convenient_service/dependencies.rb +2 -438
  28. data/lib/convenient_service/feature/configs/standard.rb +0 -2
  29. data/lib/convenient_service/service/configs/amazing_print_inspect/aliases.rb +7 -0
  30. data/lib/convenient_service/service/configs/amazing_print_inspect.rb +61 -0
  31. data/lib/convenient_service/service/configs/awesome_print_inspect.rb +1 -1
  32. data/lib/convenient_service/service/configs/{minimal.rb → essential.rb} +2 -107
  33. data/lib/convenient_service/service/configs/standard/v1.rb +5 -10
  34. data/lib/convenient_service/service/configs/standard.rb +19 -31
  35. data/lib/convenient_service/service/configs.rb +1 -1
  36. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb +4 -1
  37. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/empty.rb +4 -4
  38. data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/step_collection.rb +7 -0
  39. data/lib/convenient_service/service/plugins/can_have_fallbacks/concern.rb +18 -0
  40. data/lib/convenient_service/service/plugins/can_have_fallbacks/exceptions.rb +22 -4
  41. data/lib/convenient_service/service/plugins/can_have_fallbacks/middleware.rb +3 -3
  42. data/lib/convenient_service/service/plugins/can_have_rollbacks/middleware.rb +66 -0
  43. data/lib/convenient_service/service/plugins/can_have_rollbacks.rb +3 -0
  44. data/lib/convenient_service/service/plugins/can_have_sequential_steps/entities/step_collection.rb +7 -0
  45. data/lib/convenient_service/service/plugins/can_have_steps/commands/is_step.rb +34 -0
  46. data/lib/convenient_service/service/plugins/can_have_steps/commands.rb +1 -0
  47. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb +22 -14
  48. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed/middleware.rb +1 -15
  49. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/exceptions.rb +53 -0
  50. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/middleware.rb +60 -15
  51. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks.rb +1 -0
  52. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_amazing_print_inspect/concern.rb +46 -0
  53. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_amazing_print_inspect.rb +3 -0
  54. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect/concern.rb +3 -2
  55. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_result/middleware.rb +26 -1
  56. data/lib/convenient_service/service/plugins/can_have_steps.rb +41 -0
  57. data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_all_services_stubbed_results_cache.rb +2 -2
  58. data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/exceptions.rb +53 -0
  59. data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/middleware.rb +108 -0
  60. data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments.rb +4 -0
  61. data/lib/convenient_service/service/plugins/has_amazing_print_inspect/concern.rb +39 -0
  62. data/lib/convenient_service/service/plugins/has_amazing_print_inspect.rb +3 -0
  63. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_from_exception/concern.rb +32 -0
  64. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_from_exception.rb +3 -0
  65. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step/concern.rb +7 -0
  66. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect/concern.rb +41 -0
  67. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect.rb +3 -0
  68. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect/concern.rb +2 -2
  69. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/concern/instance_methods.rb +0 -140
  70. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_amazing_print_inspect/concern.rb +46 -0
  71. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_amazing_print_inspect.rb +3 -0
  72. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_amazing_print_inspect/concern.rb +46 -0
  73. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_amazing_print_inspect.rb +3 -0
  74. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_amazing_print_inspect/concern.rb +46 -0
  75. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_amazing_print_inspect.rb +3 -0
  76. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_amazing_print_inspect/concern.rb +46 -0
  77. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_amazing_print_inspect.rb +3 -0
  78. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/concern/instance_methods.rb +161 -0
  79. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/concern.rb +27 -0
  80. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/exceptions.rb +34 -0
  81. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects.rb +4 -0
  82. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins.rb +2 -0
  83. data/lib/convenient_service/service/plugins/has_mermaid_flowchart/concern.rb +6 -1
  84. data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +1 -0
  85. data/lib/convenient_service/service/plugins.rb +3 -1
  86. data/lib/convenient_service/support/counter.rb +2 -0
  87. data/lib/convenient_service/support/middleware/stack_builder.rb +37 -0
  88. data/lib/convenient_service/support/thread_safe_counter.rb +1 -0
  89. data/lib/convenient_service/support.rb +0 -3
  90. data/lib/convenient_service/utils/object/get_own_method.rb +54 -0
  91. data/lib/convenient_service/utils/object/safe_send.rb +84 -0
  92. data/lib/convenient_service/utils/object.rb +24 -0
  93. data/lib/convenient_service/utils/string/enclose.rb +52 -0
  94. data/lib/convenient_service/utils/string.rb +5 -0
  95. data/lib/convenient_service/version.rb +1 -1
  96. data/lib/convenient_service.rb +62 -0
  97. metadata +149 -16
  98. data/lib/convenient_service/common/plugins/normalizes_env/middleware.rb +0 -31
  99. data/lib/convenient_service/common/plugins/normalizes_env.rb +0 -3
  100. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/result.rb +0 -3
  101. data/lib/convenient_service/services.rb +0 -4
  102. data/lib/convenient_service/support/gems/active_model.rb +0 -36
  103. data/lib/convenient_service/support/gems/logger.rb +0 -37
  104. data/lib/convenient_service/support/gems/paint.rb +0 -37
  105. data/lib/convenient_service/support/gems/rspec.rb +0 -58
  106. data/lib/convenient_service/support/ruby.rb +0 -53
  107. data/lib/convenient_service/support/version/null_version.rb +0 -85
  108. data/lib/convenient_service/support/version.rb +0 -75
  109. /data/lib/convenient_service/{support → dependencies/queries}/gems.rb +0 -0
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "dependencies/built_in"
4
4
  require_relative "dependencies/extractions"
5
+ require_relative "dependencies/queries"
5
6
 
6
7
  ##
7
8
  # `ConvenientService::Dependencies` can dynamically require plugins/extensions that have external dependencies.
@@ -11,443 +12,6 @@ require_relative "dependencies/extractions"
11
12
  #
12
13
  module ConvenientService
13
14
  module Dependencies
14
- class << self
15
- ##
16
- # @api private
17
- #
18
- # @return [Boolean]
19
- # @see ConvenientService.Dependencies.require_has_j_send_result_params_validations_using_active_model_validations
20
- #
21
- def support_has_j_send_result_params_validations_using_active_model_validations?
22
- return false unless active_model.loaded?
23
- return false if ruby.version >= 3.0 && active_model.version < 6.0
24
-
25
- true
26
- end
27
-
28
- ##
29
- # @api private
30
- #
31
- # @return [Boolean]
32
- #
33
- # @see https://github.com/ruby/logger/commit/74690b87b15244e19dd91cd06ae295251e1e5781
34
- #
35
- def support_logger_non_integer_levels?
36
- logger.version >= "1.3.0"
37
- end
38
-
39
- ##
40
- # @api public
41
- #
42
- # @return [Boolean]
43
- # @note Expected to be called from app entry points like `initializers` in Rails.
44
- #
45
- def require_alias
46
- require_relative "alias"
47
- end
48
-
49
- ##
50
- # @api public
51
- #
52
- # @return [Boolean]
53
- # @note Expected to be called from app entry points like `initializers` in Rails.
54
- #
55
- def require_assigns_attributes_in_constructor_using_active_model_attribute_assignment
56
- ##
57
- # - https://edgeguides.rubyonrails.org/active_model_basics.html
58
- # - https://api.rubyonrails.org/classes/ActiveModel.html
59
- # - https://github.com/rails/rails/tree/main/activemodel
60
- #
61
- require "active_model"
62
-
63
- require_relative "common/plugins/assigns_attributes_in_constructor/using_active_model_attribute_assignment"
64
- end
65
-
66
- ##
67
- # @api public
68
- #
69
- # @return [Boolean]
70
- # @note Expected to be called from app entry points like `initializers` in Rails.
71
- #
72
- def require_assigns_attributes_in_constructor_using_dry_initializer
73
- ##
74
- # - https://dry-rb.org/gems/dry-initializer/main
75
- # - https://github.com/dry-rb/dry-initializer
76
- #
77
- require "dry-initializer"
78
-
79
- require_relative "common/plugins/assigns_attributes_in_constructor/using_dry_initializer"
80
- end
81
-
82
- ##
83
- # @api public
84
- #
85
- # @return [Boolean]
86
- # @note Expected to be called from app entry points like `initializers` in Rails.
87
- #
88
- def require_can_utilize_finite_loop
89
- require_relative "common/plugins/can_utilize_finite_loop"
90
- end
91
-
92
- ##
93
- # @api public
94
- #
95
- # @return [Boolean]
96
- # @note Expected to be called from app entry points like `initializers` in Rails.
97
- #
98
- def require_has_attributes_using_active_model_attributes
99
- ##
100
- # - https://edgeguides.rubyonrails.org/active_model_basics.html
101
- # - https://api.rubyonrails.org/classes/ActiveModel.html
102
- # - https://github.com/rails/rails/tree/main/activemodel
103
- #
104
- require "active_model"
105
-
106
- require_relative "common/plugins/has_attributes/using_active_model_attributes"
107
- end
108
-
109
- ##
110
- # @api public
111
- #
112
- # @return [Boolean]
113
- # @note Expected to be called from app entry points like `initializers` in Rails.
114
- #
115
- def require_awesome_print_inspect
116
- ##
117
- # - https://github.com/awesome-print/awesome_print
118
- #
119
- require "awesome_print"
120
-
121
- require_relative "service/plugins/has_awesome_print_inspect"
122
- require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect"
123
- require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_awesome_print_inspect"
124
- require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_awesome_print_inspect"
125
- require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_awesome_print_inspect"
126
- require_relative "service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_awesome_print_inspect"
127
- require_relative "service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect"
128
- require_relative "service/configs/awesome_print_inspect"
129
- require_relative "service/configs/awesome_print_inspect/aliases"
130
- end
131
-
132
- ##
133
- # @api public
134
- #
135
- # @return [Boolean]
136
- # @note Expected to be called from app entry points like `initializers` in Rails.
137
- #
138
- # @see https://userdocs.convenientservice.org/troubleshooting/i18n_translate_wrong_number_of_arguments
139
- #
140
- def require_has_j_send_result_params_validations_using_active_model_validations
141
- ##
142
- # - https://edgeguides.rubyonrails.org/active_model_basics.html
143
- # - https://api.rubyonrails.org/classes/ActiveModel.html
144
- # - https://github.com/rails/rails/tree/main/activemodel
145
- #
146
- require "active_model"
147
-
148
- require_relative "service/plugins/has_j_send_result_params_validations/using_active_model_validations"
149
- end
150
-
151
- ##
152
- # @api public
153
- #
154
- # @return [Boolean]
155
- # @note Expected to be called from app entry points like `initializers` in Rails.
156
- #
157
- def require_has_j_send_result_params_validations_using_dry_validation
158
- ##
159
- # - https://dry-rb.org/gems/dry-validation/main/
160
- # - https://github.com/dry-rb/dry-validation
161
- #
162
- require "dry-validation"
163
-
164
- require_relative "service/plugins/has_j_send_result_params_validations/using_dry_validation"
165
- end
166
-
167
- ##
168
- # @api public
169
- #
170
- # @return [Boolean]
171
- # @note Expected to be called from app entry points like `initializers` in Rails.
172
- #
173
- def require_rescues_result_unhandled_exceptions
174
- require_relative "service/plugins/rescues_result_unhandled_exceptions"
175
- end
176
-
177
- ##
178
- # @api private
179
- #
180
- # @return [Boolean]
181
- # @note Expected to be called from app entry points like `initializers` in Rails.
182
- #
183
- def require_wraps_result_in_db_transaction
184
- ##
185
- # - https://edgeguides.rubyonrails.org/active_record_basics.html
186
- # - https://api.rubyonrails.org/classes/ActiveRecord.html
187
- # - https://github.com/rails/rails/tree/main/activerecord
188
- #
189
- require "active_record"
190
-
191
- require_relative "service/plugins/wraps_result_in_db_transaction"
192
- end
193
-
194
- ##
195
- # @api private
196
- #
197
- # @return [Boolean]
198
- # @note Expected to be called from `irb`, `pry`, `spec_helper.rb`, etc.
199
- #
200
- # @internal
201
- # NOTE: `byebug` has C extensions, that is why it is NOT supported in JRuby.
202
- # - https://github.com/deivid-rodriguez/byebug/tree/master/ext/byebug
203
- # - https://github.com/deivid-rodriguez/byebug/issues/179#issuecomment-152727003
204
- #
205
- def require_development_tools
206
- ##
207
- # - https://github.com/awesome-print/awesome_print
208
- #
209
- require "awesome_print"
210
-
211
- ##
212
- # - https://github.com/gsamokovarov/break
213
- #
214
- require "break"
215
-
216
- ##
217
- # - https://github.com/deivid-rodriguez/byebug
218
- #
219
- require "byebug" unless ruby.jruby?
220
-
221
- ##
222
- # - https://github.com/ruby/debug
223
- #
224
- require "debug" unless ruby.jruby?
225
-
226
- ##
227
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/ostruct/rdoc/OpenStruct.html
228
- # - https://github.com/ruby/ostruct
229
- #
230
- require "ostruct"
231
-
232
- ##
233
- # - https://github.com/janlelis/paint
234
- #
235
- require "paint"
236
-
237
- ##
238
- # - https://github.com/rouge-ruby/rouge
239
- #
240
- require "rouge"
241
-
242
- ##
243
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/tempfile/rdoc/Tempfile.html
244
- # - https://github.com/ruby/tempfile
245
- #
246
- require "tempfile"
247
-
248
- ##
249
- # - https://gist.github.com/marian13/5dade20a431d7254db30e543167058ce
250
- #
251
- require_relative "dependencies/extractions/byebug_syntax_highlighting" unless ruby.jruby?
252
-
253
- require_relative "dependencies/extractions/b" unless ruby.jruby?
254
-
255
- ##
256
- #
257
- #
258
- require_relative "dependencies/extractions/ce"
259
- end
260
-
261
- ##
262
- # @api private
263
- #
264
- # @return [Boolean]
265
- # @note Expected to be called from `spec_helper.rb`.
266
- #
267
- def require_test_tools
268
- ##
269
- # - https://github.com/faker-ruby/faker
270
- #
271
- require "faker"
272
-
273
- ##
274
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/ostruct/rdoc/OpenStruct.html
275
- # - https://github.com/ruby/ostruct
276
- #
277
- require "ostruct"
278
-
279
- ##
280
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/tempfile/rdoc/Tempfile.html
281
- # - https://github.com/ruby/tempfile
282
- #
283
- require "tempfile"
284
- end
285
-
286
- ##
287
- # @api public
288
- #
289
- # Loads RSpec extensions like `be_success` matcher, `stub_service` helper, etc.
290
- #
291
- # @return [Boolean]
292
- # @note Expected to be called from `spec_helper.rb`.
293
- #
294
- def require_rspec_extentions
295
- require "rspec/expectations"
296
- require "rspec/matchers"
297
- require "rspec/mocks"
298
-
299
- require_relative "rspec"
300
- end
301
-
302
- ##
303
- # @api private
304
- #
305
- # Loads standard config examples.
306
- #
307
- # @param version [String]
308
- # @return [Boolean]
309
- #
310
- def require_standard_examples(version: "")
311
- ##
312
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/date/rdoc/Date.html
313
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/date/rdoc/DateTime.html
314
- # - https://github.com/ruby/date
315
- #
316
- require "date"
317
-
318
- ##
319
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html
320
- # - https://github.com/flori/json
321
- #
322
- require "json"
323
-
324
- ##
325
- # - https://github.com/jfelchner/ruby-progressbar
326
- #
327
- require "progressbar"
328
-
329
- ##
330
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/webrick/rdoc/WEBrick.html
331
- # - https://github.com/ruby/webrick
332
- #
333
- require "webrick"
334
-
335
- ##
336
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/uri/rdoc/URI.html
337
- # - https://github.com/ruby/uri
338
- #
339
- require "uri"
340
-
341
- require_relative ::File.join("examples", "standard", version, "cowsay")
342
- require_relative ::File.join("examples", "standard", version, "date_time")
343
- require_relative ::File.join("examples", "standard", version, "factorial")
344
- require_relative ::File.join("examples", "standard", version, "gemfile")
345
- require_relative ::File.join("examples", "standard", version, "request_params")
346
- require_relative ::File.join("examples", "standard", version, "comprehensive_suite") if version.empty?
347
- end
348
-
349
- ##
350
- # @api private
351
- #
352
- # Loads rails config examples.
353
- #
354
- # @param version [String]
355
- # @return [Boolean]
356
- #
357
- def require_rails_examples(version: "")
358
- ##
359
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html
360
- # - https://github.com/flori/json
361
- #
362
- require "json"
363
-
364
- ##
365
- # - https://github.com/jfelchner/ruby-progressbar
366
- #
367
- require "progressbar"
368
-
369
- ##
370
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/webrick/rdoc/WEBrick.html
371
- # - https://github.com/ruby/webrick
372
- #
373
- require "webrick"
374
-
375
- require_relative ::File.join("examples", "rails", version, "gemfile")
376
- end
377
-
378
- ##
379
- # @api private
380
- #
381
- # Loads dry config examples.
382
- #
383
- # @param version [String]
384
- # @return [Boolean]
385
- #
386
- def require_dry_examples(version: "")
387
- ##
388
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html
389
- # - https://github.com/flori/json
390
- #
391
- require "json"
392
-
393
- ##
394
- # - https://github.com/jfelchner/ruby-progressbar
395
- #
396
- require "progressbar"
397
-
398
- ##
399
- # - https://ruby-doc.org/stdlib-2.7.0/libdoc/webrick/rdoc/WEBrick.html
400
- # - https://github.com/ruby/webrick
401
- #
402
- require "webrick"
403
-
404
- require_relative ::File.join("examples", "dry", version, "gemfile")
405
- end
406
-
407
- ##
408
- # @api private
409
- #
410
- # @return [ConvenientService::Support::Ruby]
411
- #
412
- def ruby
413
- Support::Ruby
414
- end
415
-
416
- ##
417
- # @api private
418
- #
419
- # @return [ConvenientService::Support::RSpec]
420
- #
421
- def rspec
422
- Support::Gems::RSpec
423
- end
424
-
425
- ##
426
- # @api private
427
- #
428
- # @return [ConvenientService::Support::Gems::ActiveModel]
429
- #
430
- def active_model
431
- Support::Gems::ActiveModel
432
- end
433
-
434
- ##
435
- # @api private
436
- #
437
- # @return [ConvenientService::Support::Gems::Logger]
438
- #
439
- def logger
440
- Support::Gems::Logger
441
- end
442
-
443
- ##
444
- # @api private
445
- #
446
- # @return [ConvenientService::Support::Gems::Paint]
447
- #
448
- def paint
449
- Support::Gems::Paint
450
- end
451
- end
15
+ extend Queries
452
16
  end
453
17
  end
@@ -19,8 +19,6 @@ module ConvenientService
19
19
  end
20
20
 
21
21
  middlewares :new, scope: :class do
22
- use ConvenientService::Plugins::Common::NormalizesEnv::Middleware
23
-
24
22
  use ConvenientService::Plugins::Common::HasInstanceProxy::Middleware
25
23
  end
26
24
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module AmazingPrintInspect
5
+ Config = ::ConvenientService::Service::Configs::AmazingPrintInspect
6
+ end
7
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Service
5
+ module Configs
6
+ module AmazingPrintInspect
7
+ include Support::Concern
8
+
9
+ # rubocop:disable Lint/ConstantDefinitionInBlock
10
+ included do
11
+ include Configs::Essential
12
+
13
+ ##
14
+ # @internal
15
+ # TODO: Plugin groups for autoreplacement of plugins with same purpose.
16
+ #
17
+ concerns do
18
+ use ConvenientService::Plugins::Service::HasAmazingPrintInspect::Concern
19
+ end
20
+
21
+ class self::Result
22
+ concerns do
23
+ use ConvenientService::Plugins::Result::HasAmazingPrintInspect::Concern
24
+ end
25
+
26
+ class self::Data
27
+ concerns do
28
+ use ConvenientService::Plugins::Data::HasAmazingPrintInspect::Concern
29
+ end
30
+ end
31
+
32
+ class self::Message
33
+ concerns do
34
+ use ConvenientService::Plugins::Message::HasAmazingPrintInspect::Concern
35
+ end
36
+ end
37
+
38
+ class self::Code
39
+ concerns do
40
+ use ConvenientService::Plugins::Code::HasAmazingPrintInspect::Concern
41
+ end
42
+ end
43
+
44
+ class self::Status
45
+ concerns do
46
+ use ConvenientService::Plugins::Status::HasAmazingPrintInspect::Concern
47
+ end
48
+ end
49
+ end
50
+
51
+ class self::Step
52
+ concerns do
53
+ use ConvenientService::Plugins::Step::HasAmazingPrintInspect::Concern
54
+ end
55
+ end
56
+ end
57
+ # rubocop:enable Lint/ConstantDefinitionInBlock
58
+ end
59
+ end
60
+ end
61
+ end
@@ -8,7 +8,7 @@ module ConvenientService
8
8
 
9
9
  # rubocop:disable Lint/ConstantDefinitionInBlock
10
10
  included do
11
- include Configs::Minimal
11
+ include Configs::Essential
12
12
 
13
13
  ##
14
14
  # @internal