Skip to content

Commit 06c8d27

Browse files
Suspenders 3.0.0
In an effort to improve the developer experience and reduce technical debt, we replace the existing project with the output from running: ``` rails plugin new suspenders ``` This will allow us to use existing [testing helpers][] provided by Rails. Because of this, we deliberately switch from RSpec to MiniTest. Additionally, we move away from [calver][]. Prior to that the latest major version was `1`. This feels like a good opportunity to go back to `semver` and start fresh with `3.0.0` [testing helpers]: https://edgeguides.rubyonrails.org/generators.html#testing-generators [calver]: https://calver.org
1 parent 55cb5c2 commit 06c8d27

File tree

238 files changed

+1228
-6029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+1228
-6029
lines changed

.github/workflows/main.yml

+16-43
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,28 @@
11
name: CI
22

33
on:
4-
workflow_dispatch:
54
push:
65
branches:
76
- main
7+
88
pull_request:
9-
paths-ignore:
10-
- 'docs/**'
11-
- '**.md'
129

1310
jobs:
14-
test:
15-
11+
build:
1612
runs-on: ubuntu-latest
17-
18-
services:
19-
postgres:
20-
image: postgres
21-
env:
22-
POSTGRES_USER: postgres
23-
POSTGRES_PASSWORD: postgres
24-
ports:
25-
- 5432:5432
26-
options: >-
27-
--health-cmd pg_isready
28-
--health-interval 10s
29-
--health-timeout 5s
30-
--health-retries 5
13+
name: Ruby ${{ matrix.ruby }}
14+
strategy:
15+
matrix:
16+
ruby:
17+
- '3.1.4'
18+
- '3.2.2'
3119

3220
steps:
33-
- name: Checkout code
34-
uses: actions/checkout@v2
35-
36-
- name: Set git configuration
37-
run: |
38-
git config --global init.defaultBranch main
39-
git config --global user.name 'GitHub Actions'
40-
git config --global user.email '[email protected]'
41-
42-
- name: Set up Ruby
43-
uses: ruby/setup-ruby@v1
44-
with:
45-
bundler-cache: false
46-
47-
- name: Install dependencies
48-
run: bundle install
49-
50-
- name: Run tests
51-
run: bin/rake
52-
env:
53-
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/dummy_app_test"
54-
DEBUG: 1
55-
SPEC_OPTS: "--no-color -f d"
21+
- uses: actions/checkout@v4
22+
- name: Set up Ruby
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: ${{ matrix.ruby }}
26+
bundler-cache: true
27+
- name: Run the default task
28+
run: bundle exec rake

.gitignore

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
*.gem
2-
*.swp
3-
Gemfile.lock
4-
/.bundle
5-
/tmp
1+
/.bundle/
2+
/doc/
3+
/log/*.log
4+
/pkg/
5+
/tmp/
6+
/test/dummy/db/*.sqlite3
7+
/test/dummy/db/*.sqlite3-*
8+
/test/dummy/log/*.log
9+
/test/dummy/storage/
10+
/test/dummy/tmp/

CONTRIBUTING.md

+35-39
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,55 @@
11
# Contributing
22

3-
We love pull requests from everyone. By participating in this project, you
4-
agree to abide by the thoughtbot [code of conduct].
3+
We love contributions from everyone.
4+
By participating in this project,
5+
you agree to abide by the thoughtbot [code of conduct].
56

6-
[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
7+
[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
78

8-
Fork the repo:
9+
We expect everyone to follow the code of conduct
10+
anywhere in thoughtbot's project codebases,
11+
issue trackers, chatrooms, and mailing lists.
912

10-
git clone [email protected]:thoughtbot/suspenders.git
13+
## Contributing Code
1114

12-
Set up your machine:
15+
Fork the repo.
1316

14-
./bin/setup
17+
Run the setup script.
1518

16-
Make sure the tests pass:
17-
18-
rake
19-
20-
Make your change. Write tests. Follow our [style guide][style]. Make the tests
21-
pass:
22-
23-
[style]: https://github.com/thoughtbot/guides/blob/main/ruby/README.md
24-
25-
rake
26-
27-
Mention how your changes affect the project to other developers and users in
28-
the `NEWS.md` file.
19+
```
20+
./bin/setup
21+
```
2922

30-
Write a [good commit message][commit].
31-
Push to your fork.
32-
[Submit a pull request][pr].
23+
Make sure the tests pass:
3324

34-
[commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
35-
[pr]: https://github.com/thoughtbot/suspenders/compare/
25+
```
26+
bundle exec rake
27+
```
3628

37-
If [Hound] catches style violations, fix them.
29+
Make your change, with new passing tests. Follow the [style guide][style].
3830

39-
[hound]: https://houndci.com
31+
[style]: https://github.com/thoughtbot/guides/tree/master/style
4032

41-
Wait for us. We try to at least comment on pull requests within one business
42-
day. We may suggest changes.
33+
Mention how your changes affect the project to other developers and users in the
34+
`NEWS.md` file.
4335

44-
## Generators
36+
Push to your fork. Write a [good commit message][commit]. Submit a pull request.
4537

46-
All new contributions must be within the generator framework, as described in
47-
[our goals](GOALS.md).
38+
[commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
4839

49-
## Versions
40+
Others will give constructive feedback.
41+
This is a time for discussion and improvements,
42+
and making the necessary changes will be required before we can
43+
merge the contribution.
5044

51-
To update the Ruby version, change `.ruby-version`.
45+
## Publishing to RubyGems
5246

53-
If you see this error while running tests:
47+
When the gem is ready to be shared as a formal release, it can be
48+
[published][published] to RubyGems.
5449

55-
```
56-
Your Ruby version is XXX, but your Gemfile specified YYY (Bundler::RubyVersionMismatch)
57-
```
50+
[published]: https://guides.rubyonrails.org/plugins.html#publishing-your-gem
5851

59-
Try removing the `tmp/` directory and re-running the tests.
52+
1. Bump the version number in `Suspenders::VERSION`
53+
2. Run `bundle exec rake build`
54+
3. Run `bundle exec rake install`
55+
4. Run `bundle exec rake release`

Gemfile

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
source "https://rubygems.org"
2+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
23

4+
# Specify your gem's dependencies in suspenders.gemspec.
35
gemspec
6+
7+
gem "puma"
8+
9+
gem "sqlite3"
10+
11+
# Start debugger with binding.b [https://github.com/ruby/debug]
12+
# gem "debug", ">= 1.0.0"

0 commit comments

Comments
 (0)