Class: Adva::Static::Server::Export
- Inherits:
-
Object
- Object
- Adva::Static::Server::Export
- Includes:
- Request
- Defined in:
- lib/adva/static/server/export.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Export
constructor
A new instance of Export.
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
9 10 11 |
# File 'lib/adva/static/server/export.rb', line 9 def app @app end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
9 10 11 |
# File 'lib/adva/static/server/export.rb', line 9 def store @store end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
9 10 11 |
# File 'lib/adva/static/server/export.rb', line 9 def target @target end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/adva/static/server/export.rb', line 17 def call(env) path = env['PATH_INFO'].dup # gets modified by routing_filter app.call(env).tap do |status, headers, response| export(path, response) if export?(env, status) if headers.key?(PURGE_HEADER) paths = normalize_paths(headers[PURGE_HEADER]) paths.each do |path| purge(path) request(path) end end end end |