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 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
- * Preserve directive whitespace.
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)
@@ -149,7 +149,7 @@ module Sprockets
149
149
  logical_path = path
150
150
  pathname = Pathname.new(path)
151
151
 
152
- if pathname.to_s =~ /^\//
152
+ if pathname.absolute?
153
153
  return unless stat(pathname)
154
154
  logical_path = attributes_for(pathname).logical_path
155
155
  else
@@ -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/sprockets")
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
@@ -78,7 +78,7 @@ module Sprockets
78
78
  pathname = Pathname.new(path)
79
79
  attributes = environment.attributes_for(pathname)
80
80
 
81
- if pathname.to_s =~ /^\//
81
+ if pathname.absolute?
82
82
  pathname
83
83
 
84
84
  elsif content_type = options[:content_type]
@@ -53,9 +53,8 @@ module Sprockets
53
53
  # Return a 404 Not Found
54
54
  not_found_response
55
55
 
56
- # Check request headers `HTTP_IF_MODIFIED_SINCE` and
57
- # `HTTP_IF_NONE_MATCH` against the assets mtime and digest
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)
@@ -1,3 +1,3 @@
1
1
  module Sprockets
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.2"
3
3
  end
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: 11
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 0
10
- version: 2.1.0
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-11 00:00:00 -06:00
19
+ date: 2011-11-20 00:00:00 -06:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency