middleman/middleman-sprockets — pull request #15 by bhollis (2013-02-11 02:00:43+00:00)
Title: Set current_path from within Sprockets' context.

All requests to /stylesheets and /javascripts are handled by Sprockets
exclusively. This means a file like /stylesheets/main.css.erb has its
ERb processing handled by Sprockets, not Middleman. We have a method_missing
that forwards references to helpers to the Middleman application, but
current_path wasn't being set because those requests weren't going through
Middleman's endpoint. This change has the Sprockets context explicitly
set current_path to the asset's path before forwarding helper requests
on to Middleman, meaning things that use current_path/current_resource
like relative_assets now have the info they need to work.

Fixes middleman/middleman#764 and middleman/middleman#731.