convenient_service 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.vscode/CacheItsValue.code-snippets +1 -1
  4. data/.yardopts +3 -0
  5. data/CHANGELOG.md +22 -0
  6. data/README.md +1 -1
  7. data/Taskfile.yml +14 -2
  8. data/lib/convenient_service/dependencies.rb +2 -2
  9. data/lib/convenient_service/examples/dry/gemfile.rb +1 -1
  10. data/lib/convenient_service/examples/dry/v1/gemfile.rb +1 -1
  11. data/lib/convenient_service/examples/rails/gemfile.rb +1 -1
  12. data/lib/convenient_service/examples/rails/v1/gemfile.rb +1 -1
  13. data/lib/convenient_service/examples/standard/cowsay.rb +1 -1
  14. data/lib/convenient_service/examples/standard/date_time.rb +1 -1
  15. data/lib/convenient_service/examples/standard/factorial.rb +1 -1
  16. data/lib/convenient_service/examples/standard/gemfile.rb +1 -1
  17. data/lib/convenient_service/examples/standard/request_params.rb +1 -1
  18. data/lib/convenient_service/examples/standard/v1/cowsay.rb +1 -1
  19. data/lib/convenient_service/examples/standard/v1/date_time.rb +1 -1
  20. data/lib/convenient_service/examples/standard/v1/factorial.rb +1 -1
  21. data/lib/convenient_service/examples/standard/v1/gemfile.rb +1 -1
  22. data/lib/convenient_service/examples/standard/v1/request_params.rb +1 -1
  23. data/lib/convenient_service/feature/configs/aliases.rb +9 -0
  24. data/lib/convenient_service/feature/configs/standard.rb +22 -0
  25. data/lib/convenient_service/feature/configs.rb +5 -0
  26. data/lib/convenient_service/feature/plugins/aliases.rb +7 -0
  27. data/lib/convenient_service/feature/plugins/can_have_entries/commands/define_entry.rb +51 -0
  28. data/lib/convenient_service/feature/plugins/can_have_entries/commands.rb +3 -0
  29. data/lib/convenient_service/feature/plugins/can_have_entries/concern.rb +24 -0
  30. data/lib/convenient_service/feature/plugins/can_have_entries.rb +4 -0
  31. data/lib/convenient_service/feature/plugins.rb +5 -0
  32. data/lib/convenient_service/feature.rb +2 -9
  33. data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service/constants.rb +1 -1
  34. data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service/entities/result_spec.rb +8 -8
  35. data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service/entities/stubbed_service.rb +6 -6
  36. data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service.rb +1 -1
  37. data/lib/convenient_service/rspec/helpers/{custom → classes}/wrap_method/entities/wrapped_method.rb +6 -6
  38. data/lib/convenient_service/rspec/helpers/{custom → classes}/wrap_method/exceptions.rb +1 -1
  39. data/lib/convenient_service/rspec/helpers/{custom → classes}/wrap_method.rb +2 -2
  40. data/lib/convenient_service/rspec/helpers/classes.rb +4 -0
  41. data/lib/convenient_service/rspec/helpers/ignoring_exception.rb +1 -1
  42. data/lib/convenient_service/rspec/helpers/stub_service.rb +5 -5
  43. data/lib/convenient_service/rspec/helpers/wrap_method.rb +1 -1
  44. data/lib/convenient_service/rspec/helpers.rb +4 -6
  45. data/lib/convenient_service/rspec/matchers/call_chain_next.rb +1 -1
  46. data/lib/convenient_service/rspec/matchers/{custom → classes}/call_chain_next.rb +8 -8
  47. data/lib/convenient_service/rspec/matchers/{custom → classes}/export.rb +1 -1
  48. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/constants.rb +1 -1
  49. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/chain.rb +1 -1
  50. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_code_part.rb +4 -4
  51. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_data_part.rb +4 -4
  52. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_message_part.rb +4 -4
  53. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_parts.rb +3 -3
  54. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_service_part.rb +4 -4
  55. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_status_part.rb +4 -4
  56. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_expected_step_part.rb +4 -4
  57. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_got_parts.rb +3 -3
  58. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_got_service_part.rb +4 -4
  59. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands/generate_got_step_part.rb +4 -4
  60. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base.rb +4 -4
  61. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/error/commands/generate_got_jsend_attributes_part.rb +4 -4
  62. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/error.rb +1 -1
  63. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/failure/commands/generate_got_jsend_attributes_part.rb +4 -4
  64. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/failure.rb +1 -1
  65. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/null.rb +1 -1
  66. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb +4 -4
  67. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/success.rb +1 -1
  68. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers.rb +3 -3
  69. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result.rb +4 -4
  70. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_code.rb +5 -5
  71. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_data.rb +5 -5
  72. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_message.rb +5 -5
  73. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_service.rb +5 -5
  74. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_status.rb +5 -5
  75. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_step.rb +6 -6
  76. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands/validate_result_type.rb +5 -5
  77. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator.rb +3 -3
  78. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/exceptions.rb +1 -1
  79. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base.rb +15 -15
  80. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_error.rb +1 -1
  81. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_failure.rb +1 -1
  82. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_not_error.rb +1 -1
  83. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_not_failure.rb +1 -1
  84. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_not_success.rb +1 -1
  85. data/lib/convenient_service/rspec/matchers/{custom → classes}/results/be_success.rb +1 -1
  86. data/lib/convenient_service/rspec/matchers/classes.rb +5 -0
  87. data/lib/convenient_service/rspec/matchers/delegate_to.rb +1 -1
  88. data/lib/convenient_service/rspec/matchers/export.rb +1 -1
  89. data/lib/convenient_service/rspec/matchers/include_module.rb +1 -1
  90. data/lib/convenient_service/rspec/matchers/results/be_error.rb +1 -1
  91. data/lib/convenient_service/rspec/matchers/results/be_failure.rb +1 -1
  92. data/lib/convenient_service/rspec/matchers/results/be_not_error.rb +1 -1
  93. data/lib/convenient_service/rspec/matchers/results/be_not_failure.rb +1 -1
  94. data/lib/convenient_service/rspec/matchers/results/be_not_success.rb +1 -1
  95. data/lib/convenient_service/rspec/matchers/results/be_result.rb +6 -6
  96. data/lib/convenient_service/rspec/matchers/results/be_success.rb +1 -1
  97. data/lib/convenient_service/rspec/matchers.rb +6 -28
  98. data/lib/convenient_service/rspec/{helpers/custom → primitive_helpers/classes}/ignoring_exception/exceptions.rb +2 -2
  99. data/lib/convenient_service/rspec/{helpers/custom → primitive_helpers/classes}/ignoring_exception.rb +3 -3
  100. data/lib/convenient_service/rspec/{helpers/custom → primitive_helpers/classes}/in_threads.rb +2 -2
  101. data/lib/convenient_service/rspec/primitive_helpers/classes.rb +4 -0
  102. data/lib/convenient_service/rspec/primitive_helpers/ignoring_exception.rb +13 -0
  103. data/lib/convenient_service/rspec/{helpers → primitive_helpers}/in_threads.rb +2 -2
  104. data/lib/convenient_service/rspec/primitive_helpers.rb +19 -0
  105. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/be_descendant_of.rb +2 -2
  106. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/be_direct_descendant_of.rb +2 -2
  107. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/cache_its_value.rb +2 -2
  108. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/be_descendant_of.rb +2 -2
  109. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/be_direct_descendant_of.rb +2 -2
  110. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/cache_its_value.rb +2 -2
  111. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/commands/generate_printable_method.rb +2 -2
  112. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands/apply_stub_to_track_delegations.rb +4 -4
  113. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands/generate_printable_arguments.rb +4 -4
  114. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments.rb +2 -2
  115. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/base.rb +5 -5
  116. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/return_its_value.rb +2 -2
  117. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_any_arguments.rb +2 -2
  118. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/with_concrete_arguments.rb +2 -2
  119. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/without_arguments.rb +2 -2
  120. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/values/base.rb +4 -4
  121. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/values/with_calling_original.rb +2 -2
  122. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/values/without_calling_original.rb +2 -2
  123. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings_collection/exceptions.rb +2 -2
  124. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings_collection.rb +13 -13
  125. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/delegation.rb +3 -3
  126. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher.rb +13 -13
  127. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to.rb +13 -13
  128. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/extend_module.rb +2 -2
  129. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_abstract_method.rb +2 -2
  130. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_alias_method.rb +2 -2
  131. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_attr_accessor.rb +4 -4
  132. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_attr_reader.rb +2 -2
  133. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/have_attr_writer.rb +2 -2
  134. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/include_module.rb +2 -2
  135. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/prepend_module.rb +2 -2
  136. data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/singleton_prepend_module.rb +2 -2
  137. data/lib/convenient_service/rspec/primitive_matchers/classes.rb +15 -0
  138. data/lib/convenient_service/rspec/primitive_matchers/delegate_to.rb +13 -0
  139. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/extend_module.rb +2 -2
  140. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_abstract_method.rb +2 -2
  141. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_alias_method.rb +2 -2
  142. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_attr_accessor.rb +2 -2
  143. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_attr_reader.rb +2 -2
  144. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/have_attr_writer.rb +2 -2
  145. data/lib/convenient_service/rspec/primitive_matchers/include_module.rb +13 -0
  146. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/prepend_module.rb +2 -2
  147. data/lib/convenient_service/rspec/{matchers → primitive_matchers}/singleton_prepend_module.rb +2 -2
  148. data/lib/convenient_service/rspec/primitive_matchers.rb +41 -0
  149. data/lib/convenient_service/rspec.rb +3 -0
  150. data/lib/convenient_service/{configs → service/configs}/aliases.rb +1 -1
  151. data/lib/convenient_service/{configs → service/configs}/awesome_print_inspect/aliases.rb +1 -1
  152. data/lib/convenient_service/service/configs/awesome_print_inspect.rb +61 -0
  153. data/lib/convenient_service/service/configs/minimal.rb +261 -0
  154. data/lib/convenient_service/{configs → service/configs}/standard/aliases.rb +1 -1
  155. data/lib/convenient_service/service/configs/standard/v1.rb +185 -0
  156. data/lib/convenient_service/service/configs/standard.rb +238 -0
  157. data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +9 -3
  158. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value/exceptions.rb +32 -0
  159. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value/middleware.rb +33 -0
  160. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value.rb +4 -0
  161. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins.rb +1 -0
  162. data/lib/convenient_service/service/plugins/can_have_steps/entities/step_collection.rb +16 -0
  163. data/lib/convenient_service/service.rb +1 -0
  164. data/lib/convenient_service/support/dependency_container/commands.rb +0 -1
  165. data/lib/convenient_service/support/dependency_container.rb +0 -1
  166. data/lib/convenient_service/version.rb +1 -1
  167. data/lib/convenient_service.rb +0 -1
  168. data/yard/yard-convenient_service_concern.rb +45 -0
  169. metadata +137 -119
  170. data/lib/convenient_service/configs/awesome_print_inspect.rb +0 -59
  171. data/lib/convenient_service/configs/minimal.rb +0 -257
  172. data/lib/convenient_service/configs/standard/v1.rb +0 -183
  173. data/lib/convenient_service/configs/standard.rb +0 -234
  174. data/lib/convenient_service/rspec/helpers/custom.rb +0 -6
  175. data/lib/convenient_service/rspec/matchers/custom.rb +0 -18
  176. data/lib/convenient_service/support/dependency_container/commands/define_entry.rb +0 -49
  177. data/lib/convenient_service/support/dependency_container/entry.rb +0 -22
  178. /data/lib/convenient_service/rspec/helpers/{custom → classes}/stub_service/entities.rb +0 -0
  179. /data/lib/convenient_service/rspec/helpers/{custom → classes}/wrap_method/entities.rb +0 -0
  180. /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/base/commands.rb +0 -0
  181. /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/error/commands.rb +0 -0
  182. /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/failure/commands.rb +0 -0
  183. /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/printers/success/commands.rb +0 -0
  184. /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities/validator/commands.rb +0 -0
  185. /data/lib/convenient_service/rspec/matchers/{custom → classes}/results/base/entities.rb +0 -0
  186. /data/lib/convenient_service/rspec/matchers/{custom → classes}/results.rb +0 -0
  187. /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/commands.rb +0 -0
  188. /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands.rb +0 -0
  189. /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities/chainings.rb +0 -0
  190. /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities/matcher/entities.rb +0 -0
  191. /data/lib/convenient_service/rspec/{matchers/custom → primitive_matchers/classes}/delegate_to/entities.rb +0 -0
  192. /data/lib/convenient_service/{configs.rb → service/configs.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e849e1385e9637d36289bfeb4e78eccddd53b22f5f9e828c5a35c8c90967954d
4
- data.tar.gz: 9538a0fb396cbe7a9f04879845a25287145021b4bfa17ea78eaf4e54643552d9
3
+ metadata.gz: 86314358470fd8502e3b00853f6f0aed31fe7837fe879b8a6fe9b02b23a37055
4
+ data.tar.gz: 8c7ddbfa504ef02c2774bbc4c616297345b684320ed0e4b4b10134f2a8851c24
5
5
  SHA512:
6
- metadata.gz: f4cc32889e3c0958bc5acebc744a01b9fc80c0fa2c7a7c3a609ffd4a9d8254822d0ad4a8c1d75fd2ce39472b2ededc2ef69b3d899edcda406f1eff99b06df2b8
7
- data.tar.gz: 30bf372859ef693d1d67058a886065eb7db3b3dddb530cc585e471417a94ccedfac1c86d17df56881c3f5849b04d6a0a64b752746209afa5d860f9f35f3b3689
6
+ metadata.gz: 59dc4c6936c9764718dd105ef24255e89a21397b56770460850fa38365c37d0a4ba7d97bba924c72906f2ba27fc6b66b3981e9f1682a43c22f245e6daa811627
7
+ data.tar.gz: bc6942d0091fe8805164bfb01b00ed09c2be71ae0ea2838d2958331844053984309600f15151cb33fe261bc76913eed1f5299898b2e95df696020ab5a92e4d9d
data/.gitignore CHANGED
@@ -50,3 +50,8 @@
50
50
  # Check `HasMermaidFlowchart` for details.
51
51
  #
52
52
  flowchart.html
53
+
54
+ ##
55
+ # NOTE: Ignores `TODO.md`. Usually, this file is used for notes that are NOT ready to be shared with the outside world.
56
+ #
57
+ TODO.md
@@ -8,7 +8,7 @@
8
8
  "scope": "ruby",
9
9
  "prefix": "CacheItsValue",
10
10
  "body": [
11
- "include ConvenientService::RSpec::Matchers::CacheItsValue",
11
+ "include ConvenientService::RSpec::PrimitiveMatchers::CacheItsValue",
12
12
  ],
13
13
  "description": "`CacheItsValue` - a module that allows to use custom RSpec matcher `cache_its_value` to verify caching"
14
14
  }
data/.yardopts CHANGED
@@ -1,4 +1,6 @@
1
1
  ##
2
+ # NOTE: This config is used by `task docs:generate`.
3
+ #
2
4
  # NOTE: `.yardopts` docs.
3
5
  # https://rubydoc.info/gems/yard/YARD/CLI/Yardoc
4
6
  #
@@ -9,5 +11,6 @@
9
11
  --markup-provider commonmarker
10
12
  --output-dir docs
11
13
  --tag internal --hide-tag internal
14
+ --plugin convenient_service_concern
12
15
  'lib/**/*.rb' -
13
16
  README.md
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.15.0](https://github.com/marian13/convenient_service/compare/v0.14.0...v0.15.0) (2023-11-10)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **feature:** allow to use plugins for features
9
+
10
+ ### Features
11
+
12
+ * **can_have_steps:** do not allow to modify steps from callbacks ([b90b7f7](https://github.com/marian13/convenient_service/commit/b90b7f7b5ba7b9cb12151d02495d1ad1c230504e))
13
+ * **feature:** allow to use plugins for features ([17645f8](https://github.com/marian13/convenient_service/commit/17645f888849b5cb42c2ae45aa8430cb96e28eff))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **can_have_steps:** introduce raises_on_not_result_return_value for steps ([bb27527](https://github.com/marian13/convenient_service/commit/bb27527b708747df356980cf831c660757fb4093))
19
+
20
+
21
+ ### Miscellaneous Chores
22
+
23
+ * release 0.15.0 ([7f6a6a7](https://github.com/marian13/convenient_service/commit/7f6a6a74b722eaf26ae7195351a9078c944032dd))
24
+
3
25
  ## [0.14.0](https://github.com/marian13/convenient_service/compare/v0.13.0...v0.14.0) (2023-09-20)
4
26
 
5
27
 
data/README.md CHANGED
@@ -38,7 +38,7 @@ Yet another approach to revisit the service object pattern, but this time focusi
38
38
  <!-- general_description:end -->
39
39
 
40
40
  <!-- warning:start -->
41
- ## WARNING ❗❗❗
41
+ ## ❗❗❗ WARNING ❗❗❗
42
42
 
43
43
  This library is under heavy development. Public API may be subject to change. The first major release is still to come. Use the current version at your own risk. Ruby 2.7+, JRuby 9.4+ (TruffleRuby support is planned as well). Thanks.
44
44
  <!-- features:end -->
data/Taskfile.yml CHANGED
@@ -339,7 +339,13 @@ tasks:
339
339
  #
340
340
  docs:generate:
341
341
  cmds:
342
- - bundle exec yardoc
342
+ ##
343
+ # NOTE: yard supports plugins as gems only.
344
+ # - https://rubydoc.info/gems/yard/file/docs/GettingStarted.md#plugin-support
345
+ #
346
+ # NOTE: `RUBYLIB` is used to extend Ruby's `$LOAD_PATH`. This way yard treats `./yard` folder as a directory with custom gems.
347
+ #
348
+ - RUBYLIB=./yard bundle exec yardoc
343
349
 
344
350
  docs:generate:open:
345
351
  cmds:
@@ -664,4 +670,10 @@ tasks:
664
670
  yard_junk:
665
671
  cmds:
666
672
  - mkdir -p docs
667
- - bundle exec yard-junk --text --html docs/junk-yard.html
673
+ ##
674
+ # NOTE: yard supports plugins as gems only.
675
+ # - https://rubydoc.info/gems/yard/file/docs/GettingStarted.md#plugin-support
676
+ #
677
+ # NOTE: `RUBYLIB` is used to extend Ruby's `$LOAD_PATH`. This way yard treats `./yard` folder as a directory with custom gems.
678
+ #
679
+ - RUBYLIB=./yard bundle exec yard-junk --text --html docs/junk-yard.html
@@ -125,8 +125,8 @@ module ConvenientService
125
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
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
127
  require_relative "service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect"
128
- require_relative "configs/awesome_print_inspect"
129
- require_relative "configs/awesome_print_inspect/aliases"
128
+ require_relative "service/configs/awesome_print_inspect"
129
+ require_relative "service/configs/awesome_print_inspect/aliases"
130
130
  end
131
131
 
132
132
  ##
@@ -14,7 +14,7 @@ module ConvenientService
14
14
  module Examples
15
15
  module Dry
16
16
  class Gemfile
17
- include ConvenientService::Feature
17
+ include ConvenientService::Feature::Standard::Config
18
18
 
19
19
  entry :format do |path|
20
20
  Services::Format[path: path]
@@ -15,7 +15,7 @@ module ConvenientService
15
15
  module Dry
16
16
  module V1
17
17
  class Gemfile
18
- include ConvenientService::Feature
18
+ include ConvenientService::Feature::Standard::Config
19
19
 
20
20
  entry :format do |path|
21
21
  Services::Format[path: path]
@@ -14,7 +14,7 @@ module ConvenientService
14
14
  module Examples
15
15
  module Rails
16
16
  class Gemfile
17
- include ConvenientService::Feature
17
+ include ConvenientService::Feature::Standard::Config
18
18
 
19
19
  entry :format do |path|
20
20
  Services::Format[path: path]
@@ -15,7 +15,7 @@ module ConvenientService
15
15
  module Rails
16
16
  module V1
17
17
  class Gemfile
18
- include ConvenientService::Feature
18
+ include ConvenientService::Feature::Standard::Config
19
19
 
20
20
  entry :format do |path|
21
21
  Services::Format[path: path]
@@ -13,7 +13,7 @@ module ConvenientService
13
13
  module Examples
14
14
  module Standard
15
15
  class Cowsay
16
- include ConvenientService::Feature
16
+ include ConvenientService::Feature::Standard::Config
17
17
 
18
18
  entry :print do |text = "Hello World!", out: $stdout|
19
19
  Services::Print[text: text, out: out]
@@ -12,7 +12,7 @@ module ConvenientService
12
12
  module Examples
13
13
  module Standard
14
14
  class DateTime
15
- include ConvenientService::Feature
15
+ include ConvenientService::Feature::Standard::Config
16
16
 
17
17
  entry :safe_parse do |string, format|
18
18
  Services::SafeParse[string: string, format: format]
@@ -13,7 +13,7 @@ module ConvenientService
13
13
  module Examples
14
14
  module Standard
15
15
  class Factorial
16
- include ConvenientService::Feature
16
+ include ConvenientService::Feature::Standard::Config
17
17
 
18
18
  entry :calculate do |number|
19
19
  Services::Calculate[number: number]
@@ -13,7 +13,7 @@ module ConvenientService
13
13
  module Examples
14
14
  module Standard
15
15
  class Gemfile
16
- include ConvenientService::Feature
16
+ include ConvenientService::Feature::Standard::Config
17
17
 
18
18
  entry :format do |path|
19
19
  Services::Format[path: path]
@@ -37,7 +37,7 @@ module ConvenientService
37
37
  module Examples
38
38
  module Standard
39
39
  class RequestParams
40
- include ConvenientService::Feature
40
+ include ConvenientService::Feature::Standard::Config
41
41
 
42
42
  entry :prepare do |request|
43
43
  Services::Prepare[request: request]
@@ -14,7 +14,7 @@ module ConvenientService
14
14
  module Standard
15
15
  module V1
16
16
  class Cowsay
17
- include ConvenientService::Feature
17
+ include ConvenientService::Feature::Standard::Config
18
18
 
19
19
  entry :print do |text = "Hello World!", out: $stdout|
20
20
  Services::Print[text: text, out: out]
@@ -13,7 +13,7 @@ module ConvenientService
13
13
  module Standard
14
14
  module V1
15
15
  class DateTime
16
- include ConvenientService::Feature
16
+ include ConvenientService::Feature::Standard::Config
17
17
 
18
18
  entry :safe_parse do |string, format|
19
19
  Services::SafeParse[string: string, format: format]
@@ -14,7 +14,7 @@ module ConvenientService
14
14
  module Standard
15
15
  module V1
16
16
  class Factorial
17
- include ConvenientService::Feature
17
+ include ConvenientService::Feature::Standard::Config
18
18
 
19
19
  entry :calculate do |number|
20
20
  Services::Calculate[number: number]
@@ -14,7 +14,7 @@ module ConvenientService
14
14
  module Standard
15
15
  module V1
16
16
  class Gemfile
17
- include ConvenientService::Feature
17
+ include ConvenientService::Feature::Standard::Config
18
18
 
19
19
  entry :format do |path|
20
20
  Services::Format[path: path]
@@ -38,7 +38,7 @@ module ConvenientService
38
38
  module Standard
39
39
  module V1
40
40
  class RequestParams
41
- include ConvenientService::Feature
41
+ include ConvenientService::Feature::Standard::Config
42
42
 
43
43
  entry :prepare do |request|
44
44
  Services::Prepare[request: request]
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Feature
5
+ module Standard
6
+ Config = ::ConvenientService::Feature::Configs::Standard
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Feature
5
+ module Configs
6
+ ##
7
+ # Default configuration for the user-defined features.
8
+ #
9
+ module Standard
10
+ include Support::Concern
11
+
12
+ included do
13
+ include Core
14
+
15
+ concerns do
16
+ use ConvenientService::Plugins::Feature::CanHaveEntries::Concern
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "configs/standard"
4
+
5
+ require_relative "configs/aliases"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Plugins
5
+ Feature = ::ConvenientService::Feature::Plugins
6
+ end
7
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Feature
5
+ module Plugins
6
+ module CanHaveEntries
7
+ module Commands
8
+ class DefineEntry < Support::Command
9
+ ##
10
+ # @!attribute [r] feature_class
11
+ # @return [Class]
12
+ #
13
+ attr_reader :feature_class
14
+
15
+ ##
16
+ # @!attribute [r] name
17
+ # @return [String, Symbol]
18
+ #
19
+ attr_reader :name
20
+
21
+ ##
22
+ # @!attribute [r] body
23
+ # @return [Proc]
24
+ #
25
+ attr_reader :body
26
+
27
+ ##
28
+ # @param feature_class [Class]
29
+ # @param name [String, Symbol]
30
+ # @param body [Proc]
31
+ #
32
+ def initialize(feature_class:, name:, body:)
33
+ @feature_class = feature_class
34
+ @name = name
35
+ @body = body
36
+ end
37
+
38
+ ##
39
+ # @return [String, Symbol]
40
+ #
41
+ def call
42
+ feature_class.define_singleton_method(name, &body)
43
+
44
+ name
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "commands/define_entry"
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConvenientService
4
+ module Feature
5
+ module Plugins
6
+ module CanHaveEntries
7
+ module Concern
8
+ include Support::Concern
9
+
10
+ class_methods do
11
+ ##
12
+ # @param name [String, Symbol]
13
+ # @param body [Proc]
14
+ # @return [String, Symbol]
15
+ #
16
+ def entry(name, &body)
17
+ Commands::DefineEntry.call(feature_class: self, name: name, body: body)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "can_have_entries/commands"
4
+ require_relative "can_have_entries/concern"
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "plugins/can_have_entries"
4
+
5
+ require_relative "plugins/aliases"
@@ -1,11 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ConvenientService
4
- module Feature
5
- include Support::Concern
6
-
7
- included do
8
- include Support::DependencyContainer::Entry
9
- end
10
- end
11
- end
3
+ require_relative "feature/plugins"
4
+ require_relative "feature/configs"
@@ -3,7 +3,7 @@
3
3
  module ConvenientService
4
4
  module RSpec
5
5
  module Helpers
6
- module Custom
6
+ module Classes
7
7
  class StubService < Support::Command
8
8
  module Constants
9
9
  module Triggers
@@ -3,7 +3,7 @@
3
3
  module ConvenientService
4
4
  module RSpec
5
5
  module Helpers
6
- module Custom
6
+ module Classes
7
7
  ##
8
8
  # @internal
9
9
  # TODO: Specs.
@@ -26,7 +26,7 @@ module ConvenientService
26
26
 
27
27
  ##
28
28
  # @param service_class [Class]
29
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::ResultSpec]
29
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::ResultSpec]
30
30
  # @since 0.1.0
31
31
  #
32
32
  def for(service_class)
@@ -35,7 +35,7 @@ module ConvenientService
35
35
 
36
36
  ##
37
37
  # @param data [Hash]
38
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::ResultSpec]
38
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::ResultSpec]
39
39
  # @since 0.1.0
40
40
  #
41
41
  def with_data(data)
@@ -46,7 +46,7 @@ module ConvenientService
46
46
 
47
47
  ##
48
48
  # @param message [String]
49
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::ResultSpec]
49
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::ResultSpec]
50
50
  # @since 0.1.0
51
51
  #
52
52
  def with_message(message)
@@ -57,7 +57,7 @@ module ConvenientService
57
57
 
58
58
  ##
59
59
  # @param code [String]
60
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::ResultSpec]
60
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::ResultSpec]
61
61
  # @since 0.1.0
