Skip to content

Commit d291026

Browse files
committed
Rails 8.0 + Rails 7.1 support
1 parent 975b343 commit d291026

File tree

12 files changed

+71
-10
lines changed

12 files changed

+71
-10
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
rubyver: 2.7.6
2323
- gemfile: gemfiles/rails70.gemfile
2424
rubyver: 3.1.2
25+
- gemfile: gemfiles/rails71.gemfile
26+
rubyver: 3.4.2
27+
- gemfile: gemfiles/rails80.gemfile
28+
rubyver: 3.4.2
2529

2630
env:
2731
RAILS_ENV: test

Appraisals

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,40 @@ end
2121

2222
appraise 'rails60' do
2323
gem 'rails', '~> 6.0.0'
24-
gem 'sqlite3'
24+
gem 'sqlite3', '~> 1.3.6'
25+
gem 'concurrent-ruby', '= 1.3.4'
2526

2627
gem 'rspec-rails'
2728
end
2829

2930
appraise 'rails61' do
3031
gem 'rails', '~> 6.1.0'
31-
gem 'sqlite3'
32+
gem 'sqlite3', '~> 1.4'
33+
gem 'rake', '< 11.0'
34+
gem 'concurrent-ruby', '= 1.3.4'
3235

3336
gem 'rspec-rails'
3437
end
3538

3639
appraise 'rails70' do
3740
gem 'rails', '~> 7.0.1'
41+
gem 'sqlite3', '~> 1.4'
42+
43+
gem 'concurrent-ruby', '= 1.3.4'
44+
gem 'rspec-rails'
45+
end
46+
47+
appraise 'rails71' do
48+
gem 'rails', '~> 7.1.0'
3849
gem 'sqlite3'
3950

4051
gem 'rspec-rails'
4152
end
53+
54+
appraise 'rails80' do
55+
gem 'rails', '~> 8.0.0'
56+
gem 'sqlite3'
57+
58+
gem 'rspec-rails'
59+
end
60+

gemfiles/rails60.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
source "https://rubygems.org"
44

55
gem "rails", "~> 6.0.0"
6-
gem "sqlite3"
6+
gem "sqlite3", "~> 1.3.6"
7+
gem "concurrent-ruby", "= 1.3.4"
78
gem "rspec-rails"
89

910
gemspec path: "../"

gemfiles/rails61.gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
source "https://rubygems.org"
44

55
gem "rails", "~> 6.1.0"
6-
gem "sqlite3"
6+
gem "sqlite3", "~> 1.4"
7+
gem "rake", "< 11.0"
8+
gem "concurrent-ruby", "= 1.3.4"
79
gem "rspec-rails"
810

911
gemspec path: "../"

gemfiles/rails70.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
source "https://rubygems.org"
44

55
gem "rails", "~> 7.0.1"
6-
gem "sqlite3"
6+
gem "sqlite3", "~> 1.4"
7+
gem "concurrent-ruby", "= 1.3.4"
78
gem "rspec-rails"
89

910
gemspec path: "../"

gemfiles/rails71.gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", "~> 7.1.0"
6+
gem "sqlite3"
7+
gem "rspec-rails"
8+
9+
gemspec path: "../"

gemfiles/rails80.gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", "~> 8.0.0"
6+
gem "sqlite3"
7+
gem "rspec-rails"
8+
9+
gemspec path: "../"

lib/action_dispatch/routing/static_responder.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ def trigger_file_handler_initialization
9393

9494
def call(env)
9595
env["PATH_INFO"] = path
96+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7.1')
97+
status, headers, body = @file_handler.call(env)
98+
if headers['Cache-Control']
99+
headers.delete('last-modified')
100+
end
101+
return [status, headers, body]
102+
end
103+
96104
@file_handler.call(env)
97105
end
98106

rails-static-router.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
1515
spec.summary = spec.description
1616
spec.version = RailsStaticRouter::VERSION
1717

18-
spec.add_dependency 'railties', '>= 5.0', '< 7.1'
18+
spec.add_dependency 'railties', '>= 5.0', '< 8.1'
1919

2020
# Test and build tools
2121
# The test shouldn't broken by the incompatible RSpec version.

spec/dummy/config/application.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
module Dummy
1010
class Application < Rails::Application
11-
if Rails.version.match('7.0')
11+
if Rails.version.match('8.0')
12+
config.load_defaults 8.0
13+
elsif Rails.version.match('7.1')
14+
config.load_defaults 7.1
15+
elsif Rails.version.match('7.0')
1216
config.load_defaults 7.0
1317
elsif Rails.version.match('6.1')
1418
config.load_defaults 6.1
@@ -19,5 +23,7 @@ class Application < Rails::Application
1923
elsif Rails.version.match('5.1')
2024
config.load_defaults 5.1
2125
end
26+
27+
Rails.configuration.middleware.delete Rack::ETag
2228
end
2329
end

0 commit comments

Comments
 (0)