rack-funky-cache 0.0.5 → 0.0.6

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Mika Tuupola
1
+ Copyright (c) 2010-2012 Mika Tuupola
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -8,4 +8,4 @@ Rack middleware for funky caching content. When request is first served by Rack
8
8
 
9
9
  == Copyright
10
10
 
11
- Copyright (c) 2010-2011 Mika Tuupola. See LICENSE for details.
11
+ Copyright (c) 2010-2012 Mika Tuupola. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -13,15 +13,11 @@ module Rack
13
13
  @directory = settings[:directory] || ::File.join(@root, @path) end
14
14
 
15
15
  def call(env)
16
- dup._call(env)
17
- end
18
-
19
- def _call(env)
20
16
  response = @app.call(env)
21
17
  cache(env, response) if should_cache(env, response)
22
18
  response
23
19
  end
24
-
20
+
25
21
  def cache(env, response)
26
22
  path = Rack::Utils.unescape(env["PATH_INFO"])
27
23
 
@@ -47,9 +43,15 @@ module Rack
47
43
  end
48
44
 
49
45
  def should_cache(env, response)
50
- request = Rack::Request.new(env)
51
- request.get? && request.query_string.empty? &&
52
- /text\/html/ =~ response[1]["Content-Type"] && 200 == response[0]
46
+ unless env_excluded?(env)
47
+ request = Rack::Request.new(env)
48
+ request.get? && request.query_string.empty? &&
49
+ /text\/html/ =~ response[1]["Content-Type"] && 200 == response[0]
50
+ end
51
+ end
52
+
53
+ def env_excluded?(env)
54
+ @settings[:exclude] && @settings[:exclude].call(env)
53
55
  end
54
56
 
55
57
  end
@@ -1,45 +1,38 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{rack-funky-cache}
8
- s.version = "0.0.5"
7
+ s.name = "rack-funky-cache"
8
+ s.version = "0.0.6"
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{2011-02-18}
13
- s.description = %q{Funky caching for Rack based applications}
14
- s.email = %q{tuupola@appelsiini.net}
12
+ s.date = "2012-10-15"
13
+ s.description = "Funky caching for Rack based applications"
14
+ s.email = "tuupola@appelsiini.net"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc"
17
+ "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "lib/rack/funky-cache.rb",
27
- "rack-funky-cache.gemspec",
28
- "test/rack_funky_cache_test.rb",
29
- "test/test_helper.rb"
30
- ]
31
- s.homepage = %q{http://github.com/tuupola/rack-funky-cache}
32
- s.rdoc_options = ["--charset=UTF-8"]
33
- s.require_paths = ["lib"]
34
- s.rubygems_version = %q{1.3.7}
35
- s.summary = %q{Funky caching for Rack based applications}
36
- s.test_files = [
21
+ "LICENSE",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "lib/rack/funky-cache.rb",
26
+ "rack-funky-cache.gemspec",
37
27
  "test/rack_funky_cache_test.rb",
38
- "test/test_helper.rb"
28
+ "test/test_helper.rb"
39
29
  ]
30
+ s.homepage = "http://github.com/tuupola/rack-funky-cache"
31
+ s.require_paths = ["lib"]
32
+ s.rubygems_version = "1.8.11"
33
+ s.summary = "Funky caching for Rack based applications"
40
34
 
41
35
  if s.respond_to? :specification_version then
42
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
43
36
  s.specification_version = 3
44
37
 
45
38
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-funky-cache
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease: false
4
+ hash: 19
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mika Tuupola
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-18 00:00:00 +02:00
19
- default_executable:
18
+ date: 2012-10-15 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: thoughtbot-shoulda
@@ -43,7 +42,6 @@ extra_rdoc_files:
43
42
  - README.rdoc
44
43
  files:
45
44
  - .document
46
- - .gitignore
47
45
  - LICENSE
48
46
  - README.rdoc
49
47
  - Rakefile
@@ -52,13 +50,12 @@ files:
52
50
  - rack-funky-cache.gemspec
53
51
  - test/rack_funky_cache_test.rb
54
52
  - test/test_helper.rb
55
- has_rdoc: true
56
53
  homepage: http://github.com/tuupola/rack-funky-cache
57
54
  licenses: []
58
55
 
59
56
  post_install_message:
60
- rdoc_options:
61
- - --charset=UTF-8
57
+ rdoc_options: []
58
+
62
59
  require_paths:
63
60
  - lib
64
61
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -82,10 +79,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
79
  requirements: []
83
80
 
84
81
  rubyforge_project:
85
- rubygems_version: 1.3.7
82
+ rubygems_version: 1.8.11
86
83
  signing_key:
87
84
  specification_version: 3
88
85
  summary: Funky caching for Rack based applications
89
- test_files:
90
- - test/rack_funky_cache_test.rb
91
- - test/test_helper.rb
86
+ test_files: []
87
+
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
- rdoc
5
- pkg