dev_suite 0.2.4 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -5
  3. data/.vscode/extensions.json +8 -0
  4. data/.vscode/launch.json +39 -0
  5. data/.vscode/settings.json +28 -0
  6. data/Gemfile +6 -1
  7. data/Gemfile.lock +28 -2
  8. data/README.md +69 -8
  9. data/bin/rspec +27 -0
  10. data/dev_suite.gemspec +0 -4
  11. data/lib/dev_suite/cli/commands/base.rb +0 -2
  12. data/lib/dev_suite/cli/commands/tree.rb +3 -3
  13. data/lib/dev_suite/cli/commands/version.rb +1 -1
  14. data/lib/dev_suite/cli/main.rb +1 -1
  15. data/lib/dev_suite/dev_suite.rb +12 -0
  16. data/lib/dev_suite/directory_tree/builder/base.rb +1 -1
  17. data/lib/dev_suite/directory_tree/builder/builder.rb +13 -0
  18. data/lib/dev_suite/directory_tree/builder.rb +1 -12
  19. data/lib/dev_suite/directory_tree/config/config.rb +11 -0
  20. data/lib/dev_suite/directory_tree/config/configuration.rb +34 -0
  21. data/lib/dev_suite/directory_tree/config.rb +2 -36
  22. data/lib/dev_suite/directory_tree/directory_tree.rb +0 -3
  23. data/lib/dev_suite/directory_tree/node/node.rb +12 -0
  24. data/lib/dev_suite/directory_tree/node.rb +1 -4
  25. data/lib/dev_suite/directory_tree/renderer/base.rb +1 -7
  26. data/lib/dev_suite/directory_tree/renderer/renderer.rb +14 -0
  27. data/lib/dev_suite/directory_tree/renderer.rb +1 -13
  28. data/lib/dev_suite/directory_tree/visualizer/base.rb +1 -1
  29. data/lib/dev_suite/directory_tree/visualizer/visualizer.rb +16 -0
  30. data/lib/dev_suite/directory_tree/visualizer.rb +1 -15
  31. data/lib/dev_suite/performance/analyzer.rb +1 -1
  32. data/lib/dev_suite/performance/config/config.rb +11 -0
  33. data/lib/dev_suite/performance/config/configuration.rb +30 -0
  34. data/lib/dev_suite/performance/config.rb +2 -30
  35. data/lib/dev_suite/performance/data/data.rb +9 -0
  36. data/lib/dev_suite/performance/data.rb +1 -1
  37. data/lib/dev_suite/performance/profiler/base.rb +1 -1
  38. data/lib/dev_suite/performance/profiler/profiler.rb +16 -0
  39. data/lib/dev_suite/performance/profiler.rb +1 -20
  40. data/lib/dev_suite/performance/profiler_manager.rb +1 -0
  41. data/lib/dev_suite/performance/{reportor → reporter}/base.rb +2 -2
  42. data/lib/dev_suite/performance/{reportor → reporter}/helpers/stat_mappings.rb +1 -1
  43. data/lib/dev_suite/performance/{reportor → reporter}/helpers/table_builder.rb +1 -1
  44. data/lib/dev_suite/performance/{reportor → reporter}/helpers.rb +1 -1
  45. data/lib/dev_suite/performance/reporter/reporter.rb +15 -0
  46. data/lib/dev_suite/performance/{reportor → reporter}/simple.rb +1 -1
  47. data/lib/dev_suite/performance/reporter.rb +9 -0
  48. data/lib/dev_suite/performance.rb +1 -1
  49. data/lib/dev_suite/request_logger/adapter/adapter.rb +31 -0
  50. data/lib/dev_suite/request_logger/adapter/base.rb +17 -0
  51. data/lib/dev_suite/request_logger/adapter/faraday.rb +37 -0
  52. data/lib/dev_suite/request_logger/adapter/middleware/faraday.rb +22 -0
  53. data/lib/dev_suite/request_logger/adapter/net_http.rb +43 -0
  54. data/lib/dev_suite/request_logger/adapter.rb +9 -0
  55. data/lib/dev_suite/request_logger/config/config.rb +11 -0
  56. data/lib/dev_suite/request_logger/config/configuration.rb +24 -0
  57. data/lib/dev_suite/request_logger/config.rb +9 -0
  58. data/lib/dev_suite/request_logger/extractor/base.rb +17 -0
  59. data/lib/dev_suite/request_logger/extractor/extractor.rb +22 -0
  60. data/lib/dev_suite/request_logger/extractor/faraday.rb +37 -0
  61. data/lib/dev_suite/request_logger/extractor/net_http.rb +36 -0
  62. data/lib/dev_suite/request_logger/extractor.rb +9 -0
  63. data/lib/dev_suite/request_logger/logger.rb +87 -0
  64. data/lib/dev_suite/request_logger/request.rb +19 -0
  65. data/lib/dev_suite/request_logger/request_logger.rb +32 -0
  66. data/lib/dev_suite/request_logger/response.rb +28 -0
  67. data/lib/dev_suite/request_logger.rb +7 -0
  68. data/lib/dev_suite/utils/color/color.rb +12 -0
  69. data/lib/dev_suite/utils/color/config/config.rb +13 -0
  70. data/lib/dev_suite/utils/color/config/configuration.rb +31 -0
  71. data/lib/dev_suite/utils/color/config.rb +2 -31
  72. data/lib/dev_suite/utils/color/palette/base.rb +1 -14
  73. data/lib/dev_suite/utils/color/palette/palette.rb +16 -0
  74. data/lib/dev_suite/utils/color/palette.rb +1 -13
  75. data/lib/dev_suite/utils/color/strategy/base.rb +1 -1
  76. data/lib/dev_suite/utils/color/strategy/strategy.rb +20 -0
  77. data/lib/dev_suite/utils/color/strategy/theme.rb +6 -7
  78. data/lib/dev_suite/utils/color/strategy.rb +1 -21
  79. data/lib/dev_suite/utils/color.rb +1 -4
  80. data/lib/dev_suite/utils/construct/component/base.rb +30 -0
  81. data/lib/dev_suite/utils/construct/component/component.rb +12 -0
  82. data/lib/dev_suite/utils/construct/component/initializer.rb +28 -0
  83. data/lib/dev_suite/utils/construct/component/manager.rb +57 -0
  84. data/lib/dev_suite/utils/construct/component.rb +11 -0
  85. data/lib/dev_suite/utils/construct/config/attribute/attr_definition.rb +76 -0
  86. data/lib/dev_suite/utils/construct/config/attribute/attr_initialization.rb +22 -0
  87. data/lib/dev_suite/utils/construct/config/attribute/attr_resolving.rb +80 -0
  88. data/lib/dev_suite/utils/construct/config/attribute/attribute.rb +24 -0
  89. data/lib/dev_suite/utils/construct/config/attribute/validator.rb +55 -0
  90. data/lib/dev_suite/utils/construct/config/attribute.rb +13 -0
  91. data/lib/dev_suite/utils/construct/config/base.rb +25 -0
  92. data/lib/dev_suite/utils/construct/config/config.rb +16 -0
  93. data/lib/dev_suite/utils/construct/config/dependency_handler.rb +56 -0
  94. data/lib/dev_suite/utils/construct/config/hook/hook.rb +22 -0
  95. data/lib/dev_suite/utils/construct/config/hook/hook_registry.rb +24 -0
  96. data/lib/dev_suite/utils/construct/config/hook/hook_runner.rb +20 -0
  97. data/lib/dev_suite/utils/construct/config/hook/manager.rb +36 -0
  98. data/lib/dev_suite/utils/construct/config/hook.rb +13 -0
  99. data/lib/dev_suite/utils/construct/config/manager.rb +41 -0
  100. data/lib/dev_suite/utils/construct/config/settings/base.rb +59 -0
  101. data/lib/dev_suite/utils/construct/config/settings/manager.rb +38 -0
  102. data/lib/dev_suite/utils/construct/config/settings/settings.rb +14 -0
  103. data/lib/dev_suite/utils/construct/config/settings.rb +13 -0
  104. data/lib/dev_suite/utils/construct/config.rb +11 -0
  105. data/lib/dev_suite/utils/construct/construct.rb +10 -0
  106. data/lib/dev_suite/utils/construct.rb +16 -0
  107. data/lib/dev_suite/utils/dependency_loader.rb +71 -0
  108. data/lib/dev_suite/utils/emoji.rb +71 -0
  109. data/lib/dev_suite/utils/error_handler.rb +24 -0
  110. data/lib/dev_suite/utils/file_loader/config/config.rb +13 -0
  111. data/lib/dev_suite/utils/file_loader/config/configuration.rb +33 -0
  112. data/lib/dev_suite/utils/file_loader/config.rb +11 -0
  113. data/lib/dev_suite/utils/file_loader/file_loader.rb +23 -0
  114. data/lib/dev_suite/utils/file_loader/loader/base.rb +21 -0
  115. data/lib/dev_suite/utils/file_loader/loader/json.rb +21 -0
  116. data/lib/dev_suite/utils/file_loader/loader/loader.rb +41 -0
  117. data/lib/dev_suite/utils/file_loader/loader/text.rb +21 -0
  118. data/lib/dev_suite/utils/file_loader/loader/yaml.rb +38 -0
  119. data/lib/dev_suite/utils/file_loader/loader.rb +13 -0
  120. data/lib/dev_suite/utils/file_loader/loader_manager.rb +34 -0
  121. data/lib/dev_suite/utils/file_loader/loader_registry.rb +36 -0
  122. data/lib/dev_suite/utils/file_loader.rb +9 -0
  123. data/lib/dev_suite/utils/logger.rb +58 -0
  124. data/lib/dev_suite/utils/path_matcher/matcher.rb +31 -0
  125. data/lib/dev_suite/utils/path_matcher/path_matcher.rb +17 -0
  126. data/lib/dev_suite/utils/path_matcher/pattern.rb +35 -0
  127. data/lib/dev_suite/utils/path_matcher.rb +9 -0
  128. data/lib/dev_suite/utils/table/config/config.rb +13 -0
  129. data/lib/dev_suite/utils/table/config/configuration.rb +32 -0
  130. data/lib/dev_suite/utils/table/config.rb +2 -23
  131. data/lib/dev_suite/utils/table/formatter/formatter.rb +12 -0
  132. data/lib/dev_suite/utils/table/formatter.rb +1 -2
  133. data/lib/dev_suite/utils/table/renderer/base.rb +1 -7
  134. data/lib/dev_suite/utils/table/renderer/renderer.rb +16 -0
  135. data/lib/dev_suite/utils/table/renderer/simple.rb +9 -5
  136. data/lib/dev_suite/utils/table/renderer.rb +1 -13
  137. data/lib/dev_suite/utils/table/table.rb +6 -0
  138. data/lib/dev_suite/utils/table.rb +0 -6
  139. data/lib/dev_suite/utils/utils.rb +15 -0
  140. data/lib/dev_suite/utils.rb +1 -3
  141. data/lib/dev_suite/version.rb +3 -1
  142. data/lib/dev_suite.rb +1 -10
  143. metadata +101 -44
  144. data/lib/dev_suite/directory_tree/settings.rb +0 -18
  145. data/lib/dev_suite/emoji.rb +0 -33
  146. data/lib/dev_suite/error_handler.rb +0 -22
  147. data/lib/dev_suite/logger.rb +0 -56
  148. data/lib/dev_suite/performance/reportor.rb +0 -22
  149. data/lib/dev_suite/utils/config_tools/configuration.rb +0 -134
  150. data/lib/dev_suite/utils/config_tools/settings.rb +0 -67
  151. data/lib/dev_suite/utils/config_tools.rb +0 -10
  152. data/lib/dev_suite/utils/table/settings.rb +0 -34
@@ -4,13 +4,7 @@ module DevSuite
4
4
  module Utils
5
5
  module Table
6
6
  module Renderer
7
- class Base
8
- attr_reader :settings
9
-
10
- def initialize(settings: Settings.new)
11
- @settings = settings
12
- end
13
-
7
+ class Base < Utils::Construct::Component::Base
14
8
  def render(table)
15
9
  raise NotImplementedError, "Render method must be implemented in subclasses"
16
10
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Table
6
+ module Renderer
7
+ include Construct::Component::Manager
8
+
9
+ require_relative "base"
10
+ require_relative "simple"
11
+
12
+ register_component(Simple)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -19,6 +19,10 @@ module DevSuite
19
19
 
20
20
  private
21
21
 
22
+ def settings
23
+ Config.configuration.settings
24
+ end
25
+
22
26
  #
23
27
  # Calculates the widths of the columns
24
28
  #
@@ -45,7 +49,7 @@ module DevSuite
45
49
 
46
50
  total_width = column_widths.sum + column_widths.size * 3 - 1
47
51
  title_str = "| #{table.title.center(total_width - 2)} |"
48
- colorize(title_str, settings.color_for(:title))
52
+ colorize(title_str, settings.get("colors.title"))
49
53
  end
50
54
 
51
55
  def render_header(table, column_widths)
@@ -55,13 +59,13 @@ module DevSuite
55
59
  text_align(column.name, column_widths[index])
56
60
  end
57
61
  header_str = "| #{header.join(" | ")} |"
58
- colorize(header_str, settings.color_for(:column))
62
+ colorize(header_str, settings.get("colors.column"))
59
63
  end
60
64
 
61
65
  def render_separator(column_widths)
62
66
  separator = column_widths.map { |width| "-" * width }.join("-+-")
63
67
  separator_str = "+-#{separator}-+"
64
- colorize(separator_str, settings.color_for(:border))
68
+ colorize(separator_str, settings.get("colors.border"))
65
69
  end
66
70
 
67
71
  def render_rows(table, column_widths)
@@ -69,7 +73,7 @@ module DevSuite
69
73
  render_row(row, column_widths)
70
74
  end
71
75
  cells_str = cells.join("\n")
72
- colorize(cells_str, settings.color_for(:row))
76
+ colorize(cells_str, settings.get("colors.row"))
73
77
  end
74
78
 
75
79
  def render_row(row, column_widths)
@@ -77,7 +81,7 @@ module DevSuite
77
81
  text_align(cell.to_s, column_widths[index])
78
82
  end
79
83
  cell_str = "| #{cell.join(" | ")} |"
