summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2024-08-12 13:38:19 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2024-08-12 13:38:19 +0200
commitbc1d6ba68b2ef61ff24b48a27cd0ce412d363d49 (patch)
tree1b9af128b3183b5c3c8d045dd58c18be2c31d2f2
parent1a454b8d4f902fadcdd2f2b838e75f59f144dbe8 (diff)
downloadzorglub-bc1d6ba68b2ef61ff24b48a27cd0ce412d363d49.zip
zorglub-bc1d6ba68b2ef61ff24b48a27cd0ce412d363d49.tar.gz
fix sass engine caching
-rw-r--r--lib/zorglub/engines/sass.rb5
1 files 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']