Module: ConstConf::DirPlugin
- Defined in:
- lib/const_conf/dir_plugin.rb
Overview
A module that provides functionality for reading file contents from configuration directories, supporting XDG Base Directory Specification compliance.
The DirPlugin extends the ConstConf::Setting class to enable configuration settings that are sourced from files within named directories. This allows for more complex and secure configuration management, particularly useful for storing sensitive data or structured configs in files rather than environment variables.
Defined Under Namespace
Classes: ConfigDir
Instance Method Summary collapse
-
#dir(name, path, env_var: nil, env_var_name: nil, default: nil, required: false) ⇒ Object
The dir method creates and reads a configuration directory setting.
Instance Method Details
#dir(name, path, env_var: nil, env_var_name: nil, default: nil, required: false) ⇒ Object
The dir method creates and reads a configuration directory setting.
This method initializes a ConfigDir instance with the provided name and environment variable configuration, then reads the directory path with optional default and required validation settings.
configuration provided
178 179 180 |
# File 'lib/const_conf/dir_plugin.rb', line 178 def dir(name, path, env_var: nil, env_var_name: nil, default: nil, required: false) ConfigDir.new(name, env_var:, env_var_name:).read(path, default:, required:) end |