cache_rules 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +4 -0
- data/cache_rules.gemspec +2 -2
- data/test/test_validations.rb +17 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/cache_rules.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'date'
|
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = 'cache_rules'
|
9
|
-
s.version = '0.1.
|
9
|
+
s.version = '0.1.12'
|
10
10
|
|
11
11
|
s.date = Date.today.to_s
|
12
12
|
|
@@ -28,5 +28,5 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_development_dependency 'simplecov'
|
29
29
|
|
30
30
|
s.licenses = ['MPL-2.0']
|
31
|
-
s.required_ruby_version = ::Gem::Requirement.new("
|
31
|
+
s.required_ruby_version = ::Gem::Requirement.new(">= 1.9")
|
32
32
|
end
|
data/test/test_validations.rb
CHANGED
@@ -26,6 +26,22 @@ class TestValidations < MiniTest::Test
|
|
26
26
|
"X-Cache-Res-Date" => date
|
27
27
|
}
|
28
28
|
}
|
29
|
+
@headers_stale = {
|
30
|
+
:request => {
|
31
|
+
"If-Modified-Since" => if_modified,
|
32
|
+
"Cache-Control" => cache_control
|
33
|
+
},
|
34
|
+
:cached => {
|
35
|
+
"Date" => {"httpdate"=>"Tue, 28 Apr 2015 09:26:57 GMT", "timestamp"=>1430213217},
|
36
|
+
"Cache-Control" => {
|
37
|
+
"public" => {"token"=>nil, "quoted_string"=>nil},
|
38
|
+
"max-stale" => {"token"=>"100", "quoted_string"=>nil}
|
39
|
+
},
|
40
|
+
"Last-Modified" => {"httpdate"=>"Tue, 28 Apr 2015 09:26:57 GMT", "timestamp"=>1430213217},
|
41
|
+
"X-Cache-Req-Date" => {"httpdate"=>"Tue, 28 Apr 2015 09:26:57 GMT", "timestamp"=>1430213217},
|
42
|
+
"X-Cache-Res-Date" => {"httpdate"=>"Tue, 28 Apr 2015 09:26:57 GMT", "timestamp"=>1430213217}
|
43
|
+
}
|
44
|
+
}
|
29
45
|
@headers_noetag = {
|
30
46
|
:request => {
|
31
47
|
"If-None-Match" => ["\"myetag\""]
|
@@ -121,7 +137,7 @@ class TestValidations < MiniTest::Test
|
|
121
137
|
def test_allow_stale
|
122
138
|
guard1 = CacheRules.validate_allow_stale? @no_headers
|
123
139
|
guard2 = CacheRules.validate_allow_stale? @headers_noetag
|
124
|
-
max_stale = CacheRules.validate_allow_stale? @
|
140
|
+
max_stale = CacheRules.validate_allow_stale? @headers_stale
|
125
141
|
min_fresh = CacheRules.validate_allow_stale? @cached_rule2
|
126
142
|
nothing = CacheRules.validate_allow_stale? @headers_nothing
|
127
143
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cache_rules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-04-
|
12
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fakeweb
|
@@ -115,7 +115,7 @@ require_paths:
|
|
115
115
|
required_ruby_version: !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
|
-
- -
|
118
|
+
- - ! '>='
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '1.9'
|
121
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|