Sha256: 79acfb36cc7e1275b8bdf9cd55a5992a1779993651b3d1e47efd0c0777d8b669
Contents?: true
Size: 698 Bytes
Versions: 36
Compression:
Stored size: 698 Bytes
Contents
module Locomotive::Steam module Middlewares class DynamicAssets REGEXP = /^\/(javascripts|stylesheets)\/(.*)$/o @@sprocket_environments = {} attr_reader :app, :assets def initialize(app, options) @app = app @assets = self.class.sprocket_environment(options[:root], options) end def call(env) if env['PATH_INFO'] =~ REGEXP env['PATH_INFO'] = $2 assets.call(env) else app.call(env) end end def self.sprocket_environment(root, options) @@sprocket_environments[root] ||= Locomotive::Steam::SprocketsEnvironment.new(root, options) end end end end
Version data entries
36 entries across 36 versions & 1 rubygems