A Ruby configuration library that unifies settings from YAML, environment variables, credentials, and other sources into structured classes.
Anyway Config is a Ruby library that simplifies configuration management for gems and applications by unifying settings from multiple sources like YAML files, environment variables, and Rails credentials into structured classes. It solves the problem of scattered configuration code and provides a consistent, testable way to handle settings across different environments.
Ruby gem authors and application developers who need robust, maintainable configuration management, especially those working with Rails applications or building distributable gems.
Developers choose Anyway Config because it eliminates configuration boilerplate, provides automatic multi-source loading with sensible precedence, and makes configuration testable and explicit through Ruby classes, all while maintaining full compatibility with Rails and pure Ruby projects.
Configuration library for Ruby gems and applications
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically loads settings from YAML files, environment variables, Rails credentials, and custom loaders, eliminating scattered configuration code and providing a unified interface.
Uses a DSL to define configuration schemas with defaults, validations, and helper methods, making configuration explicit, testable, and reusable across environments.
Converts environment variable strings to appropriate Ruby types like integers and booleans, and offers required field validation with environment-specific rules via the required method.
Includes generators, autoloading for configs in Rails, and seamless integration with Rails credentials and environments, reducing setup time for Rails applications.
Version 2.x introduced significant changes, such as modifying how attr_config accessors work away from instance variables, requiring code updates and migration efforts from 1.x users.
The multi-loader system and class-based DSL add setup complexity that may be overkill for simple projects, where basic Rails config or .env files would suffice.
While functional without Rails, advanced features like credentials loading and generators are Rails-specific, limiting its utility in pure Ruby or non-Rails environments.