sinatra-cacher 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sinatra/cacher.rb +3 -5
- metadata +1 -1
data/lib/sinatra/cacher.rb
CHANGED
@@ -3,7 +3,7 @@ require 'sinatra/base'
|
|
3
3
|
|
4
4
|
module Sinatra
|
5
5
|
module Cacher
|
6
|
-
VERSION = '0.9.
|
6
|
+
VERSION = '0.9.1'
|
7
7
|
|
8
8
|
def self.registered(app)
|
9
9
|
app.helpers Helpers
|
@@ -121,15 +121,13 @@ module Sinatra
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def cache_route(verb, path, opts={}, &blk)
|
124
|
+
tag = opts.delete(:tag)
|
125
|
+
|
124
126
|
unless cache_enabled?
|
125
127
|
route(verb, path, opts, &blk)
|
126
128
|
return
|
127
129
|
end
|
128
130
|
|
129
|
-
# If we change tag when calling the route once, it remains change for the next time
|
130
|
-
# the route is called.
|
131
|
-
# Therefore don't change tag
|
132
|
-
tag = opts.delete(:tag)
|
133
131
|
method = generate_method :"C#{verb} #{path} #{opts.hash}", &blk
|
134
132
|
|
135
133
|
cache_blk = Proc.new { |context, *args|
|