sprockets 2.1.0 → 2.1.2
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.
- data/README.md +10 -1
- data/lib/sprockets/base.rb +1 -1
- data/lib/sprockets/cache/file_store.rb +4 -4
- data/lib/sprockets/context.rb +1 -1
- data/lib/sprockets/server.rb +2 -9
- data/lib/sprockets/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -354,9 +354,18 @@ submit a pull request.
|
|
354
354
|
|
355
355
|
## Version History ##
|
356
356
|
|
357
|
+
**2.1.2** (November 20, 2011)
|
358
|
+
|
359
|
+
* Disabled If-Modified-Since server checks. Fixes some browser caching issues when serving the asset body only. If-None-Match caching is sufficent.
|
360
|
+
|
361
|
+
**2.1.1** (November 18, 2011)
|
362
|
+
|
363
|
+
* Fix windows absolute path check bug.
|
364
|
+
|
357
365
|
**2.1.0** (November 11, 2011)
|
358
366
|
|
359
|
-
*
|
367
|
+
* Directive comment lines are now turned into empty lines instead of removed. This way line numbers in
|
368
|
+
CoffeeScript syntax errors are correct.
|
360
369
|
* Performance and caching bug fixes.
|
361
370
|
|
362
371
|
**2.0.3** (October 17, 2011)
|
data/lib/sprockets/base.rb
CHANGED
@@ -6,14 +6,11 @@ module Sprockets
|
|
6
6
|
module Cache
|
7
7
|
# A simple file system cache store.
|
8
8
|
#
|
9
|
-
# environment.cache = Sprockets::Cache::FileStore.new("tmp
|
9
|
+
# environment.cache = Sprockets::Cache::FileStore.new("/tmp")
|
10
10
|
#
|
11
11
|
class FileStore
|
12
12
|
def initialize(root)
|
13
13
|
@root = Pathname.new(root)
|
14
|
-
|
15
|
-
# Ensure directory exists
|
16
|
-
FileUtils.mkdir_p @root
|
17
14
|
end
|
18
15
|
|
19
16
|
# Lookup value in cache
|
@@ -24,6 +21,9 @@ module Sprockets
|
|
24
21
|
|
25
22
|
# Save value to cache
|
26
23
|
def []=(key, value)
|
24
|
+
# Ensure directory exists
|
25
|
+
FileUtils.mkdir_p @root.join(key).dirname
|
26
|
+
|
27
27
|
@root.join(key).open('w') { |f| Marshal.dump(value, f)}
|
28
28
|
value
|
29
29
|
end
|
data/lib/sprockets/context.rb
CHANGED
data/lib/sprockets/server.rb
CHANGED
@@ -53,9 +53,8 @@ module Sprockets
|
|
53
53
|
# Return a 404 Not Found
|
54
54
|
not_found_response
|
55
55
|
|
56
|
-
# Check request headers `
|
57
|
-
|
58
|
-
elsif not_modified?(asset, env) || etag_match?(asset, env)
|
56
|
+
# Check request headers `HTTP_IF_NONE_MATCH` against the asset digest
|
57
|
+
elsif etag_match?(asset, env)
|
59
58
|
logger.info "#{msg} 304 Not Modified (#{time_elapsed.call}ms)"
|
60
59
|
|
61
60
|
# Return a 304 Not Modified
|
@@ -174,12 +173,6 @@ module Sprockets
|
|
174
173
|
gsub('/', '\\\\002f ')
|
175
174
|
end
|
176
175
|
|
177
|
-
# Compare the requests `HTTP_IF_MODIFIED_SINCE` against the
|
178
|
-
# assets mtime
|
179
|
-
def not_modified?(asset, env)
|
180
|
-
env["HTTP_IF_MODIFIED_SINCE"] == asset.mtime.httpdate
|
181
|
-
end
|
182
|
-
|
183
176
|
# Compare the requests `HTTP_IF_NONE_MATCH` against the assets digest
|
184
177
|
def etag_match?(asset, env)
|
185
178
|
env["HTTP_IF_NONE_MATCH"] == etag(asset)
|
data/lib/sprockets/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 2.1.
|
9
|
+
- 2
|
10
|
+
version: 2.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sam Stephenson
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-11-
|
19
|
+
date: 2011-11-20 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|