62
62
  #
63
63
  def with_code(code)
@@ -68,7 +68,7 @@ module ConvenientService
68
68
 
69
69
  ##
70
70
  # @param data [Hash]
71
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::ResultSpec]
71
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::ResultSpec]
72
72
  # @since 0.1.0
73
73
  #
74
74
  def and_data(data)
@@ -79,7 +79,7 @@ module ConvenientService
79
79
 
80
80
  ##
81
81
  # @param message [String]
82
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::ResultSpec]
82
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::ResultSpec]
83
83
  # @since 0.1.0
84
84
  #
85
85
  def and_message(message)
@@ -90,7 +90,7 @@ module ConvenientService
90
90
 
91
91
  ##
92
92
  # @param code [String]
93
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::ResultSpec]
93
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::ResultSpec]
94
94
  # @since 0.1.0
95
95
  #
96
96
  def and_code(code)
@@ -3,7 +3,7 @@
3
3
  module ConvenientService
4
4
  module RSpec
5
5
  module Helpers
6
- module Custom
6
+ module Classes
7
7
  class StubService < Support::Command
8
8
  module Entities
9
9
  class StubbedService
@@ -31,7 +31,7 @@ module ConvenientService
31
31
  end
32
32
 
33
33
  ##
34
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::StubService]
34
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubService]
35
35
  #
