sprockets 3.0.0.beta.8 → 3.0.0.beta.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -6
- data/lib/sprockets.rb +39 -15
- data/lib/sprockets/autoload.rb +11 -0
- data/lib/sprockets/autoload/closure.rb +7 -0
- data/lib/sprockets/autoload/coffee_script.rb +7 -0
- data/lib/sprockets/autoload/eco.rb +7 -0
- data/lib/sprockets/autoload/ejs.rb +7 -0
- data/lib/sprockets/autoload/sass.rb +7 -0
- data/lib/sprockets/autoload/uglifier.rb +7 -0
- data/lib/sprockets/autoload/yui.rb +7 -0
- data/lib/sprockets/bundle.rb +33 -3
- data/lib/sprockets/cache.rb +15 -6
- data/lib/sprockets/closure_compressor.rb +3 -5
- data/lib/sprockets/coffee_script_processor.rb +2 -5
- data/lib/sprockets/compressing.rb +2 -2
- data/lib/sprockets/context.rb +2 -2
- data/lib/sprockets/dependencies.rb +1 -1
- data/lib/sprockets/directive_processor.rb +3 -3
- data/lib/sprockets/eco_processor.rb +2 -4
- data/lib/sprockets/ejs_processor.rb +1 -3
- data/lib/sprockets/engines.rb +1 -1
- data/lib/sprockets/http_utils.rb +17 -1
- data/lib/sprockets/legacy.rb +3 -2
- data/lib/sprockets/loader.rb +11 -8
- data/lib/sprockets/manifest.rb +27 -17
- data/lib/sprockets/manifest_utils.rb +45 -0
- data/lib/sprockets/mime.rb +10 -7
- data/lib/sprockets/paths.rb +2 -2
- data/lib/sprockets/processing.rb +35 -52
- data/lib/sprockets/processor_utils.rb +34 -28
- data/lib/sprockets/resolve.rb +35 -25
- data/lib/sprockets/sass_cache_store.rb +29 -2
- data/lib/sprockets/sass_compressor.rb +3 -5
- data/lib/sprockets/sass_processor.rb +11 -32
- data/lib/sprockets/server.rb +4 -4
- data/lib/sprockets/transformers.rb +1 -1
- data/lib/sprockets/uglifier_compressor.rb +3 -5
- data/lib/sprockets/uri_utils.rb +3 -3
- data/lib/sprockets/version.rb +1 -1
- data/lib/sprockets/yui_compressor.rb +3 -5
- metadata +12 -4
- data/lib/sprockets/autoload_processor.rb +0 -48
data/lib/sprockets/uri_utils.rb
CHANGED
@@ -15,7 +15,7 @@ module Sprockets
|
|
15
15
|
# id - Unique fingerprint of the entire asset and all its metadata. Assets
|
16
16
|
# will only have the same id if they serialize to an identical value.
|
17
17
|
#
|
18
|
-
#
|
18
|
+
# pipeline - String name of pipeline.
|
19
19
|
#
|
20
20
|
# encoding - A content encoding such as "gzip" or "deflate". NOT a charset
|
21
21
|
# like "utf-8".
|
@@ -161,8 +161,8 @@ module Sprockets
|
|
161
161
|
case value
|
162
162
|
when Integer
|
163
163
|
query << "#{key}=#{value}"
|
164
|
-
when String
|
165
|
-
query << "#{key}=#{URI::Generic::DEFAULT_PARSER.escape(value)}"
|
164
|
+
when String, Symbol
|
165
|
+
query << "#{key}=#{URI::Generic::DEFAULT_PARSER.escape(value.to_s)}"
|
166
166
|
when TrueClass
|
167
167
|
query << "#{key}"
|
168
168
|
when FalseClass, NilClass
|
data/lib/sprockets/version.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'yui/compressor'
|
2
|
-
|
3
1
|
module Sprockets
|
4
2
|
# Public: YUI compressor.
|
5
3
|
#
|
@@ -37,7 +35,7 @@ module Sprockets
|
|
37
35
|
@options = options
|
38
36
|
@cache_key = [
|
39
37
|
self.class.name,
|
40
|
-
::YUI::Compressor::VERSION,
|
38
|
+
Autoload::YUI::Compressor::VERSION,
|
41
39
|
VERSION,
|
42
40
|
options
|
43
41
|
].freeze
|
@@ -50,12 +48,12 @@ module Sprockets
|
|
50
48
|
when 'application/javascript'
|
51
49
|
key = @cache_key + [input[:content_type], input[:data]]
|
52
50
|
input[:cache].fetch(key) do
|
53
|
-
::YUI::JavaScriptCompressor.new(@options).compress(data)
|
51
|
+
Autoload::YUI::JavaScriptCompressor.new(@options).compress(data)
|
54
52
|
end
|
55
53
|
when 'text/css'
|
56
54
|
key = @cache_key + [input[:content_type], input[:data]]
|
57
55
|
input[:cache].fetch(key) do
|
58
|
-
::YUI::CssCompressor.new(@options).compress(data)
|
56
|
+
Autoload::YUI::CssCompressor.new(@options).compress(data)
|
59
57
|
end
|
60
58
|
else
|
61
59
|
data
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.beta.
|
4
|
+
version: 3.0.0.beta.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-03-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -223,7 +223,14 @@ files:
|
|
223
223
|
- lib/rake/sprocketstask.rb
|
224
224
|
- lib/sprockets.rb
|
225
225
|
- lib/sprockets/asset.rb
|
226
|
-
- lib/sprockets/
|
226
|
+
- lib/sprockets/autoload.rb
|
227
|
+
- lib/sprockets/autoload/closure.rb
|
228
|
+
- lib/sprockets/autoload/coffee_script.rb
|
229
|
+
- lib/sprockets/autoload/eco.rb
|
230
|
+
- lib/sprockets/autoload/ejs.rb
|
231
|
+
- lib/sprockets/autoload/sass.rb
|
232
|
+
- lib/sprockets/autoload/uglifier.rb
|
233
|
+
- lib/sprockets/autoload/yui.rb
|
227
234
|
- lib/sprockets/base.rb
|
228
235
|
- lib/sprockets/bower.rb
|
229
236
|
- lib/sprockets/bundle.rb
|
@@ -259,6 +266,7 @@ files:
|
|
259
266
|
- lib/sprockets/legacy_tilt_processor.rb
|
260
267
|
- lib/sprockets/loader.rb
|
261
268
|
- lib/sprockets/manifest.rb
|
269
|
+
- lib/sprockets/manifest_utils.rb
|
262
270
|
- lib/sprockets/mime.rb
|
263
271
|
- lib/sprockets/path_dependency_utils.rb
|
264
272
|
- lib/sprockets/path_digest_utils.rb
|
@@ -280,7 +288,7 @@ files:
|
|
280
288
|
- lib/sprockets/utils.rb
|
281
289
|
- lib/sprockets/version.rb
|
282
290
|
- lib/sprockets/yui_compressor.rb
|
283
|
-
homepage: https://github.com/
|
291
|
+
homepage: https://github.com/rails/sprockets
|
284
292
|
licenses:
|
285
293
|
- MIT
|
286
294
|
metadata: {}
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module Sprockets
|
2
|
-
# Internal: Used for lazy loading processors.
|
3
|
-
#
|
4
|
-
# Libraries should not use lazily loaded processors. They are only needed
|
5
|
-
# internally by Sprockets since it has optionally dependencies such as
|
6
|
-
# CoffeeScript that may not be available in the gem environment.
|
7
|
-
class AutoloadProcessor
|
8
|
-
# Initialize AutoloadProcessor wrapper
|
9
|
-
#
|
10
|
-
# See ProcessorUtils.autoload_processor for constructor method.
|
11
|
-
#
|
12
|
-
# mod - Parent Module of processor class/module
|
13
|
-
# name - Symbol name of processor class/module
|
14
|
-
def initialize(mod, name)
|
15
|
-
@mod = mod
|
16
|
-
@name = name.to_sym
|
17
|
-
end
|
18
|
-
|
19
|
-
# Full name of module.
|
20
|
-
#
|
21
|
-
# Returns String.
|
22
|
-
def name
|
23
|
-
"#{@mod}::#{@name}"
|
24
|
-
end
|
25
|
-
|
26
|
-
# Check if target constant is already loaded.
|
27
|
-
#
|
28
|
-
# Returns Boolean.
|
29
|
-
def const_loaded?
|
30
|
-
@mod.autoload?(@name)
|
31
|
-
end
|
32
|
-
|
33
|
-
# Delegate to processor#cache_key
|
34
|
-
def cache_key
|
35
|
-
load_processor.cache_key if load_processor.respond_to?(:cache_key)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Delegate to processor#call
|
39
|
-
def call(*args)
|
40
|
-
load_processor.call(*args)
|
41
|
-
end
|
42
|
-
|
43
|
-
private
|
44
|
-
def load_processor
|
45
|
-
@processor ||= @mod.const_get(@name)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|