Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Commit 653cca1

Browse files
committed
Merge pull request #6 from aw/allow-newer-rubies
Allow newer rubies
2 parents 8d6a652 + 81d2bfa commit 653cca1

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.1.12 (2015-04-28)
4+
5+
* Allow newer rubies
6+
37
## 0.1.11 (2015-04-20)
48

59
* Remove Gemfile.lock

cache_rules.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require 'date'
66

77
Gem::Specification.new do |s|
88
s.name = 'cache_rules'
9-
s.version = '0.1.11'
9+
s.version = '0.1.12'
1010

1111
s.date = Date.today.to_s
1212

@@ -28,5 +28,5 @@ Gem::Specification.new do |s|
2828
s.add_development_dependency 'simplecov'
2929

3030
s.licenses = ['MPL-2.0']
31-
s.required_ruby_version = ::Gem::Requirement.new("~> 1.9")
31+
s.required_ruby_version = ::Gem::Requirement.new(">= 1.9")
3232
end

test/test_validations.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ def setup
2626
"X-Cache-Res-Date" => date
2727
}
2828
}
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+
}
2945
@headers_noetag = {
3046
:request => {
3147
"If-None-Match" => ["\"myetag\""]
@@ -121,7 +137,7 @@ def test_only_if_cached
121137
def test_allow_stale
122138
guard1 = CacheRules.validate_allow_stale? @no_headers
123139
guard2 = CacheRules.validate_allow_stale? @headers_noetag
124-
max_stale = CacheRules.validate_allow_stale? @headers
140+
max_stale = CacheRules.validate_allow_stale? @headers_stale
125141
min_fresh = CacheRules.validate_allow_stale? @cached_rule2
126142
nothing = CacheRules.validate_allow_stale? @headers_nothing
127143

0 commit comments

Comments
 (0)