Class: AgentSettings::AgentConfigPath
- Inherits:
-
Data
- Object
- Data
- AgentSettings::AgentConfigPath
- Defined in:
- lib/agent_settings/agent_config_path.rb
Overview
The complete result of resolving an agent's config location.
AgentConfigPath is the primary return value from resolve and contains all information about where an agent's configuration is located, including:
- The effective (active) config location
- Global and project-specific locations
- All config layers organized by precedence
- Environment variable overrides detected
- Any warnings (e.g., untrusted project)
The effective location is determined by checking in order:
- Active environment variable overrides (highest precedence)
- First existing layer in precedence order
- First layer if none exist
Instance Attribute Summary collapse
-
#agent ⇒ Symbol
readonly
the agent this config path is for.
-
#effective ⇒ Location?
readonly
the currently active config location.
-
#env_overrides ⇒ Array<EnvOverride>
readonly
detected environment variable overrides.
-
#global ⇒ Location?
readonly
the global (user) config location.
-
#layers ⇒ Array<Location>
readonly
all config locations in precedence order.
-
#project ⇒ Location?
readonly
the project-level config location.
-
#warnings ⇒ Array<String>
readonly
any warnings about the configuration.
Instance Method Summary collapse
-
#custom_config? ⇒ Boolean
Check if a custom config is being used via environment variable.
Instance Attribute Details
#agent ⇒ Symbol (readonly)
the agent this config path is for
36 37 38 |
# File 'lib/agent_settings/agent_config_path.rb', line 36 def agent @agent end |
#effective ⇒ Location? (readonly)
the currently active config location
36 37 38 |
# File 'lib/agent_settings/agent_config_path.rb', line 36 def effective @effective end |
#env_overrides ⇒ Array<EnvOverride> (readonly)
detected environment variable overrides
36 37 38 |
# File 'lib/agent_settings/agent_config_path.rb', line 36 def env_overrides @env_overrides end |
#global ⇒ Location? (readonly)
the global (user) config location
36 37 38 |
# File 'lib/agent_settings/agent_config_path.rb', line 36 def global @global end |
#layers ⇒ Array<Location> (readonly)
all config locations in precedence order
36 37 38 |
# File 'lib/agent_settings/agent_config_path.rb', line 36 def layers @layers end |
#project ⇒ Location? (readonly)
the project-level config location
36 37 38 |
# File 'lib/agent_settings/agent_config_path.rb', line 36 def project @project end |
#warnings ⇒ Array<String> (readonly)
any warnings about the configuration
36 37 38 |
# File 'lib/agent_settings/agent_config_path.rb', line 36 def warnings @warnings end |
Instance Method Details
#custom_config? ⇒ Boolean
Check if a custom config is being used via environment variable.
Returns true if any environment variable override is active, meaning the agent is using a config location different from the default file-based locations.
49 |
# File 'lib/agent_settings/agent_config_path.rb', line 49 def custom_config? = env_overrides.any?(&:active?) |