rack-cache-buster 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
data/lib/rack/cache_buster.rb
CHANGED
@@ -34,9 +34,7 @@ module Rack
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def unpatch_etag(headers)
|
37
|
-
p headers
|
38
37
|
ETAGGY_HEADERS.inject(headers){|memo, k|
|
39
|
-
p [k, memo[k], strip_etag(memo[k])] if memo[k]
|
40
38
|
memo.has_key?(k) ? memo.merge(k => strip_etag(memo[k])) : memo
|
41
39
|
}
|
42
40
|
end
|
@@ -55,5 +53,6 @@ module Rack
|
|
55
53
|
end
|
56
54
|
|
57
55
|
autoload :CacheControlHeader, "rack/cache_buster/cache_control_header"
|
56
|
+
autoload :Rails, "rack/cache_buster/rails"
|
58
57
|
end
|
59
58
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require "rack/cache_buster"
|
2
|
+
|
3
|
+
class Rack::CacheBuster::Rails < Rack::CacheBuster
|
4
|
+
def initialize(app)
|
5
|
+
app_version = File.read(File.join(::Rails.root, "REVISION")) rescue nil
|
6
|
+
wind_down_time = Time.parse(File.read(File.join(::Rails.root, "WIND_DOWN"))) rescue nil
|
7
|
+
super(app, app_version, wind_down_time)
|
8
|
+
end
|
9
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-cache-buster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Lea
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-26 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- test/cache_busting_test.rb
|
28
28
|
- test/test_helper.rb
|
29
29
|
- lib/rack/cache_buster/cache_control_header.rb
|
30
|
+
- lib/rack/cache_buster/rails.rb
|
30
31
|
- lib/rack/cache_buster.rb
|
31
32
|
has_rdoc: true
|
32
33
|
homepage: http://tomlea.co.uk/
|