A Rails engine for managing dynamic configuration and feature flags with conditional rules.
It's time for you to take the wheel.
-
Dynamic Configuration Storage
- Store and manage configuration values with type safety
- Supported types: string, integer, float, boolean, and JSON
- In-memory caching for fast access
- Real-time configuration updates
-
Conditional Rules
- Define rules based on context attributes
- Supported operators: equals, not_equals, in, not_in, matches, greater_than, less_than
- Multiple conditions per configuration
- Context-based evaluation
-
Web Interface
- Modern UI for managing configurations
- Create and edit configuration values
- Define conditional rules
- Type-safe value editing
- Add to your Gemfile:
gem 'wheel'
- Install:
$ bundle install
- Run the installer:
$ rails generate wheel:install
$ rails db:migrate
- Mount the engine in
config/routes.rb
:
Rails.application.routes.draw do
mount Wheel::Engine => "/wheel"
end
# Get a configuration value
value = Wheel["feature.enabled"]
# Get a configuration with context
value = Wheel["pricing.tier", user_id: "123"]
You can define default context attributes:
# config/initializers/wheel.rb
Wheel.configure do |config|
config.attributes = {
user_id: {
name: 'User ID',
description: 'The unique identifier of the user'
}
}
end
- Fork the repository
- Create your feature branch (
git checkout -b feature/my-feature
) - Commit your changes (
git commit -am 'Add my feature'
) - Push to the branch (
git push origin feature/my-feature
) - Create a Pull Request
This project is licensed under the MIT License.