Sha256: 7f7c544dcc35f6812ee1fe8cdf4b03518e812c57e8acd3159794966d2ef2931f
Contents?: true
Size: 773 Bytes
Versions: 3
Compression:
Stored size: 773 Bytes
Contents
module MongoBrowser module Middleware class SprocketsSinatra def initialize(app, options = {}) @app = app @root = options[:root] path = options[:path] || "assets" @matcher = /^\/#{path}\/*/ @environment = ::Sprockets::Environment.new(@root) @environment.append_path "assets/javascripts" @environment.append_path "assets/javascripts/vendor" @environment.append_path "assets/stylesheets" @environment.append_path "assets/stylesheets/vendor" @environment.append_path "assets/images" end def call(env) return @app.call(env) unless @matcher =~ env["PATH_INFO"] env["PATH_INFO"].sub!(@matcher, "") @environment.call(env) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems