sprockets 3.7.2 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +47 -267
- data/README.md +477 -321
- data/bin/sprockets +11 -7
- data/lib/rake/sprocketstask.rb +3 -2
- data/lib/sprockets.rb +99 -39
- data/lib/sprockets/add_source_map_comment_to_asset_processor.rb +60 -0
- data/lib/sprockets/asset.rb +31 -23
- data/lib/sprockets/autoload.rb +5 -0
- data/lib/sprockets/autoload/babel.rb +8 -0
- data/lib/sprockets/autoload/closure.rb +1 -0
- data/lib/sprockets/autoload/coffee_script.rb +1 -0
- data/lib/sprockets/autoload/eco.rb +1 -0
- data/lib/sprockets/autoload/ejs.rb +1 -0
- data/lib/sprockets/autoload/jsminc.rb +8 -0
- data/lib/sprockets/autoload/sass.rb +1 -0
- data/lib/sprockets/autoload/sassc.rb +8 -0
- data/lib/sprockets/autoload/uglifier.rb +1 -0
- data/lib/sprockets/autoload/yui.rb +1 -0
- data/lib/sprockets/autoload/zopfli.rb +7 -0
- data/lib/sprockets/babel_processor.rb +66 -0
- data/lib/sprockets/base.rb +49 -12
- data/lib/sprockets/bower.rb +5 -2
- data/lib/sprockets/bundle.rb +40 -4
- data/lib/sprockets/cache.rb +36 -1
- data/lib/sprockets/cache/file_store.rb +25 -3
- data/lib/sprockets/cache/memory_store.rb +9 -0
- data/lib/sprockets/cache/null_store.rb +8 -0
- data/lib/sprockets/cached_environment.rb +14 -19
- data/lib/sprockets/closure_compressor.rb +1 -0
- data/lib/sprockets/coffee_script_processor.rb +18 -4
- data/lib/sprockets/compressing.rb +43 -3
- data/lib/sprockets/configuration.rb +3 -7
- data/lib/sprockets/context.rb +97 -24
- data/lib/sprockets/dependencies.rb +1 -0
- data/lib/sprockets/digest_utils.rb +25 -5
- data/lib/sprockets/directive_processor.rb +45 -35
- data/lib/sprockets/eco_processor.rb +1 -0
- data/lib/sprockets/ejs_processor.rb +1 -0
- data/lib/sprockets/encoding_utils.rb +1 -0
- data/lib/sprockets/environment.rb +9 -4
- data/lib/sprockets/erb_processor.rb +28 -21
- data/lib/sprockets/errors.rb +1 -0
- data/lib/sprockets/exporters/base.rb +71 -0
- data/lib/sprockets/exporters/file_exporter.rb +24 -0
- data/lib/sprockets/exporters/zlib_exporter.rb +33 -0
- data/lib/sprockets/exporters/zopfli_exporter.rb +14 -0
- data/lib/sprockets/exporting.rb +73 -0
- data/lib/sprockets/file_reader.rb +1 -0
- data/lib/sprockets/http_utils.rb +25 -7
- data/lib/sprockets/jsminc_compressor.rb +32 -0
- data/lib/sprockets/jst_processor.rb +11 -10
- data/lib/sprockets/loader.rb +87 -67
- data/lib/sprockets/manifest.rb +64 -62
- data/lib/sprockets/manifest_utils.rb +9 -6
- data/lib/sprockets/mime.rb +8 -42
- data/lib/sprockets/npm.rb +52 -0
- data/lib/sprockets/path_dependency_utils.rb +3 -11
- data/lib/sprockets/path_digest_utils.rb +2 -1
- data/lib/sprockets/path_utils.rb +87 -7
- data/lib/sprockets/paths.rb +1 -0
- data/lib/sprockets/preprocessors/default_source_map.rb +49 -0
- data/lib/sprockets/processing.rb +31 -61
- data/lib/sprockets/processor_utils.rb +24 -35
- data/lib/sprockets/resolve.rb +177 -93
- data/lib/sprockets/sass_cache_store.rb +2 -6
- data/lib/sprockets/sass_compressor.rb +13 -1
- data/lib/sprockets/sass_functions.rb +1 -0
- data/lib/sprockets/sass_importer.rb +1 -0
- data/lib/sprockets/sass_processor.rb +30 -9
- data/lib/sprockets/sassc_compressor.rb +56 -0
- data/lib/sprockets/sassc_processor.rb +297 -0
- data/lib/sprockets/server.rb +26 -23
- data/lib/sprockets/source_map_processor.rb +66 -0
- data/lib/sprockets/source_map_utils.rb +483 -0
- data/lib/sprockets/transformers.rb +63 -35
- data/lib/sprockets/uglifier_compressor.rb +21 -11
- data/lib/sprockets/unloaded_asset.rb +13 -11
- data/lib/sprockets/uri_tar.rb +1 -0
- data/lib/sprockets/uri_utils.rb +11 -8
- data/lib/sprockets/utils.rb +41 -74
- data/lib/sprockets/utils/gzip.rb +46 -14
- data/lib/sprockets/version.rb +2 -1
- data/lib/sprockets/yui_compressor.rb +1 -0
- metadata +127 -23
- 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 -330
- 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
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'delegate'
|
2
|
-
|
3
|
-
module Sprockets
|
4
|
-
# Deprecated: Wraps legacy process Procs with new processor call signature.
|
5
|
-
#
|
6
|
-
# Will be removed in Sprockets 4.x.
|
7
|
-
#
|
8
|
-
# LegacyProcProcessor.new(:compress,
|
9
|
-
# proc { |context, data| data.gsub(...) })
|
10
|
-
#
|
11
|
-
class LegacyProcProcessor < Delegator
|
12
|
-
def initialize(name, proc)
|
13
|
-
@name = name
|
14
|
-
@proc = proc
|
15
|
-
end
|
16
|
-
|
17
|
-
def __getobj__
|
18
|
-
@proc
|
19
|
-
end
|
20
|
-
|
21
|
-
def name
|
22
|
-
"Sprockets::LegacyProcProcessor (#{@name})"
|
23
|
-
end
|
24
|
-
|
25
|
-
def to_s
|
26
|
-
name
|
27
|
-
end
|
28
|
-
|
29
|
-
def call(input)
|
30
|
-
context = input[:environment].context_class.new(input)
|
31
|
-
data = @proc.call(context, input[:data])
|
32
|
-
context.metadata.merge(data: data.to_str)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'delegate'
|
2
|
-
|
3
|
-
module Sprockets
|
4
|
-
# Deprecated: Wraps legacy engine and process Tilt templates with new
|
5
|
-
# processor call signature.
|
6
|
-
#
|
7
|
-
# Will be removed in Sprockets 4.x.
|
8
|
-
#
|
9
|
-
# LegacyTiltProcessor.new(Tilt::CoffeeScriptProcessor)
|
10
|
-
#
|
11
|
-
class LegacyTiltProcessor < Delegator
|
12
|
-
def initialize(klass)
|
13
|
-
@klass = klass
|
14
|
-
end
|
15
|
-
|
16
|
-
def __getobj__
|
17
|
-
@klass
|
18
|
-
end
|
19
|
-
|
20
|
-
def call(input)
|
21
|
-
filename = input[:filename]
|
22
|
-
data = input[:data]
|
23
|
-
context = input[:environment].context_class.new(input)
|
24
|
-
|
25
|
-
data = @klass.new(filename) { data }.render(context, {})
|
26
|
-
context.metadata.merge(data: data.to_str)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'sprockets/sass_processor'
|
2
|
-
|
3
|
-
module Sprockets
|
4
|
-
# Deprecated
|
5
|
-
class SassTemplate < SassProcessor
|
6
|
-
def self.call(*args)
|
7
|
-
Deprecation.new.warn "SassTemplate is deprecated please use SassProcessor instead"
|
8
|
-
super
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
# Deprecated
|
13
|
-
class ScssTemplate < ScssProcessor
|
14
|
-
def self.call(*args)
|
15
|
-
Deprecation.new.warn "ScssTemplate is deprecated please use ScssProcessor instead"
|
16
|
-
super
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|