rails-static-router 1.0.2 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +45 -0
- data/Appraisals +14 -0
- data/README.md +16 -2
- data/gemfiles/{rails41.gemfile → rails61.gemfile} +2 -2
- data/gemfiles/{rails42.gemfile → rails70.gemfile} +2 -2
- data/lib/action_dispatch/routing/static_responder.rb +14 -6
- data/lib/rails_static_router/version.rb +1 -1
- data/rails-static-router.gemspec +1 -1
- metadata +10 -10
- data/.travis.yml +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5afbaac5e8b46b8a81637080a997639817c4182f25f36b52c3e1eecc525cf6c
|
4
|
+
data.tar.gz: '002957e19d71dd402d3ff486121d94a84a0925980f76446e31565664fd4f39bb'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 659fc566ff5fd77b5d342504cc51fed8fd18e7351f464f1ef5493e03553dabfe8f91d46d7960ba498e2b22d528093b8b505ac437f0523f97d125c988b3baaa03
|
7
|
+
data.tar.gz: e1573c4c8590dfa8852ace996aadf1c4b78b791a723622c7dc3170b2baaa840a0cf2231132647e2290f0107e81e741807a1a7aa47ce04a5757b4dbb44acbb80b
|
@@ -0,0 +1,45 @@
|
|
1
|
+
name: Main
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
strategy:
|
10
|
+
fail-fast: false
|
11
|
+
matrix:
|
12
|
+
include:
|
13
|
+
- gemfile: gemfiles/rails50.gemfile
|
14
|
+
rubyver: 2.4.6
|
15
|
+
- gemfile: gemfiles/rails51.gemfile
|
16
|
+
rubyver: 2.4.6
|
17
|
+
- gemfile: gemfiles/rails52.gemfile
|
18
|
+
rubyver: 2.4.6
|
19
|
+
- gemfile: gemfiles/rails60.gemfile
|
20
|
+
rubyver: 2.6.8
|
21
|
+
- gemfile: gemfiles/rails61.gemfile
|
22
|
+
rubyver: 2.7.4
|
23
|
+
- gemfile: gemfiles/rails70.gemfile
|
24
|
+
rubyver: 3.1.2
|
25
|
+
|
26
|
+
env:
|
27
|
+
RAILS_ENV: test
|
28
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
29
|
+
|
30
|
+
steps:
|
31
|
+
- uses: actions/checkout@v2
|
32
|
+
|
33
|
+
- name: Set up Ruby
|
34
|
+
uses: ruby/setup-ruby@v1
|
35
|
+
with:
|
36
|
+
# Not needed with a .ruby-version file
|
37
|
+
ruby-version: ${{ matrix.rubyver }}
|
38
|
+
# runs 'bundle install' and caches installed gems automatically
|
39
|
+
bundler-cache: true
|
40
|
+
|
41
|
+
- name: Run tests
|
42
|
+
env:
|
43
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
44
|
+
run: |
|
45
|
+
bundle exec rake test
|
data/Appraisals
CHANGED
@@ -39,3 +39,17 @@ appraise 'rails60' do
|
|
39
39
|
|
40
40
|
gem 'rspec-rails'
|
41
41
|
end
|
42
|
+
|
43
|
+
appraise 'rails61' do
|
44
|
+
gem 'rails', '~> 6.1.0'
|
45
|
+
gem 'sqlite3'
|
46
|
+
|
47
|
+
gem 'rspec-rails'
|
48
|
+
end
|
49
|
+
|
50
|
+
appraise 'rails70' do
|
51
|
+
gem 'rails', '~> 7.0.1'
|
52
|
+
gem 'sqlite3'
|
53
|
+
|
54
|
+
gem 'rspec-rails'
|
55
|
+
end
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rails Static Router [](https://travis-ci.org/mufid/rails-static-router)
|
1
|
+
# Rails Static Router [](https://travis-ci.org/mufid/rails-static-router) [](https://badge.fury.io/rb/rails-static-router)
|
2
2
|
|
3
3
|
Enjoy static routes in your Rails `config/routes.rb`.
|
4
4
|
|
@@ -42,7 +42,16 @@ new_user_registration GET /register(.:format) static('index.html')
|
|
42
42
|
|
43
43
|
## Compatibility
|
44
44
|
|
45
|
-
This gem is compatible with Rails
|
45
|
+
This gem is compatible with Rails 5.0+.
|
46
|
+
|
47
|
+
If you want to use with Rails 4.1 or Rails 4.2, use version 1.0.4:
|
48
|
+
|
49
|
+
gem 'rails-static-router', '1.0.4'
|
50
|
+
|
51
|
+
## Rails API Mode
|
52
|
+
|
53
|
+
We don't recommend use this gem if you are using Rails API Mode. Your apps
|
54
|
+
supposed to only serving API, not assets.
|
46
55
|
|
47
56
|
## Why?
|
48
57
|
|
@@ -114,3 +123,8 @@ For example:
|
|
114
123
|
|
115
124
|
For contributors that have access to release server, do the
|
116
125
|
following commands to release the gem.
|
126
|
+
|
127
|
+
# Edit version.rb to match next version, then
|
128
|
+
git add .
|
129
|
+
git commit -m "ops: <NEXT_VERSION> release"
|
130
|
+
bundle exec rake release
|
@@ -51,17 +51,19 @@ require 'action_dispatch/middleware/static'
|
|
51
51
|
|
52
52
|
module ActionDispatch
|
53
53
|
module Routing
|
54
|
+
|
54
55
|
if Gem::Version.new(Rails.version) >= Gem::Version.new('4.2')
|
55
56
|
class StaticResponder < Endpoint; end
|
56
57
|
else
|
57
58
|
class StaticResponder; end
|
58
59
|
end
|
59
60
|
|
60
|
-
if Gem::Version.new(Rails.version)
|
61
|
+
if Gem::Version.new(Rails.version) < Gem::Version.new('5.0')
|
61
62
|
class StaticResponder
|
62
63
|
def file_handler
|
63
64
|
@file_handler ||= ::ActionDispatch::FileHandler.new(
|
64
|
-
Rails.configuration.paths["public"].first
|
65
|
+
Rails.configuration.paths["public"].first,
|
66
|
+
Rails.configuration.static_cache_control
|
65
67
|
)
|
66
68
|
end
|
67
69
|
end
|
@@ -70,7 +72,7 @@ module ActionDispatch
|
|
70
72
|
def file_handler
|
71
73
|
@file_handler ||= ::ActionDispatch::FileHandler.new(
|
72
74
|
Rails.configuration.paths["public"].first,
|
73
|
-
Rails.configuration.
|
75
|
+
headers: Rails.configuration.public_file_server.headers
|
74
76
|
)
|
75
77
|
end
|
76
78
|
end
|
@@ -89,9 +91,15 @@ module ActionDispatch
|
|
89
91
|
file_handler
|
90
92
|
end
|
91
93
|
|
92
|
-
|
93
|
-
|
94
|
-
|
94
|
+
if Gem::Version.new(Rails.version) < Gem::Version.new('6.1')
|
95
|
+
def call(env)
|
96
|
+
env["PATH_INFO"] = @file_handler.match?(path)
|
97
|
+
@file_handler.call(env)
|
98
|
+
end
|
99
|
+
else
|
100
|
+
def call(env)
|
101
|
+
@file_handler.call(env)
|
102
|
+
end
|
95
103
|
end
|
96
104
|
|
97
105
|
def inspect
|
data/rails-static-router.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.summary = spec.description
|
16
16
|
spec.version = RailsStaticRouter::VERSION
|
17
17
|
|
18
|
-
spec.add_dependency 'railties', '>=
|
18
|
+
spec.add_dependency 'railties', '>= 5.0', '< 7.1'
|
19
19
|
|
20
20
|
# Test and build tools
|
21
21
|
# The test shouldn't broken by the incompatible RSpec version.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-static-router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eliot Sykes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -17,20 +17,20 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '5.0'
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '7.1'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
28
|
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: '
|
30
|
+
version: '5.0'
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '7.1'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: appraisal
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,21 +179,21 @@ extensions: []
|
|
179
179
|
extra_rdoc_files: []
|
180
180
|
files:
|
181
181
|
- ".editorconfig"
|
182
|
+
- ".github/workflows/main.yml"
|
182
183
|
- ".gitignore"
|
183
184
|
- ".rspec"
|
184
|
-
- ".travis.yml"
|
185
185
|
- Appraisals
|
186
186
|
- Gemfile
|
187
187
|
- LICENSE
|
188
188
|
- README.md
|
189
189
|
- Rakefile
|
190
190
|
- gemfiles/.gitignore
|
191
|
-
- gemfiles/rails41.gemfile
|
192
|
-
- gemfiles/rails42.gemfile
|
193
191
|
- gemfiles/rails50.gemfile
|
194
192
|
- gemfiles/rails51.gemfile
|
195
193
|
- gemfiles/rails52.gemfile
|
196
194
|
- gemfiles/rails60.gemfile
|
195
|
+
- gemfiles/rails61.gemfile
|
196
|
+
- gemfiles/rails70.gemfile
|
197
197
|
- lib/action_dispatch/routing/static_responder.rb
|
198
198
|
- lib/rails-static-router.rb
|
199
199
|
- lib/rails_static_router/railtie.rb
|
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
218
|
- !ruby/object:Gem::Version
|
219
219
|
version: '0'
|
220
220
|
requirements: []
|
221
|
-
rubygems_version: 3.
|
221
|
+
rubygems_version: 3.3.7
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Enjoy static routes in your Rails `config/routes.rb`
|
data/.travis.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: false
|
3
|
-
|
4
|
-
matrix:
|
5
|
-
include:
|
6
|
-
- gemfile: gemfiles/rails41.gemfile
|
7
|
-
rvm: 2.3.8
|
8
|
-
- gemfile: gemfiles/rails42.gemfile
|
9
|
-
rvm: 2.3.8
|
10
|
-
- gemfile: gemfiles/rails50.gemfile
|
11
|
-
rvm: 2.4.6
|
12
|
-
- gemfile: gemfiles/rails51.gemfile
|
13
|
-
rvm: 2.4.6
|
14
|
-
- gemfile: gemfiles/rails52.gemfile
|
15
|
-
rvm: 2.4.6
|
16
|
-
- gemfile: gemfiles/rails60.gemfile
|
17
|
-
rvm: 2.6.3
|