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.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +37 -0
  3. data/Gemfile +13 -6
  4. data/Gemfile.lock +9 -1
  5. data/README.md +66 -2
  6. data/dev_suite.gemspec +1 -0
  7. data/lib/dev_suite/cli/commands/base.rb +0 -30
  8. data/lib/dev_suite/cli/commands/tree.rb +29 -8
  9. data/lib/dev_suite/cli/commands/version.rb +1 -1
  10. data/lib/dev_suite/cli/main.rb +12 -9
  11. data/lib/dev_suite/dev_suite.rb +12 -0
  12. data/lib/dev_suite/directory_tree/config/config.rb +11 -0
  13. data/lib/dev_suite/directory_tree/config/configuration.rb +21 -0
  14. data/lib/dev_suite/directory_tree/config.rb +2 -11
  15. data/lib/dev_suite/directory_tree/directory_tree.rb +20 -0
  16. data/lib/dev_suite/directory_tree/renderer/base.rb +0 -6
  17. data/lib/dev_suite/directory_tree/renderer/simple.rb +3 -3
  18. data/lib/dev_suite/directory_tree/visualizer/base.rb +13 -0
  19. data/lib/dev_suite/directory_tree/visualizer/tree.rb +50 -0
  20. data/lib/dev_suite/directory_tree/visualizer.rb +14 -13
  21. data/lib/dev_suite/directory_tree.rb +1 -8
  22. data/lib/dev_suite/performance/analyzer.rb +1 -1
  23. data/lib/dev_suite/performance/config/config.rb +11 -0
  24. data/lib/dev_suite/performance/config/configuration.rb +30 -0
  25. data/lib/dev_suite/performance/config.rb +2 -10
  26. data/lib/dev_suite/performance/{reportor → reporter}/base.rb +1 -1
  27. data/lib/dev_suite/performance/{reportor → reporter}/helpers/stat_mappings.rb +1 -1
  28. data/lib/dev_suite/performance/{reportor → reporter}/helpers/table_builder.rb +1 -1
  29. data/lib/dev_suite/performance/{reportor → reporter}/helpers.rb +1 -1
  30. data/lib/dev_suite/performance/{reportor → reporter}/simple.rb +1 -1
  31. data/lib/dev_suite/performance/reporter.rb +22 -0
  32. data/lib/dev_suite/performance.rb +1 -1
  33. data/lib/dev_suite/request_logger/adapter/adapter.rb +27 -0
  34. data/lib/dev_suite/request_logger/adapter/base.rb +17 -0
  35. data/lib/dev_suite/request_logger/adapter/net_http.rb +42 -0
  36. data/lib/dev_suite/request_logger/adapter.rb +9 -0
  37. data/lib/dev_suite/request_logger/config/config.rb +11 -0
  38. data/lib/dev_suite/request_logger/config/configuration.rb +24 -0
  39. data/lib/dev_suite/request_logger/config.rb +9 -0
  40. data/lib/dev_suite/request_logger/logger.rb +93 -0
  41. data/lib/dev_suite/request_logger/request_logger.rb +29 -0
  42. data/lib/dev_suite/request_logger.rb +7 -0
  43. data/lib/dev_suite/utils/color/color.rb +12 -0
  44. data/lib/dev_suite/utils/color/config/config.rb +13 -0
  45. data/lib/dev_suite/utils/color/config/configuration.rb +31 -0
  46. data/lib/dev_suite/utils/color/config.rb +2 -31
  47. data/lib/dev_suite/utils/color/strategy/theme.rb +6 -7
  48. data/lib/dev_suite/utils/color/strategy.rb +2 -4
  49. data/lib/dev_suite/utils/color.rb +1 -4
  50. data/lib/dev_suite/utils/construct/config/attribute/attribute.rb +15 -0
  51. data/lib/dev_suite/utils/construct/config/attribute/manager.rb +63 -0
  52. data/lib/dev_suite/utils/construct/config/attribute/resolver.rb +31 -0
  53. data/lib/dev_suite/utils/construct/config/attribute/validator.rb +55 -0
  54. data/lib/dev_suite/utils/construct/config/attribute.rb +13 -0
  55. data/lib/dev_suite/utils/construct/config/base.rb +20 -0
  56. data/lib/dev_suite/utils/construct/config/config.rb +24 -0
  57. data/lib/dev_suite/utils/construct/config/configuration.rb +13 -0
  58. data/lib/dev_suite/utils/construct/config/hook/hook.rb +13 -0
  59. data/lib/dev_suite/utils/construct/config/hook/manager.rb +36 -0
  60. data/lib/dev_suite/utils/construct/config/hook.rb +13 -0
  61. data/lib/dev_suite/utils/construct/config/initializer.rb +21 -0
  62. data/lib/dev_suite/utils/construct/config/manager.rb +33 -0
  63. data/lib/dev_suite/utils/construct/config/settings/base.rb +59 -0
  64. data/lib/dev_suite/utils/construct/config/settings/manager.rb +38 -0
  65. data/lib/dev_suite/utils/construct/config/settings/settings.rb +14 -0
  66. data/lib/dev_suite/utils/construct/config/settings.rb +13 -0
  67. data/lib/dev_suite/utils/construct/config.rb +11 -0
  68. data/lib/dev_suite/utils/construct/construct.rb +9 -0
  69. data/lib/dev_suite/utils/construct.rb +16 -0
  70. data/lib/dev_suite/utils/emoji.rb +71 -0
  71. data/lib/dev_suite/utils/error_handler.rb +24 -0
  72. data/lib/dev_suite/utils/file_loader/config/config.rb +13 -0
  73. data/lib/dev_suite/utils/file_loader/config/configuration.rb +33 -0
  74. data/lib/dev_suite/utils/file_loader/config.rb +11 -0
  75. data/lib/dev_suite/utils/file_loader/file_loader.rb +23 -0
  76. data/lib/dev_suite/utils/file_loader/loader/base.rb +21 -0
  77. data/lib/dev_suite/utils/file_loader/loader/json.rb +21 -0
  78. data/lib/dev_suite/utils/file_loader/loader/text.rb +21 -0
  79. data/lib/dev_suite/utils/file_loader/loader/yaml.rb +38 -0
  80. data/lib/dev_suite/utils/file_loader/loader.rb +41 -0
  81. data/lib/dev_suite/utils/file_loader/loader_manager.rb +34 -0
  82. data/lib/dev_suite/utils/file_loader/loader_registry.rb +36 -0
  83. data/lib/dev_suite/utils/file_loader.rb +9 -0
  84. data/lib/dev_suite/utils/logger.rb +58 -0
  85. data/lib/dev_suite/utils/path_matcher/matcher.rb +31 -0
  86. data/lib/dev_suite/utils/path_matcher/path_matcher.rb +17 -0
  87. data/lib/dev_suite/utils/path_matcher/pattern.rb +35 -0
  88. data/lib/dev_suite/utils/path_matcher.rb +9 -0
  89. data/lib/dev_suite/utils/table/config/config.rb +13 -0
  90. data/lib/dev_suite/utils/table/config/configuration.rb +32 -0
  91. data/lib/dev_suite/utils/table/config.rb +2 -23
  92. data/lib/dev_suite/utils/table/renderer/base.rb +0 -6
  93. data/lib/dev_suite/utils/table/renderer/simple.rb +9 -5
  94. data/lib/dev_suite/utils/table/renderer.rb +2 -2
  95. data/lib/dev_suite/utils/table/table.rb +6 -0
  96. data/lib/dev_suite/utils/table.rb +0 -6
  97. data/lib/dev_suite/utils/utils.rb +14 -0
  98. data/lib/dev_suite/utils.rb +1 -3
  99. data/lib/dev_suite/version.rb +1 -1
  100. data/lib/dev_suite.rb +1 -8
  101. metadata +72 -13
  102. data/lib/dev_suite/directory_tree/settings.rb +0 -29
  103. data/lib/dev_suite/performance/reportor.rb +0 -22
  104. data/lib/dev_suite/utils/config_tools/configuration.rb +0 -41
  105. data/lib/dev_suite/utils/config_tools/settings.rb +0 -75
  106. data/lib/dev_suite/utils/config_tools.rb +0 -10
  107. data/lib/dev_suite/utils/table/settings.rb +0 -34
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Attribute
8
+ require_relative "attribute/attribute"
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ class Base
8
+ include Attribute::Manager
9
+ include Hook::Manager
10
+
11
+ def initialize
12
+ run_hooks(:before_initialize)
13
+ initialize_config_attrs
14
+ run_hooks(:after_initialize)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ require_relative "attribute"
8
+ require_relative "hook"
9
+ require_relative "base"
10
+ require_relative "settings"
11
+ require_relative "configuration"
12
+ require_relative "manager"
13
+ require_relative "initializer"
14
+
15
+ class << self
16
+ def included(base)
17
+ base.extend(Manager)
18
+ Initializer.define_config_constants(base)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ class Configuration < Base
8
+ include Settings::Manager
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Hook
8
+ require_relative "manager"
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Hook
8
+ module Manager
9
+ class << self
10
+ def included(base)
11
+ base.extend(ClassMethods)
12
+ end
13
+ end
14
+
15
+ module ClassMethods
16
+ def register_hook(stage, &block)
17
+ hooks[stage] ||= []
18
+ hooks[stage] << block
19
+ end
20
+
21
+ def hooks
22
+ @hooks ||= {}
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ def run_hooks(stage)
29
+ self.class.hooks[stage]&.each { |hook| instance_eval(&hook) }
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Hook
8
+ require_relative "hook/hook"
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Initializer
8
+ class << self
9
+ def define_config_constants(base)
10
+ base.const_set(:BaseConfiguration, Configuration)
11
+
12
+ unless base.const_defined?(:Configuration)
13
+ base.const_set(:Configuration, Class.new(base::BaseConfiguration))
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Manager
8
+ # Provides access to a single instance of the configuration class
9
+ # It dynamically uses the Configuration class in the including module's namespace
10
+ def configuration
11
+ @configuration ||= self::Configuration.new
12
+ end
13
+
14
+ # Allows block-based configuration
15
+ # Example usage:
16
+ # ConfigClass.configure do |config|
17
+ # config.attr_name = value
18
+ # end
19
+ def configure
20
+ yield(configuration)
21
+ rescue StandardError => e
22
+ ErrorHandler.handle_error(e)
23
+ end
24
+
25
+ # Resets the configuration by reinitializing it with default values
26
+ def reset!
27
+ @configuration = self::Configuration.new # Reinitialize the configuration instance
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Settings
8
+ class Base
9
+ def initialize(settings = {})
10
+ @default_settings = settings
11
+ @settings = merge_settings(@default_settings, settings)
12
+ end
13
+
14
+ def set(*keys, value)
15
+ key_path = normalize_keys(keys)
16
+ last_key = key_path.pop
17
+ target = key_path.each_with_object(@settings) do |key, nested|
18
+ nested[key] ||= {}
19
+ end
20
+ target[last_key] = value
21
+ end
22
+
23
+ def get(*keys)
24
+ key_path = normalize_keys(keys)
25
+ key_path.reduce(@settings) do |nested, key|
26
+ nested.is_a?(Hash) ? nested[key] : nil
27
+ end
28
+ end
29
+
30
+ def reset!
31
+ @settings = @default_settings
32
+ end
33
+
34
+ private
35
+
36
+ def normalize_keys(keys)
37
+ key_path = keys.flatten
38
+ if key_path.size == 1 && key_path.first.is_a?(String)
39
+ key_path.first.to_s.split(".").map(&:to_sym)
40
+ else
41
+ key_path.map(&:to_sym)
42
+ end
43
+ end
44
+
45
+ def merge_settings(defaults, overrides)
46
+ defaults.merge(overrides) do |_key, oldval, newval|
47
+ if oldval.is_a?(Hash) && newval.is_a?(Hash)
48
+ merge_settings(oldval, newval)
49
+ else
50
+ newval
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Settings
8
+ module Manager
9
+ class << self
10
+ def included(base)
11
+ base.extend(ClassMethods)
12
+ end
13
+ end
14
+
15
+ module ClassMethods
16
+ # Ensure that default configuration attributes are applied to subclasses.
17
+ def inherited(subclass)
18
+ subclass.set_default_settings
19
+ super
20
+ end
21
+
22
+ # Define default settings for the class.
23
+ def set_default_settings(settings = {})
24
+ config_attr(:settings, default_value: settings, type: :hash, resolver: :resolve_settings)
25
+ end
26
+ end
27
+
28
+ private
29
+
30
+ def resolve_settings(value)
31
+ Base.new(value)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Settings
8
+ require_relative "base"
9
+ require_relative "manager"
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ module Settings
8
+ require_relative "settings/settings"
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ module Config
7
+ require_relative "config/config"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ require_relative "config"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Construct
6
+ # The Construct module serves as a namespace for reusable constructs that
7
+ # provide foundational utilities, such as configuration management, which
8
+ # can be included in other modules throughout the DevSuite framework.
9
+ #
10
+ # This module centralizes shared functionality to promote code reuse,
11
+ # maintainability, and consistency across different modules.
12
+
13
+ require_relative "construct/construct"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module Emoji
6
+ # Status-related emojis
7
+ STATUS = {
8
+ start: "🚀",
9
+ success: "✅",
10
+ error: "🚨❌",
11
+ retry: "💥",
12
+ warning: "⚠️", # For warnings
13
+ caution: "🟡", # For caution or proceed with care
14
+ }.freeze
15
+
16
+ # Action-related emojis
17
+ ACTIONS = {
18
+ update: "🔄", # For updates or changes
19
+ fix: "🔧", # For fixes or repairs
20
+ bug: "🐞", # For bugs or issues
21
+ code: "💻", # For code or technical content
22
+ }.freeze
23
+
24
+ # Notification-related emojis
25
+ NOTIFICATIONS = {
26
+ info: "ℹ️",
27
+ important: "❗",
28
+ note: "📝", # For notes or annotations
29
+ tip: "💡", # For tips or helpful hints
30
+ }.freeze
31
+
32
+ # Resource-related emojis
33
+ RESOURCES = {
34
+ document: "📄", # For representing documents or files
35
+ network: "🌐", # For network-related logs
36
+ database: "💾", # For database-related logs
37
+ cache: "🗄️", # For cache-related logs
38
+ file: "📁", # For file-related logs
39
+ cookie: "🍪", # For cookie-related logs
40
+ header: "📑", # For header-related logs
41
+ request: "📤", # For request-related logs
42
+ response: "📥", # For response-related logs
43
+ }.freeze
44
+
45
+ DEFAULT_EMOJI = "❓"
46
+
47
+ EMOJIS = STATUS.merge(ACTIONS).merge(NOTIFICATIONS).merge(RESOURCES).freeze
48
+
49
+ class << self
50
+ # Returns the emoji corresponding to the given key.
51
+ # @param key [Symbol] the key to look up the emoji
52
+ # @param default [String] the default emoji if the key is not found
53
+ # @return [String] the corresponding emoji or the default emoji
54
+ def get(key, default: DEFAULT_EMOJI)
55
+ EMOJIS[key] || default
56
+ end
57
+
58
+ # Returns all emojis categorized by their purpose.
59
+ # @return [Hash] a hash containing all emojis organized by categories.
60
+ def all
61
+ {
62
+ status: STATUS,
63
+ actions: ACTIONS,
64
+ notifications: NOTIFICATIONS,
65
+ resources: RESOURCES,
66
+ }
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module ErrorHandler
6
+ extend self # This makes all instance methods behave like class methods
7
+
8
+ def handle_error(error)
9
+ Utils::Logger.log(
10
+ "Oops! An error occurred: #{error.message}",
11
+ level: :error,
12
+ emoji: :error,
13
+ )
14
+ Utils::Logger.log(
15
+ "For more information, please refer to the README: " \
16
+ "https://github.com/patrick204nqh/dev_suite",
17
+ level: :error,
18
+ emoji: :document,
19
+ )
20
+ # exit(1)
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module FileLoader
6
+ module Config
7
+ include Construct::Config
8
+
9
+ require_relative "configuration"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module FileLoader
6
+ module Config
7
+ class Configuration < BaseConfiguration
8
+ config_attr :loaders, default_value: [:text, :json, :yaml], type: :array
9
+
10
+ register_hook :after_initialize do
11
+ setup_registry
12
+ end
13
+
14
+ # Expose the registry as a read-only attribute
15
+ attr_reader :registry
16
+
17
+ # Setup the registry based on the current loaders
18
+ def setup_registry
19
+ @registry = LoaderRegistry.new
20
+ update_registry(loaders)
21
+ end
22
+
23
+ # Update the registry with the provided loaders
24
+ def update_registry(loaders)
25
+ @registry ||= LoaderRegistry.new
26
+ @registry.clear # Clear the existing registry
27
+ Loader.registry_loaders(@registry, loaders)
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module FileLoader
6
+ module Config
7
+ require_relative "config/config"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module FileLoader
6
+ require "pathname"
7
+ require "json"
8
+ require "yaml"
9
+
10
+ require_relative "loader"
11
+ require_relative "loader_registry"
12
+ require_relative "loader_manager"
13
+ require_relative "config"
14
+
15
+ class << self
16
+ def load(path)
17
+ loader = LoaderManager.new
18
+ loader.load(path)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module FileLoader
6
+ module Loader
7
+ class Base
8
+ class << self
9
+ def extensions
10
+ raise NotImplementedError, "You must implement the extensions method"
11
+ end
12
+ end
13
+
14
+ def load(_path)
15
+ raise NotImplementedError, "You must implement the load method"
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module FileLoader
6
+ module Loader
7
+ class Json < Base
8
+ class << self
9
+ def extensions
10
+ ["json"]
11
+ end
12
+ end
13
+
14
+ def load(path)
15
+ ::JSON.parse(::File.read(path))
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module FileLoader
6
+ module Loader
7
+ class Text < Base
8
+ class << self
9
+ def extensions
10
+ ["txt"]
11
+ end
12
+ end
13
+
14
+ def load(path)
15
+ ::File.read(path)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DevSuite
4
+ module Utils
5
+ module FileLoader
6
+ module Loader
7
+ class Yaml < Base
8
+ class << self
9
+ def extensions
10
+ ["yml", "yaml"]
11
+ end
12
+ end
13
+
14
+ def load(path, safe: true)
15
+ validate_file_existence!(path)
16
+ parse_yaml_file(path, safe)
17
+ rescue ::Psych::SyntaxError => e
18
+ handle_yaml_parsing_error(path, e)
19
+ end
20
+
21
+ private
22
+
23
+ def validate_file_existence!(path)
24
+ raise "File not found: #{path}" unless ::File.exist?(path)
25
+ end
26
+
27
+ def parse_yaml_file(path, safe)
28
+ safe ? ::YAML.safe_load_file(path) : ::YAML.load_file(path)
29
+ end
30
+
31
+ def handle_yaml_parsing_error(path, error)
32
+ raise "YAML parsing error in file #{path}: #{error.message}"
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end