Method: Astro::Middleware::Sprockets#call

Defined in:
lib/astro/middleware/sprockets.rb

#call(env) ⇒ Object

Creates a new sprockets environment instance and adds an anonymous preprocessor to require dependencies from the astro.assets array.



15
16
17
18
19
20
21
22
23
# File 'lib/astro/middleware/sprockets.rb', line 15

def call( env )
  sprockets = ::Sprockets::Environment.new
  sprockets.append_path 'lib/assets/javascripts'
  sprockets.append_path 'lib/assets/stylesheets'

  env[ 'astro.sprockets' ] = sprockets

  @app.call env
end