80
- colorize(cell_str, settings.color_for(:row))
84
+ colorize(cell_str, settings.get("colors.row"))
81
85
  end
82
86
  end
83
87
  end
@@ -4,19 +4,7 @@ module DevSuite
4
4
  module Utils
5
5
  module Table
6
6
  module Renderer
7
- require_relative "renderer/base"
8
- require_relative "renderer/simple"
9
-
10
- class << self
11
- def create(type, settings: Settings.new)
12
- case type
13
- when :simple
14
- Simple.new(settings: settings)
15
- else
16
- raise ArgumentError, "Unknown renderer type: #{type}"
17
- end
18
- end
19
- end
7
+ require_relative "renderer/renderer"
20
8
  end
21
9
  end
22
10
  end
@@ -3,6 +3,12 @@
3
3
  module DevSuite
4
4
  module Utils
5
5
  module Table
6
+ require_relative "column"
7
+ require_relative "row"
8
+ require_relative "config"
9
+ require_relative "formatter"
10
+ require_relative "renderer"
11
+
6
12
  class Table
7
13
  attr_accessor :title
8
14
  attr_reader :columns, :rows
@@ -4,12 +4,6 @@ module DevSuite
4
4
  module Utils
5
5
  module Table
6
6
  require_relative "table/table"
7
- require_relative "table/column"
8
- require_relative "table/row"
9
- require_relative "table/config"
10
- require_relative "table/settings"
11
- require_relative "table/formatter"
12
- require_relative "table/renderer"
13
7
  end
14
8
  end
15
9
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ require_relative "emoji"
6
+ require_relative "logger"
7
+ require_relative "error_handler"
8
+ require_relative "dependency_loader"
9
+ require_relative "construct"
10
+ require_relative "color"
11
+ require_relative "table"
12
+ require_relative "file_loader"
13
+ require_relative "path_matcher"
14
+ end
15
+ end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module DevSuite
4
4
  module Utils
5
- require_relative "utils/config_tools"
6
- require_relative "utils/color"
7
- require_relative "utils/table"
5
+ require_relative "utils/utils"
8
6
  end
9
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DevSuite
2
- VERSION = "0.2.4"
4
+ VERSION = "0.2.7"
3
5
  end
