Skip to content

Commit

Permalink
Sass: Support both sassc and sass gems
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Nov 28, 2018
1 parent 8f70818 commit 4566c58
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/tilt/sass.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'tilt/template'
require 'sass'

module Tilt
# Sass template implementation. See:
Expand All @@ -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)
Expand Down

0 comments on commit 4566c58

Please sign in to comment.