Sha256: 99b4e0134cd72877ee8c505373f7f6e31d3ecfda20896fe56930f95204f92d41

Contents?: true

Size: 756 Bytes

Versions: 2

Compression:

Stored size: 756 Bytes

Contents

require 'sass'
require 'dassets/engine'
require "dassets-sass/version"

module Dassets::Sass

  class Engine < Dassets::Engine

    def syntax
      (self.opts[:syntax] || self.opts['syntax'] || 'scss').to_s
    end

    def output_style
      (self.opts[:output_style] || self.opts['output_style'] || 'nested').to_s
    end

    def load_paths
      @load_paths ||= ([self.opts['source_path']] +
                       [*(self.opts[:load_paths] || self.opts['load_paths'] || [])])
    end

    def ext(input_ext)
      'css'
    end

    def compile(input_content)
      ::Sass.compile(input_content, {
        :syntax => self.syntax.to_sym,
        :style  => self.output_style.to_sym,
        :load_paths => self.load_paths
      })
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dassets-sass-0.4.0 lib/dassets-sass.rb
dassets-sass-0.3.0 lib/dassets-sass.rb