data/lib/dev_suite.rb CHANGED
@@ -1,14 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DevSuite
4
- require_relative "dev_suite/version"
5
- require_relative "dev_suite/emoji"
6
- require_relative "dev_suite/logger"
7
- require_relative "dev_suite/error_handler"
8
- require_relative "dev_suite/utils"
9
- require_relative "dev_suite/cli"
10
- require_relative "dev_suite/performance"
11
- require_relative "dev_suite/directory_tree"
12
-
13
- class Error < StandardError; end
4
+ require_relative "dev_suite/dev_suite"
14
5
  end
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.4
4
+ version: 0.2.7
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-15 00:00:00.000000000 Z
11
+ date: 2024-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark
@@ -52,34 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.1'
55
- - !ruby/object:Gem::Dependency
56
- name: rspec
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '3.9'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '3.9'
69
- - !ruby/object:Gem::Dependency
70
- name: simplecov
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0.21'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0.21'
83
55
  description: This gem provides a suite of utilities for developers to enhance their
84
56
  productivity.
85
57
  email:
@@ -95,6 +67,9 @@ files:
95
67
  - ".rubocop.yml"
96
68
  - ".tool-versions"
97
69
  - ".travis.yml"
70
+ - ".vscode/extensions.json"
71
+ - ".vscode/launch.json"
72
+ - ".vscode/settings.json"
98
73
  - CODE_OF_CONDUCT.md
99
74
  - Gemfile
100
75
  - Gemfile.lock
@@ -102,6 +77,7 @@ files:
102
77
  - README.md
103
78
  - Rakefile
104
79
  - bin/console
80
+ - bin/rspec
105
81
  - bin/setup
106
82
  - dev_suite.gemspec
107
83
  - exe/devsuite
@@ -112,69 +88,150 @@ files:
112
88
  - lib/dev_suite/cli/commands/tree.rb
113
89
  - lib/dev_suite/cli/commands/version.rb
114
90
  - lib/dev_suite/cli/main.rb
91
+ - lib/dev_suite/dev_suite.rb
115
92
  - lib/dev_suite/directory_tree.rb
116
93
  - lib/dev_suite/directory_tree/builder.rb
117
94
  - lib/dev_suite/directory_tree/builder/base.rb
95
+ - lib/dev_suite/directory_tree/builder/builder.rb
118
96
  - lib/dev_suite/directory_tree/config.rb
97
+ - lib/dev_suite/directory_tree/config/config.rb
98
+ - lib/dev_suite/directory_tree/config/configuration.rb
119
99
  - lib/dev_suite/directory_tree/directory_tree.rb
120
100
  - lib/dev_suite/directory_tree/node.rb
121
101
  - lib/dev_suite/directory_tree/node/base.rb
122
102
  - lib/dev_suite/directory_tree/node/directory.rb
123
103
  - lib/dev_suite/directory_tree/node/file.rb
104
+ - lib/dev_suite/directory_tree/node/node.rb
124
105
  - lib/dev_suite/directory_tree/node/permission_denied.rb
125
106
  - lib/dev_suite/directory_tree/renderer.rb
126
107
  - lib/dev_suite/directory_tree/renderer/base.rb
108
+ - lib/dev_suite/directory_tree/renderer/renderer.rb
127
109
  - lib/dev_suite/directory_tree/renderer/simple.rb
128
- - lib/dev_suite/directory_tree/settings.rb
129
110
  - lib/dev_suite/directory_tree/visualizer.rb
130
111
  - lib/dev_suite/directory_tree/visualizer/base.rb
131
112
  - lib/dev_suite/directory_tree/visualizer/tree.rb
132
- - lib/dev_suite/emoji.rb
133
- - lib/dev_suite/error_handler.rb
134
- - lib/dev_suite/logger.rb
113
+ - lib/dev_suite/directory_tree/visualizer/visualizer.rb
135
114
  - lib/dev_suite/performance.rb
136
115
  - lib/dev_suite/performance/analyzer.rb
137
116
  - lib/dev_suite/performance/config.rb
117
+ - lib/dev_suite/performance/config/config.rb
118
+ - lib/dev_suite/performance/config/configuration.rb
138
119
  - lib/dev_suite/performance/data.rb
120
+ - lib/dev_suite/performance/data/data.rb
139
121
  - lib/dev_suite/performance/data/memory_usage.rb
140
122
  - lib/dev_suite/performance/profiler.rb
141
123
  - lib/dev_suite/performance/profiler/base.rb
142
124
  - lib/dev_suite/performance/profiler/execution_time.rb
143
125
  - lib/dev_suite/performance/profiler/memory.rb
126
+ - lib/dev_suite/performance/profiler/profiler.rb
144
127
  - lib/dev_suite/performance/profiler_manager.rb
