smart_assets 0.5.0 → 1.1.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
  SHA256:
3
- metadata.gz: e136bc4b3048f09450f8b8c82273f9f3bc007912e304357fe857f79d7e84fbcc
4
- data.tar.gz: 6331834972800d5e830c88b82727d5549b3772505594896080e6d39cb02ba03e
3
+ metadata.gz: ba7e64f833285ce837eaa898746c6801a297495c3dc4a14869a2b7dfb12ee97a
4
+ data.tar.gz: b19a832d43a12a70769d017bb38e59ef2da16b18e62a5d480c75379673d39156
5
5
  SHA512:
6
- metadata.gz: 57c34fe81eceaad9d1f41f6009f19eaf7a48a39b7021f47a4e0f22937d2c8f3e690bbca0da8ee34a355858cb6159da0303c2174b94a0b39b2f134778e57ecf27
7
- data.tar.gz: 74bdf8ed5cc1f80d1616ac21c6a39f4556722a4984b23b63db5d4f8df90607d36374d1ec71aa0e4145067edf165646fd958257c3d48542508e9bf156e7728bc4
6
+ metadata.gz: d18dacb103fb7fe11b10bfa1cc5be9242fd8d10d2a7756a80748d041a52dc1b08c0577a24b05b4b8c6955f5f711fd91e8ed93c5587d078da480576e67233349b
7
+ data.tar.gz: eff33c723ee6a2c2a8a6a08afeb57438da50892f04564ca35f82754ea5011c0a58e02f26dc7ecef44050d9de2b1bbe3e35394f7bae29a6b94a4329c076c7953d
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2021 thomas morgan
1
+ Copyright (c) 2014-2024 thomas morgan
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -49,3 +49,8 @@ And then execute:
49
49
  3. Commit your changes (`git commit -am 'Add some feature'`)
50
50
  4. Push to the branch (`git push origin my-new-feature`)
51
51
  5. Create new Pull Request
52
+
53
+
54
+ ## License
55
+
56
+ MIT
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SmartAssets
2
4
  class Rack
3
5
 
@@ -18,6 +20,15 @@ module SmartAssets
18
20
  end
19
21
  status, headers, body = @app.call(env)
20
22
  if [200, 206].include?(status)
23
+ # rack 2 expects Mixed-Case headers, while rack 3 expects lower-case. rails doesn't ensure
24
+ # either one. normal controller actions use ActionDispatch::Response::Headers, which maps
25
+ # to rack 2's HeaderHash or rack 3's Headers, both of which are case-insensitive extensions
26
+ # to Hash. however, some responses (ActionDispatch::Static among them), just use Hash.
27
+ # more, Static relies on the user-configurable public_file_server.headers setting, which
28
+ # may have unpredictable casing regardless of the rails or rack version.
29
+ headers = ActionDispatch::Response::Headers[headers] if defined? ActionDispatch::Response::Headers
30
+
31
+ # keep Mixed-Case as long as supporting rails <= 7.0 or rack 2
21
32
  headers['Cache-Control'] = @cache_control
22
33
  headers['ETag'] ||= %("#{digest(digest_asset)}")
23
34
  end
@@ -11,13 +11,7 @@ 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
- 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
20
- end
14
+ app.config.public_file_server.enabled = true
21
15
 
22
16
  app.middleware.insert_after(::Rack::Sendfile, SmartAssets::Rack, prefix, cc)
23
17
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SmartAssets
2
- VERSION = '0.5.0'
4
+ VERSION = '1.1.0'
3
5
  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.5.0
4
+ version: 1.1.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: 2021-11-03 00:00:00.000000000 Z
11
+ date: 2024-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,27 +16,27 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '6.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.1'
22
+ version: '8.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.0'
29
+ version: '6.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.1'
32
+ version: '8.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: sprockets-rails
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '2'
39
+ version: '3'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '4'
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '2'
49
+ version: '3'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '4'
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubygems_version: 3.2.22
130
+ rubygems_version: 3.5.22
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Rails/Rack middleware to enable delivery of non-digest assets