36
36
  def with_arguments(...)
37
37
  @arguments = Support::Arguments.new(...)
@@ -40,7 +40,7 @@ module ConvenientService
40
40
  end
41
41
 
42
42
  ##
43
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::StubService]
43
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubService]
44
44
  #
45
45
  def without_arguments
46
46
  @arguments = Support::Arguments.null_arguments
@@ -49,8 +49,8 @@ module ConvenientService
49
49
  end
50
50
 
51
51
  ##
52
- # @param result_spec [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::ResultSpec]
53
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::StubService]
52
+ # @param result_spec [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::ResultSpec]
53
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubService]
54
54
  #
55
55
  def to(result_spec)
56
56
  @result_spec = result_spec
@@ -78,7 +78,7 @@ module ConvenientService
78
78
 
79
79
  ##
80
80
  # @!attribute [r] result_spec
81
- # @return [ConvenientService::RSpec::Helpers::Custom::StubService::Entities::ResultSpec]
81
+ # @return [ConvenientService::RSpec::Helpers::Classes::StubService::Entities::ResultSpec]
82
82
  #
83
83
  attr_reader :result_spec
84
84
 
@@ -6,7 +6,7 @@ require_relative "stub_service/entities"
6
6
  module ConvenientService
7
7
  module RSpec
8
8
  module Helpers
9
- module Custom
9
+ module Classes
10
10
  ##
11
11
  # TODO: Specs.
12
12
  #
@@ -3,7 +3,7 @@
3
3
  module ConvenientService
4
4
  module RSpec
5
5
  module Helpers
6
- module Custom
6
+ module Classes
7
7
  class WrapMethod < Support::Command
8
8
  module Entities
9
9
  ##
@@ -129,7 +129,7 @@ module ConvenientService
129
129
 
130
130
  ##
131
131
  # @return [Object] Can be any type.
132
- # @raise [ConvenientService::RSpec::Helpers::Custom::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
132
+ # @raise [ConvenientService::RSpec::Helpers::Classes::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
133
133
  #
134
134
  def chain_value
135
135
  raise Exceptions::ChainAttributePreliminaryAccess.new(attribute: :value) unless chain_called?
@@ -139,7 +139,7 @@ module ConvenientService
139
139
 
140
140
  ##
141
141
  # @return [Array]
142
- # @raise [ConvenientService::RSpec::Helpers::Custom::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
142
+ # @raise [ConvenientService::RSpec::Helpers::Classes::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
143
143
  #
144
144
  def chain_args
145
145
  raise Exceptions::ChainAttributePreliminaryAccess.new(attribute: :args) unless chain_called?
