Class: Superconductor::Middleware
- Inherits:
-
Object
- Object
- Superconductor::Middleware
- Defined in:
- lib/superconductor/middleware.rb
Constant Summary collapse
- PORT =
Superconductor.start()
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
10 11 12 13 14 15 |
# File 'lib/superconductor/middleware.rb', line 10 def initialize(app) @app = app @gem_path = File.(File.join(File.dirname(__FILE__), '../..')) @assets = Dir[File.join(@gem_path, 'assets/**/*.{js,css}')] @assets += Dir[File.join(@gem_path, 'spec/integration/screenshots/*.png')] end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 |
# File 'lib/superconductor/middleware.rb', line 17 def call(env) path = env['PATH_INFO'] serve_asset(path) or serve_xslt(path) or serve_response(env) end |