smart_assets 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +15 -0
- data/LICENSE.txt +1 -1
- data/README.md +3 -6
- data/lib/smart_assets/railtie.rb +8 -4
- data/lib/smart_assets/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 243ed25e84822ff06bd0b5942e1cfcc14d70aae1
|
4
|
+
data.tar.gz: 4dc83e40149a0ac6dfd63d0f4b17b8e99e7b80b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cff1dddef1938b7acc850e1dbb37a2a5f9aa2047947affccca322003fdb4c19e3182f0fc8b45c8d3a58662993e6e3729eb7e64f11abf24b24a821cb7f94b8514
|
7
|
+
data.tar.gz: 71e944abfb6ef78b5637969af25173fb9a234997a0bfdbe3405d6329ece9d961adc6e38fbd30db8ce3357ae42260a8e49f234568b257e10ae1ff9388e098dc6b
|
data/.gitignore
CHANGED
data/CHANGELOG.md
ADDED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -14,7 +14,7 @@ This middleware works by reading the sprockets manifest file and internally chan
|
|
14
14
|
|
15
15
|
In order to minimize the risks of long caching while using this gem, requests where the requested filename is mutated will set `Cache-Control: public,max-age=60`.
|
16
16
|
|
17
|
-
This can configured in your environment files (or an initializer). `max-age` is in seconds. If you've configured apache or nginx to set Cache-Control, you may need to ensure that configuration doesn't override this.
|
17
|
+
This can be configured in your environment files (or an initializer). `max-age` is in seconds. If you've configured apache or nginx to set Cache-Control, you may need to ensure that configuration doesn't override this.
|
18
18
|
|
19
19
|
config.smart_assets.cache_control = 'public,max-age=60'
|
20
20
|
|
@@ -26,12 +26,9 @@ This middleware may also be diabled on a per-environment basis with:
|
|
26
26
|
|
27
27
|
config.smart_assets.serve_non_digest_assets = false
|
28
28
|
|
29
|
-
|
29
|
+
The default is disabled for `development` and enabled for all other environments.
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
config.serve_static_files = true # Rails 4.2+
|
34
|
-
config.serve_static_assets = true # Rails 4.0 & 4.1
|
31
|
+
When this middleware is enabled for a given environment, it automatically enables serving of static files.
|
35
32
|
|
36
33
|
|
37
34
|
## Installation
|
data/lib/smart_assets/railtie.rb
CHANGED
@@ -11,11 +11,15 @@ module SmartAssets
|
|
11
11
|
prefix = app.config.smart_assets.prefix || app.config.assets.prefix || '/assets'
|
12
12
|
cc = app.config.smart_assets.cache_control
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
app.
|
14
|
+
if app.config.respond_to?(:public_file_server)
|
15
|
+
app.config.public_file_server.enabled = true # >= 5.0
|
16
|
+
elsif app.config.respond_to?(:serve_static_files)
|
17
|
+
app.config.serve_static_files = true # = 4.2
|
18
|
+
else
|
19
|
+
app.config.serve_static_assets = true # <= 4.1
|
18
20
|
end
|
21
|
+
|
22
|
+
app.middleware.insert_after(::Rack::Sendfile, SmartAssets::Rack, prefix, cc)
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
data/lib/smart_assets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thomas morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -86,6 +86,7 @@ extensions: []
|
|
86
86
|
extra_rdoc_files: []
|
87
87
|
files:
|
88
88
|
- ".gitignore"
|
89
|
+
- CHANGELOG.md
|
89
90
|
- Gemfile
|
90
91
|
- LICENSE.txt
|
91
92
|
- README.md
|
@@ -115,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
116
|
version: '0'
|
116
117
|
requirements: []
|
117
118
|
rubyforge_project:
|
118
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.6.12
|
119
120
|
signing_key:
|
120
121
|
specification_version: 4
|
121
122
|
summary: Rails/Rack middleware to enable delivery of non-digest assets
|