Skip to content

Adds Contributing.md #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 3, 2025
Merged
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
39 changes: 25 additions & 14 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
appraise "rails_6_1" do
gem "rails", "~> 6.1.0"
gem 'concurrent-ruby', '<= 1.3.4'
RUBY_MAJOR_VERSION, RUBY_MINOR_VERSION, _ = RUBY_VERSION.split(".").map(&:to_i)

# run on ruby <= 3.2
if RUBY_MAJOR_VERSION == 3 && RUBY_MINOR_VERSION <= 2
appraise "rails_6_1" do
gem "rails", "~> 6.1.0"
gem 'concurrent-ruby', '<= 1.3.4'
end
end

appraise "rails_7_0" do
gem "rails", "~> 7.0.0"
gem 'concurrent-ruby', '<= 1.3.4'
gem "propshaft"
# run on ruby <= 3.3
if RUBY_MAJOR_VERSION == 3 && RUBY_MINOR_VERSION <= 3
appraise "rails_7_0" do
gem "rails", "~> 7.0.0"
gem 'concurrent-ruby', '<= 1.3.4'
gem "propshaft"
end
end

appraise "rails_7_1" do
Expand All @@ -19,12 +27,15 @@ appraise "rails_7_2" do
gem "propshaft"
end

appraise "rails_8_0" do
gem "rails", "~> 8.0.0"
gem "propshaft"
end
# run on ruby >= 3.1
if RUBY_MAJOR_VERSION >= 3 && RUBY_MINOR_VERSION > 1
appraise "rails_8_0" do
gem "rails", "~> 8.0.0"
gem "propshaft"
end

appraise "rails_main" do
gem "rails", github: "rails/rails", branch: "main"
gem "propshaft"
appraise "rails_main" do
gem "rails", github: "rails/rails", branch: "main"
gem "propshaft"
end
end
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributing

## How to contribute

This gem uses [Appraisal](https:..//github.com/thoughtbot/appraisal) to test against multiple versions of Rails.

Some versions of Ruby are not supported using different versions of Rails. Checkout
the .github/workflows/ci.yml and Appraisals file to see which versions of Ruby are tested.

## Running tests

Install dependencies:

```bash
bundle install
bundle exec appraisal bundle install
```

Both Appraisals and ci.yml define what versions of Ruby and Rails are supported.

Run tests for all Rails versions supported for your Ruby version:

```bash
bundle exec appraisal bundle exec rake
```

Run tests against a specific version of Rails:

```bash
bundle exec appraisal rails_main bundle exec rake
```