lib/malt/formats/sass.rb in malt-0.3.0 vs lib/malt/formats/sass.rb in malt-0.4.0
- old
+ new
@@ -4,13 +4,14 @@
module Malt::Format
# Sass Format
#
+ #
class Sass < Abstract
- register 'sass'
+ file_extension 'sass'
#
def sass(*)
text
end
@@ -19,47 +20,38 @@
def to_sass(*)
self
end
#
- def css(data=nil, &yld)
- render_engine.render(:format=>:css, :text=>text, :file=>file, :type=>type)
+ def css(*data, &content)
+ render_into(:css, *data, &content)
+ #render_engine.render(:format=>:css, :text=>text, :file=>file, :data=>data, :type=>type, &yld)
end
#
- def to_css(data=nil, &yld)
- result = css(data, &yld)
+ def to_css(*data, &content)
+ result = css(*data, &content)
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
+ private
+
+ ##
+ #def render_engine
+ # @render_engine ||= Malt::Engine::Sass.new(options)
#end
- private
-
- #
- def render_engine
- @render_engine ||= Malt::Engine::Sass.new(options)
- end
-
- # Sass default output type is CSS.
- def default
- :css
- end
+ # Sass default output type is CSS.
+ def default
+ :css
+ end
end
end