### Install App Configurable Gem Source: https://github.com/ramp106/app_configurable/blob/master/README.md Add the 'app_configurable' gem to your application's Gemfile to start using it for configuration management. ```Ruby gem 'app_configurable' ``` -------------------------------- ### Define Root-Level Configurations Source: https://github.com/ramp106/app_configurable/blob/master/README.md Define application-wide configurations using the 'entry' directive. This example shows how to set default values and environment-specific values for 'secret_key' and 'base_url'. ```Ruby class AppConfig include AppConfigurable entry :secret_key, default: 'your_secret_key' entry :base_url, default: 'http://my-site.local', production: 'http:// my-site.io', staging: 'http://staging.my-site.io' end ``` -------------------------------- ### Define Namespaced Configurations Source: https://github.com/ramp106/app_configurable/blob/master/README.md Define configurations for specific services or modules by creating nested classes that include 'AppConfigurable'. This example shows configurations for 'Hubspot'. ```Ruby class AppConfig::Hubspot include AppConfigurable entry :access_token, default: 'secret_access_token' entry :base_url, default: 'https://hubspot.com/1234', production: 'https:// hubspot.com/4321' entry :client_secret, default: 'client_secret_token' end ``` -------------------------------- ### Set Environment Per Namespace Source: https://github.com/ramp106/app_configurable/blob/master/README.md Set the environment for a specific configuration namespace by prefixing the environment variable with the namespace and module names. ```Bash APPCONFIG_MYNICEMODULE_ENV=staging rspec ``` -------------------------------- ### Load Configurations Globally Source: https://github.com/ramp106/app_configurable/blob/master/README.md Load configuration files globally using 'AppConfigurable.load_configs'. You can specify the environment or enable error reporting for missing configurations. ```Ruby AppConfigurable.load_configs(%w[./config/app_config.rb]) ``` ```Ruby AppConfigurable.load_configs(%w[./config/app_config.rb], rails_env: 'production') ``` ```Ruby AppConfigurable.load_configs(%w[./config/app_config.rb], raise_on_missing: true) ``` -------------------------------- ### Access Configurations Source: https://github.com/ramp106/app_configurable/blob/master/README.md Access defined configurations directly as class methods on the configuration class. ```Ruby AppConfig.secret_key ``` -------------------------------- ### Access Namespaced Configurations Source: https://github.com/ramp106/app_configurable/blob/master/README.md Access configurations within namespaces using the nested class structure. ```Ruby AppConfig.secret_key_base ``` ```Ruby AppConfig::Hubspot.base_url ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.