sprockets 3.7.5 → 4.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +2 -307
- data/README.md +21 -35
- data/bin/sprockets +11 -8
- data/lib/rake/sprocketstask.rb +2 -2
- data/lib/sprockets/asset.rb +8 -21
- data/lib/sprockets/autoload/babel.rb +7 -0
- data/lib/sprockets/autoload/jsminc.rb +7 -0
- data/lib/sprockets/autoload/sassc.rb +7 -0
- data/lib/sprockets/autoload.rb +3 -0
- data/lib/sprockets/babel_processor.rb +58 -0
- data/lib/sprockets/base.rb +8 -8
- data/lib/sprockets/bower.rb +4 -2
- data/lib/sprockets/bundle.rb +1 -1
- data/lib/sprockets/cache.rb +2 -4
- data/lib/sprockets/closure_compressor.rb +1 -2
- data/lib/sprockets/coffee_script_processor.rb +9 -3
- data/lib/sprockets/compressing.rb +2 -2
- data/lib/sprockets/configuration.rb +1 -7
- data/lib/sprockets/context.rb +10 -18
- data/lib/sprockets/digest_utils.rb +40 -52
- data/lib/sprockets/directive_processor.rb +10 -15
- data/lib/sprockets/erb_processor.rb +1 -13
- data/lib/sprockets/http_utils.rb +19 -4
- data/lib/sprockets/jsminc_compressor.rb +31 -0
- data/lib/sprockets/jst_processor.rb +10 -10
- data/lib/sprockets/loader.rb +34 -28
- data/lib/sprockets/manifest.rb +3 -35
- data/lib/sprockets/manifest_utils.rb +0 -2
- data/lib/sprockets/mime.rb +7 -62
- data/lib/sprockets/path_dependency_utils.rb +2 -11
- data/lib/sprockets/path_digest_utils.rb +1 -1
- data/lib/sprockets/path_utils.rb +43 -18
- data/lib/sprockets/preprocessors/default_source_map.rb +24 -0
- data/lib/sprockets/processing.rb +30 -61
- data/lib/sprockets/processor_utils.rb +27 -28
- data/lib/sprockets/resolve.rb +172 -92
- data/lib/sprockets/sass_cache_store.rb +1 -6
- data/lib/sprockets/sass_compressor.rb +14 -1
- data/lib/sprockets/sass_processor.rb +18 -8
- data/lib/sprockets/sassc_compressor.rb +30 -0
- data/lib/sprockets/sassc_processor.rb +68 -0
- data/lib/sprockets/server.rb +11 -22
- data/lib/sprockets/source_map_comment_processor.rb +29 -0
- data/lib/sprockets/source_map_processor.rb +40 -0
- data/lib/sprockets/source_map_utils.rb +345 -0
- data/lib/sprockets/transformers.rb +62 -35
- data/lib/sprockets/uglifier_compressor.rb +12 -5
- data/lib/sprockets/unloaded_asset.rb +12 -11
- data/lib/sprockets/uri_tar.rb +4 -2
- data/lib/sprockets/uri_utils.rb +9 -14
- data/lib/sprockets/utils.rb +30 -79
- data/lib/sprockets/version.rb +1 -1
- data/lib/sprockets.rb +80 -35
- metadata +70 -41
- data/LICENSE +0 -21
- data/lib/sprockets/coffee_script_template.rb +0 -17
- data/lib/sprockets/deprecation.rb +0 -90
- data/lib/sprockets/eco_template.rb +0 -17
- data/lib/sprockets/ejs_template.rb +0 -17
- data/lib/sprockets/engines.rb +0 -92
- data/lib/sprockets/erb_template.rb +0 -11
- data/lib/sprockets/legacy.rb +0 -322
- data/lib/sprockets/legacy_proc_processor.rb +0 -35
- data/lib/sprockets/legacy_tilt_processor.rb +0 -29
- data/lib/sprockets/sass_template.rb +0 -19
data/lib/sprockets.rb
CHANGED
@@ -4,7 +4,6 @@ require 'sprockets/cache'
|
|
4
4
|
require 'sprockets/environment'
|
5
5
|
require 'sprockets/errors'
|
6
6
|
require 'sprockets/manifest'
|
7
|
-
require 'sprockets/deprecation'
|
8
7
|
|
9
8
|
module Sprockets
|
10
9
|
require 'sprockets/processor_utils'
|
@@ -23,21 +22,19 @@ module Sprockets
|
|
23
22
|
dependencies: Set.new.freeze,
|
24
23
|
dependency_resolvers: {}.freeze,
|
25
24
|
digest_class: Digest::SHA256,
|
26
|
-
engine_mime_types: {}.freeze,
|
27
|
-
engines: {}.freeze,
|
28
25
|
mime_exts: {}.freeze,
|
29
26
|
mime_types: {}.freeze,
|
30
27
|
paths: [].freeze,
|
31
28
|
pipelines: {}.freeze,
|
29
|
+
pipeline_exts: {}.freeze,
|
32
30
|
postprocessors: Hash.new { |h, k| [].freeze }.freeze,
|
33
31
|
preprocessors: Hash.new { |h, k| [].freeze }.freeze,
|
34
|
-
registered_transformers:
|
35
|
-
root:
|
32
|
+
registered_transformers: [].freeze,
|
33
|
+
root: __dir__.dup.freeze,
|
36
34
|
transformers: Hash.new { |h, k| {}.freeze }.freeze,
|
37
35
|
version: "",
|
38
36
|
gzip_enabled: true
|
39
37
|
}.freeze
|
40
|
-
self.computed_config = {}
|
41
38
|
|
42
39
|
@context_class = Context
|
43
40
|
|
@@ -48,6 +45,7 @@ module Sprockets
|
|
48
45
|
# Common asset text types
|
49
46
|
register_mime_type 'application/javascript', extensions: ['.js'], charset: :unicode
|
50
47
|
register_mime_type 'application/json', extensions: ['.json'], charset: :unicode
|
48
|
+
register_mime_type 'application/ruby', extensions: ['.rb']
|
51
49
|
register_mime_type 'application/xml', extensions: ['.xml']
|
52
50
|
register_mime_type 'text/css', extensions: ['.css'], charset: :css
|
53
51
|
register_mime_type 'text/html', extensions: ['.html', '.htm'], charset: :html
|
@@ -80,74 +78,123 @@ module Sprockets
|
|
80
78
|
register_mime_type 'application/x-font-opentype', extensions: ['.otf']
|
81
79
|
register_mime_type 'application/x-font-ttf', extensions: ['.ttf']
|
82
80
|
register_mime_type 'application/font-woff', extensions: ['.woff']
|
81
|
+
register_mime_type 'application/font-woff2', extensions: ['.woff2']
|
82
|
+
|
83
|
+
require 'sprockets/source_map_processor'
|
84
|
+
register_mime_type 'application/js-sourcemap+json', extensions: ['.js.map']
|
85
|
+
register_mime_type 'application/css-sourcemap+json', extensions: ['.css.map']
|
86
|
+
register_transformer 'application/javascript', 'application/js-sourcemap+json', SourceMapProcessor
|
87
|
+
register_transformer 'text/css', 'application/css-sourcemap+json', SourceMapProcessor
|
83
88
|
|
84
89
|
register_pipeline :source do |env|
|
85
90
|
[]
|
86
91
|
end
|
87
92
|
|
88
|
-
register_pipeline :self do |env, type, file_type
|
89
|
-
env.self_processors_for(type, file_type
|
93
|
+
register_pipeline :self do |env, type, file_type|
|
94
|
+
env.self_processors_for(type, file_type)
|
95
|
+
end
|
96
|
+
|
97
|
+
register_pipeline :default do |env, type, file_type|
|
98
|
+
# TODO: Hack for to inject source map transformer
|
99
|
+
if (type == "application/js-sourcemap+json" && file_type != "application/js-sourcemap+json") ||
|
100
|
+
(type == "application/css-sourcemap+json" && file_type != "application/css-sourcemap+json")
|
101
|
+
[SourceMapProcessor]
|
102
|
+
else
|
103
|
+
env.default_processors_for(type, file_type)
|
104
|
+
end
|
90
105
|
end
|
91
106
|
|
92
|
-
|
93
|
-
|
107
|
+
require 'sprockets/source_map_comment_processor'
|
108
|
+
register_pipeline :debug do
|
109
|
+
[SourceMapCommentProcessor]
|
94
110
|
end
|
95
111
|
|
112
|
+
require 'sprockets/preprocessors/default_source_map'
|
113
|
+
register_preprocessor 'text/css', Preprocessors::DefaultSourceMap.new
|
114
|
+
register_preprocessor 'application/javascript', Preprocessors::DefaultSourceMap.new
|
115
|
+
|
96
116
|
require 'sprockets/directive_processor'
|
97
|
-
register_preprocessor 'text/css', DirectiveProcessor.new(
|
98
|
-
|
99
|
-
)
|
100
|
-
register_preprocessor 'application/javascript', DirectiveProcessor.new(
|
101
|
-
comments: ["//", ["/*", "*/"]] + ["#", ["###", "###"]]
|
102
|
-
)
|
117
|
+
register_preprocessor 'text/css', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
118
|
+
register_preprocessor 'application/javascript', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
103
119
|
|
104
120
|
require 'sprockets/bundle'
|
105
121
|
register_bundle_processor 'application/javascript', Bundle
|
106
122
|
register_bundle_processor 'text/css', Bundle
|
107
123
|
|
108
|
-
register_bundle_metadata_reducer '*/*', :data, proc { "" },
|
124
|
+
register_bundle_metadata_reducer '*/*', :data, proc { "" }, :concat
|
109
125
|
register_bundle_metadata_reducer 'application/javascript', :data, proc { "" }, Utils.method(:concat_javascript_sources)
|
110
126
|
register_bundle_metadata_reducer '*/*', :links, :+
|
127
|
+
register_bundle_metadata_reducer '*/*', :map, SourceMapUtils.method(:concat_source_maps)
|
111
128
|
|
112
129
|
require 'sprockets/closure_compressor'
|
113
130
|
require 'sprockets/sass_compressor'
|
131
|
+
require 'sprockets/sassc_compressor'
|
132
|
+
require 'sprockets/jsminc_compressor'
|
114
133
|
require 'sprockets/uglifier_compressor'
|
115
134
|
require 'sprockets/yui_compressor'
|
116
135
|
register_compressor 'text/css', :sass, SassCompressor
|
136
|
+
register_compressor 'text/css', :sassc, SasscCompressor
|
117
137
|
register_compressor 'text/css', :scss, SassCompressor
|
138
|
+
register_compressor 'text/css', :scssc, SasscCompressor
|
118
139
|
register_compressor 'text/css', :yui, YUICompressor
|
119
140
|
register_compressor 'application/javascript', :closure, ClosureCompressor
|
141
|
+
register_compressor 'application/javascript', :jsmin, JSMincCompressor
|
142
|
+
register_compressor 'application/javascript', :jsminc, JSMincCompressor
|
120
143
|
register_compressor 'application/javascript', :uglifier, UglifierCompressor
|
121
144
|
register_compressor 'application/javascript', :uglify, UglifierCompressor
|
122
145
|
register_compressor 'application/javascript', :yui, YUICompressor
|
123
146
|
|
147
|
+
# Babel, TheFuture™ is now
|
148
|
+
require 'sprockets/babel_processor'
|
149
|
+
register_mime_type 'application/ecmascript-6', extensions: ['.es6'], charset: :unicode
|
150
|
+
register_transformer 'application/ecmascript-6', 'application/javascript', BabelProcessor
|
151
|
+
register_preprocessor 'application/ecmascript-6', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
152
|
+
|
124
153
|
# Mmm, CoffeeScript
|
125
154
|
require 'sprockets/coffee_script_processor'
|
126
|
-
|
127
|
-
|
128
|
-
|
155
|
+
register_mime_type 'text/coffeescript', extensions: ['.coffee', '.js.coffee']
|
156
|
+
register_transformer 'text/coffeescript', 'application/javascript', CoffeeScriptProcessor
|
157
|
+
register_preprocessor 'text/coffeescript', DirectiveProcessor.new(comments: ["#", ["###", "###"]])
|
129
158
|
|
130
|
-
# JST
|
159
|
+
# JST processors
|
131
160
|
require 'sprockets/eco_processor'
|
132
161
|
require 'sprockets/ejs_processor'
|
133
162
|
require 'sprockets/jst_processor'
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
163
|
+
register_mime_type 'text/eco', extensions: ['.eco', '.jst.eco']
|
164
|
+
register_mime_type 'text/ejs', extensions: ['.ejs', '.jst.ejs']
|
165
|
+
register_transformer 'text/eco', 'application/javascript+function', EcoProcessor
|
166
|
+
register_transformer 'text/ejs', 'application/javascript+function', EjsProcessor
|
167
|
+
register_transformer 'application/javascript+function', 'application/javascript', JstProcessor
|
139
168
|
|
140
|
-
# CSS
|
169
|
+
# CSS processors
|
141
170
|
require 'sprockets/sass_processor'
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
171
|
+
register_mime_type 'text/sass', extensions: ['.sass', '.css.sass']
|
172
|
+
register_mime_type 'text/scss', extensions: ['.scss', '.css.scss']
|
173
|
+
register_transformer 'text/sass', 'text/css', SassProcessor
|
174
|
+
register_transformer 'text/scss', 'text/css', ScssProcessor
|
175
|
+
register_preprocessor 'text/sass', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
176
|
+
register_preprocessor 'text/scss', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
146
177
|
register_bundle_metadata_reducer 'text/css', :sass_dependencies, Set.new, :+
|
147
178
|
|
148
|
-
#
|
179
|
+
# ERB
|
149
180
|
require 'sprockets/erb_processor'
|
150
|
-
|
181
|
+
register_transformer_suffix(%w(
|
182
|
+
application/ecmascript-6
|
183
|
+
application/javascript
|
184
|
+
application/json
|
185
|
+
application/xml
|
186
|
+
text/coffeescript
|
187
|
+
text/css
|
188
|
+
text/html
|
189
|
+
text/plain
|
190
|
+
text/sass
|
191
|
+
text/scss
|
192
|
+
text/yaml
|
193
|
+
), 'application/\2+ruby', '.erb', ERBProcessor)
|
194
|
+
|
195
|
+
register_mime_type 'application/html+ruby', extensions: ['.html.erb', '.erb', '.rhtml'], charset: :html
|
196
|
+
register_mime_type 'application/xml+ruby', extensions: ['.xml.erb', '.rxml']
|
197
|
+
|
151
198
|
|
152
199
|
register_dependency_resolver 'environment-version' do |env|
|
153
200
|
env.version
|
@@ -165,5 +212,3 @@ module Sprockets
|
|
165
212
|
depend_on 'environment-version'
|
166
213
|
depend_on 'environment-paths'
|
167
214
|
end
|
168
|
-
|
169
|
-
require 'sprockets/legacy'
|
metadata
CHANGED
@@ -1,30 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
8
8
|
- Joshua Peek
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: base64
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
21
|
-
type: :runtime
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: rack
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,6 +45,20 @@ dependencies:
|
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: '1.0'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: babel-transpiler
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.6'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.6'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: closure-compiler
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,6 +143,20 @@ dependencies:
|
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '2.0'
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
name: jsminc
|
148
|
+
requirement: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1.1'
|
153
|
+
type: :development
|
154
|
+
prerelease: false
|
155
|
+
version_requirements: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '1.1'
|
146
160
|
- !ruby/object:Gem::Dependency
|
147
161
|
name: minitest
|
148
162
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,30 +203,44 @@ dependencies:
|
|
189
203
|
name: rake
|
190
204
|
requirement: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
|
-
- - "
|
206
|
+
- - "~>"
|
193
207
|
- !ruby/object:Gem::Version
|
194
|
-
version: '0'
|
208
|
+
version: '10.0'
|
195
209
|
type: :development
|
196
210
|
prerelease: false
|
197
211
|
version_requirements: !ruby/object:Gem::Requirement
|
198
212
|
requirements:
|
199
|
-
- - "
|
213
|
+
- - "~>"
|
200
214
|
- !ruby/object:Gem::Version
|
201
|
-
version: '0'
|
215
|
+
version: '10.0'
|
202
216
|
- !ruby/object:Gem::Dependency
|
203
217
|
name: sass
|
204
218
|
requirement: !ruby/object:Gem::Requirement
|
205
219
|
requirements:
|
206
220
|
- - "~>"
|
207
221
|
- !ruby/object:Gem::Version
|
208
|
-
version: '3.
|
222
|
+
version: '3.4'
|
209
223
|
type: :development
|
210
224
|
prerelease: false
|
211
225
|
version_requirements: !ruby/object:Gem::Requirement
|
212
226
|
requirements:
|
213
227
|
- - "~>"
|
214
228
|
- !ruby/object:Gem::Version
|
215
|
-
version: '3.
|
229
|
+
version: '3.4'
|
230
|
+
- !ruby/object:Gem::Dependency
|
231
|
+
name: sassc
|
232
|
+
requirement: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - "~>"
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '1.7'
|
237
|
+
type: :development
|
238
|
+
prerelease: false
|
239
|
+
version_requirements: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - "~>"
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '1.7'
|
216
244
|
- !ruby/object:Gem::Dependency
|
217
245
|
name: uglifier
|
218
246
|
requirement: !ruby/object:Gem::Requirement
|
@@ -242,7 +270,7 @@ dependencies:
|
|
242
270
|
- !ruby/object:Gem::Version
|
243
271
|
version: '0.12'
|
244
272
|
description: Sprockets is a Rack-based asset packaging system that concatenates and
|
245
|
-
serves JavaScript, CoffeeScript, CSS,
|
273
|
+
serves JavaScript, CoffeeScript, CSS, Sass, and SCSS.
|
246
274
|
email:
|
247
275
|
- sstephenson@gmail.com
|
248
276
|
- josh@joshpeek.com
|
@@ -252,20 +280,23 @@ extensions: []
|
|
252
280
|
extra_rdoc_files: []
|
253
281
|
files:
|
254
282
|
- CHANGELOG.md
|
255
|
-
- LICENSE
|
256
283
|
- README.md
|
257
284
|
- bin/sprockets
|
258
285
|
- lib/rake/sprocketstask.rb
|
259
286
|
- lib/sprockets.rb
|
260
287
|
- lib/sprockets/asset.rb
|
261
288
|
- lib/sprockets/autoload.rb
|
289
|
+
- lib/sprockets/autoload/babel.rb
|
262
290
|
- lib/sprockets/autoload/closure.rb
|
263
291
|
- lib/sprockets/autoload/coffee_script.rb
|
264
292
|
- lib/sprockets/autoload/eco.rb
|
265
293
|
- lib/sprockets/autoload/ejs.rb
|
294
|
+
- lib/sprockets/autoload/jsminc.rb
|
266
295
|
- lib/sprockets/autoload/sass.rb
|
296
|
+
- lib/sprockets/autoload/sassc.rb
|
267
297
|
- lib/sprockets/autoload/uglifier.rb
|
268
298
|
- lib/sprockets/autoload/yui.rb
|
299
|
+
- lib/sprockets/babel_processor.rb
|
269
300
|
- lib/sprockets/base.rb
|
270
301
|
- lib/sprockets/bower.rb
|
271
302
|
- lib/sprockets/bundle.rb
|
@@ -276,30 +307,22 @@ files:
|
|
276
307
|
- lib/sprockets/cached_environment.rb
|
277
308
|
- lib/sprockets/closure_compressor.rb
|
278
309
|
- lib/sprockets/coffee_script_processor.rb
|
279
|
-
- lib/sprockets/coffee_script_template.rb
|
280
310
|
- lib/sprockets/compressing.rb
|
281
311
|
- lib/sprockets/configuration.rb
|
282
312
|
- lib/sprockets/context.rb
|
283
313
|
- lib/sprockets/dependencies.rb
|
284
|
-
- lib/sprockets/deprecation.rb
|
285
314
|
- lib/sprockets/digest_utils.rb
|
286
315
|
- lib/sprockets/directive_processor.rb
|
287
316
|
- lib/sprockets/eco_processor.rb
|
288
|
-
- lib/sprockets/eco_template.rb
|
289
317
|
- lib/sprockets/ejs_processor.rb
|
290
|
-
- lib/sprockets/ejs_template.rb
|
291
318
|
- lib/sprockets/encoding_utils.rb
|
292
|
-
- lib/sprockets/engines.rb
|
293
319
|
- lib/sprockets/environment.rb
|
294
320
|
- lib/sprockets/erb_processor.rb
|
295
|
-
- lib/sprockets/erb_template.rb
|
296
321
|
- lib/sprockets/errors.rb
|
297
322
|
- lib/sprockets/file_reader.rb
|
298
323
|
- lib/sprockets/http_utils.rb
|
324
|
+
- lib/sprockets/jsminc_compressor.rb
|
299
325
|
- lib/sprockets/jst_processor.rb
|
300
|
-
- lib/sprockets/legacy.rb
|
301
|
-
- lib/sprockets/legacy_proc_processor.rb
|
302
|
-
- lib/sprockets/legacy_tilt_processor.rb
|
303
326
|
- lib/sprockets/loader.rb
|
304
327
|
- lib/sprockets/manifest.rb
|
305
328
|
- lib/sprockets/manifest_utils.rb
|
@@ -308,6 +331,7 @@ files:
|
|
308
331
|
- lib/sprockets/path_digest_utils.rb
|
309
332
|
- lib/sprockets/path_utils.rb
|
310
333
|
- lib/sprockets/paths.rb
|
334
|
+
- lib/sprockets/preprocessors/default_source_map.rb
|
311
335
|
- lib/sprockets/processing.rb
|
312
336
|
- lib/sprockets/processor_utils.rb
|
313
337
|
- lib/sprockets/resolve.rb
|
@@ -316,8 +340,12 @@ files:
|
|
316
340
|
- lib/sprockets/sass_functions.rb
|
317
341
|
- lib/sprockets/sass_importer.rb
|
318
342
|
- lib/sprockets/sass_processor.rb
|
319
|
-
- lib/sprockets/
|
343
|
+
- lib/sprockets/sassc_compressor.rb
|
344
|
+
- lib/sprockets/sassc_processor.rb
|
320
345
|
- lib/sprockets/server.rb
|
346
|
+
- lib/sprockets/source_map_comment_processor.rb
|
347
|
+
- lib/sprockets/source_map_processor.rb
|
348
|
+
- lib/sprockets/source_map_utils.rb
|
321
349
|
- lib/sprockets/transformers.rb
|
322
350
|
- lib/sprockets/uglifier_compressor.rb
|
323
351
|
- lib/sprockets/unloaded_asset.rb
|
@@ -331,7 +359,7 @@ homepage: https://github.com/rails/sprockets
|
|
331
359
|
licenses:
|
332
360
|
- MIT
|
333
361
|
metadata: {}
|
334
|
-
post_install_message:
|
362
|
+
post_install_message:
|
335
363
|
rdoc_options: []
|
336
364
|
require_paths:
|
337
365
|
- lib
|
@@ -339,15 +367,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
339
367
|
requirements:
|
340
368
|
- - ">="
|
341
369
|
- !ruby/object:Gem::Version
|
342
|
-
version:
|
370
|
+
version: 2.0.0
|
343
371
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
344
372
|
requirements:
|
345
|
-
- - "
|
373
|
+
- - ">"
|
346
374
|
- !ruby/object:Gem::Version
|
347
|
-
version:
|
375
|
+
version: 1.3.1
|
348
376
|
requirements: []
|
349
|
-
|
350
|
-
|
377
|
+
rubyforge_project: sprockets
|
378
|
+
rubygems_version: 2.5.1
|
379
|
+
signing_key:
|
351
380
|
specification_version: 4
|
352
381
|
summary: Rack-based asset packaging system
|
353
382
|
test_files: []
|
data/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Sam Stephenson
|
2
|
-
Copyright (c) 2014 Joshua Peek
|
3
|
-
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
a copy of this software and associated documentation files (the
|
6
|
-
"Software"), to deal in the Software without restriction, including
|
7
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be
|
13
|
-
included in all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'sprockets/coffee_script_processor'
|
2
|
-
|
3
|
-
module Sprockets
|
4
|
-
# Deprecated
|
5
|
-
module CoffeeScriptTemplate
|
6
|
-
VERSION = CoffeeScriptProcessor::VERSION
|
7
|
-
|
8
|
-
def self.cache_key
|
9
|
-
CoffeeScriptProcessor.cache_key
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.call(*args)
|
13
|
-
Deprecation.new.warn "CoffeeScriptTemplate is deprecated please use CoffeeScriptProcessor instead"
|
14
|
-
CoffeeScriptProcessor.call(*args)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
module Sprockets
|
2
|
-
class Deprecation
|
3
|
-
THREAD_LOCAL__SILENCE_KEY = "_sprockets_deprecation_silence".freeze
|
4
|
-
DEFAULT_BEHAVIORS = {
|
5
|
-
raise: ->(message, callstack) {
|
6
|
-
e = DeprecationException.new(message)
|
7
|
-
e.set_backtrace(callstack.map(&:to_s))
|
8
|
-
raise e
|
9
|
-
},
|
10
|
-
|
11
|
-
stderr: ->(message, callstack) {
|
12
|
-
$stderr.puts(message)
|
13
|
-
},
|
14
|
-
}
|
15
|
-
|
16
|
-
attr_reader :callstack
|
17
|
-
|
18
|
-
def self.silence(&block)
|
19
|
-
Thread.current[THREAD_LOCAL__SILENCE_KEY] = true
|
20
|
-
block.call
|
21
|
-
ensure
|
22
|
-
Thread.current[THREAD_LOCAL__SILENCE_KEY] = false
|
23
|
-
end
|
24
|
-
|
25
|
-
def initialize(callstack = nil)
|
26
|
-
@callstack = callstack || caller(2)
|
27
|
-
end
|
28
|
-
|
29
|
-
def warn(message)
|
30
|
-
return if Thread.current[THREAD_LOCAL__SILENCE_KEY]
|
31
|
-
deprecation_message(message).tap do |m|
|
32
|
-
behavior.each { |b| b.call(m, callstack) }
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
def behavior
|
38
|
-
@behavior ||= [DEFAULT_BEHAVIORS[:stderr]]
|
39
|
-
end
|
40
|
-
|
41
|
-
def behavior=(behavior)
|
42
|
-
@behavior = Array(behavior).map { |b| DEFAULT_BEHAVIORS[b] || b }
|
43
|
-
end
|
44
|
-
|
45
|
-
def deprecation_message(message = nil)
|
46
|
-
message ||= "You are using deprecated behavior which will be removed from the next major or minor release."
|
47
|
-
"DEPRECATION WARNING: #{message} #{ deprecation_caller_message }"
|
48
|
-
end
|
49
|
-
|
50
|
-
def deprecation_caller_message
|
51
|
-
file, line, method = extract_callstack
|
52
|
-
if file
|
53
|
-
if line && method
|
54
|
-
"(called from #{method} at #{file}:#{line})"
|
55
|
-
else
|
56
|
-
"(called from #{file}:#{line})"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
SPROCKETS_GEM_ROOT = File.expand_path("../../../../..", __FILE__) + "/"
|
62
|
-
|
63
|
-
def ignored_callstack(path)
|
64
|
-
path.start_with?(SPROCKETS_GEM_ROOT) || path.start_with?(RbConfig::CONFIG['rubylibdir'])
|
65
|
-
end
|
66
|
-
|
67
|
-
def extract_callstack
|
68
|
-
return _extract_callstack if callstack.first.is_a? String
|
69
|
-
|
70
|
-
offending_line = callstack.find { |frame|
|
71
|
-
frame.absolute_path && !ignored_callstack(frame.absolute_path)
|
72
|
-
} || callstack.first
|
73
|
-
|
74
|
-
[offending_line.path, offending_line.lineno, offending_line.label]
|
75
|
-
end
|
76
|
-
|
77
|
-
def _extract_callstack
|
78
|
-
offending_line = callstack.find { |line| !ignored_callstack(line) } || callstack.first
|
79
|
-
|
80
|
-
if offending_line
|
81
|
-
if md = offending_line.match(/^(.+?):(\d+)(?::in `(.*?)')?/)
|
82
|
-
md.captures
|
83
|
-
else
|
84
|
-
offending_line
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
private_constant :Deprecation
|
90
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'sprockets/eco_processor'
|
2
|
-
|
3
|
-
module Sprockets
|
4
|
-
# Deprecated
|
5
|
-
module EcoTemplate
|
6
|
-
VERSION = EcoProcessor::VERSION
|
7
|
-
|
8
|
-
def self.cache_key
|
9
|
-
EcoProcessor.cache_key
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.call(*args)
|
13
|
-
Deprecation.new.warn "EcoTemplate is deprecated please use EcoProcessor instead"
|
14
|
-
EcoProcessor.call(*args)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'sprockets/ejs_processor'
|
2
|
-
|
3
|
-
module Sprockets
|
4
|
-
# Deprecated
|
5
|
-
module EjsTemplate
|
6
|
-
VERSION = EjsProcessor::VERSION
|
7
|
-
|
8
|
-
def self.cache_key
|
9
|
-
EjsProcessor.cache_key
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.call(*args)
|
13
|
-
Deprecation.new.warn "EjsTemplate is deprecated please use EjsProcessor instead"
|
14
|
-
EjsProcessor.call(*args)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|