Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
test:
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.2", "3.3", "3.4", "4.0"]
rails: ["7.1", "7.2", "8.0", "8.1"]
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
*.gem
Gemfile.lock
.ruby-lsp/
/gemfiles/*.lock
/test/tmp/
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.2
4.0.9
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- **Ruby × Rails compatibility matrix** in the README and a GitHub Actions CI
workflow that runs the test suite on Ruby 3.2, 3.3, 3.4 and 4.0 against
Rails 7.1, 7.2, 8.0 and 8.1 (per-version Gemfiles under `gemfiles/`).

### Changed

- **Minimum Ruby raised to 3.2.** Phlex 2.x (required by `phlex-rails >= 2.0`)
already needs Ruby 3.2+, so the previous `>= 3.1` couldn't be installed on 3.1.

## [0.1.0] - 2026-06-09

### Added
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## What this is

`ruby_ui_scaffold` is a Ruby gem (Rails plugin) that provides `rails g ruby_ui_scaffold` — a drop-in replacement for `rails g scaffold` that emits **Phlex view classes wired to [ruby_ui](https://github.com/ruby-ui/ruby_ui) components** instead of ERB. It also ships a `rails ruby_ui_scaffold:seed` command that populates models with realistic fake data via Faker. Ruby >= 3.1, Rails >= 7.1.
`ruby_ui_scaffold` is a Ruby gem (Rails plugin) that provides `rails g ruby_ui_scaffold` — a drop-in replacement for `rails g scaffold` that emits **Phlex view classes wired to [ruby_ui](https://github.com/ruby-ui/ruby_ui) components** instead of ERB. It also ships a `rails ruby_ui_scaffold:seed` command that populates models with realistic fake data via Faker. Ruby >= 3.2, Rails >= 7.1.

This repo is the gem source, not a host Rails app. There is no `bin/rails` here; the generator/command behavior is exercised through Rails' generator test harness against a temp destination.

Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,30 @@ Drop-in alternative to `rails g scaffold` — generates model, migration, contro

## Requirements

- Ruby 3.2+
- Rails 7.1+
- Tailwind CSS (any Rails Tailwind setup — `tailwindcss-rails` is fine)

### Compatibility matrix

The full test suite runs in CI against every combination below.

| Ruby \ Rails | 7.1 | 7.2 | 8.0 | 8.1 |
|--------------|:---:|:---:|:---:|:---:|
| **4.0** | ✅ | ✅ | ✅ | ✅ |
| **3.4** | ✅ | ✅ | ✅ | ✅ |
| **3.3** | ✅ | ✅ | ✅ | ✅ |
| **3.2** | ✅ | ✅ | ✅ | ✅ |

Last verified with Ruby 4.0.9 and Rails 8.1.4.1. Ruby 3.1 isn't supported because Phlex 2.x (required by `phlex-rails >= 2.0`) needs Ruby 3.2+.

To run the suite against a specific Rails version locally:

```bash
BUNDLE_GEMFILE=gemfiles/rails_8.1.gemfile bundle install
BUNDLE_GEMFILE=gemfiles/rails_8.1.gemfile bundle exec rake test
```

## Disclaimer

`ruby_ui_scaffold` is a development-only generator built on the [`ruby_ui`](https://github.com/ruby-ui/ruby_ui) component library — you add both to your app. [`faker`](https://github.com/faker-ruby/faker) and [`lucide-rails`](https://github.com/heyvito/lucide-rails) come along automatically as runtime dependencies of `ruby_ui_scaffold` — `faker` powers the `seed` command, and `lucide-rails` renders the icons in the generated views (the index action menu plus the New / Edit / Create / Update buttons).
Expand Down
7 changes: 7 additions & 0 deletions gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "~> 7.1.0"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "~> 7.2.0"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_8.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "~> 8.0.0"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_8.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "~> 8.1.0"

gemspec path: "../"
2 changes: 1 addition & 1 deletion mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tools]
ruby = "4.0.2"
ruby = "4.0.9"
2 changes: 1 addition & 1 deletion ruby_ui_scaffold.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
"to ruby_ui components (Input, Textarea, Checkbox, Button, Table, FormField, etc.)."
spec.homepage = "https://github.com/jacksonpires/ruby_ui_scaffold"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.1.0"
spec.required_ruby_version = ">= 3.2.0"

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage
Expand Down
Loading