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
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convenient_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marian Kostyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-11 00:00:00.000000000 Z
11
+ date: 2024-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: amazing_print
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.5.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.5.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: appraisal
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -26,6 +40,20 @@ dependencies:
26
40
  version: 2.5.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: awesome_print
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.9.2
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.9.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: base64
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - ">="
@@ -52,6 +80,20 @@ dependencies:
52
80
  - - "~>"
53
81
  - !ruby/object:Gem::Version
54
82
  version: 2.12.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: benchmark-memory
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.2.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.2.0
55
97
  - !ruby/object:Gem::Dependency
56
98
  name: break
57
99
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +150,20 @@ dependencies:
108
150
  - - ">="
109
151
  - !ruby/object:Gem::Version
110
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: diffy
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 3.4.0
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 3.4.0
111
167
  - !ruby/object:Gem::Dependency
112
168
  name: faker
113
169
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +178,20 @@ dependencies:
122
178
  - - ">="
123
179
  - !ruby/object:Gem::Version
124
180
  version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: ffi
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 1.16.0
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 1.16.0
125
195
  - !ruby/object:Gem::Dependency
126
196
  name: gem-release
127
197
  requirement: !ruby/object:Gem::Requirement
@@ -192,6 +262,20 @@ dependencies:
192
262
  - - "~>"
193
263
  - !ruby/object:Gem::Version
194
264
  version: 5.18.0
265
+ - !ruby/object:Gem::Dependency
266
+ name: mutex_m
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - ">="
270
+ - !ruby/object:Gem::Version
271
+ version: '0'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
195
279
  - !ruby/object:Gem::Dependency
196
280
  name: paint
197
281
  requirement: !ruby/object:Gem::Requirement
@@ -444,6 +528,20 @@ dependencies:
444
528
  - - "~>"
445
529
  - !ruby/object:Gem::Version
446
530
  version: 0.2.25
531
+ - !ruby/object:Gem::Dependency
532
+ name: uri
533
+ requirement: !ruby/object:Gem::Requirement
534
+ requirements:
535
+ - - "~>"
536
+ - !ruby/object:Gem::Version
537
+ version: 0.13.0
538
+ type: :development
539
+ prerelease: false
540
+ version_requirements: !ruby/object:Gem::Requirement
541
+ requirements:
542
+ - - "~>"
543
+ - !ruby/object:Gem::Version
544
+ version: 0.13.0
447
545
  - !ruby/object:Gem::Dependency
448
546
  name: webrick
449
547
  requirement: !ruby/object:Gem::Requirement
@@ -587,6 +685,9 @@ files:
587
685
  - lib/convenient_service.rb
588
686
  - lib/convenient_service/alias.rb
589
687
  - lib/convenient_service/aliases.rb
688
+ - lib/convenient_service/commands.rb
689
+ - lib/convenient_service/commands/is_service.rb
690
+ - lib/convenient_service/commands/is_service_class.rb
590
691
  - lib/convenient_service/common.rb
591
692
  - lib/convenient_service/common/plugins.rb
592
693
  - lib/convenient_service/common/plugins/aliases.rb
@@ -653,8 +754,6 @@ files:
653
754
  - lib/convenient_service/common/plugins/has_internals/entities/internals/plugins/has_cache/concern.rb
654
755
  - lib/convenient_service/common/plugins/has_j_send_result_duck_short_syntax.rb
655
756
  - lib/convenient_service/common/plugins/has_j_send_result_duck_short_syntax/concern.rb
656
- - lib/convenient_service/common/plugins/normalizes_env.rb
657
- - lib/convenient_service/common/plugins/normalizes_env/middleware.rb
658
757
  - lib/convenient_service/core.rb
659
758
  - lib/convenient_service/core/aliases.rb
660
759
  - lib/convenient_service/core/concern.rb
@@ -711,6 +810,7 @@ files:
711
810
  - lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain.rb
712
811
  - lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands.rb
713
812
  - lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands/create_observable_middleware.rb
