Class: IgnoreExtJsCacheBuster

Inherits:
Object
  • Object
show all
Defined in:
lib/ignore_ext_js_cache_buster.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, cache_param = '_dc') ⇒ IgnoreExtJsCacheBuster

Returns a new instance of IgnoreExtJsCacheBuster.



3
4
5
6
# File 'lib/ignore_ext_js_cache_buster.rb', line 3

def initialize(app, cache_param = '_dc')
  @app = app
  @cache_param = cache_param
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
# File 'lib/ignore_ext_js_cache_buster.rb', line 8

def call(env)
  env["QUERY_STRING"] = env["QUERY_STRING"].to_s.sub(/#{@cache_param}=\d+/, "#{@cache_param}=")
  @status, @header, @body = @app.call(env)
  [@status, @header, @body]
end