← BlogLab

Custom Ruby Gem Scaffolder with dry-rb

A template generator that sets up modern Ruby gems pre-configured with dry-initializer, dry-validation, and RSpec test suites.

Setting up standard Ruby packages can involve repetitive configuration. This interactive CLI tool scaffolds clean, dry-based structures so you can write actual business logic faster.

Integrated Libraries

Every bootstrapped project includes:

  • dry-initializer: Declarative initialization parameters.
  • dry-validation: Highly flexible input contracts.
  • RSpec: BDD testing environment configured with coverage reporting.

Example CLI Usage

Install the command-line utility and run the generator:

# Generate a new project named my-service
gem-scaffold generate my-service --dry-rb

# Run test suites inside the generated directory
cd my-service && bundle exec rspec

The output contains lint-configured configuration files and automated GitHub Actions workflows.