dev_suite 0.2.5 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -5
- data/.vscode/extensions.json +8 -0
- data/.vscode/launch.json +39 -0
- data/.vscode/settings.json +28 -0
- data/Gemfile +4 -1
- data/Gemfile.lock +28 -2
- data/README.md +39 -31
- data/bin/rspec +27 -0
- data/lib/dev_suite/directory_tree/builder/base.rb +1 -1
- data/lib/dev_suite/directory_tree/builder/builder.rb +13 -0
- data/lib/dev_suite/directory_tree/builder.rb +1 -12
- data/lib/dev_suite/directory_tree/config/config.rb +1 -1
- data/lib/dev_suite/directory_tree/config/configuration.rb +18 -5
- data/lib/dev_suite/directory_tree/directory_tree.rb +0 -2
- data/lib/dev_suite/directory_tree/node/node.rb +12 -0
- data/lib/dev_suite/directory_tree/node.rb +1 -4
- data/lib/dev_suite/directory_tree/renderer/base.rb +1 -1
- data/lib/dev_suite/directory_tree/renderer/renderer.rb +14 -0
- data/lib/dev_suite/directory_tree/renderer.rb +1 -13
- data/lib/dev_suite/directory_tree/visualizer/base.rb +1 -1
- data/lib/dev_suite/directory_tree/visualizer/visualizer.rb +16 -0
- data/lib/dev_suite/directory_tree/visualizer.rb +1 -15
- data/lib/dev_suite/performance/config/config.rb +1 -1
- data/lib/dev_suite/performance/config/configuration.rb +3 -3
- data/lib/dev_suite/performance/data/data.rb +9 -0
- data/lib/dev_suite/performance/data.rb +1 -1
- data/lib/dev_suite/performance/profiler/base.rb +1 -1
- data/lib/dev_suite/performance/profiler/profiler.rb +16 -0
- data/lib/dev_suite/performance/profiler.rb +1 -20
- data/lib/dev_suite/performance/profiler_manager.rb +1 -0
- data/lib/dev_suite/performance/reporter/base.rb +1 -1
- data/lib/dev_suite/performance/reporter/reporter.rb +15 -0
- data/lib/dev_suite/performance/reporter.rb +1 -14
- data/lib/dev_suite/request_logger/adapter/adapter.rb +16 -12
- data/lib/dev_suite/request_logger/adapter/base.rb +1 -1
- data/lib/dev_suite/request_logger/adapter/faraday.rb +37 -0
- data/lib/dev_suite/request_logger/adapter/middleware/faraday.rb +22 -0
- data/lib/dev_suite/request_logger/adapter/net_http.rb +1 -0
- data/lib/dev_suite/request_logger/adapter.rb +1 -1
- data/lib/dev_suite/request_logger/config/config.rb +1 -1
- data/lib/dev_suite/request_logger/config/configuration.rb +2 -2
- data/lib/dev_suite/request_logger/extractor/base.rb +17 -0
- data/lib/dev_suite/request_logger/extractor/extractor.rb +22 -0
- data/lib/dev_suite/request_logger/extractor/faraday.rb +37 -0
- data/lib/dev_suite/request_logger/extractor/net_http.rb +36 -0
- data/lib/dev_suite/request_logger/extractor.rb +9 -0
- data/lib/dev_suite/request_logger/logger.rb +22 -28
- data/lib/dev_suite/request_logger/request.rb +19 -0
- data/lib/dev_suite/request_logger/request_logger.rb +3 -0
- data/lib/dev_suite/request_logger/response.rb +28 -0
- data/lib/dev_suite/utils/color/config/config.rb +1 -1
- data/lib/dev_suite/utils/color/config/configuration.rb +3 -3
- data/lib/dev_suite/utils/color/palette/base.rb +1 -14
- data/lib/dev_suite/utils/color/palette/palette.rb +16 -0
- data/lib/dev_suite/utils/color/palette.rb +1 -13
- data/lib/dev_suite/utils/color/strategy/base.rb +1 -1
- data/lib/dev_suite/utils/color/strategy/strategy.rb +20 -0
- data/lib/dev_suite/utils/color/strategy.rb +1 -19
- data/lib/dev_suite/utils/construct/component/base.rb +30 -0
- data/lib/dev_suite/utils/construct/component/component.rb +12 -0
- data/lib/dev_suite/utils/construct/component/initializer.rb +28 -0
- data/lib/dev_suite/utils/construct/component/manager.rb +57 -0
- data/lib/dev_suite/utils/construct/{config/configuration.rb → component.rb} +2 -4
- data/lib/dev_suite/utils/construct/config/attribute/attr_definition.rb +76 -0
- data/lib/dev_suite/utils/construct/config/attribute/attr_initialization.rb +22 -0
- data/lib/dev_suite/utils/construct/config/attribute/attr_resolving.rb +80 -0
- data/lib/dev_suite/utils/construct/config/attribute/attribute.rb +12 -3
- data/lib/dev_suite/utils/construct/config/base.rb +7 -2
- data/lib/dev_suite/utils/construct/config/config.rb +2 -10
- data/lib/dev_suite/utils/construct/config/dependency_handler.rb +56 -0
- data/lib/dev_suite/utils/construct/config/hook/hook.rb +10 -1
- data/lib/dev_suite/utils/construct/config/hook/hook_registry.rb +24 -0
- data/lib/dev_suite/utils/construct/config/hook/hook_runner.rb +20 -0
- data/lib/dev_suite/utils/construct/config/manager.rb +25 -17
- data/lib/dev_suite/utils/construct/construct.rb +1 -0
- data/lib/dev_suite/utils/dependency_loader.rb +71 -0
- data/lib/dev_suite/utils/file_loader/config/config.rb +1 -1
- data/lib/dev_suite/utils/file_loader/config/configuration.rb +1 -1
- data/lib/dev_suite/utils/file_loader/loader/base.rb +1 -1
- data/lib/dev_suite/utils/file_loader/loader/loader.rb +41 -0
- data/lib/dev_suite/utils/file_loader/loader.rb +2 -30
- data/lib/dev_suite/utils/table/config/config.rb +1 -1
- data/lib/dev_suite/utils/table/config/configuration.rb +2 -2
- data/lib/dev_suite/utils/table/formatter/formatter.rb +12 -0
- data/lib/dev_suite/utils/table/formatter.rb +1 -2
- data/lib/dev_suite/utils/table/renderer/base.rb +1 -1
- data/lib/dev_suite/utils/table/renderer/renderer.rb +16 -0
- data/lib/dev_suite/utils/table/renderer.rb +1 -13
- data/lib/dev_suite/utils/utils.rb +1 -0
- data/lib/dev_suite/version.rb +3 -1
- metadata +39 -6
- data/lib/dev_suite/utils/construct/config/attribute/manager.rb +0 -63
- data/lib/dev_suite/utils/construct/config/attribute/resolver.rb +0 -31
- data/lib/dev_suite/utils/construct/config/initializer.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a7188e92386a13da83abc637b7446d68c485eff8e6e2198a53f88360ac13f02
|
4
|
+
data.tar.gz: f76c576284ba7b90bc671a389cd6e43065079f04ae19567b0e633a147e2b2276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b565a159f2aee25115301ae629dcd2e44e844005586c2505e92cd18f75f9845a856c16f8db1c5a309eb249f645ba1e90b6c36ca4e0958f6106f39d0d86f7434a
|
7
|
+
data.tar.gz: 7a34933bf806f8e3fb09351b200698da8d6f5568fefc3054f7ba0591c939dc264b9962c77cd56b6f01e5304b2bb60e5301885f33f34b05bebd54858046cb1e73
|
data/.rubocop.yml
CHANGED
@@ -5,13 +5,12 @@ AllCops:
|
|
5
5
|
NewCops: enable
|
6
6
|
TargetRubyVersion: 2.7
|
7
7
|
Exclude:
|
8
|
+
- '.git/**/*'
|
8
9
|
- 'bin/**/*'
|
9
|
-
- 'db/schema.rb'
|
10
10
|
- 'node_modules/**/*'
|
11
|
-
- '
|
12
|
-
- '
|
13
|
-
- '
|
14
|
-
- 'lib/dev_suite/version.rb'
|
11
|
+
- 'coverage/**/*'
|
12
|
+
- 'tmp/**/*'
|
13
|
+
- 'log/**/*'
|
15
14
|
|
16
15
|
Metrics/LineLength:
|
17
16
|
Max: 120
|
data/.vscode/launch.json
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
{
|
2
|
+
"version": "0.2.0",
|
3
|
+
"configurations": [
|
4
|
+
{
|
5
|
+
"name": "Debug all tests",
|
6
|
+
"type": "rdbg",
|
7
|
+
"request": "launch",
|
8
|
+
"useBundler": true,
|
9
|
+
"script": "${workspaceFolder}/bin/rspec",
|
10
|
+
"args": [
|
11
|
+
"--color",
|
12
|
+
"--require",
|
13
|
+
"rspec",
|
14
|
+
"--format",
|
15
|
+
"progress",
|
16
|
+
"${workspaceFolder}/spec"
|
17
|
+
],
|
18
|
+
"useTerminal": false,
|
19
|
+
"env": { "DEBUG": "true" }
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"name": "Debug current line",
|
23
|
+
"type": "rdbg",
|
24
|
+
"request": "launch",
|
25
|
+
"useBundler": true,
|
26
|
+
"script": "${workspaceFolder}/bin/rspec",
|
27
|
+
"args": [
|
28
|
+
"--color",
|
29
|
+
"--require",
|
30
|
+
"rspec",
|
31
|
+
"--format",
|
32
|
+
"progress",
|
33
|
+
"${file}:${lineNumber}"
|
34
|
+
],
|
35
|
+
"useTerminal": false,
|
36
|
+
"env": { "DEBUG": "true" }
|
37
|
+
}
|
38
|
+
]
|
39
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"[ruby]": {
|
3
|
+
"editor.defaultFormatter": "Shopify.ruby-lsp", // Use the Ruby LSP as the default formatter
|
4
|
+
"editor.formatOnSave": true, // Format files automatically when saving
|
5
|
+
"editor.tabSize": 2, // Use 2 spaces for indentation
|
6
|
+
"editor.insertSpaces": true, // Use spaces and not tabs for indentation
|
7
|
+
"editor.semanticHighlighting.enabled": true, // Enable semantic highlighting
|
8
|
+
"editor.formatOnType": true // Enable formatting while typing
|
9
|
+
},
|
10
|
+
"rubyLsp.enabledFeatures": {
|
11
|
+
"codeActions": true,
|
12
|
+
"diagnostics": true,
|
13
|
+
"documentHighlights": true,
|
14
|
+
"documentLink": true,
|
15
|
+
"documentSymbols": true,
|
16
|
+
"foldingRanges": true,
|
17
|
+
"formatting": true,
|
18
|
+
"hover": true,
|
19
|
+
"inlayHint": true,
|
20
|
+
"onTypeFormatting": true,
|
21
|
+
"selectionRanges": true,
|
22
|
+
"semanticHighlighting": true,
|
23
|
+
"completion": true,
|
24
|
+
"codeLens": true
|
25
|
+
},
|
26
|
+
"rubyLsp.formatter": "rubocop", // Use RuboCop for formatting within Ruby LSP
|
27
|
+
"ruby.rubocop.configFilePath": ".rubocop.yml" // Use the .rubocop.yml file in the root of the project
|
28
|
+
}
|
data/Gemfile
CHANGED
@@ -5,15 +5,18 @@ source "https://rubygems.org"
|
|
5
5
|
# Use the gemspec method to include dependencies specified in the gemspec file
|
6
6
|
gemspec
|
7
7
|
|
8
|
+
# Additional runtime dependencies
|
9
|
+
gem "faraday", "~> 1.4"
|
10
|
+
|
8
11
|
# Additional development tools not required as part of the gem's runtime
|
9
12
|
group :development, :test do
|
10
13
|
gem "rspec", "~> 3.9"
|
11
14
|
gem "simplecov", "~> 0.21"
|
12
15
|
gem "rake", "~> 13.0"
|
13
|
-
gem "pry", "~> 0.14"
|
14
16
|
end
|
15
17
|
|
16
18
|
group :development do
|
19
|
+
gem "pry", "~> 0.14"
|
17
20
|
gem "rubocop", "~> 1.65", require: false
|
18
21
|
gem "rubocop-shopify", "~> 2.15", require: false
|
19
22
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dev_suite (0.2.
|
4
|
+
dev_suite (0.2.7)
|
5
5
|
benchmark (~> 0.1)
|
6
6
|
get_process_mem (~> 1.0)
|
7
7
|
thor (~> 1.1)
|
@@ -15,6 +15,29 @@ GEM
|
|
15
15
|
coderay (1.1.3)
|
16
16
|
diff-lcs (1.5.1)
|
17
17
|
docile (1.4.1)
|
18
|
+
faraday (1.10.3)
|
19
|
+
faraday-em_http (~> 1.0)
|
20
|
+
faraday-em_synchrony (~> 1.0)
|
21
|
+
faraday-excon (~> 1.1)
|
22
|
+
faraday-httpclient (~> 1.0)
|
23
|
+
faraday-multipart (~> 1.0)
|
24
|
+
faraday-net_http (~> 1.0)
|
25
|
+
faraday-net_http_persistent (~> 1.0)
|
26
|
+
faraday-patron (~> 1.0)
|
27
|
+
faraday-rack (~> 1.0)
|
28
|
+
faraday-retry (~> 1.0)
|
29
|
+
ruby2_keywords (>= 0.0.4)
|
30
|
+
faraday-em_http (1.0.0)
|
31
|
+
faraday-em_synchrony (1.0.0)
|
32
|
+
faraday-excon (1.1.0)
|
33
|
+
faraday-httpclient (1.0.1)
|
34
|
+
faraday-multipart (1.0.4)
|
35
|
+
multipart-post (~> 2)
|
36
|
+
faraday-net_http (1.0.2)
|
37
|
+
faraday-net_http_persistent (1.2.0)
|
38
|
+
faraday-patron (1.0.0)
|
39
|
+
faraday-rack (1.0.0)
|
40
|
+
faraday-retry (1.0.3)
|
18
41
|
ffi (1.17.0)
|
19
42
|
ffi (1.17.0-aarch64-linux-gnu)
|
20
43
|
ffi (1.17.0-aarch64-linux-musl)
|
@@ -32,6 +55,7 @@ GEM
|
|
32
55
|
json (2.7.2)
|
33
56
|
language_server-protocol (3.17.0.3)
|
34
57
|
method_source (1.1.0)
|
58
|
+
multipart-post (2.4.1)
|
35
59
|
parallel (1.25.1)
|
36
60
|
parser (3.3.4.1)
|
37
61
|
ast (~> 2.4.1)
|
@@ -43,7 +67,7 @@ GEM
|
|
43
67
|
rainbow (3.1.1)
|
44
68
|
rake (13.2.1)
|
45
69
|
regexp_parser (2.9.2)
|
46
|
-
rexml (3.3.
|
70
|
+
rexml (3.3.6)
|
47
71
|
strscan
|
48
72
|
rspec (3.13.0)
|
49
73
|
rspec-core (~> 3.13.0)
|
@@ -74,6 +98,7 @@ GEM
|
|
74
98
|
rubocop-shopify (2.15.1)
|
75
99
|
rubocop (~> 1.51)
|
76
100
|
ruby-progressbar (1.13.0)
|
101
|
+
ruby2_keywords (0.0.5)
|
77
102
|
simplecov (0.22.0)
|
78
103
|
docile (~> 1.1)
|
79
104
|
simplecov-html (~> 0.11)
|
@@ -99,6 +124,7 @@ PLATFORMS
|
|
99
124
|
|
100
125
|
DEPENDENCIES
|
101
126
|
dev_suite!
|
127
|
+
faraday (~> 1.4)
|
102
128
|
pry (~> 0.14)
|
103
129
|
rake (~> 13.0)
|
104
130
|
rspec (~> 3.9)
|
data/README.md
CHANGED
@@ -57,15 +57,13 @@ DevSuite also provides a command-line interface for various utilities. Below are
|
|
57
57
|
## Features Overview
|
58
58
|
|
59
59
|
### Performance Analysis
|
60
|
+
Analyze the performance of Ruby code blocks, capturing metrics like execution time and memory usage.
|
61
|
+
|
60
62
|
<details>
|
61
63
|
<summary>Show more</summary>
|
62
64
|
|
63
|
-
**Purpose**: Quickly analyze the performance of Ruby code blocks, capturing metrics like execution time and memory usage.
|
64
|
-
|
65
65
|
**How to Use**:
|
66
66
|
```ruby
|
67
|
-
require 'dev_suite'
|
68
|
-
|
69
67
|
DevSuite::Performance.analyze(description: "Example Analysis") do
|
70
68
|
sum = 0
|
71
69
|
1_000_000.times { |i| sum += i }
|
@@ -88,15 +86,13 @@ DevSuite also provides a command-line interface for various utilities. Below are
|
|
88
86
|
</details>
|
89
87
|
|
90
88
|
### Directory Tree Visualization
|
89
|
+
Visualize the file structure of directories and subdirectories to better understand project organization.
|
90
|
+
|
91
91
|
<details>
|
92
92
|
<summary>Show more</summary>
|
93
93
|
|
94
|
-
**Purpose**: Visualize the file structure of directories and subdirectories to better understand project organization.
|
95
|
-
|
96
94
|
**How to Use**:
|
97
95
|
```ruby
|
98
|
-
require 'dev_suite'
|
99
|
-
|
100
96
|
# Define the directory path
|
101
97
|
base_path = "/path/to/your/directory"
|
102
98
|
|
@@ -154,15 +150,13 @@ DevSuite also provides a command-line interface for various utilities. Below are
|
|
154
150
|
</details>
|
155
151
|
|
156
152
|
### Request Logging
|
153
|
+
Log detailed HTTP requests and responses across different adapters like Net::HTTP and Faraday for debugging and monitoring
|
154
|
+
|
157
155
|
<details>
|
158
156
|
<summary>Show more</summary>
|
159
157
|
|
160
|
-
**Purpose**: The `RequestLogger` feature enables detailed logging of HTTP requests and responses across different adapters (e.g., `Net::HTTP`, `Faraday`). This can be useful for debugging, monitoring, and auditing API interactions.
|
161
|
-
|
162
158
|
**How to Use**:
|
163
159
|
```ruby
|
164
|
-
require 'dev_suite'
|
165
|
-
|
166
160
|
DevSuite::RequestLogger.with_logging do
|
167
161
|
# Make an HTTP request using Net::HTTP
|
168
162
|
uri = URI('https://jsonplaceholder.typicode.com/posts')
|
@@ -173,36 +167,50 @@ DevSuite also provides a command-line interface for various utilities. Below are
|
|
173
167
|
**Configuration Guide**:
|
174
168
|
Customize the request logging behavior by setting configuration options:
|
175
169
|
```ruby
|
176
|
-
DevSuite::RequestLogger.configure do |config|
|
170
|
+
DevSuite::RequestLogger::Config.configure do |config|
|
177
171
|
config.adapters = [:net_http]
|
178
|
-
|
172
|
+
config.settings.set(:log_level, :debug)
|
173
|
+
config.settings.set(:log_headers, true)
|
174
|
+
config.settings.set(:log_cookies, true)
|
175
|
+
config.settings.set(:log_body, true)
|
179
176
|
end
|
180
177
|
```
|
181
178
|
|
182
179
|
**Configuration Options**:
|
183
180
|
|
184
|
-
Below is a table describing the
|
181
|
+
Below is a table describing the general configuration options available:
|
185
182
|
|
186
|
-
| Setting | Description
|
187
|
-
|
188
|
-
| `:adapters`
|
189
|
-
<!-- | `:log_level` | Set the logging level (e.g., info, debug). | `:info`, `:debug`, `:warn`, `:error` |
|
190
|
-
| `:log_response` | Enable or disable response logging. | `true`, `false` |
|
191
|
-
| `:log_emoji` | Customize emojis for request and response logs. | `{ request: :globe, response: :envelope }` | -->
|
183
|
+
| Setting | Description | Default Value | Example Values |
|
184
|
+
|----------------|-------------------------------------------------------|---------------|------------------------------------|
|
185
|
+
| `:adapters` | List of adapters for which logging is enabled. | `[:net_http]` | `[:net_http, :faraday]` |
|
192
186
|
|
193
|
-
**
|
194
|
-
|
195
|
-
The `
|
196
|
-
|
197
|
-
|
|
198
|
-
|
199
|
-
| `
|
200
|
-
|
187
|
+
**Settings Options**:
|
188
|
+
|
189
|
+
The `settings` key allows you to customize various logging behaviors. Below is a table describing these settings:
|
190
|
+
|
191
|
+
| Setting | Description | Default Value | Example Values |
|
192
|
+
|----------------|-------------------------------------------------------|---------------|------------------------------------|
|
193
|
+
| `:log_level` | Set the logging level. | `:debug` | `:info`, `:debug`, `:warn`, `:error` |
|
194
|
+
| `:log_headers` | Enable or disable logging of HTTP headers. | `true` | `true`, `false` |
|
195
|
+
| `:log_cookies` | Enable or disable logging of cookies. | `true` | `true`, `false` |
|
196
|
+
| `:log_body` | Enable or disable logging of HTTP bodies. | `true` | `true`, `false` |
|
201
197
|
|
202
198
|
**Sample Output**:
|
203
199
|
```bash
|
204
|
-
|
205
|
-
|
200
|
+
[DEBUG] 🚀 Net::HTTP Request: GET https://jsonplaceholder.typicode.com/posts
|
201
|
+
[DEBUG] 📄 Headers: {"accept-encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3", "accept"=>"*/*", "user-agent"=>"Ruby", "host"=>"jsonplaceholder.typicode.com"}
|
202
|
+
[DEBUG] 🍪 Cookies: None
|
203
|
+
[DEBUG] ✅ Net::HTTP Response: 200 OK
|
204
|
+
[DEBUG] 📄 Headers: {"date"=>"Wed, 21 Aug 2024 10:33:59 GMT", "content-type"=>"application/json; charset=utf-8", "transfer-encoding"=>"chunked", "connection"=>"keep-alive", "report-to"=>"{\"group\":\"heroku-nel\",\"max_age\":3600,\"endpoints\":[{\"url\":\"https://nel.heroku.com/reports?ts=1723379558&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&s=LYnyHXQQqBH310%2FAbzjH0MN%2BaFoA6Ntqh94a3%2F5J54E%3D\"}]}", "reporting-endpoints"=>"heroku-nel=https://nel.heroku.com/reports?ts=1723379558&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&s=LYnyHXQQqBH310%2FAbzjH0MN%2BaFoA6Ntqh94a3%2F5J54E%3D", "nel"=>"{\"report_to\":\"heroku-nel\",\"max_age\":3600,\"success_fraction\":0.005,\"failure_fraction\":0.05,\"response_headers\":[\"Via\"]}", "x-powered-by"=>"Express", "x-ratelimit-limit"=>"1000", "x-ratelimit-remaining"=>"999", "x-ratelimit-reset"=>"1723379596", "vary"=>"Origin, Accept-Encoding", "access-control-allow-credentials"=>"true", "cache-control"=>"max-age=43200", "pragma"=>"no-cache", "expires"=>"-1", "x-content-type-options"=>"nosniff", "etag"=>"W/\"6b80-Ybsq/K6GwwqrYkAsFxqDXGC7DoM\"", "via"=>"1.1 vegur", "cf-cache-status"=>"HIT", "age"=>"4620", "server"=>"cloudflare", "cf-ray"=>"8b69f7d4ad941fa4-HKG", "alt-svc"=>"h3=\":443\"; ma=86400"}
|
205
|
+
[DEBUG] 💻 Response Body: [
|
206
|
+
{
|
207
|
+
"userId": 1,
|
208
|
+
"id": 1,
|
209
|
+
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
|
210
|
+
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
|
211
|
+
},
|
212
|
+
...
|
213
|
+
]
|
206
214
|
```
|
207
215
|
</details>
|
208
216
|
|
data/bin/rspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
12
|
+
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
14
|
+
|
15
|
+
if File.file?(bundle_binstub)
|
16
|
+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
17
|
+
load(bundle_binstub)
|
18
|
+
else
|
19
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
require "rubygems"
|
25
|
+
require "bundler/setup"
|
26
|
+
|
27
|
+
load Gem.bin_path("rspec-core", "rspec")
|
@@ -3,18 +3,7 @@
|
|
3
3
|
module DevSuite
|
4
4
|
module DirectoryTree
|
5
5
|
module Builder
|
6
|
-
require_relative "builder/
|
7
|
-
|
8
|
-
class << self
|
9
|
-
def create(type)
|
10
|
-
case type
|
11
|
-
when :base
|
12
|
-
Base.new
|
13
|
-
else
|
14
|
-
raise ArgumentError, "Unknown renderer type: #{type}"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
6
|
+
require_relative "builder/builder"
|
18
7
|
end
|
19
8
|
end
|
20
9
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module DevSuite
|
4
4
|
module DirectoryTree
|
5
5
|
module Config
|
6
|
-
class Configuration <
|
6
|
+
class Configuration < Utils::Construct::Config::Base
|
7
7
|
set_default_settings(
|
8
8
|
skip_hidden: false,
|
9
9
|
skip_types: [],
|
@@ -11,10 +11,23 @@ module DevSuite
|
|
11
11
|
max_size: 100 * 1024 * 1024, # 100 MB
|
12
12
|
)
|
13
13
|
|
14
|
-
|
15
|
-
config_attr :
|
16
|
-
config_attr :
|
17
|
-
|
14
|
+
config_attr :builder, default_value: :base, type: :symbol, resolver: :resolve_builder
|
15
|
+
config_attr :renderer, default_value: :simple, type: :symbol, resolver: :resolve_renderer
|
16
|
+
config_attr :visualizer, default_value: :tree, type: :symbol, resolver: :resolve_visualizer
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def resolve_builder(value)
|
21
|
+
Builder.build_component(value)
|
22
|
+
end
|
23
|
+
|
24
|
+
def resolve_renderer(value)
|
25
|
+
Renderer.build_component(value)
|
26
|
+
end
|
27
|
+
|
28
|
+
def resolve_visualizer(value)
|
29
|
+
Visualizer.build_component(value)
|
30
|
+
end
|
18
31
|
end
|
19
32
|
end
|
20
33
|
end
|
@@ -3,19 +3,7 @@
|
|
3
3
|
module DevSuite
|
4
4
|
module DirectoryTree
|
5
5
|
module Renderer
|
6
|
-
require_relative "renderer/
|
7
|
-
require_relative "renderer/simple"
|
8
|
-
|
9
|
-
class << self
|
10
|
-
def create(type)
|
11
|
-
case type
|
12
|
-
when :simple
|
13
|
-
Simple.new
|
14
|
-
else
|
15
|
-
raise ArgumentError, "Unknown renderer type: #{type}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
6
|
+
require_relative "renderer/renderer"
|
19
7
|
end
|
20
8
|
end
|
21
9
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DevSuite
|
4
|
+
module DirectoryTree
|
5
|
+
module Visualizer
|
6
|
+
include Utils::Construct::Component::Manager
|
7
|
+
|
8
|
+
require "pathname"
|
9
|
+
|
10
|
+
require_relative "base"
|
11
|
+
require_relative "tree"
|
12
|
+
|
13
|
+
register_component(Tree)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -3,21 +3,7 @@
|
|
3
3
|
module DevSuite
|
4
4
|
module DirectoryTree
|
5
5
|
module Visualizer
|
6
|
-
|
7
|
-
|
8
|
-
require_relative "visualizer/base"
|
9
|
-
require_relative "visualizer/tree"
|
10
|
-
|
11
|
-
class << self
|
12
|
-
def create(type)
|
13
|
-
case type
|
14
|
-
when :tree
|
15
|
-
Tree.new
|
16
|
-
else
|
17
|
-
raise ArgumentError, "Unknown renderer type: #{type}"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
6
|
+
require_relative "visualizer/visualizer"
|
21
7
|
end
|
22
8
|
end
|
23
9
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module DevSuite
|
4
4
|
module Performance
|
5
5
|
module Config
|
6
|
-
class Configuration <
|
6
|
+
class Configuration < Utils::Construct::Config::Base
|
7
7
|
# Define configuration attributes
|
8
8
|
config_attr :profilers,
|
9
9
|
default_value: [:execution_time, :memory],
|
@@ -18,11 +18,11 @@ module DevSuite
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def resolve_profilers(value)
|
21
|
-
Profiler.
|
21
|
+
Profiler.build_components(value)
|
22
22
|
end
|
23
23
|
|
24
24
|
def resolve_reporter(value)
|
25
|
-
Reporter.
|
25
|
+
Reporter.build_component(value)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DevSuite
|
4
|
+
module Performance
|
5
|
+
module Profiler
|
6
|
+
include Utils::Construct::Component::Manager
|
7
|
+
|
8
|
+
require_relative "base"
|
9
|
+
require_relative "execution_time"
|
10
|
+
require_relative "memory"
|
11
|
+
|
12
|
+
register_component(ExecutionTime)
|
13
|
+
register_component(Memory)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|