non-digest-assets 1.2.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -19
  3. data/lib/non-digest-assets.rb +2 -18
  4. metadata +34 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52ec82545e132f58fcccffc6919e17cb7458f293703039e64774824e0d115d42
4
- data.tar.gz: b616bfa6fbcf8a8701db9f33ea27cdc9684cababfff96d9c96fe538067aa530e
3
+ metadata.gz: a9377e2c15c7460175fcefb2cd3696932f58fe8e827cd197c094167e78bd383b
4
+ data.tar.gz: 3584f37ecde68edcb6e3f93c95381207a901ba4229e48ad2b662fa743753732d
5
5
  SHA512:
6
- metadata.gz: 1d6653fd4f4538997715f6583ece7dbafa942a8990c0ed5b77f91004a4db1619b2291e9df24f58721709c08f87dc75c8e63e4240f2351e440ddefab890721888
7
- data.tar.gz: bb926937f8faa5ca937faf754af3b1aaca51317617a288254e9bf15242633c3b7b324c1b1f721b50e292c8b5c7b8e1ed72b539fb3741259adf4124ca5e03556d
6
+ metadata.gz: 2cd7cb87d97efbf01fb645195ae26bed6d04d1e8b04fde0db039147e131f02b02d99d0268fc3d52be2e24bbeac95f2e2723d700ee0cc3ebde130ff79df7a8f01
7
+ data.tar.gz: 52f57dd038816014433586c0ec984db03752ce271d5ed2fab1320f06788e011086e19e32b9f3339238e7d3b8e0a0f9664a8b1d2bb5427511181eb06ea25ab031
data/README.md CHANGED
@@ -1,16 +1,13 @@
1
- Non-digest assets in Rails
2
- ==========================
1
+ # Non-digest assets in Rails
3
2
 
4
- What is it?
5
- -----------
3
+ ## What is it?
6
4
 
7
5
  In Rails starting from version 4, there is no way to by default compile both
8
6
  digest and non-digest assets. This is problematic if you also need to refer to
9
7
  assets from outside your Rails application. This gem solves the problem with the
10
8
  minimum possible effort.
11
9
 
12
- How do I install it?
13
- --------------------
10
+ ## How do I install it?
14
11
 
15
12
  Just put it in your Gemfile
16
13
 
@@ -33,8 +30,7 @@ path of the asset in question.
33
30
  Note that the logical path is what you would provide to `asset_url`, so for an
34
31
  image at `RAILS_ROOT/assets/images/foo.png` the logical path is `foo.png`
35
32
 
36
- But shouldn't I always use the Rails asset helpers anyway?
37
- ----------------------------------------------------------
33
+ ## But shouldn't I always use the Rails asset helpers anyway?
38
34
 
39
35
  Yes. But there are some obvious cases where you can't do this:
40
36
 
@@ -42,8 +38,8 @@ Yes. But there are some obvious cases where you can't do this:
42
38
  * In a static error page, e.g. a 404 page or a 500 page
43
39
  * Referencing the assets from outside your rails application
44
40
 