813
+ - lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands/normalize_env.rb
714
814
  - lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern.rb
715
815
  - lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/class_methods.rb
716
816
  - lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/instance_methods.rb
@@ -729,11 +829,22 @@ files:
729
829
  - lib/convenient_service/dependencies/extractions/b.rb
730
830
  - lib/convenient_service/dependencies/extractions/byebug_syntax_highlighting.rb
731
831
  - lib/convenient_service/dependencies/extractions/ce.rb
832
+ - lib/convenient_service/dependencies/extractions/ds.rb
732
833
  - lib/convenient_service/dependencies/extractions/ruby_middleware.rb
733
834
  - lib/convenient_service/dependencies/extractions/ruby_middleware/middleware.rb
734
835
  - lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/builder.rb
735
836
  - lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/logger.rb
736
837
  - lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/runner.rb
838
+ - lib/convenient_service/dependencies/only_queries.rb
839
+ - lib/convenient_service/dependencies/queries.rb
840
+ - lib/convenient_service/dependencies/queries/gems.rb
841
+ - lib/convenient_service/dependencies/queries/gems/active_model.rb
842
+ - lib/convenient_service/dependencies/queries/gems/logger.rb
843
+ - lib/convenient_service/dependencies/queries/gems/paint.rb
844
+ - lib/convenient_service/dependencies/queries/gems/rspec.rb
845
+ - lib/convenient_service/dependencies/queries/ruby.rb
846
+ - lib/convenient_service/dependencies/queries/version.rb
847
+ - lib/convenient_service/dependencies/queries/version/null_version.rb
737
848
  - lib/convenient_service/exception.rb
738
849
  - lib/convenient_service/feature.rb
739
850
  - lib/convenient_service/feature/configs.rb
@@ -881,9 +992,11 @@ files:
881
992
  - lib/convenient_service/service.rb
882
993
  - lib/convenient_service/service/configs.rb
883
994
  - lib/convenient_service/service/configs/aliases.rb
995
+ - lib/convenient_service/service/configs/amazing_print_inspect.rb
996
+ - lib/convenient_service/service/configs/amazing_print_inspect/aliases.rb
884
997
  - lib/convenient_service/service/configs/awesome_print_inspect.rb
885
998
  - lib/convenient_service/service/configs/awesome_print_inspect/aliases.rb
886
- - lib/convenient_service/service/configs/minimal.rb
999
+ - lib/convenient_service/service/configs/essential.rb
887
1000
  - lib/convenient_service/service/configs/standard.rb
888
1001
  - lib/convenient_service/service/configs/standard/aliases.rb
889
1002
  - lib/convenient_service/service/configs/standard/v1.rb
@@ -909,6 +1022,8 @@ files:
909
1022
  - lib/convenient_service/service/plugins/can_have_fallbacks/middleware.rb
910
1023
  - lib/convenient_service/service/plugins/can_have_method_steps.rb
911
1024
  - lib/convenient_service/service/plugins/can_have_method_steps/middleware.rb
1025
+ - lib/convenient_service/service/plugins/can_have_rollbacks.rb
1026
+ - lib/convenient_service/service/plugins/can_have_rollbacks/middleware.rb
912
1027
  - lib/convenient_service/service/plugins/can_have_sequential_steps.rb
913
1028
  - lib/convenient_service/service/plugins/can_have_sequential_steps/concern.rb
914
1029
  - lib/convenient_service/service/plugins/can_have_sequential_steps/entities.rb
@@ -917,6 +1032,7 @@ files:
917
1032
  - lib/convenient_service/service/plugins/can_have_steps.rb
918
1033
  - lib/convenient_service/service/plugins/can_have_steps/commands.rb
919
1034
  - lib/convenient_service/service/plugins/can_have_steps/commands/create_step_class.rb
1035
+ - lib/convenient_service/service/plugins/can_have_steps/commands/is_step.rb
920
1036
  - lib/convenient_service/service/plugins/can_have_steps/concern.rb
