Sha256: 97528a39537e79315ae2898d8e4ccb868b0a0bbbc1630eb0f074519dba971429

Contents?: true

Size: 535 Bytes

Versions: 14

Compression:

Stored size: 535 Bytes

Contents

# encoding: utf-8

require "sass"
require "ace/filters"

module Ace
  class SassFilter < Filter
    def call(item, content)
      if item.output_path && item.output_path.end_with?(".scss")
        item.output_path.sub!(/scss$/, "css")
        begin
          engine = Sass::Engine.new(content, {:syntax => :scss})
          output = engine.render
        rescue Exception => e
          warn "~~ SassFilter exception: #{e}"
          abort
        end
        return output
      else
        return content
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ace-0.4.9 lib/ace/filters/sass.rb
ace-0.4.8 lib/ace/filters/sass.rb
ace-0.4.7 lib/ace/filters/sass.rb
ace-0.4.6 lib/ace/filters/sass.rb
ace-0.4.5 lib/ace/filters/sass.rb
ace-0.4.4 lib/ace/filters/sass.rb
ace-0.4.3 lib/ace/filters/sass.rb
ace-0.4.2 lib/ace/filters/sass.rb
ace-0.4.1 lib/ace/filters/sass.rb
ace-0.4 lib/ace/filters/sass.rb
ace-0.3.3 lib/ace/filters/sass.rb
ace-0.3.2 lib/ace/filters/sass.rb
ace-0.3.1 lib/ace/filters/sass.rb
ace-0.3 lib/ace/filters/sass.rb