Skip to content

Commit

Permalink
Suspenders 3.0.0
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stevepolitodesign committed May 10, 2024
1 parent 55cb5c2 commit ab3eb97
Show file tree
Hide file tree
Showing 239 changed files with 1,233 additions and 6,029 deletions.
59 changes: 16 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,28 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- main

pull_request:
paths-ignore:
- 'docs/**'
- '**.md'

jobs:
test:

build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.1.4'
- '3.2.2'

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

- name: Set git configuration
run: |
git config --global init.defaultBranch main
git config --global user.name 'GitHub Actions'
git config --global user.email 'microsoft@example.com'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false

- name: Install dependencies
run: bundle install

- name: Run tests
run: bin/rake
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/dummy_app_test"
DEBUG: 1
SPEC_OPTS: "--no-color -f d"
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
15 changes: 10 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
*.gem
*.swp
Gemfile.lock
/.bundle
/tmp
/.bundle/
/doc/
/log/*.log
/pkg/
/tmp/
/test/dummy/db/*.sqlite3
/test/dummy/db/*.sqlite3-*
/test/dummy/log/*.log
/test/dummy/storage/
/test/dummy/tmp/
74 changes: 35 additions & 39 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,55 @@
# Contributing

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

[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct

Fork the repo:
We expect everyone to follow the code of conduct
anywhere in thoughtbot's project codebases,
issue trackers, chatrooms, and mailing lists.

git clone git@github.com:thoughtbot/suspenders.git
## Contributing Code

Set up your machine:
Fork the repo.

./bin/setup
Run the setup script.

Make sure the tests pass:

rake

Make your change. Write tests. Follow our [style guide][style]. Make the tests
pass:

[style]: https://github.com/thoughtbot/guides/blob/main/ruby/README.md

rake

Mention how your changes affect the project to other developers and users in
the `NEWS.md` file.
```
./bin/setup
```

Write a [good commit message][commit].
Push to your fork.
[Submit a pull request][pr].
Make sure the tests pass:

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

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

[hound]: https://houndci.com
[style]: https://github.com/thoughtbot/guides/tree/master/style

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

## Generators
Push to your fork. Write a [good commit message][commit]. Submit a pull request.

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

## Versions
Others will give constructive feedback.
This is a time for discussion and improvements,
and making the necessary changes will be required before we can
merge the contribution.

To update the Ruby version, change `.ruby-version`.
## Publishing to RubyGems

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

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

Try removing the `tmp/` directory and re-running the tests.
1. Bump the version number in `Suspenders::VERSION`
2. Run `bundle exec rake build`
3. Run `bundle exec rake install`
4. Run `bundle exec rake release`
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Specify your gem's dependencies in suspenders.gemspec.
gemspec

gem "puma"

gem "sqlite3"

# Start debugger with binding.b [https://github.com/ruby/debug]
# gem "debug", ">= 1.0.0"
Loading

0 comments on commit ab3eb97

Please sign in to comment.