rack-funky-cache 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -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 = settings
11
- end
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(@settings[:directory], ::File.dirname(path))
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)
@@ -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.4"
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-07}
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: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
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-07 00:00:00 +02:00
18
+ date: 2011-02-18 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency