rack-funky-cache 0.0.4 → 0.0.5
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/VERSION +1 -1
- data/lib/rack/funky-cache.rb +6 -4
- data/rack-funky-cache.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/rack/funky-cache.rb
CHANGED
@@ -5,10 +5,12 @@ module Rack
|
|
5
5
|
|
6
6
|
class FunkyCache
|
7
7
|
|
8
|
-
def initialize(app, settings)
|
8
|
+
def initialize(app, settings={})
|
9
9
|
@app = app
|
10
|
-
@settings
|
11
|
-
|
10
|
+
@settings = settings
|
11
|
+
@root = settings[:root] || Dir.pwd
|
12
|
+
@path = settings[:path] || "/public"
|
13
|
+
@directory = settings[:directory] || ::File.join(@root, @path) end
|
12
14
|
|
13
15
|
def call(env)
|
14
16
|
dup._call(env)
|
@@ -30,7 +32,7 @@ module Rack
|
|
30
32
|
end
|
31
33
|
|
32
34
|
basename = ::File.basename(path)
|
33
|
-
dirname = ::File.join(@
|
35
|
+
dirname = ::File.join(@directory, ::File.dirname(path))
|
34
36
|
cachefile = ::File.join(dirname, basename)
|
35
37
|
|
36
38
|
FileUtils.mkdir_p(dirname) unless ::File.directory?(dirname)
|
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.5"
|
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-
|
12
|
+
s.date = %q{2011-02-18}
|
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 = [
|
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:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mika Tuupola
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-18 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|