1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/sass/plugin/merb.rb
nex3 c1b21a2d75 Merb handler for Sass. This includes a pretty major restructuring of Sass::Plugin to factor out the Rails-specific code.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@616 7063305b-7217-0410-af8c-cdc13e5119b9
2007-11-17 19:55:26 +00:00

20 lines
896 B
Ruby

unless defined?(Sass::MERB_LOADED)
Sass::MERB_LOADED = true
Sass::Plugin.options.merge!(:template_location => MERB_ROOT + '/public/stylesheets/sass',
:css_location => MERB_ROOT + '/public/stylesheets',
:always_check => MERB_ENV != "production",
:full_exception => MERB_ENV != "production")
config = Merb::Plugins.config[:sass] || Merb::Plugins.config["sass"] || {}
config.symbolize_keys!
Sass::Plugin.options.merge!(config)
class MerbHandler # :nodoc:
def process_with_sass(request, response)
Sass::Plugin.update_stylesheets if Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
process_without_sass(request, response)
end
alias_method :process_without_sass, :process
alias_method :process, :process_with_sass
end
end