sprockets 2.11.3 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sprockets might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/sprockets/sass_importer.rb +9 -8
- data/lib/sprockets/sass_template.rb +9 -3
- data/lib/sprockets/server.rb +7 -7
- data/lib/sprockets/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8efd52cbc36180a9d159eccda49e71d3b979ac45
|
4
|
+
data.tar.gz: e6ab087dec16c64f2b48607039283e030a9aed04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75c5d0b9cd9cc3001bc7dadc320e8a82b8f8fffac55ce4e49936f720da3ce25d5dd2a8c56e4e93f5ea603b1e69666b7eed80b6d8aaf7936e7f73ed0001316a5e
|
7
|
+
data.tar.gz: ec401d6e2fa75d1dc25d7c3a64db8130663c2eb3aeb46cfe8dfebc3a86a4c0a912ffa7694a2fb2c570b9cb0ed5f3bd6f9e1f7212d79275c0fe2a4f542be31eeb
|
data/README.md
CHANGED
@@ -366,6 +366,11 @@ submit a pull request.
|
|
366
366
|
|
367
367
|
## Version History ##
|
368
368
|
|
369
|
+
**2.12.0** (March 13, 2014)
|
370
|
+
|
371
|
+
* Avoid context reference in SassImporter hack so its Marshallable. Fixes
|
372
|
+
issues with Sass 3.3.x.
|
373
|
+
|
369
374
|
**2.11.0** (February 19, 2014)
|
370
375
|
|
371
376
|
* Support for `.bower.json`
|
@@ -1,19 +1,20 @@
|
|
1
1
|
require 'sass'
|
2
2
|
|
3
3
|
module Sprockets
|
4
|
-
# This custom importer
|
5
|
-
#
|
6
|
-
# systems work together.
|
4
|
+
# This custom importer that tracks all imported filenames during
|
5
|
+
# compile.
|
7
6
|
class SassImporter < Sass::Importers::Filesystem
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
attr_reader :imported_filenames
|
8
|
+
|
9
|
+
def initialize(*args)
|
10
|
+
@imported_filenames = []
|
11
|
+
super
|
11
12
|
end
|
12
13
|
|
13
14
|
def find_relative(*args)
|
14
15
|
engine = super
|
15
16
|
if engine && (filename = engine.options[:filename])
|
16
|
-
@
|
17
|
+
@imported_filenames << filename
|
17
18
|
end
|
18
19
|
engine
|
19
20
|
end
|
@@ -21,7 +22,7 @@ module Sprockets
|
|
21
22
|
def find(*args)
|
22
23
|
engine = super
|
23
24
|
if engine && (filename = engine.options[:filename])
|
24
|
-
@
|
25
|
+
@imported_filenames << filename
|
25
26
|
end
|
26
27
|
engine
|
27
28
|
end
|
@@ -42,15 +42,21 @@ module Sprockets
|
|
42
42
|
:line => line,
|
43
43
|
:syntax => syntax,
|
44
44
|
:cache_store => cache_store,
|
45
|
-
:importer => SassImporter.new(context
|
46
|
-
:load_paths => context.environment.paths.map { |path| SassImporter.new(
|
45
|
+
:importer => SassImporter.new(context.pathname.to_s),
|
46
|
+
:load_paths => context.environment.paths.map { |path| SassImporter.new(path.to_s) },
|
47
47
|
:sprockets => {
|
48
48
|
:context => context,
|
49
49
|
:environment => context.environment
|
50
50
|
}
|
51
51
|
}
|
52
52
|
|
53
|
-
::Sass::Engine.new(data, options).render
|
53
|
+
result = ::Sass::Engine.new(data, options).render
|
54
|
+
|
55
|
+
# Track all imported files
|
56
|
+
filenames = ([options[:importer].imported_filenames] + options[:load_paths].map(&:imported_filenames)).flatten.uniq
|
57
|
+
filenames.each { |filename| context.depend_on(filename) }
|
58
|
+
|
59
|
+
result
|
54
60
|
rescue ::Sass::SyntaxError => e
|
55
61
|
# Annotates exception message with parse line number
|
56
62
|
context.__LINE__ = e.sass_backtrace.first[:line]
|
data/lib/sprockets/server.rb
CHANGED
@@ -33,16 +33,16 @@ module Sprockets
|
|
33
33
|
# Extract the path from everything after the leading slash
|
34
34
|
path = unescape(env['PATH_INFO'].to_s.sub(/^\//, ''))
|
35
35
|
|
36
|
-
# Strip fingerprint
|
37
|
-
if fingerprint = path_fingerprint(path)
|
38
|
-
path = path.sub("-#{fingerprint}", '')
|
39
|
-
end
|
40
|
-
|
41
36
|
# URLs containing a `".."` are rejected for security reasons.
|
42
37
|
if forbidden_request?(path)
|
43
38
|
return forbidden_response
|
44
39
|
end
|
45
40
|
|
41
|
+
# Strip fingerprint
|
42
|
+
if fingerprint = path_fingerprint(path)
|
43
|
+
path = path.sub("-#{fingerprint}", '')
|
44
|
+
end
|
45
|
+
|
46
46
|
# Look up the asset.
|
47
47
|
asset = find_asset(path, :bundle => !body_only?(env))
|
48
48
|
|
@@ -90,7 +90,7 @@ module Sprockets
|
|
90
90
|
#
|
91
91
|
# http://example.org/assets/../../../etc/passwd
|
92
92
|
#
|
93
|
-
path.include?("..")
|
93
|
+
path.include?("..")
|
94
94
|
end
|
95
95
|
|
96
96
|
# Returns a 403 Forbidden response tuple
|
@@ -222,7 +222,7 @@ module Sprockets
|
|
222
222
|
# # => "0aa2105d29558f3eb790d411d7d8fb66"
|
223
223
|
#
|
224
224
|
def path_fingerprint(path)
|
225
|
-
path[/-([0-9a-f]{7,40})\.[^.]
|
225
|
+
path[/-([0-9a-f]{7,40})\.[^.]+$/, 1]
|
226
226
|
end
|
227
227
|
|
228
228
|
# URI.unescape is deprecated on 1.9. We need to use URI::Parser
|
data/lib/sprockets/version.rb
CHANGED
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: 2.
|
4
|
+
version: 2.12.0
|
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: 2014-
|
12
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hike
|
@@ -313,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
313
313
|
version: '0'
|
314
314
|
requirements: []
|
315
315
|
rubyforge_project: sprockets
|
316
|
-
rubygems_version: 2.2.
|
316
|
+
rubygems_version: 2.2.0
|
317
317
|
signing_key:
|
318
318
|
specification_version: 4
|
319
319
|
summary: Rack-based asset packaging system
|