sprockets 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +72 -0
  3. data/README.md +665 -0
  4. data/bin/sprockets +93 -0
  5. data/lib/rake/sprocketstask.rb +153 -0
  6. data/lib/sprockets.rb +229 -0
  7. data/lib/sprockets/add_source_map_comment_to_asset_processor.rb +60 -0
  8. data/lib/sprockets/asset.rb +202 -0
  9. data/lib/sprockets/autoload.rb +16 -0
  10. data/lib/sprockets/autoload/babel.rb +8 -0
  11. data/lib/sprockets/autoload/closure.rb +8 -0
  12. data/lib/sprockets/autoload/coffee_script.rb +8 -0
  13. data/lib/sprockets/autoload/eco.rb +8 -0
  14. data/lib/sprockets/autoload/ejs.rb +8 -0
  15. data/lib/sprockets/autoload/jsminc.rb +8 -0
  16. data/lib/sprockets/autoload/sass.rb +8 -0
  17. data/lib/sprockets/autoload/sassc.rb +8 -0
  18. data/lib/sprockets/autoload/uglifier.rb +8 -0
  19. data/lib/sprockets/autoload/yui.rb +8 -0
  20. data/lib/sprockets/autoload/zopfli.rb +7 -0
  21. data/lib/sprockets/babel_processor.rb +66 -0
  22. data/lib/sprockets/base.rb +147 -0
  23. data/lib/sprockets/bower.rb +61 -0
  24. data/lib/sprockets/bundle.rb +105 -0
  25. data/lib/sprockets/cache.rb +271 -0
  26. data/lib/sprockets/cache/file_store.rb +208 -0
  27. data/lib/sprockets/cache/memory_store.rb +75 -0
  28. data/lib/sprockets/cache/null_store.rb +54 -0
  29. data/lib/sprockets/cached_environment.rb +64 -0
  30. data/lib/sprockets/closure_compressor.rb +48 -0
  31. data/lib/sprockets/coffee_script_processor.rb +39 -0
  32. data/lib/sprockets/compressing.rb +134 -0
  33. data/lib/sprockets/configuration.rb +79 -0
  34. data/lib/sprockets/context.rb +304 -0
  35. data/lib/sprockets/dependencies.rb +74 -0
  36. data/lib/sprockets/digest_utils.rb +200 -0
  37. data/lib/sprockets/directive_processor.rb +414 -0
  38. data/lib/sprockets/eco_processor.rb +33 -0
  39. data/lib/sprockets/ejs_processor.rb +32 -0
  40. data/lib/sprockets/encoding_utils.rb +262 -0
  41. data/lib/sprockets/environment.rb +46 -0
  42. data/lib/sprockets/erb_processor.rb +37 -0
  43. data/lib/sprockets/errors.rb +12 -0
  44. data/lib/sprockets/exporters/base.rb +71 -0
  45. data/lib/sprockets/exporters/file_exporter.rb +24 -0
  46. data/lib/sprockets/exporters/zlib_exporter.rb +33 -0
  47. data/lib/sprockets/exporters/zopfli_exporter.rb +14 -0
  48. data/lib/sprockets/exporting.rb +73 -0
  49. data/lib/sprockets/file_reader.rb +16 -0
  50. data/lib/sprockets/http_utils.rb +135 -0
  51. data/lib/sprockets/jsminc_compressor.rb +32 -0
  52. data/lib/sprockets/jst_processor.rb +50 -0
  53. data/lib/sprockets/loader.rb +345 -0
  54. data/lib/sprockets/manifest.rb +338 -0
  55. data/lib/sprockets/manifest_utils.rb +48 -0
  56. data/lib/sprockets/mime.rb +96 -0
  57. data/lib/sprockets/npm.rb +52 -0
  58. data/lib/sprockets/path_dependency_utils.rb +77 -0
  59. data/lib/sprockets/path_digest_utils.rb +48 -0
  60. data/lib/sprockets/path_utils.rb +367 -0
  61. data/lib/sprockets/paths.rb +82 -0
  62. data/lib/sprockets/preprocessors/default_source_map.rb +49 -0
  63. data/lib/sprockets/processing.rb +228 -0
  64. data/lib/sprockets/processor_utils.rb +169 -0
  65. data/lib/sprockets/resolve.rb +295 -0
  66. data/lib/sprockets/sass_cache_store.rb +30 -0
  67. data/lib/sprockets/sass_compressor.rb +63 -0
  68. data/lib/sprockets/sass_functions.rb +3 -0
  69. data/lib/sprockets/sass_importer.rb +3 -0
  70. data/lib/sprockets/sass_processor.rb +313 -0
  71. data/lib/sprockets/sassc_compressor.rb +56 -0
  72. data/lib/sprockets/sassc_processor.rb +297 -0
  73. data/lib/sprockets/server.rb +295 -0
  74. data/lib/sprockets/source_map_processor.rb +66 -0
  75. data/lib/sprockets/source_map_utils.rb +483 -0
  76. data/lib/sprockets/transformers.rb +173 -0
  77. data/lib/sprockets/uglifier_compressor.rb +66 -0
  78. data/lib/sprockets/unloaded_asset.rb +139 -0
  79. data/lib/sprockets/uri_tar.rb +99 -0
  80. data/lib/sprockets/uri_utils.rb +191 -0
  81. data/lib/sprockets/utils.rb +202 -0
  82. data/lib/sprockets/utils/gzip.rb +99 -0
  83. data/lib/sprockets/version.rb +4 -0
  84. data/lib/sprockets/yui_compressor.rb +56 -0
  85. metadata +444 -0
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+ module Sprockets
3
+ VERSION = "4.0.1"
4
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+ require 'sprockets/autoload'
3
+ require 'sprockets/digest_utils'
4
+
5
+ module Sprockets
6
+ # Public: YUI compressor.
7
+ #
8
+ # To accept the default options
9
+ #
10
+ # environment.register_bundle_processor 'application/javascript',
11
+ # Sprockets::YUICompressor
12
+ #
13
+ # Or to pass options to the YUI::JavaScriptCompressor class.
14
+ #
15
+ # environment.register_bundle_processor 'application/javascript',
16
+ # Sprockets::YUICompressor.new(munge: true)
17
+ #
18
+ class YUICompressor
19
+ VERSION = '1'
20
+
21
+ # Public: Return singleton instance with default options.
22
+ #
23
+ # Returns YUICompressor object.
24
+ def self.instance
25
+ @instance ||= new
26
+ end
27
+
28
+ def self.call(input)
29
+ instance.call(input)
30
+ end
31
+
32
+ def self.cache_key
33
+ instance.cache_key
34
+ end
35
+
36
+ attr_reader :cache_key
37
+
38
+ def initialize(options = {})
39
+ @options = options
40
+ @cache_key = "#{self.class.name}:#{Autoload::YUI::Compressor::VERSION}:#{VERSION}:#{DigestUtils.digest(options)}".freeze
41
+ end
42
+
43
+ def call(input)
44
+ data = input[:data]
45
+
46
+ case input[:content_type]
47
+ when 'application/javascript'
48
+ Autoload::YUI::JavaScriptCompressor.new(@options).compress(data)
49
+ when 'text/css'
50
+ Autoload::YUI::CssCompressor.new(@options).compress(data)
51
+ else
52
+ data
53
+ end
54
+ end
55
+ end
56
+ end
metadata ADDED
@@ -0,0 +1,444 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sprockets
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Sam Stephenson
8
+ - Joshua Peek
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2020-06-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rack
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">"
19
+ - !ruby/object:Gem::Version
20
+ version: '1'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '3'
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ">"
29
+ - !ruby/object:Gem::Version
30
+ version: '1'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '3'
34
+ - !ruby/object:Gem::Dependency
35
+ name: concurrent-ruby
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ - !ruby/object:Gem::Dependency
49
+ name: m
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: babel-transpiler
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.6'
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.6'
76
+ - !ruby/object:Gem::Dependency
77
+ name: closure-compiler
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.1'
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.1'
90
+ - !ruby/object:Gem::Dependency
91
+ name: coffee-script-source
92
+ requirement: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.6'
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.6'
104
+ - !ruby/object:Gem::Dependency
105
+ name: coffee-script
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.2'
111
+ type: :development
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.2'
118
+ - !ruby/object:Gem::Dependency
119
+ name: eco
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.0'
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.0'
132
+ - !ruby/object:Gem::Dependency
133
+ name: ejs
134
+ requirement: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.0'
139
+ type: :development
140
+ prerelease: false
141
+ version_requirements: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '1.0'
146
+ - !ruby/object:Gem::Dependency
147
+ name: execjs
148
+ requirement: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '2.0'
153
+ type: :development
154
+ prerelease: false
155
+ version_requirements: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '2.0'
160
+ - !ruby/object:Gem::Dependency
161
+ name: jsminc
162
+ requirement: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.1'
167
+ type: :development
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.1'
174
+ - !ruby/object:Gem::Dependency
175
+ name: timecop
176
+ requirement: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 0.9.1
181
+ type: :development
182
+ prerelease: false
183
+ version_requirements: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 0.9.1
188
+ - !ruby/object:Gem::Dependency
189
+ name: minitest
190
+ requirement: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '5.0'
195
+ type: :development
196
+ prerelease: false
197
+ version_requirements: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '5.0'
202
+ - !ruby/object:Gem::Dependency
203
+ name: nokogiri
204
+ requirement: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '1.3'
209
+ type: :development
210
+ prerelease: false
211
+ version_requirements: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '1.3'
216
+ - !ruby/object:Gem::Dependency
217
+ name: rack-test
218
+ requirement: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '0.6'
223
+ type: :development
224
+ prerelease: false
225
+ version_requirements: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '0.6'
230
+ - !ruby/object:Gem::Dependency
231
+ name: rake
232
+ requirement: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '12.0'
237
+ type: :development
238
+ prerelease: false
239
+ version_requirements: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '12.0'
244
+ - !ruby/object:Gem::Dependency
245
+ name: sass
246
+ requirement: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '3.4'
251
+ type: :development
252
+ prerelease: false
253
+ version_requirements: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - "~>"
256
+ - !ruby/object:Gem::Version
257
+ version: '3.4'
258
+ - !ruby/object:Gem::Dependency
259
+ name: sassc
260
+ requirement: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "~>"
263
+ - !ruby/object:Gem::Version
264
+ version: '2.0'
265
+ type: :development
266
+ prerelease: false
267
+ version_requirements: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "~>"
270
+ - !ruby/object:Gem::Version
271
+ version: '2.0'
272
+ - !ruby/object:Gem::Dependency
273
+ name: uglifier
274
+ requirement: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '2.3'
279
+ type: :development
280
+ prerelease: false
281
+ version_requirements: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ version: '2.3'
286
+ - !ruby/object:Gem::Dependency
287
+ name: yui-compressor
288
+ requirement: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - "~>"
291
+ - !ruby/object:Gem::Version
292
+ version: '0.12'
293
+ type: :development
294
+ prerelease: false
295
+ version_requirements: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - "~>"
298
+ - !ruby/object:Gem::Version
299
+ version: '0.12'
300
+ - !ruby/object:Gem::Dependency
301
+ name: zopfli
302
+ requirement: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - "~>"
305
+ - !ruby/object:Gem::Version
306
+ version: 0.0.4
307
+ type: :development
308
+ prerelease: false
309
+ version_requirements: !ruby/object:Gem::Requirement
310
+ requirements:
311
+ - - "~>"
312
+ - !ruby/object:Gem::Version
313
+ version: 0.0.4
314
+ - !ruby/object:Gem::Dependency
315
+ name: rubocop-performance
316
+ requirement: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - "~>"
319
+ - !ruby/object:Gem::Version
320
+ version: '1.3'
321
+ type: :development
322
+ prerelease: false
323
+ version_requirements: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - "~>"
326
+ - !ruby/object:Gem::Version
327
+ version: '1.3'
328
+ description: Sprockets is a Rack-based asset packaging system that concatenates and
329
+ serves JavaScript, CoffeeScript, CSS, Sass, and SCSS.
330
+ email:
331
+ - sstephenson@gmail.com
332
+ - josh@joshpeek.com
333
+ executables:
334
+ - sprockets
335
+ extensions: []
336
+ extra_rdoc_files: []
337
+ files:
338
+ - CHANGELOG.md
339
+ - README.md
340
+ - bin/sprockets
341
+ - lib/rake/sprocketstask.rb
342
+ - lib/sprockets.rb
343
+ - lib/sprockets/add_source_map_comment_to_asset_processor.rb
344
+ - lib/sprockets/asset.rb
345
+ - lib/sprockets/autoload.rb
346
+ - lib/sprockets/autoload/babel.rb
347
+ - lib/sprockets/autoload/closure.rb
348
+ - lib/sprockets/autoload/coffee_script.rb
349
+ - lib/sprockets/autoload/eco.rb
350
+ - lib/sprockets/autoload/ejs.rb
351
+ - lib/sprockets/autoload/jsminc.rb
352
+ - lib/sprockets/autoload/sass.rb
353
+ - lib/sprockets/autoload/sassc.rb
354
+ - lib/sprockets/autoload/uglifier.rb
355
+ - lib/sprockets/autoload/yui.rb
356
+ - lib/sprockets/autoload/zopfli.rb
357
+ - lib/sprockets/babel_processor.rb
358
+ - lib/sprockets/base.rb
359
+ - lib/sprockets/bower.rb
360
+ - lib/sprockets/bundle.rb
361
+ - lib/sprockets/cache.rb
362
+ - lib/sprockets/cache/file_store.rb
363
+ - lib/sprockets/cache/memory_store.rb
364
+ - lib/sprockets/cache/null_store.rb
365
+ - lib/sprockets/cached_environment.rb
366
+ - lib/sprockets/closure_compressor.rb
367
+ - lib/sprockets/coffee_script_processor.rb
368
+ - lib/sprockets/compressing.rb
369
+ - lib/sprockets/configuration.rb
370
+ - lib/sprockets/context.rb
371
+ - lib/sprockets/dependencies.rb
372
+ - lib/sprockets/digest_utils.rb
373
+ - lib/sprockets/directive_processor.rb
374
+ - lib/sprockets/eco_processor.rb
375
+ - lib/sprockets/ejs_processor.rb
376
+ - lib/sprockets/encoding_utils.rb
377
+ - lib/sprockets/environment.rb
378
+ - lib/sprockets/erb_processor.rb
379
+ - lib/sprockets/errors.rb
380
+ - lib/sprockets/exporters/base.rb
381
+ - lib/sprockets/exporters/file_exporter.rb
382
+ - lib/sprockets/exporters/zlib_exporter.rb
383
+ - lib/sprockets/exporters/zopfli_exporter.rb
384
+ - lib/sprockets/exporting.rb
385
+ - lib/sprockets/file_reader.rb
386
+ - lib/sprockets/http_utils.rb
387
+ - lib/sprockets/jsminc_compressor.rb
388
+ - lib/sprockets/jst_processor.rb
389
+ - lib/sprockets/loader.rb
390
+ - lib/sprockets/manifest.rb
391
+ - lib/sprockets/manifest_utils.rb
392
+ - lib/sprockets/mime.rb
393
+ - lib/sprockets/npm.rb
394
+ - lib/sprockets/path_dependency_utils.rb
395
+ - lib/sprockets/path_digest_utils.rb
396
+ - lib/sprockets/path_utils.rb
397
+ - lib/sprockets/paths.rb
398
+ - lib/sprockets/preprocessors/default_source_map.rb
399
+ - lib/sprockets/processing.rb
400
+ - lib/sprockets/processor_utils.rb
401
+ - lib/sprockets/resolve.rb
402
+ - lib/sprockets/sass_cache_store.rb
403
+ - lib/sprockets/sass_compressor.rb
404
+ - lib/sprockets/sass_functions.rb
405
+ - lib/sprockets/sass_importer.rb
406
+ - lib/sprockets/sass_processor.rb
407
+ - lib/sprockets/sassc_compressor.rb
408
+ - lib/sprockets/sassc_processor.rb
409
+ - lib/sprockets/server.rb
410
+ - lib/sprockets/source_map_processor.rb
411
+ - lib/sprockets/source_map_utils.rb
412
+ - lib/sprockets/transformers.rb
413
+ - lib/sprockets/uglifier_compressor.rb
414
+ - lib/sprockets/unloaded_asset.rb
415
+ - lib/sprockets/uri_tar.rb
416
+ - lib/sprockets/uri_utils.rb
417
+ - lib/sprockets/utils.rb
418
+ - lib/sprockets/utils/gzip.rb
419
+ - lib/sprockets/version.rb
420
+ - lib/sprockets/yui_compressor.rb
421
+ homepage: https://github.com/rails/sprockets
422
+ licenses:
423
+ - MIT
424
+ metadata: {}
425
+ post_install_message:
426
+ rdoc_options: []
427
+ require_paths:
428
+ - lib
429
+ required_ruby_version: !ruby/object:Gem::Requirement
430
+ requirements:
431
+ - - ">="
432
+ - !ruby/object:Gem::Version
433
+ version: 2.5.0
434
+ required_rubygems_version: !ruby/object:Gem::Requirement
435
+ requirements:
436
+ - - ">="
437
+ - !ruby/object:Gem::Version
438
+ version: '0'
439
+ requirements: []
440
+ rubygems_version: 3.1.2
441
+ signing_key:
442
+ specification_version: 4
443
+ summary: Rack-based asset packaging system
444
+ test_files: []