Skip to content

Create application template#5

Merged
stevepolitodesign merged 1 commit intomainfrom
sp-template
Nov 27, 2025
Merged

Create application template#5
stevepolitodesign merged 1 commit intomainfrom
sp-template

Conversation

@stevepolitodesign
Copy link
Owner

Introduces an application template.

Override the source_paths method to contain the location of the
template. Now methods like copy_file will accept relative paths to the
template's location.

Comment on lines +56 to +66
```
heroku apps:create

heroku buildpacks:set heroku/nodejs
heroku buildpacks:set heroku/ruby

heroku addons:create heroku-postgresql:essential-0
heroku addons:create heroku-redis:mini
heroku ci:config:set \
APPLICATION_HOST=value-from-heroku
RAILS_MASTER_KEY=value-from-config/master.key
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to verify this.

Because Staples sets `config.require_master_key = true`, you'll need to set this value in GitHub in order for GitHub Actions to work.

```
gh variable set RAILS_MASTER_KEY < config/master.key
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a Rails application template system that allows Staples to automatically configure new Rails applications with opinionated defaults including authentication (Devise), organizations, background jobs (Sidekiq), and a comprehensive test suite.

Key Changes:

  • Adds a source_paths method override to enable relative file copying in the template
  • Integrates the template into the CLI via the -m flag
  • Includes extensive application scaffolding (models, views, controllers, tests, migrations, and configuration)

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
lib/staples/cli.rb Updated to construct template path and pass it to rails new command via -m flag
spec/staples_spec.rb Updated tests to verify template path is included in rails new arguments
lib/templates/base.rb Main application template that orchestrates installation of gems, generators, and configuration
lib/templates/app/* Application code including models (User, Organization, Membership), views, and controllers
lib/templates/test/* Comprehensive test suite with factories, model tests, controller tests, and system tests
lib/templates/db/migrate/* Database migrations for users, organizations, and memberships
lib/templates/config/initializers/* Configuration for Sidekiq and High Voltage
lib/templates/lib/* Development seeder and rake tasks for local development
lib/templates/README.md Template README documenting features and configuration
lib/templates/Procfile Production process configuration for Heroku deployment
README.md Updated main README with extensive documentation of features, requirements, and deployment instructions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Introduces an [application template][template].

Override the `source_paths` method to contain the location of the
template. Now methods like `copy_file` will accept relative paths to the
template's location.

[template]: https://guides.rubyonrails.org/generators.html#application-templates
@stevepolitodesign stevepolitodesign merged commit 04c77ed into main Nov 27, 2025
3 checks passed
@stevepolitodesign stevepolitodesign deleted the sp-template branch November 27, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants