Sha256: c5b7495da74fb10a420f68910b83ed64024c13ebe58b8f56b37a8a1bb7c30304

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'malt/formats/abstract'
require 'malt/formats/css'
require 'malt/engines/sass'

module Malt::Formats

  # Sass Format
  #
  class Sass < Abstract

    register 'sass'

    #
    def css(data=nil, &yld)
      render_engine.render(:format=>:css, :text=>text, :file=>file, :type=>type)
    end

    #
    def to_css(data=nil, &yld)
      result = css(data, &yld)
      CSS.new(:text=>result, :file=>refile(:css), :type=>:css)
    end

    #
    #def compile(db, &yld)
    #  result = render_engine.render(text, db, &yld)
    #  opts = options.merge(:text=>result, file=>refile(:css))
    #  CSS.new(opts)
    #end

    #
    #def render_to(to, db, &yld)
    #  case to
    #  when :css
    #    malt_engine.render_css(text, file, db, &yld)
    #  else
    #    raise UnspportedConversion.new(type, to)
    #  end
    #end

    private

      #
      def render_engine
        @render_engine ||= Malt::Engines::Sass.new(options)
      end

      # Sass default output type is CSS.
      def default
        :css
      end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
malt-0.1.0 lib/malt/formats/sass.rb