145
- - lib/dev_suite/performance/reportor.rb
146
- - lib/dev_suite/performance/reportor/base.rb
147
- - lib/dev_suite/performance/reportor/helpers.rb
148
- - lib/dev_suite/performance/reportor/helpers/stat_mappings.rb
149
- - lib/dev_suite/performance/reportor/helpers/table_builder.rb
150
- - lib/dev_suite/performance/reportor/simple.rb
128
+ - lib/dev_suite/performance/reporter.rb
129
+ - lib/dev_suite/performance/reporter/base.rb
130
+ - lib/dev_suite/performance/reporter/helpers.rb
131
+ - lib/dev_suite/performance/reporter/helpers/stat_mappings.rb
132
+ - lib/dev_suite/performance/reporter/helpers/table_builder.rb
133
+ - lib/dev_suite/performance/reporter/reporter.rb
134
+ - lib/dev_suite/performance/reporter/simple.rb
135
+ - lib/dev_suite/request_logger.rb
136
+ - lib/dev_suite/request_logger/adapter.rb
137
+ - lib/dev_suite/request_logger/adapter/adapter.rb
138
+ - lib/dev_suite/request_logger/adapter/base.rb
139
+ - lib/dev_suite/request_logger/adapter/faraday.rb
140
+ - lib/dev_suite/request_logger/adapter/middleware/faraday.rb
141
+ - lib/dev_suite/request_logger/adapter/net_http.rb
142
+ - lib/dev_suite/request_logger/config.rb
143
+ - lib/dev_suite/request_logger/config/config.rb
144
+ - lib/dev_suite/request_logger/config/configuration.rb
145
+ - lib/dev_suite/request_logger/extractor.rb
146
+ - lib/dev_suite/request_logger/extractor/base.rb
147
+ - lib/dev_suite/request_logger/extractor/extractor.rb
148
+ - lib/dev_suite/request_logger/extractor/faraday.rb
149
+ - lib/dev_suite/request_logger/extractor/net_http.rb
150
+ - lib/dev_suite/request_logger/logger.rb
151
+ - lib/dev_suite/request_logger/request.rb
152
+ - lib/dev_suite/request_logger/request_logger.rb
153
+ - lib/dev_suite/request_logger/response.rb
151
154
  - lib/dev_suite/utils.rb
152
155
  - lib/dev_suite/utils/color.rb
156
+ - lib/dev_suite/utils/color/color.rb
153
157
  - lib/dev_suite/utils/color/colorizer.rb
154
158
  - lib/dev_suite/utils/color/config.rb
159
+ - lib/dev_suite/utils/color/config/config.rb
160
+ - lib/dev_suite/utils/color/config/configuration.rb
155
161
  - lib/dev_suite/utils/color/palette.rb
156
162
  - lib/dev_suite/utils/color/palette/base.rb
157
163
  - lib/dev_suite/utils/color/palette/default.rb
164
+ - lib/dev_suite/utils/color/palette/palette.rb
158
165
  - lib/dev_suite/utils/color/strategy.rb
159
166
  - lib/dev_suite/utils/color/strategy/base.rb
160
167
  - lib/dev_suite/utils/color/strategy/basic.rb
161
168
  - lib/dev_suite/utils/color/strategy/rgb.rb
169
+ - lib/dev_suite/utils/color/strategy/strategy.rb
162
170
  - lib/dev_suite/utils/color/strategy/theme.rb
