From a5c65bac53c030b5ae33134a17c029d8a4e91d18 Mon Sep 17 00:00:00 2001 From: Nico Hagenburger Date: Mon, 9 Feb 2015 23:16:20 +0100 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20override=20:custom=20if=20alrea?= =?UTF-8?q?dy=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes Sprockets needs to access `options[:custom][:sprockets_context]`. If this is set, it should not be overridden. This happens when building a LivingStyleGuide file when the Sass source uses `asset-path`, `image-url` or similar functions. --- middleman-core/lib/middleman-core/renderers/sass.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleman-core/lib/middleman-core/renderers/sass.rb b/middleman-core/lib/middleman-core/renderers/sass.rb index 3b2ad68a..80af2d1a 100644 --- a/middleman-core/lib/middleman-core/renderers/sass.rb +++ b/middleman-core/lib/middleman-core/renderers/sass.rb @@ -105,7 +105,7 @@ module Middleman filename: eval_file, line: line, syntax: syntax, - custom: { middleman_context: ctx.app } + custom: (options[:custom] || {}).merge(middleman_context: ctx.app) } if ctx.is_a?(::Middleman::TemplateContext) && file