Skip to content
Draft
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: 9 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "CI"
name: CI
on:
push:
branches: ["master"]
branches: [ master ]
pull_request:
branches: ["master"]
branches: [ master ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
Expand All @@ -12,26 +12,18 @@ concurrency:
jobs:
run_specs:
name: Rspec
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
env:
CI: true
RAILS_ENV: test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Run specs
run: bundle exec rspec --format documentation --format RspecJunitFormatter --out tmp/rspec.xml

- name: Publish Rspec Test Results
uses: mikepenz/action-junit-report@v4
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with: { bundler-cache: true }
- run: bundle exec rspec --format documentation --format RspecJunitFormatter --out tmp/rspec.xml
- uses: mikepenz/action-junit-report@v6
if: success() || failure()
with:
check_name: Rspec Test Results
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ log

*.gem
.history

.DS_Store
15 changes: 12 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

source 'https://rubygems.org'

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# Specify your gem's dependencies in rolemodel_rails.gemspec
# Specify your gem's dependencies in rolemodel-rails.gemspec.
gemspec

# Gems which are necessary to boot the included test applications,
# but should not be bundled with this gem may be added here.
gem 'pg'
gem 'propshaft'
gem 'puma'
gem 'stimulus-rails'
gem 'turbo-rails'

# Start debugger with binding.b [https://github.com/ruby/debug]
gem 'debug', '>= 1.0.0'
57 changes: 41 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
rolemodel_rails (0.27.1)
rolemodel-rails (0.27.1)
rails (> 7.1)

GEM
Expand Down Expand Up @@ -90,7 +90,10 @@ GEM
connection_pool (3.0.2)
crass (1.0.6)
date (3.5.1)
diff-lcs (1.5.0)
debug (1.11.1)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.6.2)
drb (2.2.3)
erb (6.0.1)
erubi (1.13.1)
Expand Down Expand Up @@ -137,17 +140,27 @@ GEM
nokogiri (1.19.0)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.19.0-x86_64-linux-gnu)
racc (~> 1.4)
parallel (1.27.0)
parser (3.3.8.0)
ast (~> 2.4.1)
racc
pg (1.6.3-arm64-darwin)
pg (1.6.3-x86_64-linux)
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
propshaft (1.3.1)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
psych (5.3.1)
date
stringio
puma (7.2.0)
nio4r (~> 2.0)
racc (1.8.1)
rack (3.2.4)
rack-session (2.1.1)
Expand Down Expand Up @@ -196,19 +209,19 @@ GEM
regexp_parser (2.10.0)
reline (0.6.3)
io-console (~> 0.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.1)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.1)
rspec-support (~> 3.13.0)
rspec-support (3.13.7)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.78.0)
Expand All @@ -232,10 +245,15 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.2.0)
thor (1.5.0)
timeout (0.6.0)
tsort (0.2.0)
turbo-rails (2.0.23)
actionpack (>= 7.1.0)
railties (>= 7.1.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.4)
Expand All @@ -250,18 +268,25 @@ GEM
zeitwerk (2.7.4)

PLATFORMS
ruby
arm64-darwin-25
x86_64-linux

DEPENDENCIES
benchmark
bundler (~> 4)
debug (>= 1.0.0)
generator_spec (~> 0.10)
pg
propshaft
puma
rake (~> 13)
rolemodel_rails!
rolemodel-rails!
rspec (~> 3)
rspec_junit_formatter
rubocop
rubocop-rails
stimulus-rails
turbo-rails

BUNDLED WITH
4.0.5
4.0.8
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Attempts to solve the pain of:

## Precondition

The rolemodel_rails gem expects to be added to an existing Rails project. Typically those are started with:
The rolemodel-rails gem expects to be added to an existing Rails project. Typically those are started with:

```shell
rails new <app-name> --javascript=webpack --database=postgresql --skip-test
Expand All @@ -29,7 +29,7 @@ Add this line to your application's Gemfile:

```ruby
group :development do
gem 'rolemodel_rails', github: 'RoleModel/rolemodel_rails'
gem 'rolemodel-rails', github: 'RoleModel/rolemodel_rails'
end
```

Expand Down Expand Up @@ -115,7 +115,7 @@ e.g.
bin/new_generator testing/fantasitic_specs 'A Fantastic Testing Framework'
```

We use the embeded Rails apps (`example_rails*`) to test generators against. They reference the rolemodel_rails gem by local path,
We use the embeded Rails apps (`example_rails*`) to test generators against. They reference the rolemodel-rails gem by local path,
so you can navigate into one of them and run your generator for immediate feedback while developing.

> [!IMPORTANT]
Expand Down
24 changes: 6 additions & 18 deletions bin/bump_version
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby

require 'bundler/setup'
require 'rolemodel_rails/version'
require 'rolemodel/version'
require 'rake/file_list'
require 'thor'

Expand All @@ -17,23 +17,17 @@ class VersionBumper < Thor::Group
source_root File.expand_path('../', __FILE__)

def bump_version
gsub_file 'lib/rolemodel_rails/version.rb', /^ VERSION = .*/, " VERSION = '#{new_version_string}'"
gsub_file 'lib/rolemodel/version.rb', /^ VERSION = .*/, " VERSION = '#{new_version_string}'"
end

def update_lockfile
run_clean_bundle_install
Bundler.with_original_env do
run "#{Gem.bin_path("bundler", "bundle")} install --quiet"
end
end

def build_gem
run 'gem build rolemodel_rails.gemspec'
end

def update_current_example_app
Rake::FileList.new('example_rails*').each do |example_path|
inside(example_path) do
run_clean_bundle_install
end
end
run 'gem build rolemodel-rails.gemspec'
end

def echo_new_version
Expand Down Expand Up @@ -61,12 +55,6 @@ class VersionBumper < Thor::Group
)
end

def run_clean_bundle_install
Bundler.with_original_env do
run "#{Gem.bin_path("bundler", "bundle")} install --quiet"
end
end

class << self
def banner = 'bin/bump_version [--patch|--major|--version VERSION]'
def desc = 'Update Gem Version & Sync Example Apps'
Expand Down
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "rolemodel_rails"
require "rolemodel-rails"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand Down
14 changes: 14 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.

ENGINE_ROOT = File.expand_path("..", __dir__)
ENGINE_PATH = File.expand_path("../lib/rolemodel/engine", __dir__)
APP_PATH = File.expand_path("../example_rails8/config/application", __dir__)

# Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])

require "rails/all"
require "rails/engine/commands"
2 changes: 1 addition & 1 deletion bin/recreate_current_example
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rails _"$RAILS_VERSION"_ new --skip-keeps --skip-git --skip-jbuilder -j webpack

cd example_rails$MAJOR_VERSION_NUMBER

bundle add --group development --path '..' --version '> 0.20' rolemodel_rails
bundle add --group development --path '..' --version '> 0.20' rolemodel-rails
bundle install

rm config/credentials.yml.enc
Expand Down
2 changes: 1 addition & 1 deletion bin/recreate_legacy_example
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rails _"$RAILS_VERSION"_ new --skip-keeps --skip-git --skip-jbuilder -j webpack

cd example_rails7

bundle add --group development --path '..' --version '> 0.20' rolemodel_rails
bundle add --group development --path '..' --version '> 0.20' rolemodel-rails
bundle install

rm config/credentials.yml.enc
Expand Down
2 changes: 0 additions & 2 deletions example_rails7/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,3 @@ group :test do
gem "capybara"
gem "selenium-webdriver"
end

gem "rolemodel_rails", "> 0.20", group: :development, path: ".."
13 changes: 1 addition & 12 deletions example_rails7/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
PATH
remote: ..
specs:
rolemodel_rails (0.27.1)
rails (> 7.1)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -135,7 +129,6 @@ GEM
marcel (1.1.0)
matrix (0.4.3)
mini_mime (1.1.5)
mini_portile2 (2.8.9)
minitest (5.27.0)
msgpack (1.8.0)
net-imap (0.5.12)
Expand All @@ -148,9 +141,6 @@ GEM
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4)
nokogiri (1.18.10)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.18.10-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.10-aarch64-linux-musl)
Expand Down Expand Up @@ -333,7 +323,6 @@ DEPENDENCIES
pg (~> 1.1)
puma (>= 5.0)
rails (~> 7.2.2, >= 7.2.2.1)
rolemodel_rails (> 0.20)!
rubocop-rails-omakase
selenium-webdriver
sprockets-rails
Expand All @@ -343,4 +332,4 @@ DEPENDENCIES
web-console

BUNDLED WITH
4.0.5
2.7.2
7 changes: 4 additions & 3 deletions example_rails7/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
# Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __dir__)

require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
$LOAD_PATH.unshift File.expand_path("../../lib", __dir__)
2 changes: 0 additions & 2 deletions example_rails8/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,3 @@ group :test do
gem "capybara"
gem "selenium-webdriver"
end

gem "rolemodel_rails", "> 0.20", group: :development, path: ".."
Loading