@@ -149,7 +149,7 @@ module ConvenientService
149
149
 
150
150
  ##
151
151
  # @return [Hash]
152
- # @raise [ConvenientService::RSpec::Helpers::Custom::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
152
+ # @raise [ConvenientService::RSpec::Helpers::Classes::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
153
153
  #
154
154
  def chain_kwargs
155
155
  raise Exceptions::ChainAttributePreliminaryAccess.new(attribute: :kwargs) unless chain_called?
@@ -159,7 +159,7 @@ module ConvenientService
159
159
 
160
160
  ##
161
161
  # @return [Proc, nil]
162
- # @raise [ConvenientService::RSpec::Helpers::Custom::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
162
+ # @raise [ConvenientService::RSpec::Helpers::Classes::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
163
163
  #
164
164
  def chain_block
165
165
  raise Exceptions::ChainAttributePreliminaryAccess.new(attribute: :block) unless chain_called?
@@ -169,7 +169,7 @@ module ConvenientService
169
169
 
170
170
  ##
171
171
  # @return [StandardError, nil]
172
- # @raise [ConvenientService::RSpec::Helpers::Custom::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
172
+ # @raise [ConvenientService::RSpec::Helpers::Classes::WrapMethod::Exceptions::ChainAttributePreliminaryAccess]
173
173
  #
174
174
  def chain_exception
175
175
  raise Exceptions::ChainAttributePreliminaryAccess.new(attribute: :exception) unless chain_called?
@@ -3,7 +3,7 @@
3
3
  module ConvenientService
4
4
  module RSpec
5
5
  module Helpers
6
- module Custom
6
+ module Classes
7
7
  class WrapMethod < Support::Command
8
8
  module Exceptions
9
9
  class ChainAttributePreliminaryAccess < ::ConvenientService::Exception
@@ -6,7 +6,7 @@ require_relative "wrap_method/exceptions"
6
6
  module ConvenientService
7
7
  module RSpec
8
8
  module Helpers
9
- module Custom
9
+ module Classes
10
10
  class WrapMethod < Support::Command
11
11
  ##
12
12
  # @!attribute [r] entity
@@ -39,7 +39,7 @@ module ConvenientService
39
39
  end
40
40
 
41
41
  ##
42
- # @return [ConvenientService::RSpec::Helpers::Custom::Entities::WrappedMethod]
42
+ # @return [ConvenientService::RSpec::Helpers::Classes::Entities::WrappedMethod]
43
43
  #
44
44
  def call
45
45
  Entities::WrappedMethod.new(entity: entity, method: method, observe_middleware: observe_middleware)
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "classes/stub_service"
4
+ require_relative "classes/wrap_method"