A Ruby gem for managing multi-environment YAML settings in Rails, Sinatra, Padrino, and other Ruby projects.
Config is a Ruby gem that simplifies configuration management for Ruby applications. It provides a structured way to handle environment-specific settings using YAML files, making it easy to organize and access configuration data across different deployment environments like development, test, and production.
Ruby developers building applications with Rails, Padrino, or Sinatra frameworks who need a robust, environment-aware configuration system. It's particularly useful for teams managing multiple deployment environments and requiring local developer settings that don't conflict with version control.
Developers choose Config for its clean, intuitive object notation (e.g., Settings.group.setting), built-in support for environment inheritance and ERB templating, and flexibility to add or reload configuration sources at runtime. It emphasizes convention over configuration while supporting complex needs like validation with dry-schema and environment variable integration.
Easiest way to add multi-environment yaml settings to Rails, Sinatra, Padrino and other Ruby projects.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows embedded Ruby in YAML files for dynamic values, enabling computed settings like `<%= 1 + 2 + 3 %>` as shown in the README examples.
Supports hierarchical config files where environment-specific settings (e.g., development.yml) override common ones, simplifying multi-environment management.
Enables reloading settings and adding new sources at runtime with methods like `Settings.reload!` and `add_source!`, useful for testing or dynamic updates.
Optional integration with dry-schema or dry-validation allows robust config validation, ensuring required fields and types are correct, as detailed in the validation section.
Automatically ignores local config files (e.g., settings.local.yml) in version control, preventing conflicts and allowing per-developer settings without Git commits.
Merge options like `overwrite_arrays` and `knockout_prefix` can be intricate and lead to unexpected behavior if misconfigured, as noted in the documentation's merge customization section.
Environment variable integration does not handle arrays well ('It won't work with arrays, though.'), restricting its use for nested array configurations via ENV.
Lacks native encryption for config files, forcing reliance on environment variables or external services like AWS Secrets Manager for sensitive data, which adds setup complexity.
ERB evaluation and multiple file loads during runtime reloads can introduce performance overhead in large applications, especially with frequent config changes.