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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4180553a2366cd5d37a2267d012ceee0f94f333d
4
- data.tar.gz: ad873a2436fa2e45b9de249a5df8da78cabb5c9f
3
+ metadata.gz: 243ed25e84822ff06bd0b5942e1cfcc14d70aae1
4
+ data.tar.gz: 4dc83e40149a0ac6dfd63d0f4b17b8e99e7b80b4
5
5
  SHA512:
6
- metadata.gz: e7e1606aa3c2e246995993f17a21298874da2054597c06feab3ea3d8bc05807581f6eba1474b034e5eb48bd18c14d0fff40a7c8d4af2d00b50090d469e00052d
7
- data.tar.gz: 3f382bdcd68fab3b53b2c11c6f1cd12ce79ed4f9de0c3fdc7b24324a6fdf386c449211e0b083e3cd782dd2f0e6fc3acb8afd3de639d20329dc76e99c52a61346
6
+ metadata.gz: cff1dddef1938b7acc850e1dbb37a2a5f9aa2047947affccca322003fdb4c19e3182f0fc8b45c8d3a58662993e6e3729eb7e64f11abf24b24a821cb7f94b8514
7
+ data.tar.gz: 71e944abfb6ef78b5637969af25173fb9a234997a0bfdbe3405d6329ece9d961adc6e38fbd30db8ce3357ae42260a8e49f234568b257e10ae1ff9388e098dc6b
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .ruby-*
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ #### 0.4.0
2
+
3
+ - Fix Rails 5.1 compatibility
4
+ - Instead of requiring static file serving to be enabled in advance, turn it on
5
+ automatically.
6
+
7
+
8
+ #### 0.3.0
9
+
10
+ - Support Rails 5.0
11
+
12
+
13
+ #### 0.2.0
14
+
15
+ - Support Rails 4.2
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 thomas morgan
1
+ Copyright (c) 2014-2017 thomas morgan
2
2
 
3
3
  MIT License
4
4
 
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
- It is disabled by default for `development` environments, but may be enabled there using the above setting.
29
+ The default is disabled for `development` and enabled for all other environments.
30
30
 
31
- `serve_static_files` (`serve_static_assets` in Rails 4.0-4.1), or `assets.compile` must be changed to true or the middleware will disable itself:
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
@@ -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
- serve_static = app.config.respond_to?(:serve_static_files) ? app.config.serve_static_files : app.config.serve_static_assets
15
-
16
- if serve_static || app.config.assets.compile
17
- app.middleware.insert_after(::Rack::Sendfile, SmartAssets::Rack, prefix, cc)
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
 
@@ -1,3 +1,3 @@
1
1
  module SmartAssets
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
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.3.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: 2016-12-09 00:00:00.000000000 Z
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.4.8
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