Skip to content

Commit

Permalink
Add option to install local build
Browse files Browse the repository at this point in the history
In the process of supporting Rails 8 via #1213, we realized we needed to
install a local build.

This commit simply introduces a `--suspenders-local` option, and
documents how to build locally.

Co-Authored-By: Nick Charlton <[email protected]>
  • Loading branch information
stevepolitodesign and nickcharlton committed Dec 5, 2024
1 parent 947dccf commit c69f21a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,32 @@ This is a time for discussion and improvements,
and making the necessary changes will be required before we can
merge the contribution.

## Testing a Local Build

There are cases where you'll want to use a local build, rather tha a released
version.

```
SUSPENDERS_LOCAL_PATH=/path/to/suspenders \
rails new app_name \
--suspenders-local \
--skip-rubocop \
--skip-test \
-d=postgresql \
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
```

You can also change the path used for the application template by setting the
`-m` flag to something else.

```
rails new app_name \
--skip-rubocop \
--skip-test \
-d=postgresql \
-m=path/to/suspenders/lib/install/web.rb
```

## Testing Generators

There is a smaller dummy application at `test/dummy`. This application is used
Expand Down
2 changes: 2 additions & 0 deletions lib/install/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def apply_template!
gem_group :development, :test do
if ARGV.include?("--suspenders-main")
gem "suspenders", github: "thoughtbot/suspenders", branch: "main"
elsif ARGV.include?("--suspenders-local") && ENV["SUSPENDERS_LOCAL_PATH"]
gem "suspenders", path: ENV.fetch("SUSPENDERS_LOCAL_PATH")
else
gem "suspenders"
end
Expand Down

0 comments on commit c69f21a

Please sign in to comment.