Skip to content
Permalink
Browse files

Sass: Support both sassc and sass gems

  • Loading branch information...
judofyr committed Nov 14, 2018
1 parent 8f70818 commit 4566c58267f073abd8e7a9215b36021596b35635
Showing with 13 additions and 2 deletions.
  1. +13 −2 lib/tilt/sass.rb
@@ -1,5 +1,4 @@
require 'tilt/template'
require 'sass'

module Tilt
# Sass template implementation. See:
@@ -9,8 +8,20 @@ module Tilt
class SassTemplate < Template
self.default_mime_type = 'text/css'

begin
require 'sassc'
Sass = ::SassC
rescue LoadError => err
begin
require 'sass'
Sass == ::Sass
rescue LoadError
raise err
end
end

def prepare
@engine = ::Sass::Engine.new(data, sass_options)
@engine = Sass::Engine.new(data, sass_options)
end

def evaluate(scope, locals, &block)

0 comments on commit 4566c58

Please sign in to comment.
You can’t perform that action at this time.