Class: Superconductor::Middleware

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

Constant Summary collapse

PORT =
Superconductor.start()

Instance Method Summary collapse

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.expand_path(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