Skip to content
This repository was archived by the owner on Sep 21, 2025. It is now read-only.

Commit efcec3c

Browse files
authored
Rails 6 compatibility (#121)
1 parent a581053 commit efcec3c

File tree

13 files changed

+157
-29
lines changed

13 files changed

+157
-29
lines changed

.circleci/config.yml

Lines changed: 93 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# * GEM_HOME
1111
# * BUNDLE_PATH
1212
# * BUNDLE_BIN
13-
1413
common_ruby_environment: &common_ruby_environment
1514
environment:
1615
RAILS_ENV: test
@@ -33,8 +32,7 @@ jobs:
3332
environment:
3433
PGDATA: /dev/shm/pgdata
3534
<<: *common_pg_environment_vars
36-
37-
- image: redis:3-alpine
35+
- image: redis:4-alpine
3836
steps:
3937
- checkout
4038

@@ -116,8 +114,7 @@ jobs:
116114
environment:
117115
PGDATA: /dev/shm/pgdata
118116
<<: *common_pg_environment_vars
119-
120-
- image: redis:3-alpine
117+
- image: redis:4-alpine
121118
steps:
122119
- checkout
123120

@@ -199,8 +196,7 @@ jobs:
199196
environment:
200197
PGDATA: /dev/shm/pgdata
201198
<<: *common_pg_environment_vars
202-
203-
- image: redis:3-alpine
199+
- image: redis:4-alpine
204200
steps:
205201
- checkout
206202

@@ -282,8 +278,7 @@ jobs:
282278
environment:
283279
PGDATA: /dev/shm/pgdata
284280
<<: *common_pg_environment_vars
285-
286-
- image: redis:3-alpine
281+
- image: redis:4-alpine
287282
steps:
288283
- checkout
289284

@@ -365,8 +360,7 @@ jobs:
365360
environment:
366361
PGDATA: /dev/shm/pgdata
367362
<<: *common_pg_environment_vars
368-
369-
- image: redis:3-alpine
363+
- image: redis:4-alpine
370364
steps:
371365
- checkout
372366

@@ -448,8 +442,7 @@ jobs:
448442
environment:
449443
PGDATA: /dev/shm/pgdata
450444
<<: *common_pg_environment_vars
451-
452-
- image: redis:3-alpine
445+
- image: redis:4-alpine
453446
steps:
454447
- checkout
455448

@@ -531,8 +524,7 @@ jobs:
531524
environment:
532525
PGDATA: /dev/shm/pgdata
533526
<<: *common_pg_environment_vars
534-
535-
- image: redis:3-alpine
527+
- image: redis:4-alpine
536528
steps:
537529
- checkout
538530

@@ -614,8 +606,7 @@ jobs:
614606
environment:
615607
PGDATA: /dev/shm/pgdata
616608
<<: *common_pg_environment_vars
617-
618-
- image: redis:3-alpine
609+
- image: redis:4-alpine
619610
steps:
620611
- checkout
621612

@@ -689,6 +680,89 @@ jobs:
689680
- ~/project/vendor/bundle
690681
- ~/project/vendor/bundle-scaffold
691682

683+
build_2.6.5_rails_6:
684+
docker:
685+
- image: ruby:2.6.5-alpine
686+
<<: *common_ruby_environment
687+
- image: postgres:9.6-alpine
688+
environment:
689+
PGDATA: /dev/shm/pgdata
690+
<<: *common_pg_environment_vars
691+
- image: redis:4-alpine
692+
steps:
693+
- checkout
694+
695+
- run:
696+
name: Setup RAM disk
697+
command: |
698+
rm -rf ~/project/tmp ;
699+
mkdir /dev/shm/tmp ;
700+
ln -s /dev/shm/tmp ~/project/tmp
701+
702+
- run:
703+
name: Setup requirements
704+
command: |
705+
apk add --update git bash build-base postgresql-dev sqlite-dev tzdata nodejs
706+
707+
- run:
708+
name: Configure bundler
709+
command: |
710+
unset \
711+
BUNDLE_APP_CONFIG \
712+
GEM_HOME \
713+
BUNDLE_PATH \
714+
BUNDLE_BIN
715+
bundle config --local gemfile $PWD/gemfiles/rails_6.gemfile
716+
717+
- restore_cache:
718+
keys:
719+
- v2-bundle-2.6.5-rails_6-{{ .Branch }}
720+
- v2-bundle-2.6.5-rails_6
721+
- v2-bundle-2.6.5
722+
723+
- run:
724+
name: Install bundle
725+
command: |
726+
unset \
727+
BUNDLE_APP_CONFIG \
728+
GEM_HOME \
729+
BUNDLE_PATH \
730+
BUNDLE_BIN
731+
bundle install --jobs=3 --retry=3 --path=$PWD/vendor/bundle
732+
733+
# The default Ruby containers modify the behaviour of Bundler in a way that breaks
734+
# the CI since it makes it harder to run multiple apps in a single container
735+
# See https://github.com/docker-library/docs/pull/1221/files for a summary
736+
# Unsettting the variables restores the default behaviour
737+
- run:
738+
name: Run test suite
739+
command: |
740+
unset \
741+
RACK_ENV \
742+
RAILS_ENV \
743+
BUNDLE_APP_CONFIG \
744+
GEM_HOME \
745+
BUNDLE_PATH \
746+
BUNDLE_BIN
747+
bundle exec rspec
748+
749+
- save_cache:
750+
key: v2-bundle-2.6.5-rails_6-{{ .Branch }}
751+
paths:
752+
- ~/project/vendor/bundle
753+
- ~/project/vendor/bundle-scaffold
754+
- save_cache:
755+
key: v2-bundle-2.6.5-rails_6
756+
paths:
757+
- ~/project/vendor/bundle
758+
- ~/project/vendor/bundle-scaffold
759+
- save_cache:
760+
key: v2-bundle-2.6.5
761+
paths:
762+
- ~/project/vendor/bundle
763+
- ~/project/vendor/bundle-scaffold
764+
765+
692766
workflows:
693767
version: 2
694768
test:
@@ -710,3 +784,5 @@ workflows:
710784

711785
- build_2.5.5_rails_5_2
712786

787+
- build_2.6.5_rails_6
788+

.circleci/config.yml.erb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@
1010
# * GEM_HOME
1111
# * BUNDLE_PATH
1212
# * BUNDLE_BIN
13-
13+
common_ruby_environment: &common_ruby_environment
14+
environment:
15+
RAILS_ENV: test
16+
PGHOST: 127.0.0.1
17+
PGUSER: postgres
18+
POSTGRES_HOST_AUTH_METHOD: "trust"
19+
common_pg_environment_vars: &common_pg_environment_vars
20+
POSTGRES_USER: postgres
21+
POSTGRES_DB: ror_testapp_test
22+
POSTGRES_HOST_AUTH_METHOD: "trust"
1423
<%
1524
builds = [
1625
['2.4.6', 'rails_4'],
@@ -20,7 +29,8 @@
2029
['2.5.5', 'rails_4'],
2130
['2.5.5', 'rails_5'],
2231
['2.5.5', 'rails_5_1'],
23-
['2.5.5', 'rails_5_2']
32+
['2.5.5', 'rails_5_2'],
33+
['2.6.5', 'rails_6']
2434
]
2535
%>
2636
version: 2
@@ -29,9 +39,11 @@ jobs:
2939
build_<%= ruby %>_<%= variant %>:
3040
docker:
3141
- image: ruby:<%= ruby %>-alpine
42+
<<: *common_ruby_environment
3243
- image: postgres:9.6-alpine
3344
environment:
3445
PGDATA: /dev/shm/pgdata
46+
<<: *common_pg_environment_vars
3547
- image: redis:4-alpine
3648
steps:
3749
- checkout

Appraisals

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@ appraise 'rails-5-2' do
2727
gem 'pg', '~> 0.18'
2828
gem 'rake', '13.0.1'
2929
end
30+
31+
appraise 'rails-6' do
32+
gem 'rails', '~> 6.0.3'
33+
gem 'bootsnap', '>= 1.1.0', require: false
34+
gem 'sqlite3', '~> 1.4'
35+
gem 'pg', '~> 0.18'
36+
gem 'rake', '13.0.1'
37+
end

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v2.1.0
2+
3+
Features:
4+
5+
- Rails 6 compatibility
6+
17
# v2.0.0-pre.2
28

39
Features:

appraise

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require 'yaml'
66

77

8-
RUBIES = ['2.4.5', '2.5.5']
8+
RUBIES = ['2.4.5', '2.5.5', '2.6.5']
99
APPRAISALS = `appraisal list`.strip.split(/\s+/)
1010

1111
# setup

gemfiles/rails_4.gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ gem "webmock"
99
gem "pg", "~> 0.11"
1010
gem "sqlite3", "~> 1.3.6"
1111
gem "rails", "~> 4.2"
12+
gem "sprockets", "~>3.0"
13+
gem "rake", "13.0.1"
1214

1315
gemspec path: "../"

gemfiles/rails_5.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ gem "webmock"
99
gem "pg", "~> 0.18"
1010
gem "sqlite3", "~> 1.3.6"
1111
gem "rails", "~> 5.0.0"
12+
gem "rake", "13.0.1"
1213

1314
gemspec path: "../"

gemfiles/rails_5_1.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ gem "guard-rspec"
77
gem "appraisal"
88
gem "webmock"
99
gem "pg", "~> 0.18"
10-
gem "sqlite3"
10+
gem "sqlite3", "~> 1.3.6"
1111
gem "rails", "~> 5.1.0"
12+
gem "rake", "13.0.1"
1213

1314
gemspec path: "../"

gemfiles/rails_5_2.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ gem "guard-rspec"
77
gem "appraisal"
88
gem "webmock"
99
gem "pg", "~> 0.18"
10-
gem "sqlite3"
10+
gem "sqlite3", "~> 1.3.6"
1111
gem "rails", "~> 5.2.0"
1212
gem "bootsnap", ">= 1.1.0", require: false
13+
gem "rake", "13.0.1"
1314

1415
gemspec path: "../"

gemfiles/rails_6.gemfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "guard"
6+
gem "guard-rspec"
7+
gem "appraisal"
8+
gem "webmock"
9+
gem "pg", "~> 0.18"
10+
gem "sqlite3", "~> 1.4"
11+
gem "rails", "~> 6.0.3"
12+
gem "bootsnap", ">= 1.1.0", require: false
13+
gem "rake", "13.0.1"
14+
15+
gemspec path: "../"

0 commit comments

Comments
 (0)