dev_suite 0.2.7 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +12 -0
  3. data/.github/workflows/ci.yml +1 -1
  4. data/.sonarcloud.properties +23 -0
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +17 -33
  7. data/README.md +216 -0
  8. data/dev_suite.gemspec +1 -0
  9. data/examples/helpers/api_helper.rb +51 -0
  10. data/examples/helpers/data_helper.rb +72 -0
  11. data/examples/helpers/helpers.rb +4 -0
  12. data/examples/workflow/basic_workflow.rb +15 -0
  13. data/examples/workflow/composite_workflow.rb +21 -0
  14. data/examples/workflow/conditional_workflow.rb +17 -0
  15. data/examples/workflow/full_workflow.rb +79 -0
  16. data/examples/workflow/loop_workflow.rb +17 -0
  17. data/examples/workflow/order_processing_workflow.rb +163 -0
  18. data/examples/workflow/parallel_workflow.rb +17 -0
  19. data/lib/dev_suite/dev_suite.rb +3 -0
  20. data/lib/dev_suite/method_tracer/config/config.rb +11 -0
  21. data/lib/dev_suite/method_tracer/config/configuration.rb +16 -0
  22. data/lib/dev_suite/method_tracer/config.rb +9 -0
  23. data/lib/dev_suite/method_tracer/helpers.rb +41 -0
  24. data/lib/dev_suite/method_tracer/logger.rb +46 -0
  25. data/lib/dev_suite/method_tracer/method_tracer.rb +20 -0
  26. data/lib/dev_suite/method_tracer/tracer.rb +65 -0
  27. data/lib/dev_suite/method_tracer.rb +7 -0
  28. data/lib/dev_suite/request_builder/builder/base.rb +27 -0
  29. data/lib/dev_suite/request_builder/builder/builder.rb +10 -0
  30. data/lib/dev_suite/request_builder/builder/http.rb +32 -0
  31. data/lib/dev_suite/request_builder/builder.rb +9 -0
  32. data/lib/dev_suite/request_builder/config/config.rb +11 -0
  33. data/lib/dev_suite/request_builder/config/configuration.rb +24 -0
  34. data/lib/dev_suite/request_builder/config.rb +9 -0
  35. data/lib/dev_suite/request_builder/formatter/base.rb +13 -0
  36. data/lib/dev_suite/request_builder/formatter/formatter.rb +10 -0
  37. data/lib/dev_suite/request_builder/formatter/graphql.rb +19 -0
  38. data/lib/dev_suite/request_builder/formatter.rb +9 -0
  39. data/lib/dev_suite/request_builder/request_builder.rb +21 -0
  40. data/lib/dev_suite/request_builder/tool/base.rb +19 -0
  41. data/lib/dev_suite/request_builder/tool/curl.rb +91 -0
  42. data/lib/dev_suite/request_builder/tool/tool.rb +11 -0
  43. data/lib/dev_suite/request_builder/tool/validator/curl.rb +38 -0
  44. data/lib/dev_suite/request_builder/tool/validator/validator.rb +11 -0
  45. data/lib/dev_suite/request_builder/tool/validator.rb +11 -0
  46. data/lib/dev_suite/request_builder/tool.rb +9 -0
  47. data/lib/dev_suite/request_builder.rb +7 -0
  48. data/lib/dev_suite/request_logger/adapter/adapter.rb +11 -9
  49. data/lib/dev_suite/request_logger/adapter/faraday.rb +12 -1
  50. data/lib/dev_suite/request_logger/adapter/middleware/faraday.rb +3 -3
  51. data/lib/dev_suite/request_logger/adapter/net_http.rb +15 -6
  52. data/lib/dev_suite/request_logger/config/configuration.rb +1 -0
  53. data/lib/dev_suite/request_logger/extractor/base.rb +8 -2
  54. data/lib/dev_suite/request_logger/extractor/extractor.rb +5 -6
  55. data/lib/dev_suite/request_logger/extractor/faraday.rb +32 -14
  56. data/lib/dev_suite/request_logger/extractor/net_http.rb +53 -12
  57. data/lib/dev_suite/request_logger/logger.rb +9 -3
  58. data/lib/dev_suite/request_logger/request.rb +12 -0
  59. data/lib/dev_suite/request_logger/response.rb +34 -9
  60. data/lib/dev_suite/utils/construct/component/base.rb +13 -0
  61. data/lib/dev_suite/utils/construct/component/component.rb +1 -0
  62. data/lib/dev_suite/utils/construct/component/manager.rb +27 -10
  63. data/lib/dev_suite/utils/construct/component/validator/base.rb +25 -0
  64. data/lib/dev_suite/utils/construct/component/validator/validation_error.rb +21 -0
  65. data/lib/dev_suite/utils/construct/component/validator/validation_rule.rb +68 -0
  66. data/lib/dev_suite/utils/construct/component/validator/validator.rb +15 -0
  67. data/lib/dev_suite/utils/construct/component/validator.rb +13 -0
  68. data/lib/dev_suite/utils/construct/config/dependency_handler.rb +25 -34
  69. data/lib/dev_suite/utils/construct/config/settings/base.rb +43 -26
  70. data/lib/dev_suite/utils/data/base_operations.rb +61 -0
  71. data/lib/dev_suite/utils/data/data.rb +19 -0
  72. data/lib/dev_suite/utils/data/path_access.rb +172 -0
  73. data/lib/dev_suite/utils/data/search_filter.rb +60 -0
  74. data/lib/dev_suite/utils/data/serialization.rb +29 -0
  75. data/lib/dev_suite/utils/data/transformations.rb +45 -0
  76. data/lib/dev_suite/utils/data.rb +9 -0
  77. data/lib/dev_suite/utils/dependency_loader.rb +2 -2
  78. data/lib/dev_suite/utils/emoji.rb +19 -0
  79. data/lib/dev_suite/utils/file_loader/file_loader.rb +1 -5
  80. data/lib/dev_suite/utils/file_loader/loader/json.rb +4 -1
  81. data/lib/dev_suite/utils/file_loader/loader/loader.rb +23 -19
  82. data/lib/dev_suite/utils/file_loader/loader.rb +0 -2
  83. data/lib/dev_suite/utils/file_writer/atomic_writer.rb +53 -0
  84. data/lib/dev_suite/utils/file_writer/backup_manager.rb +21 -0
  85. data/lib/dev_suite/utils/file_writer/file_writer.rb +24 -0
  86. data/lib/dev_suite/utils/file_writer/writer/base.rb +43 -0
  87. data/lib/dev_suite/utils/file_writer/writer/json.rb +24 -0
  88. data/lib/dev_suite/utils/file_writer/writer/text.rb +27 -0
  89. data/lib/dev_suite/utils/file_writer/writer/writer.rb +14 -0
  90. data/lib/dev_suite/utils/file_writer/writer/yaml.rb +44 -0
  91. data/lib/dev_suite/utils/file_writer/writer.rb +11 -0
  92. data/lib/dev_suite/utils/file_writer/writer_manager.rb +32 -0
  93. data/lib/dev_suite/utils/file_writer.rb +9 -0
  94. data/lib/dev_suite/utils/logger.rb +7 -5
  95. data/lib/dev_suite/utils/store/config/config.rb +13 -0
  96. data/lib/dev_suite/utils/store/config/configuration.rb +30 -0
  97. data/lib/dev_suite/utils/store/config.rb +11 -0
  98. data/lib/dev_suite/utils/store/driver/base.rb +35 -0
  99. data/lib/dev_suite/utils/store/driver/driver.rb +18 -0
  100. data/lib/dev_suite/utils/store/driver/file.rb +61 -0
  101. data/lib/dev_suite/utils/store/driver/memory.rb +42 -0
  102. data/lib/dev_suite/utils/store/driver.rb +11 -0
  103. data/lib/dev_suite/utils/store/store.rb +69 -0
  104. data/lib/dev_suite/utils/store.rb +9 -0
  105. data/lib/dev_suite/utils/utils.rb +17 -5
  106. data/lib/dev_suite/utils/warning_handler.rb +25 -0
  107. data/lib/dev_suite/version.rb +1 -1
  108. data/lib/dev_suite/workflow/engine.rb +27 -0
  109. data/lib/dev_suite/workflow/step/base.rb +56 -0
  110. data/lib/dev_suite/workflow/step/composite.rb +27 -0
  111. data/lib/dev_suite/workflow/step/conditional.rb +23 -0
  112. data/lib/dev_suite/workflow/step/loop.rb +21 -0
  113. data/lib/dev_suite/workflow/step/parallel.rb +18 -0
  114. data/lib/dev_suite/workflow/step/step.rb +21 -0
  115. data/lib/dev_suite/workflow/step.rb +9 -0
  116. data/lib/dev_suite/workflow/step_context.rb +46 -0
  117. data/lib/dev_suite/workflow/workflow.rb +39 -0
  118. data/lib/dev_suite/workflow.rb +7 -0
  119. metadata +101 -3
  120. data/lib/dev_suite/utils/construct/component/initializer.rb +0 -28
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_suite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Huy Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-26 00:00:00.000000000 Z
11
+ date: 2024-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: csv
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: get_process_mem
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -61,10 +75,12 @@ executables:
61
75
  extensions: []
62
76
  extra_rdoc_files: []
63
77
  files:
78
+ - ".codeclimate.yml"
64
79
  - ".github/workflows/ci.yml"
65
80
  - ".gitignore"
66
81
  - ".rspec"
67
82
  - ".rubocop.yml"
83
+ - ".sonarcloud.properties"
68
84
  - ".tool-versions"
69
85
  - ".travis.yml"
70
86
  - ".vscode/extensions.json"
@@ -80,6 +96,16 @@ files:
80
96
  - bin/rspec
81
97
  - bin/setup
82
98
  - dev_suite.gemspec
99
+ - examples/helpers/api_helper.rb
100
+ - examples/helpers/data_helper.rb
101
+ - examples/helpers/helpers.rb
102
+ - examples/workflow/basic_workflow.rb
103
+ - examples/workflow/composite_workflow.rb
104
+ - examples/workflow/conditional_workflow.rb
105
+ - examples/workflow/full_workflow.rb
106
+ - examples/workflow/loop_workflow.rb
107
+ - examples/workflow/order_processing_workflow.rb
108
+ - examples/workflow/parallel_workflow.rb
83
109
  - exe/devsuite
84
110
  - lib/dev_suite.rb
85
111
  - lib/dev_suite/cli.rb
@@ -111,6 +137,14 @@ files:
111
137
  - lib/dev_suite/directory_tree/visualizer/base.rb
