Class: MongoBrowser::Middleware::SprocketsSpecs

Inherits:
SprocketsBase show all
Defined in:
lib/mongo_browser/middleware/sprockets_specs.rb

Instance Method Summary collapse

Methods inherited from SprocketsBase

#call

Constructor Details

#initialize(app, options = {}) ⇒ SprocketsSpecs

Returns a new instance of SprocketsSpecs.



6
7
8
9
10
11
12
13
14
15
# File 'lib/mongo_browser/middleware/sprockets_specs.rb', line 6

def initialize(app, options = {})
  @app = app
  @root = options[:root]
  path =  options[:path] || "_specs"
  @matcher = /^\/#{path}\/*/
  @environment = ::Sprockets::Environment.new(@root)

  # Serve specs
  @environment.append_path "spec/javascripts"
end