Skip to content

Commit adf3824

Browse files
authored
Adds Contributing.md (#211)
* don't run appraisal's for unsupported ruby versions * Add CONTRIBUTING.md with basic setup
1 parent 8b20363 commit adf3824

File tree

2 files changed

+56
-14
lines changed

2 files changed

+56
-14
lines changed

Appraisals

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
appraise "rails_6_1" do
2-
gem "rails", "~> 6.1.0"
3-
gem 'concurrent-ruby', '<= 1.3.4'
1+
RUBY_MAJOR_VERSION, RUBY_MINOR_VERSION, _ = RUBY_VERSION.split(".").map(&:to_i)
2+
3+
# run on ruby <= 3.2
4+
if RUBY_MAJOR_VERSION == 3 && RUBY_MINOR_VERSION <= 2
5+
appraise "rails_6_1" do
6+
gem "rails", "~> 6.1.0"
7+
gem 'concurrent-ruby', '<= 1.3.4'
8+
end
49
end
510

6-
appraise "rails_7_0" do
7-
gem "rails", "~> 7.0.0"
8-
gem 'concurrent-ruby', '<= 1.3.4'
9-
gem "propshaft"
11+
# run on ruby <= 3.3
12+
if RUBY_MAJOR_VERSION == 3 && RUBY_MINOR_VERSION <= 3
13+
appraise "rails_7_0" do
14+
gem "rails", "~> 7.0.0"
15+
gem 'concurrent-ruby', '<= 1.3.4'
16+
gem "propshaft"
17+
end
1018
end
1119

1220
appraise "rails_7_1" do
@@ -19,12 +27,15 @@ appraise "rails_7_2" do
1927
gem "propshaft"
2028
end
2129

22-
appraise "rails_8_0" do
23-
gem "rails", "~> 8.0.0"
24-
gem "propshaft"
25-
end
30+
# run on ruby >= 3.1
31+
if RUBY_MAJOR_VERSION >= 3 && RUBY_MINOR_VERSION > 1
32+
appraise "rails_8_0" do
33+
gem "rails", "~> 8.0.0"
34+
gem "propshaft"
35+
end
2636

27-
appraise "rails_main" do
28-
gem "rails", github: "rails/rails", branch: "main"
29-
gem "propshaft"
37+
appraise "rails_main" do
38+
gem "rails", github: "rails/rails", branch: "main"
39+
gem "propshaft"
40+
end
3041
end

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing
2+
3+
## How to contribute
4+
5+
This gem uses [Appraisal](https:..//github.com/thoughtbot/appraisal) to test against multiple versions of Rails.
6+
7+
Some versions of Ruby are not supported using different versions of Rails. Checkout
8+
the .github/workflows/ci.yml and Appraisals file to see which versions of Ruby are tested.
9+
10+
## Running tests
11+
12+
Install dependencies:
13+
14+
```bash
15+
bundle install
16+
bundle exec appraisal bundle install
17+
```
18+
19+
Both Appraisals and ci.yml define what versions of Ruby and Rails are supported.
20+
21+
Run tests for all Rails versions supported for your Ruby version:
22+
23+
```bash
24+
bundle exec appraisal bundle exec rake
25+
```
26+
27+
Run tests against a specific version of Rails:
28+
29+
```bash
30+
bundle exec appraisal rails_main bundle exec rake
31+
```

0 commit comments

Comments
 (0)