163
- - lib/dev_suite/utils/config_tools.rb
164
- - lib/dev_suite/utils/config_tools/configuration.rb
165
- - lib/dev_suite/utils/config_tools/settings.rb
171
+ - lib/dev_suite/utils/construct.rb
172
+ - lib/dev_suite/utils/construct/component.rb
173
+ - lib/dev_suite/utils/construct/component/base.rb
174
+ - lib/dev_suite/utils/construct/component/component.rb
175
+ - lib/dev_suite/utils/construct/component/initializer.rb
176
+ - lib/dev_suite/utils/construct/component/manager.rb
177
+ - lib/dev_suite/utils/construct/config.rb
178
+ - lib/dev_suite/utils/construct/config/attribute.rb
179
+ - lib/dev_suite/utils/construct/config/attribute/attr_definition.rb
180
+ - lib/dev_suite/utils/construct/config/attribute/attr_initialization.rb
181
+ - lib/dev_suite/utils/construct/config/attribute/attr_resolving.rb
182
+ - lib/dev_suite/utils/construct/config/attribute/attribute.rb
183
+ - lib/dev_suite/utils/construct/config/attribute/validator.rb
184
+ - lib/dev_suite/utils/construct/config/base.rb
185
+ - lib/dev_suite/utils/construct/config/config.rb
186
+ - lib/dev_suite/utils/construct/config/dependency_handler.rb
187
+ - lib/dev_suite/utils/construct/config/hook.rb
188
+ - lib/dev_suite/utils/construct/config/hook/hook.rb
189
+ - lib/dev_suite/utils/construct/config/hook/hook_registry.rb
190
+ - lib/dev_suite/utils/construct/config/hook/hook_runner.rb
191
+ - lib/dev_suite/utils/construct/config/hook/manager.rb
192
+ - lib/dev_suite/utils/construct/config/manager.rb
193
+ - lib/dev_suite/utils/construct/config/settings.rb
194
+ - lib/dev_suite/utils/construct/config/settings/base.rb
195
+ - lib/dev_suite/utils/construct/config/settings/manager.rb
196
+ - lib/dev_suite/utils/construct/config/settings/settings.rb
197
+ - lib/dev_suite/utils/construct/construct.rb
198
+ - lib/dev_suite/utils/dependency_loader.rb
199
+ - lib/dev_suite/utils/emoji.rb
200
+ - lib/dev_suite/utils/error_handler.rb
201
+ - lib/dev_suite/utils/file_loader.rb
202
+ - lib/dev_suite/utils/file_loader/config.rb
203
+ - lib/dev_suite/utils/file_loader/config/config.rb
204
+ - lib/dev_suite/utils/file_loader/config/configuration.rb
205
+ - lib/dev_suite/utils/file_loader/file_loader.rb
206
+ - lib/dev_suite/utils/file_loader/loader.rb
207
+ - lib/dev_suite/utils/file_loader/loader/base.rb
208
+ - lib/dev_suite/utils/file_loader/loader/json.rb
209
+ - lib/dev_suite/utils/file_loader/loader/loader.rb
210
+ - lib/dev_suite/utils/file_loader/loader/text.rb
211
+ - lib/dev_suite/utils/file_loader/loader/yaml.rb
212
+ - lib/dev_suite/utils/file_loader/loader_manager.rb
213
+ - lib/dev_suite/utils/file_loader/loader_registry.rb
214
+ - lib/dev_suite/utils/logger.rb
215
+ - lib/dev_suite/utils/path_matcher.rb
216
+ - lib/dev_suite/utils/path_matcher/matcher.rb
217
+ - lib/dev_suite/utils/path_matcher/path_matcher.rb
218
+ - lib/dev_suite/utils/path_matcher/pattern.rb
166
219
  - lib/dev_suite/utils/table.rb
167
220
  - lib/dev_suite/utils/table/column.rb
168
221
  - lib/dev_suite/utils/table/config.rb
222
+ - lib/dev_suite/utils/table/config/config.rb
223
+ - lib/dev_suite/utils/table/config/configuration.rb
169
224
  - lib/dev_suite/utils/table/formatter.rb
170
225
  - lib/dev_suite/utils/table/formatter/column_width_calculator.rb
226
+ - lib/dev_suite/utils/table/formatter/formatter.rb
171
227
  - lib/dev_suite/utils/table/formatter/text_aligner.rb
172
228
  - lib/dev_suite/utils/table/renderer.rb
173
229
  - lib/dev_suite/utils/table/renderer/base.rb
230
+ - lib/dev_suite/utils/table/renderer/renderer.rb
174
231
  - lib/dev_suite/utils/table/renderer/simple.rb
175
232
  - lib/dev_suite/utils/table/row.rb
176
- - lib/dev_suite/utils/table/settings.rb
177
233
  - lib/dev_suite/utils/table/table.rb
234
+ - lib/dev_suite/utils/utils.rb
178
235
  - lib/dev_suite/version.rb
179
236
  homepage: https://patrick204nqh.github.io
