From bc1d6ba68b2ef61ff24b48a27cd0ce412d363d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 12 Aug 2024 13:38:19 +0200 Subject: fix sass engine caching --- lib/zorglub/engines/sass.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/zorglub/engines/sass.rb b/lib/zorglub/engines/sass.rb index 44973d5..447be02 100644 --- a/lib/zorglub/engines/sass.rb +++ b/lib/zorglub/engines/sass.rb @@ -4,10 +4,11 @@ module Zorglub module Engines module Sass def self.proc(path, obj) - sass = ::Sass::Engine.new(::File.read(path), obj.app.opt(:sass_options)) if obj.app.opt(:engines_cache_enabled) key = path.sub obj.app.opt(:root), '' - obj.app.engines_cache[key] ||= sass + sass = obj.app.engines_cache[key] || ::Sass::Engine.new(::File.read(path), obj.app.opt(:sass_options)) + else + sass = ::Sass::Engine.new(::File.read(path), obj.app.opt(:sass_options)) end css = sass.render [css, 'text/css'] -- cgit v1.1-2-g2b99