dev_suite 0.2.3 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +37 -0
- data/Gemfile +13 -6
- data/Gemfile.lock +9 -1
- data/README.md +66 -2
- data/dev_suite.gemspec +1 -0
- data/lib/dev_suite/cli/commands/base.rb +0 -30
- data/lib/dev_suite/cli/commands/tree.rb +29 -8
- data/lib/dev_suite/cli/commands/version.rb +1 -1
- data/lib/dev_suite/cli/main.rb +12 -9
- data/lib/dev_suite/dev_suite.rb +12 -0
- data/lib/dev_suite/directory_tree/config/config.rb +11 -0
- data/lib/dev_suite/directory_tree/config/configuration.rb +21 -0
- data/lib/dev_suite/directory_tree/config.rb +2 -11
- data/lib/dev_suite/directory_tree/directory_tree.rb +20 -0
- data/lib/dev_suite/directory_tree/renderer/base.rb +0 -6
- data/lib/dev_suite/directory_tree/renderer/simple.rb +3 -3
- data/lib/dev_suite/directory_tree/visualizer/base.rb +13 -0
- data/lib/dev_suite/directory_tree/visualizer/tree.rb +50 -0
- data/lib/dev_suite/directory_tree/visualizer.rb +14 -13
- data/lib/dev_suite/directory_tree.rb +1 -8
- data/lib/dev_suite/performance/analyzer.rb +1 -1
- data/lib/dev_suite/performance/config/config.rb +11 -0
- data/lib/dev_suite/performance/config/configuration.rb +30 -0
- data/lib/dev_suite/performance/config.rb +2 -10
- data/lib/dev_suite/performance/{reportor → reporter}/base.rb +1 -1
- data/lib/dev_suite/performance/{reportor → reporter}/helpers/stat_mappings.rb +1 -1
- data/lib/dev_suite/performance/{reportor → reporter}/helpers/table_builder.rb +1 -1
- data/lib/dev_suite/performance/{reportor → reporter}/helpers.rb +1 -1
- data/lib/dev_suite/performance/{reportor → reporter}/simple.rb +1 -1
- data/lib/dev_suite/performance/reporter.rb +22 -0
- data/lib/dev_suite/performance.rb +1 -1
- data/lib/dev_suite/request_logger/adapter/adapter.rb +27 -0
- data/lib/dev_suite/request_logger/adapter/base.rb +17 -0
- data/lib/dev_suite/request_logger/adapter/net_http.rb +42 -0
- data/lib/dev_suite/request_logger/adapter.rb +9 -0
- data/lib/dev_suite/request_logger/config/config.rb +11 -0
- data/lib/dev_suite/request_logger/config/configuration.rb +24 -0
- data/lib/dev_suite/request_logger/config.rb +9 -0
- data/lib/dev_suite/request_logger/logger.rb +93 -0
- data/lib/dev_suite/request_logger/request_logger.rb +29 -0
- data/lib/dev_suite/request_logger.rb +7 -0
- data/lib/dev_suite/utils/color/color.rb +12 -0
- data/lib/dev_suite/utils/color/config/config.rb +13 -0
- data/lib/dev_suite/utils/color/config/configuration.rb +31 -0
- data/lib/dev_suite/utils/color/config.rb +2 -31
- data/lib/dev_suite/utils/color/strategy/theme.rb +6 -7
- data/lib/dev_suite/utils/color/strategy.rb +2 -4
- data/lib/dev_suite/utils/color.rb +1 -4
- data/lib/dev_suite/utils/construct/config/attribute/attribute.rb +15 -0
- data/lib/dev_suite/utils/construct/config/attribute/manager.rb +63 -0
- data/lib/dev_suite/utils/construct/config/attribute/resolver.rb +31 -0
- data/lib/dev_suite/utils/construct/config/attribute/validator.rb +55 -0
- data/lib/dev_suite/utils/construct/config/attribute.rb +13 -0
- data/lib/dev_suite/utils/construct/config/base.rb +20 -0
- data/lib/dev_suite/utils/construct/config/config.rb +24 -0
- data/lib/dev_suite/utils/construct/config/configuration.rb +13 -0
- data/lib/dev_suite/utils/construct/config/hook/hook.rb +13 -0
- data/lib/dev_suite/utils/construct/config/hook/manager.rb +36 -0
- data/lib/dev_suite/utils/construct/config/hook.rb +13 -0
- data/lib/dev_suite/utils/construct/config/initializer.rb +21 -0
- data/lib/dev_suite/utils/construct/config/manager.rb +33 -0
- data/lib/dev_suite/utils/construct/config/settings/base.rb +59 -0
- data/lib/dev_suite/utils/construct/config/settings/manager.rb +38 -0
- data/lib/dev_suite/utils/construct/config/settings/settings.rb +14 -0
- data/lib/dev_suite/utils/construct/config/settings.rb +13 -0
- data/lib/dev_suite/utils/construct/config.rb +11 -0
- data/lib/dev_suite/utils/construct/construct.rb +9 -0
- data/lib/dev_suite/utils/construct.rb +16 -0
- data/lib/dev_suite/utils/emoji.rb +71 -0
- data/lib/dev_suite/utils/error_handler.rb +24 -0
- data/lib/dev_suite/utils/file_loader/config/config.rb +13 -0
- data/lib/dev_suite/utils/file_loader/config/configuration.rb +33 -0
- data/lib/dev_suite/utils/file_loader/config.rb +11 -0
- data/lib/dev_suite/utils/file_loader/file_loader.rb +23 -0
- data/lib/dev_suite/utils/file_loader/loader/base.rb +21 -0
- data/lib/dev_suite/utils/file_loader/loader/json.rb +21 -0
- data/lib/dev_suite/utils/file_loader/loader/text.rb +21 -0
- data/lib/dev_suite/utils/file_loader/loader/yaml.rb +38 -0
- data/lib/dev_suite/utils/file_loader/loader.rb +41 -0
- data/lib/dev_suite/utils/file_loader/loader_manager.rb +34 -0
- data/lib/dev_suite/utils/file_loader/loader_registry.rb +36 -0
- data/lib/dev_suite/utils/file_loader.rb +9 -0
- data/lib/dev_suite/utils/logger.rb +58 -0
- data/lib/dev_suite/utils/path_matcher/matcher.rb +31 -0
- data/lib/dev_suite/utils/path_matcher/path_matcher.rb +17 -0
- data/lib/dev_suite/utils/path_matcher/pattern.rb +35 -0
- data/lib/dev_suite/utils/path_matcher.rb +9 -0
- data/lib/dev_suite/utils/table/config/config.rb +13 -0
- data/lib/dev_suite/utils/table/config/configuration.rb +32 -0
- data/lib/dev_suite/utils/table/config.rb +2 -23
- data/lib/dev_suite/utils/table/renderer/base.rb +0 -6
- data/lib/dev_suite/utils/table/renderer/simple.rb +9 -5
- data/lib/dev_suite/utils/table/renderer.rb +2 -2
- data/lib/dev_suite/utils/table/table.rb +6 -0
- data/lib/dev_suite/utils/table.rb +0 -6
- data/lib/dev_suite/utils/utils.rb +14 -0
- data/lib/dev_suite/utils.rb +1 -3
- data/lib/dev_suite/version.rb +1 -1
- data/lib/dev_suite.rb +1 -8
- metadata +72 -13
- data/lib/dev_suite/directory_tree/settings.rb +0 -29
- data/lib/dev_suite/performance/reportor.rb +0 -22
- data/lib/dev_suite/utils/config_tools/configuration.rb +0 -41
- data/lib/dev_suite/utils/config_tools/settings.rb +0 -75
- data/lib/dev_suite/utils/config_tools.rb +0 -10
- data/lib/dev_suite/utils/table/settings.rb +0 -34
@@ -1,29 +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
|
-
}
|
14
|
-
end
|
15
|
-
|
16
|
-
def skip_hidden?
|
17
|
-
get(:skip_hidden)
|
18
|
-
end
|
19
|
-
|
20
|
-
def skip_types
|
21
|
-
get(:skip_types)
|
22
|
-
end
|
23
|
-
|
24
|
-
def max_depth
|
25
|
-
get(:max_depth)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
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
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DevSuite
|
4
|
-
module Utils
|
5
|
-
module ConfigTools
|
6
|
-
module Configuration
|
7
|
-
# Module for global configuration
|
8
|
-
class << self
|
9
|
-
def included(base)
|
10
|
-
base.extend(ClassMethods)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
module ClassMethods
|
15
|
-
#
|
16
|
-
# Provide global access to a single instance of Config
|
17
|
-
#
|
18
|
-
def configuration
|
19
|
-
@configuration ||= new
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# Allow block-based configuration
|
24
|
-
#
|
25
|
-
def configure
|
26
|
-
yield(configuration)
|
27
|
-
rescue StandardError => e
|
28
|
-
handle_configuration_error(e)
|
29
|
-
raise
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def handle_configuration_error(error)
|
35
|
-
puts "Configuration error: #{error.message}"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DevSuite
|
4
|
-
module Utils
|
5
|
-
module ConfigTools
|
6
|
-
# Module for managing instance settings
|
7
|
-
module Settings
|
8
|
-
class << self
|
9
|
-
def included(base)
|
10
|
-
base.include(InstanceMethods)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
module InstanceMethods
|
15
|
-
def initialize(settings = {})
|
16
|
-
@settings = merge_settings(default_settings, settings)
|
17
|
-
end
|
18
|
-
|
19
|
-
def set(*keys, value)
|
20
|
-
key_path = normalize_keys(keys)
|
21
|
-
last_key = key_path.pop
|
22
|
-
target = key_path.each_with_object(@settings) do |key, nested|
|
23
|
-
nested[key] ||= {}
|
24
|
-
end
|
25
|
-
target[last_key] = value
|
26
|
-
end
|
27
|
-
|
28
|
-
def get(*keys)
|
29
|
-
key_path = normalize_keys(keys)
|
30
|
-
key_path.reduce(@settings) do |nested, key|
|
31
|
-
nested.is_a?(Hash) ? nested[key] : nil
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def apply
|
36
|
-
#
|
37
|
-
# Implement logic to apply settings in the including class
|
38
|
-
# TODO: need to review this method
|
39
|
-
#
|
40
|
-
raise NotImplementedError, "#{self.class} must implement the #apply method"
|
41
|
-
end
|
42
|
-
|
43
|
-
def reset!
|
44
|
-
@settings = default_settings
|
45
|
-
end
|
46
|
-
|
47
|
-
def default_settings
|
48
|
-
raise NotImplementedError, "#{self.class} must implement the #default_settings method"
|
49
|
-
end
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
def normalize_keys(keys)
|
54
|
-
key_path = keys.flatten
|
55
|
-
if key_path.size == 1 && key_path.first.is_a?(String)
|
56
|
-
key_path.first.to_s.split(".").map(&:to_sym)
|
57
|
-
else
|
58
|
-
key_path.map(&:to_sym)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def merge_settings(defaults, overrides)
|
63
|
-
defaults.merge(overrides) do |_key, oldval, newval|
|
64
|
-
if oldval.is_a?(Hash) && newval.is_a?(Hash)
|
65
|
-
merge_settings(oldval, newval)
|
66
|
-
else
|
67
|
-
newval
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DevSuite
|
4
|
-
module Utils
|
5
|
-
module Table
|
6
|
-
class Settings
|
7
|
-
include ConfigTools::Settings
|
8
|
-
|
9
|
-
def default_settings
|
10
|
-
{
|
11
|
-
colors: {
|
12
|
-
title: :cyan,
|
13
|
-
column: :yellow,
|
14
|
-
row: :default,
|
15
|
-
border: :blue,
|
16
|
-
},
|
17
|
-
alignments: {
|
18
|
-
column: :left,
|
19
|
-
row: :left,
|
20
|
-
},
|
21
|
-
}
|
22
|
-
end
|
23
|
-
|
24
|
-
def color_for(key)
|
25
|
-
get(:colors, key)
|
26
|
-
end
|
27
|
-
|
28
|
-
def alignment_for(key)
|
29
|
-
get(:alignments, key)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|