Module: ClaudeSwarm::YamlLoader

Defined in:
lib/claude_swarm/yaml_loader.rb

Overview

Provides consistent YAML loading across the application

Class Method Summary collapse

Class Method Details

.load_config_file(file_path) ⇒ Hash

Load a YAML configuration file (enables aliases for configuration flexibility)

Parameters:

  • file_path (String)

    Path to the configuration file

Returns:

  • (Hash)

    The loaded configuration

Raises:



11
12
13
14
15
16
17
18
19
# File 'lib/claude_swarm/yaml_loader.rb', line 11

def load_config_file(file_path)
  YAML.load_file(file_path, aliases: true)
rescue Errno::ENOENT
  raise ClaudeSwarm::Error, "Configuration file not found: #{file_path}"
rescue Psych::SyntaxError => e
  raise ClaudeSwarm::Error, "Invalid YAML syntax in #{file_path}: #{e.message}"
rescue Psych::BadAlias => e
  raise ClaudeSwarm::Error, "Invalid YAML alias in #{file_path}: #{e.message}"
end