180
237
  licenses:
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DevSuite
4
- module DirectoryTree
5
- class Settings
6
- include Utils::ConfigTools::Settings
7
-
8
- def default_settings
9
- {
10
- skip_hidden: false,
11
- skip_types: [],
12
- max_depth: nil,
13
- max_size: 100 * 1024 * 1024, # 100 MB
14
- }
15
- end
16
- end
17
- end
18
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DevSuite
4
- module Emoji
5
- # A frozen hash that contains all the emojis used in the application.
6
- EMOJIS = {
7
- start: "🚀",
8
- success: "✅",
9
- error: "🚨❌",
10
- retry: "💥",
11
- info: "ℹ️",
12
- warning: "⚠️",
13
- note: "📝", # For notes or annotations
14
- tip: "💡", # For tips or helpful hints
15
- important: "❗", # For important information
16
- caution: "⚠️", # For warnings or cautions
17
- document: "📄", # For representing documents or files
18
- code: "💻", # For code or technical content
19
- update: "🔄", # For updates or changes
20
- bug: "🐞", # For bugs or issues
21
- fix: "🔧", # For fixes or repairs
22
- }.freeze
23
-
24
- class << self
25
- # Returns the emoji corresponding to the given key.
26
- # @param key [Symbol] the key to look up the emoji
27
- # @return [String] the corresponding emoji or an empty string if not found
28
- def get(key)
29
- EMOJIS[key] || ""
30
- end
31
- end
32
- end
33
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DevSuite
4
- module ErrorHandler
5
- extend self # This makes all instance methods behave like class methods
6
-
7
- def handle_error(error)
8
- Logger.log(
9
- "Oops! An error occurred: #{error.message}",
10
- level: :error,
11
- emoji: :error,
12
- )
13
- Logger.log(
14
- "For more information, please refer to the README: " \
15
- "https://github.com/patrick204nqh/dev_suite",
16
- level: :error,
17
- emoji: :document,
18
- )
19
- # exit(1)
20
- end
21
- end
22
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DevSuite
4
- module Logger
5
- LOG_DETAILS = {
6
- info: { prefix: "[INFO]", color: :green },
7
- warn: { prefix: "[WARNING]", color: :yellow },
8
- error: { prefix: "[ERROR]", color: :red },
9
- debug: { prefix: "[DEBUG]", color: :blue },
10
- }.freeze
11
-
12
- class << self
13
- # Logs a message with an optional emoji and specified log level.
14
- #
15
- # @param message [String] The message to log.
16
- # @param level [Symbol] The log level (:info, :warn, :error, :debug).
17
- # @param emoji [String, Symbol] Optional emoji to prepend to the message.
18
- def log(message, level: :info, emoji: nil)
19
- emoji_icon = resolve_emoji(emoji)
20
- formatted_message = format_message("#{emoji_icon} #{message}", level)
21
- output_log(formatted_message)
22
- end
23
-
24
- private
25
-
26
- # Resolves the emoji, either from a symbol or directly as a string.
27
- #
28
- # @param emoji [String, Symbol, nil] The emoji or its symbol key.
29
- # @return [String] The resolved emoji or an empty string if none is provided.
30
- def resolve_emoji(emoji)
31
- return "" unless emoji
32
-
33
- emoji.is_a?(Symbol) ? Emoji.get(emoji) : emoji
34
- end
35
-
36
- # Formats the log message with the appropriate prefix and color.
37
- #
38
- # @param message [String] The message to format.
39
- # @param level [Symbol] The log level (:info, :warn, :error, :debug).
40
- # @return [String] The formatted log message.
41
- def format_message(message, level)
42
- details = LOG_DETAILS[level]
43
- raise ArgumentError, "Invalid log level: #{level}" unless details
44
-
45
- Utils::Color.colorize("#{details[:prefix]} #{message}", color: details[:color])
46
- end
47
-
48
- # Outputs the formatted log message to the console.
49
- #
50
- # @param formatted_message [String] The message to output.
51
- def output_log(formatted_message)
52
- puts formatted_message if formatted_message
53
- end
54
- end
55
- end
56
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DevSuite
4
- module Performance
5
- module Reportor
6
- require_relative "reportor/base"
7
- require_relative "reportor/simple"
8
- require_relative "reportor/helpers"
9
-
10
- class << self
11
- def create(reportor)
12
- case reportor
13
- when :simple
14
- Simple.new
15
- else
16
- raise ArgumentError, "Invalid reportor: #{reportor}"
17
- end
18
- end
19
- end
20
- end
21
- end
22
- end