-
Notifications
You must be signed in to change notification settings - Fork 0
Home
simple_command_dispatcher (SCD) is a lightweight Ruby gem that enables Rails applications to dynamically execute command objects using convention over configuration. It automatically transforms request paths into Ruby class constants, allowing controllers to dispatch commands based on routes and parameters.
- Installation Guide - Set up the gem in your project
- Quick Start Tutorial - Build your first command in 5 minutes
- Core Concepts - Understand how SCD works
- Creating Commands - Learn to write command classes
- CommandCallable Module - Standardize your commands with built-in tracking
- Parameter Handling - Master different parameter types
- Error Handling - Handle errors gracefully
- Route-to-Command Mapping - Deep dive into convention over configuration
- Dynamic Dispatching - Advanced controller patterns
- Versioning API Commands - Manage multiple API versions
- Configuration & Logging - Customize SCD behavior
- Authentication Example - User login/authentication
- Payment Processing Example - Handling payments
- API Search Example - Building search endpoints
- CRUD Operations - Standard CRUD patterns
- API Reference - Complete method and class documentation
- Migration Guide - Upgrading from v3.x to v4.x
- Troubleshooting - Common issues and solutions
- FAQ - Frequently asked questions
Controllers get bloated with business logic. Service objects help, but you still need boilerplate routing code.
SCD automatically maps request paths to commands—zero configuration needed:
# Your request:
POST /api/v1/mechs/search
# SCD automatically calls:
Api::V1::Mechs::Search.call(params)No routing tables. No switch statements. No manual mapping. Just convention.
✅ Convention Over Configuration - Paths automatically map to commands ✅ Built-in Success/Failure Tracking - Know instantly if your command worked ✅ Dynamic Dispatching - One controller action handles multiple commands ✅ Smart Parameter Handling - Works with Hash, Array, or single values ✅ Lightweight - Only one dependency (ActiveSupport) ✅ Fast - Uses Rails' proven camelization under the hood
See SCD in action with the demo application - a complete Rails API app with tests demonstrating real-world usage.
- Documentation: You're in the right place!
- Issues: Report bugs on GitHub
- RubyDoc: API Documentation
Bug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration.
The gem is available as open source under the terms of the MIT License.