45
- What about other solutions?
46
- --------------------------
41
+ ## What about other solutions?
42
+
47
43
  [sprockets-redirect](https://github.com/sikachu/sprockets-redirect) uses a rack
48
44
  middleware to 302 redirect to the digest asset. This is terrible for
49
45
  performance because it requires 2 HTTP requests, and it also hits your ruby
@@ -55,27 +51,28 @@ will solve this problem, but requires an extra rake task. It won't work by
55
51
  default with things like capistrano / heroku. And it requires you to manage the
56
52
  code in your app.
57
53
 
58
- Why do I need digest assets at all?
59
- -----------------------------------
54
+ ## Why do I need digest assets at all?
60
55
 
61
56
  Digests are used for cache busting. Remember that if you use the non-digest
62
57
  assets and serve them with far-future expires headers, you will cause problems
63
58
  with cached assets if the contents ever need to change. You must bear this in
64
59
  mind when using non-digest assets.
65
60
 
66
- Why is this not the default or a config option in Rails?
67
- ----------------------------------------------------------------
61
+ ## Why is this not the default or a config option in Rails?
68
62
 
69
63
  The sprockets-rails developers do not want to support it.
70
64
  [Read the discussion here](https://github.com/rails/sprockets-rails/issues/49)
71
65
 
72
- Which versions of Ruby and Rails are supported?
73
- --------------------------------------
66
+ ## Which versions of Ruby and Rails are supported?
74
67
 
75
- This gem is tested with Rails 5.2 and 6.0 and targets Ruby 2.5 and up.
68
+ This gem is tested with Rails 5.2, 6.0, 6.1 and 7.0 alpha and targets Ruby 2.6
69
+ and up.
76
70
 
77
- Who wrote this?
78
- ---------------
71
+ ## Who wrote this?
79
72
 
80
73
  This gem was created under a different name by Alex Speller and is currently
81
74
  maintained by Matijs van Zuijlen.
75
+
76
+ ## Can I contribute?
77
+
78
+ Certainly. See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
@@ -2,11 +2,10 @@
2
2
 
3
3
  require "sprockets/manifest"
4
4
  require "active_support/core_ext/module/attribute_accessors"
5
- require "active_support/deprecation"
6
5
 
7
6
  module NonDigestAssets
8
- mattr_accessor :whitelist
9
- @@whitelist = []
7
+ mattr_accessor :asset_selectors
8
+ @@asset_selectors = []
10
9
 
11
10
  class << self
12
11
  def filter_assets(asset_list)
@@ -30,21 +29,6 @@ module NonDigestAssets
30
29
  FileUtils.rm_f to
31
30
  FileUtils.copy_file from, to, :preserve_attributes
32
31
  end
33
-
34
- def assets(asset_list)
35
- filter_assets(asset_list)
36
- end
37
-
38
- alias asset_selectors whitelist
39
- alias asset_selectors= whitelist=
40
-
41
- ActiveSupport::Deprecation
42
- .deprecate_methods(self,
43
- assets: "use filter_assets instead",
44
- whitelist: "use asset_selectors instead",
45
- "whitelist=": "use asset_selectors= instead",
46
- deprecator: ActiveSupport::Deprecation.new("2.0.0",
47
- "non-digest-assets"))
48
32
  end
49
33
 
50
34
  module CompileWithNonDigest
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: non-digest-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Speller
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-30 00:00:00.000000000 Z
12
+ date: 2022-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '5.2'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '6.2'
23
+ version: '7.1'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: '5.2'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '6.2'
33
+ version: '7.1'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: sprockets
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -99,20 +99,20 @@ dependencies:
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: '5.0'
102
+ version: '5.2'
103
103
  - - "<"
104
104
  - !ruby/object:Gem::Version
105
- version: '6.2'
105
+ version: '7.1'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
- version: '5.0'
112
+ version: '5.2'
113
113
  - - "<"
114
114
  - !ruby/object:Gem::Version
115
- version: '6.2'
115
+ version: '7.1'
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: rake
118
118
  requirement: !ruby/object:Gem::Requirement
@@ -147,14 +147,14 @@ dependencies:
147
147
  requirements:
148
148
  - - "~>"
149
149
  - !ruby/object:Gem::Version
150
- version: 1.18.1
150
+ version: '1.25'
151
151
  type: :development
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
154
154
  requirements:
155
155
  - - "~>"
156
156
  - !ruby/object:Gem::Version
157
- version: 1.18.1
157
+ version: '1.25'
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: rubocop-packaging
160
160
  requirement: !ruby/object:Gem::Requirement
@@ -175,28 +175,28 @@ dependencies:
175
175
  requirements:
176
176
  - - "~>"
177
177
  - !ruby/object:Gem::Version
178
- version: 1.11.3
178
+ version: '1.13'
179
179
  type: :development
180
180
  prerelease: false
181
181
  version_requirements: !ruby/object:Gem::Requirement
182
182
  requirements:
183
183
  - - "~>"
184
184
  - !ruby/object:Gem::Version
185
- version: 1.11.3
185
+ version: '1.13'
186
186
  - !ruby/object:Gem::Dependency
187
187
  name: rubocop-rails
188
188
  requirement: !ruby/object:Gem::Requirement
189
189
  requirements:
190
190
  - - "~>"
191
191
  - !ruby/object:Gem::Version
192
- version: 2.11.0
192
+ version: '2.13'
193
193
  type: :development
194
194
  prerelease: false
195
195
  version_requirements: !ruby/object:Gem::Requirement
196
196
  requirements:
197
197
  - - "~>"
198
198
  - !ruby/object:Gem::Version
199
- version: 2.11.0
199
+ version: '2.13'
200
200
  - !ruby/object:Gem::Dependency
201
201
  name: rubocop-rake
202
202
  requirement: !ruby/object:Gem::Requirement
@@ -217,14 +217,28 @@ dependencies:
217
217
  requirements:
218
218
  - - "~>"
219
219
  - !ruby/object:Gem::Version
220
- version: 2.4.0
220
+ version: '2.9'
221
+ type: :development
222
+ prerelease: false
223
+ version_requirements: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - "~>"
226
+ - !ruby/object:Gem::Version
227
+ version: '2.9'
228
+ - !ruby/object:Gem::Dependency
229
+ name: sprockets-rails
230
+ requirement: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - "~>"
233
+ - !ruby/object:Gem::Version
234
+ version: '3.0'
221
235
  type: :development
222
236
  prerelease: false
223
237
  version_requirements: !ruby/object:Gem::Requirement
224
238
  requirements:
225
239
  - - "~>"
226
240
  - !ruby/object:Gem::Version
227
- version: 2.4.0
241
+ version: '3.0'
228
242
  description: |2
229
243
  Rails provides no option to generate both digest and non-digest
230
244
  assets. Installing this gem automatically creates both digest and
@@ -241,7 +255,8 @@ files:
241
255
  homepage: http://github.com/mvz/non-digest-assets
242
256
  licenses:
243
257
  - MIT
244
- metadata: {}
258
+ metadata:
259
+ rubygems_mfa_required: 'true'
245
260
  post_install_message:
246
261
  rdoc_options: []
247
262
  require_paths:
@@ -250,14 +265,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
265
  requirements:
251
266
  - - ">="
252
267
  - !ruby/object:Gem::Version
253
- version: '2.5'
268
+ version: '2.6'
254
269
  required_rubygems_version: !ruby/object:Gem::Requirement
255
270
  requirements:
256
271
  - - ">="
257
272
  - !ruby/object:Gem::Version
258
273
  version: '0'
259
274
  requirements: []
260
- rubygems_version: 3.2.22
275
+ rubygems_version: 3.3.7
261
276
  signing_key:
262
277
  specification_version: 4
263
278
  summary: Make the Rails asset pipeline generate non-digest along with digest assets