112
138
  - lib/dev_suite/directory_tree/visualizer/tree.rb
113
139
  - lib/dev_suite/directory_tree/visualizer/visualizer.rb
140
+ - lib/dev_suite/method_tracer.rb
141
+ - lib/dev_suite/method_tracer/config.rb
142
+ - lib/dev_suite/method_tracer/config/config.rb
143
+ - lib/dev_suite/method_tracer/config/configuration.rb
144
+ - lib/dev_suite/method_tracer/helpers.rb
145
+ - lib/dev_suite/method_tracer/logger.rb
146
+ - lib/dev_suite/method_tracer/method_tracer.rb
147
+ - lib/dev_suite/method_tracer/tracer.rb
114
148
  - lib/dev_suite/performance.rb
115
149
  - lib/dev_suite/performance/analyzer.rb
116
150
  - lib/dev_suite/performance/config.rb
@@ -132,6 +166,26 @@ files:
132
166
  - lib/dev_suite/performance/reporter/helpers/table_builder.rb
133
167
  - lib/dev_suite/performance/reporter/reporter.rb
134
168
  - lib/dev_suite/performance/reporter/simple.rb
169
+ - lib/dev_suite/request_builder.rb
170
+ - lib/dev_suite/request_builder/builder.rb
171
+ - lib/dev_suite/request_builder/builder/base.rb
172
+ - lib/dev_suite/request_builder/builder/builder.rb
173
+ - lib/dev_suite/request_builder/builder/http.rb
174
+ - lib/dev_suite/request_builder/config.rb
175
+ - lib/dev_suite/request_builder/config/config.rb
176
+ - lib/dev_suite/request_builder/config/configuration.rb
177
+ - lib/dev_suite/request_builder/formatter.rb
178
+ - lib/dev_suite/request_builder/formatter/base.rb
179
+ - lib/dev_suite/request_builder/formatter/formatter.rb
180
+ - lib/dev_suite/request_builder/formatter/graphql.rb
181
+ - lib/dev_suite/request_builder/request_builder.rb
182
+ - lib/dev_suite/request_builder/tool.rb
183
+ - lib/dev_suite/request_builder/tool/base.rb
184
+ - lib/dev_suite/request_builder/tool/curl.rb
185
+ - lib/dev_suite/request_builder/tool/tool.rb
186
+ - lib/dev_suite/request_builder/tool/validator.rb
187
+ - lib/dev_suite/request_builder/tool/validator/curl.rb
188
+ - lib/dev_suite/request_builder/tool/validator/validator.rb
135
189
  - lib/dev_suite/request_logger.rb
136
190
  - lib/dev_suite/request_logger/adapter.rb
137
191
  - lib/dev_suite/request_logger/adapter/adapter.rb
@@ -172,8 +226,12 @@ files:
172
226
  - lib/dev_suite/utils/construct/component.rb
173
227
  - lib/dev_suite/utils/construct/component/base.rb
174
228
  - lib/dev_suite/utils/construct/component/component.rb
175
- - lib/dev_suite/utils/construct/component/initializer.rb
176
229
  - lib/dev_suite/utils/construct/component/manager.rb
230
+ - lib/dev_suite/utils/construct/component/validator.rb
231
+ - lib/dev_suite/utils/construct/component/validator/base.rb
232
+ - lib/dev_suite/utils/construct/component/validator/validation_error.rb
233
+ - lib/dev_suite/utils/construct/component/validator/validation_rule.rb
234
+ - lib/dev_suite/utils/construct/component/validator/validator.rb
177
235
  - lib/dev_suite/utils/construct/config.rb
178
236
  - lib/dev_suite/utils/construct/config/attribute.rb
179
237
  - lib/dev_suite/utils/construct/config/attribute/attr_definition.rb
@@ -195,6 +253,13 @@ files:
195
253
  - lib/dev_suite/utils/construct/config/settings/manager.rb
196
254
  - lib/dev_suite/utils/construct/config/settings/settings.rb
197
255
  - lib/dev_suite/utils/construct/construct.rb
256
+ - lib/dev_suite/utils/data.rb
257
+ - lib/dev_suite/utils/data/base_operations.rb
258
+ - lib/dev_suite/utils/data/data.rb
259
+ - lib/dev_suite/utils/data/path_access.rb
260
+ - lib/dev_suite/utils/data/search_filter.rb
261
+ - lib/dev_suite/utils/data/serialization.rb
262
+ - lib/dev_suite/utils/data/transformations.rb
198
263
  - lib/dev_suite/utils/dependency_loader.rb
199
264
  - lib/dev_suite/utils/emoji.rb
200
265
  - lib/dev_suite/utils/error_handler.rb
@@ -211,11 +276,32 @@ files:
211
276
  - lib/dev_suite/utils/file_loader/loader/yaml.rb
212
277
  - lib/dev_suite/utils/file_loader/loader_manager.rb
