rails-static-router 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/lib/action_dispatch/routing/static_responder.rb +5 -3
- data/lib/rails_static_router/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 054e4a02f816776d523074c6c3e559ee17d4e60a62c492d0e22abd98715ec41b
|
4
|
+
data.tar.gz: e98f916e13623a222e5455af37cf6ff52deaa5e2e867873b2853d276a66c47fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d9c385af9ccc89d8b13954ff3e0fc703cb9d24b52ddd7ce4b196176080ac1f75c0213f8372c1869e4b3204d8c37c6dc598814e381dec73e98623ff8dc8997a0
|
7
|
+
data.tar.gz: ea3bc1fad350289a7ee6b8fae9f4702869e08064dc9726b0d531561ddd06ede80b538f24b050c614a82b15cbf987cb4e9b5fdba3734d35f047794f9e98f8cd67
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rails Static Router [![Build Status](https://travis-ci.org/mufid/rails-static-router.svg?branch=master)](https://travis-ci.org/mufid/rails-static-router)
|
1
|
+
# Rails Static Router [![Build Status](https://travis-ci.org/mufid/rails-static-router.svg?branch=master)](https://travis-ci.org/mufid/rails-static-router) [![Gem Version](https://badge.fury.io/rb/rails-static-router.svg)](https://badge.fury.io/rb/rails-static-router)
|
2
2
|
|
3
3
|
Enjoy static routes in your Rails `config/routes.rb`.
|
4
4
|
|
@@ -114,3 +114,8 @@ For example:
|
|
114
114
|
|
115
115
|
For contributors that have access to release server, do the
|
116
116
|
following commands to release the gem.
|
117
|
+
|
118
|
+
# Edit version.rb to match next version, then
|
119
|
+
git add .
|
120
|
+
git commit -m "ops: <NEXT_VERSION> release"
|
121
|
+
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
|