travis-web/lib/travis/web/app/assets.rb
2012-10-10 20:43:53 +02:00

25 lines
406 B
Ruby

class Travis::Web::App
class Assets
include Helpers
attr_reader :app, :config
def initialize(app, config)
@app = app
@config = config
end
def call(env)
path = env['PATH_INFO']
env = map_env(env, config.version) if asset?(path)
app.call(env)
end
private
def asset?(path)
path =~ Travis::Web::App::ASSET_DIRS
end
end
end