921
1037
  - lib/convenient_service/service/plugins/can_have_steps/entities.rb
922
1038
  - lib/convenient_service/service/plugins/can_have_steps/entities/method.rb
@@ -983,10 +1099,12 @@ files:
983
1099
  - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_alternative_steps.rb
984
1100
  - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks.rb
985
1101
  - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/concern.rb
1102
+ - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/exceptions.rb
986
1103
  - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/middleware.rb
987
- - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/result.rb
988
1104
  - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_parent_result.rb
989
1105
  - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_parent_result/middleware.rb
1106
+ - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_amazing_print_inspect.rb
1107
+ - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_amazing_print_inspect/concern.rb
990
1108
  - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect.rb
991
1109
  - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect/concern.rb
992
1110
  - lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_inspect.rb
@@ -1017,6 +1135,11 @@ files:
1017
1135
  - lib/convenient_service/service/plugins/collects_services_in_exception/middleware.rb
1018
1136
  - lib/convenient_service/service/plugins/counts_stubbed_results_invocations.rb
1019
1137
  - lib/convenient_service/service/plugins/counts_stubbed_results_invocations/middleware.rb
1138
+ - lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments.rb
1139
+ - lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/exceptions.rb
1140
+ - lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/middleware.rb
1141
+ - lib/convenient_service/service/plugins/has_amazing_print_inspect.rb
1142
+ - lib/convenient_service/service/plugins/has_amazing_print_inspect/concern.rb
1020
1143
  - lib/convenient_service/service/plugins/has_awesome_print_inspect.rb
1021
1144
  - lib/convenient_service/service/plugins/has_awesome_print_inspect/concern.rb
1022
1145
  - lib/convenient_service/service/plugins/has_inspect.rb
@@ -1035,6 +1158,8 @@ files:
1035
1158
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/concern.rb
1036
1159
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins.rb
1037
1160
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/aliases.rb
1161
+ - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_from_exception.rb
1162
+ - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_from_exception/concern.rb
1038
1163
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_own_result.rb
1039
1164
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_own_result/concern.rb
1040
1165
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_stubbed_result.rb
@@ -1050,6 +1175,8 @@ files:
1050
1175
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step/concern.rb
1051
1176
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_recalculate_result.rb
1052
1177
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_recalculate_result/concern.rb
1178
+ - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect.rb
1179
+ - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect/concern.rb
1053
1180
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect.rb
1054
1181
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect/concern.rb
1055
1182
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_inspect.rb
@@ -1073,6 +1200,8 @@ files:
1073
1200
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb
1074
1201
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins.rb
1075
1202
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/aliases.rb
1203
+ - 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
1204
+ - 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
1076
1205
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_awesome_print_inspect.rb
1077
1206
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_awesome_print_inspect/concern.rb
1078
1207
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_inspect.rb
@@ -1085,6 +1214,8 @@ files:
1085
1214
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/instance_methods.rb
1086
1215
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins.rb
1087
1216
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/aliases.rb
1217
+ - 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
1218
+ - 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
1088
1219
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_awesome_print_inspect.rb
1089
1220
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_awesome_print_inspect/concern.rb
1090
1221
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_inspect.rb
@@ -1099,6 +1230,8 @@ files:
1099
1230
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/concern/instance_methods.rb
1100
1231
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins.rb
1101
1232
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/aliases.rb
1233
+ - 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
1234
+ - 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
1102
1235
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_awesome_print_inspect.rb
1103
1236
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_awesome_print_inspect/concern.rb
1104
1237
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_inspect.rb
@@ -1114,6 +1247,8 @@ files:
1114
1247
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/can_be_checked.rb
1115
1248
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/can_be_checked/concern.rb
1116
1249
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/can_be_checked/middleware.rb
1250
+ - 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
1251
+ - 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
1117
1252
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_awesome_print_inspect.rb
1118
1253
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_awesome_print_inspect/concern.rb
1119
1254
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_inspect.rb
@@ -1127,6 +1262,10 @@ files:
1127
1262
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter.rb
1128
1263
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter/concern.rb
1129
1264
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_stubbed_result_invocations_counter/middleware.rb
1265
+ - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects.rb
1266
+ - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/concern.rb
1267
+ - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/concern/instance_methods.rb
1268
+ - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/exceptions.rb
1130
1269
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status.rb
1131
1270
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/exceptions.rb
1132
1271
  - lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb
@@ -1194,7 +1333,6 @@ files:
1194
1333
  - lib/convenient_service/service/plugins/sets_parent_to_foreign_result/middleware.rb
1195
1334
  - lib/convenient_service/service/plugins/wraps_result_in_d_b_transaction/middleware.rb
1196
1335
  - lib/convenient_service/service/plugins/wraps_result_in_db_transaction.rb
1197
- - lib/convenient_service/services.rb
1198
1336
  - lib/convenient_service/specification.rb
1199
1337
  - lib/convenient_service/support.rb
1200
1338
  - lib/convenient_service/support/abstract_method.rb
@@ -1239,25 +1377,17 @@ files:
1239
1377
  - lib/convenient_service/support/dependency_container/export.rb
1240
1378
  - lib/convenient_service/support/dependency_container/import.rb
1241
1379
  - lib/convenient_service/support/finite_loop.rb
1242
- - lib/convenient_service/support/gems.rb
1243
- - lib/convenient_service/support/gems/active_model.rb
1244
- - lib/convenient_service/support/gems/logger.rb
1245
- - lib/convenient_service/support/gems/paint.rb
1246
- - lib/convenient_service/support/gems/rspec.rb
1247
1380
  - lib/convenient_service/support/method_parameters.rb
1248
1381
  - lib/convenient_service/support/middleware.rb
1249
1382
  - lib/convenient_service/support/middleware/stack_builder.rb
1250
1383
  - lib/convenient_service/support/never_reach_here.rb
1251
1384
  - lib/convenient_service/support/not_passed.rb
1252
1385
  - lib/convenient_service/support/raw_value.rb
1253
- - lib/convenient_service/support/ruby.rb
1254
1386
  - lib/convenient_service/support/safe_method.rb
1255
1387
  - lib/convenient_service/support/thread_safe_counter.rb
1256
1388
  - lib/convenient_service/support/undefined.rb
1257
1389
  - lib/convenient_service/support/unique_value.rb
1258
1390
  - lib/convenient_service/support/value.rb
1259
- - lib/convenient_service/support/version.rb
1260
- - lib/convenient_service/support/version/null_version.rb
1261
1391
  - lib/convenient_service/utils.rb
1262
1392
  - lib/convenient_service/utils/array.rb
1263
1393
  - lib/convenient_service/utils/array/contain_exactly.rb
@@ -1291,10 +1421,12 @@ files:
1291
1421
  - lib/convenient_service/utils/object.rb
1292
1422
  - lib/convenient_service/utils/object/clamp_class.rb
1293
1423
  - lib/convenient_service/utils/object/duck_class.rb
1424
+ - lib/convenient_service/utils/object/get_own_method.rb
1294
1425
  - lib/convenient_service/utils/object/instance_variable_delete.rb
1295
1426
  - lib/convenient_service/utils/object/instance_variable_fetch.rb
1296
1427
  - lib/convenient_service/utils/object/memoize_including_falsy_values.rb
1297
1428
  - lib/convenient_service/utils/object/resolve_type.rb
1429
+ - lib/convenient_service/utils/object/safe_send.rb
1298
1430
  - lib/convenient_service/utils/proc.rb
1299
1431
  - lib/convenient_service/utils/proc/conjunct.rb
1300
1432
  - lib/convenient_service/utils/proc/display.rb
@@ -1302,6 +1434,7 @@ files:
1302
1434
  - lib/convenient_service/utils/string.rb
1303
1435
  - lib/convenient_service/utils/string/camelize.rb
1304
1436
  - lib/convenient_service/utils/string/demodulize.rb
1437
+ - lib/convenient_service/utils/string/enclose.rb
1305
1438
  - lib/convenient_service/utils/string/split.rb
1306
1439
  - lib/convenient_service/utils/string/truncate.rb
1307
1440
  - lib/convenient_service/version.rb
@@ -1327,7 +1460,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1327
1460
  - !ruby/object:Gem::Version
1328
1461
  version: '0'
1329
1462
  requirements: []
1330
- rubygems_version: 3.4.1
1463
+ rubygems_version: 3.5.3
1331
1464
  signing_key:
1332
1465
  specification_version: 4
1333
1466
  summary: Service object pattern implementation in Ruby.
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ConvenientService
4
- module Common
5
- module Plugins
6
- module NormalizesEnv
7
- ##
8
- # - Single splat `*` converts `nil` to empty array.
9
- # - Double splat `**` raises on `nil`.
10
- # - Umpersand `&` converts `nil` to `nil`.
11
- #
12
- # The following middleware converts `env[:kwargs]` to a hash.
13
- # This way `stack.call(*env[:args], **env[:kwargs], &env[:block])` won't fail even if a user passes `nil` as `kwargs`.
14
- #
15
- # Check the following link for more details:
16
- # - https://bugs.ruby-lang.org/issues/8507
17
- #
18
- class Middleware < MethodClassicMiddleware
19
- intended_for any_method, scope: any_scope, entity: any_entity
20
-
21
- def call(env = nil)
22
- env = env.to_h
23
- env = env.merge(args: env[:args].to_a, kwargs: env[:kwargs].to_h, block: env[:block])
24
-
25
- stack.call(env)
26
- end
27
- end
28
- end
29
- end
30
- end
31
- end
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "normalizes_env/middleware"
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "result/middleware"
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "services/run_own_method_in_organizer"
4
- require_relative "services/run_method_in_organizer"
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ConvenientService
4
- module Support
5
- module Gems
6
- ##
7
- # @api private
8
- #
9
- class ActiveModel
10
- class << self
11
- ##
12
- # @return [Boolean]
13
- #
14
- # @internal
15
- # `Style/TernaryParentheses` is disabled since `defined?` has too low priority without parentheses.
16
- #
17
- # rubocop:disable Style/TernaryParentheses
18
- def loaded?
19
- (defined? ::ActiveModel) ? true : false
20
- end
21
- # rubocop:enable Style/TernaryParentheses
22
-
23
- ##
24
- # @return [ConvenientService::Support::Version]
25
- #
26
- # @internal
27
- # https://github.com/rails/rails/blob/main/activemodel/lib/active_model/version.rb
28
- #
29
- def version
30
- loaded? ? Support::Version.new(::ActiveModel.version) : Support::Version.null_version
31
- end
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ConvenientService
4
- module Support
5
- module Gems
6
- class Logger
7
- class << self
8
- ##
9
- # @api private
10
- #
11
- # @return [Boolean]
12
- #
13
- # @internal
14
- # `Style/TernaryParentheses` is disabled since `defined?` has too low priority without parentheses.
15
- #
16
- # rubocop:disable Style/TernaryParentheses
17
- def loaded?
18
- (defined? ::Logger) ? true : false
19
- end
20
- # rubocop:enable Style/TernaryParentheses
21
-
22
- ##
23
- # @api private
24
- #
25
- # @return [ConvenientService::Support::Version]
26
- #
27
- # @internal
28
- # - https://github.com/ruby/logger/blob/v1.5.3/lib/logger/version.rb
29
- #
30
- def version
31
- loaded? ? Support::Version.new(::Logger::VERSION) : Support::Version.null_version
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ConvenientService
4
- module Support
5
- module Gems
6
- class Paint
7
- class << self
8
- ##
9
- # @api private
10
- #
11
- # @return [Boolean]
12
- #
13
- # @internal
14
- # `Style/TernaryParentheses` is disabled since `defined?` has too low priority without parentheses.
15
- #
16
- # rubocop:disable Style/TernaryParentheses
17
- def loaded?
18
- (defined? ::Paint) ? true : false
19
- end
20
- # rubocop:enable Style/TernaryParentheses
21
-
22
- ##
23
- # @api private
24
- #
25
- # @return [ConvenientService::Support::Version]
26
- #
27
- # @internal
28
- # - https://github.com/janlelis/paint/blob/v2.2.1/lib/paint/version.rb
29
- #
30
- def version
31
- loaded? ? Support::Version.new(::Paint::VERSION) : Support::Version.null_version
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,58 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ConvenientService
4
- module Support
5
- module Gems
6
- ##
7
- # @api private
8
- #
9
- class RSpec
10
- class << self
11
- ##
12
- # @return [Boolean]
13
- #
14
- # @internal
15
- # `Style/TernaryParentheses` is disabled since `defined?` has too low priority without parentheses.
16
- #
17
- # rubocop:disable Style/TernaryParentheses
18
- def loaded?
19
- (defined? ::RSpec) ? true : false
20
- end
21
- # rubocop:enable Style/TernaryParentheses
22
-
23
- ##
24
- # @return [ConvenientService::Support::Version]
25
- #
26
- # @internal
27
- # https://github.com/rspec/rspec-core/blob/main/lib/rspec/core/version.rb
28
- #
29
- def version
30
- loaded? ? Support::Version.new(::RSpec::Core::Version::STRING) : Support::Version.null_version
31
- end
32
-
33
- ##
34
- # @return [RSpec::Core::Example, nil]
35
- #
36
- # @internal
37
- # NOTE: Returns `nil` in environments where RSpec is NOT fully loaded, e.g: irb, rails console, etc.
38
- #
39
- # `::RSpec.current_example` docs:
40
- # - https://www.rubydoc.info/github/rspec/rspec-core/RSpec.current_example
41
- # - https://github.com/rspec/rspec-core/blob/v3.12.0/lib/rspec/core.rb#L122
42
- # - https://relishapp.com/rspec/rspec-core/docs/metadata/current-example
43
- #
44
- def current_example
45
- return unless loaded?
46
-
47
- ##
48
- # NOTE: This happens in Ruby-only projects where RSpec is loaded by `Bundler.require`, not by `bundle exec rspec`.
49
- #
50
- return unless ::RSpec.respond_to?(:current_example)
51
-
52
- ::RSpec.current_example
53
- end
54
- end
55
- end
56
- end
57
- end
58
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ConvenientService
4
- module Support
5
- ##
6
- # @api private
7
- #
8
- class Ruby
9
- class << self
10
- ##
11
- # @return [ConvenientService::Support::Version]
12
- #
13
- # @internal
14
- # https://ruby-doc.org/core-2.7.2/doc/globals_rdoc.html
15
- #
16
- def version
17
- @version ||= Support::Version.new(::RUBY_VERSION)
18
- end
19
-
20
- ##
21
- # Returns `true` when JRuby, `false` otherwise.
22
- #
23
- # @return [Boolean]
24
- #
25
- # @see https://github.com/rdp/os
26
- #
27
- # @internal
28
- # NOTE: Gratefully copied from the `os` gem. Version `1.1.4`.
29
- # - https://github.com/rdp/os/blob/v1.1.4/lib/os.rb#L101
30
- #
31
- # NOTE: Modified original implementation in order to return a boolean.
32
- #
33
- def jruby?
34
- ::RUBY_PLATFORM.to_s.match?(/java/)
35
- end
36
-
37
- ##
38
- # Returns `true` when TruffleRuby, `false` otherwise.
39
- #
40
- # @return [Boolean]
41
- #
42
- # @internal
43
- # NOTE: Taken from irb testing. May NOT be stable.
44
- #
45
- # TODO: Find a confirmation of stability.
46
- #
47
- def truffleruby?
48
- ::RUBY_ENGINE.to_s.match?(/truffleruby/)
49
- end
50
- end
51
- end
52
- end
53
- end