rack-funky-cache 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +5 -1
- data/VERSION +1 -1
- data/lib/rack/funky-cache.rb +1 -1
- data/rack-funky-cache.gemspec +4 -4
- data/test/rack_funky_cache_test.rb +13 -2
- data/test/test_helper.rb +2 -1
- metadata +11 -4
data/README.rdoc
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Rack middleware for funky caching content. When request is first served by Rack it is written to disk as static html file. All subsequent requests are then served by webserver and they never reach Rack.
|
4
4
|
|
5
|
+
== Install
|
6
|
+
|
7
|
+
$ sudo gem install rack-funky-cache
|
8
|
+
|
5
9
|
== Copyright
|
6
10
|
|
7
|
-
Copyright (c) 2010 Mika Tuupola. See LICENSE for details.
|
11
|
+
Copyright (c) 2010-2011 Mika Tuupola. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/lib/rack/funky-cache.rb
CHANGED
@@ -47,7 +47,7 @@ module Rack
|
|
47
47
|
def should_cache(env, response)
|
48
48
|
request = Rack::Request.new(env)
|
49
49
|
request.get? && request.query_string.empty? &&
|
50
|
-
|
50
|
+
/text\/html/ =~ response[1]["Content-Type"] && 200 == response[0]
|
51
51
|
end
|
52
52
|
|
53
53
|
end
|
data/rack-funky-cache.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rack-funky-cache}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mika Tuupola"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-02-07}
|
13
13
|
s.description = %q{Funky caching for Rack based applications}
|
14
14
|
s.email = %q{tuupola@appelsiini.net}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.homepage = %q{http://github.com/tuupola/rack-funky-cache}
|
32
32
|
s.rdoc_options = ["--charset=UTF-8"]
|
33
33
|
s.require_paths = ["lib"]
|
34
|
-
s.rubygems_version = %q{1.3.
|
34
|
+
s.rubygems_version = %q{1.3.7}
|
35
35
|
s.summary = %q{Funky caching for Rack based applications}
|
36
36
|
s.test_files = [
|
37
37
|
"test/rack_funky_cache_test.rb",
|
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
|
|
42
42
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
43
|
s.specification_version = 3
|
44
44
|
|
45
|
-
if Gem::Version.new(Gem::
|
45
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
46
|
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
47
47
|
else
|
48
48
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
@@ -1,7 +1,18 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class RackFunkyCacheTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
|
4
|
+
include Rack::Test::Methods
|
5
|
+
|
6
|
+
def app
|
7
|
+
lambda { |env| [200, {}, "Coolness"] }
|
6
8
|
end
|
9
|
+
|
10
|
+
should "return some coolness" do
|
11
|
+
get "/"
|
12
|
+
assert last_response.body.include?("Cool")
|
13
|
+
end
|
14
|
+
|
15
|
+
context "A User instance" do
|
16
|
+
end
|
17
|
+
|
7
18
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
require 'rubygems'
|
2
|
+
require 'rack/test'
|
2
3
|
require 'test/unit'
|
3
4
|
require 'shoulda'
|
4
5
|
|
5
6
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
6
7
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
|
-
require 'rack
|
8
|
+
require 'rack/funky-cache'
|
8
9
|
|
9
10
|
class Test::Unit::TestCase
|
10
11
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-funky-cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Mika Tuupola
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date:
|
18
|
+
date: 2011-02-07 00:00:00 +02:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: thoughtbot-shoulda
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
version: "0"
|
@@ -59,23 +62,27 @@ rdoc_options:
|
|
59
62
|
require_paths:
|
60
63
|
- lib
|
61
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
62
66
|
requirements:
|
63
67
|
- - ">="
|
64
68
|
- !ruby/object:Gem::Version
|
69
|
+
hash: 3
|
65
70
|
segments:
|
66
71
|
- 0
|
67
72
|
version: "0"
|
68
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
69
75
|
requirements:
|
70
76
|
- - ">="
|
71
77
|
- !ruby/object:Gem::Version
|
78
|
+
hash: 3
|
72
79
|
segments:
|
73
80
|
- 0
|
74
81
|
version: "0"
|
75
82
|
requirements: []
|
76
83
|
|
77
84
|
rubyforge_project:
|
78
|
-
rubygems_version: 1.3.
|
85
|
+
rubygems_version: 1.3.7
|
79
86
|
signing_key:
|
80
87
|
specification_version: 3
|
81
88
|
summary: Funky caching for Rack based applications
|