213
278
  - lib/dev_suite/utils/file_loader/loader_registry.rb
279
+ - lib/dev_suite/utils/file_writer.rb
280
+ - lib/dev_suite/utils/file_writer/atomic_writer.rb
281
+ - lib/dev_suite/utils/file_writer/backup_manager.rb
282
+ - lib/dev_suite/utils/file_writer/file_writer.rb
283
+ - lib/dev_suite/utils/file_writer/writer.rb
284
+ - lib/dev_suite/utils/file_writer/writer/base.rb
285
+ - lib/dev_suite/utils/file_writer/writer/json.rb
286
+ - lib/dev_suite/utils/file_writer/writer/text.rb
287
+ - lib/dev_suite/utils/file_writer/writer/writer.rb
288
+ - lib/dev_suite/utils/file_writer/writer/yaml.rb
289
+ - lib/dev_suite/utils/file_writer/writer_manager.rb
214
290
  - lib/dev_suite/utils/logger.rb
215
291
  - lib/dev_suite/utils/path_matcher.rb
216
292
  - lib/dev_suite/utils/path_matcher/matcher.rb
217
293
  - lib/dev_suite/utils/path_matcher/path_matcher.rb
218
294
  - lib/dev_suite/utils/path_matcher/pattern.rb
295
+ - lib/dev_suite/utils/store.rb
296
+ - lib/dev_suite/utils/store/config.rb
297
+ - lib/dev_suite/utils/store/config/config.rb
298
+ - lib/dev_suite/utils/store/config/configuration.rb
299
+ - lib/dev_suite/utils/store/driver.rb
300
+ - lib/dev_suite/utils/store/driver/base.rb
301
+ - lib/dev_suite/utils/store/driver/driver.rb
302
+ - lib/dev_suite/utils/store/driver/file.rb
303
+ - lib/dev_suite/utils/store/driver/memory.rb
304
+ - lib/dev_suite/utils/store/store.rb
219
305
  - lib/dev_suite/utils/table.rb
220
306
  - lib/dev_suite/utils/table/column.rb
221
307
  - lib/dev_suite/utils/table/config.rb
@@ -232,7 +318,19 @@ files:
232
318
  - lib/dev_suite/utils/table/row.rb
233
319
  - lib/dev_suite/utils/table/table.rb
234
320
  - lib/dev_suite/utils/utils.rb
321
+ - lib/dev_suite/utils/warning_handler.rb
235
322
  - lib/dev_suite/version.rb
323
+ - lib/dev_suite/workflow.rb
324
+ - lib/dev_suite/workflow/engine.rb
325
+ - lib/dev_suite/workflow/step.rb
326
+ - lib/dev_suite/workflow/step/base.rb
327
+ - lib/dev_suite/workflow/step/composite.rb
328
+ - lib/dev_suite/workflow/step/conditional.rb
329
+ - lib/dev_suite/workflow/step/loop.rb
330
+ - lib/dev_suite/workflow/step/parallel.rb
331
+ - lib/dev_suite/workflow/step/step.rb
332
+ - lib/dev_suite/workflow/step_context.rb
333
+ - lib/dev_suite/workflow/workflow.rb
236
334
  homepage: https://patrick204nqh.github.io
237
335
  licenses:
238
336
  - MIT
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DevSuite
4
- module Utils
5
- module Construct
6
- module Component
7
- module Initializer
8
- extend self
9
-
10
- def define_constants(base)
11
- structure_module = ensure_structure_module(base)
12
- define_structure_component(structure_module)
13
- end
14
-
15
- private
16
-
17
- def ensure_structure_module(base)
18
- base.const_defined?(:Structure) ? base.const_get(:Structure) : base.const_set(:Structure, Module.new)
19
- end
20
-
21
- def define_structure_component(structure_module)
22
- structure_module.const_set(:Component, Base) unless structure_module.const_defined?(:Component)
23
- end
24
- end
25
- end
26
- end
27
- end
28
- end