haml-3.0.25.lib.sass.plugin.merb.rb Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalate-jruby_2.10 Show documentation
Show all versions of scalate-jruby_2.10 Show documentation
Scalate integration with JRuby to access Ruby based filters such as sass
The newest version!
unless defined?(Sass::MERB_LOADED)
Sass::MERB_LOADED = true
version = Merb::VERSION.split('.').map { |n| n.to_i }
if version[0] <= 0 && version[1] < 5
root = MERB_ROOT
env = MERB_ENV
else
root = Merb.root.to_s
env = Merb.environment
end
Sass::Plugin.options.merge!(:template_location => root + '/public/stylesheets/sass',
:css_location => root + '/public/stylesheets',
:cache_location => root + '/tmp/sass-cache',
:always_check => env != "production",
:quiet => env != "production",
:full_exception => env != "production")
config = Merb::Plugins.config[:sass] || Merb::Plugins.config["sass"] || {}
if defined? config.symbolize_keys!
config.symbolize_keys!
end
Sass::Plugin.options.merge!(config)
require 'sass/plugin/rack'
class Sass::Plugin::MerbBootLoader < Merb::BootLoader
after Merb::BootLoader::RackUpApplication
def self.run
# Apparently there's no better way than this to add Sass
# to Merb's Rack stack.
Merb::Config[:app] = Sass::Plugin::Rack.new(Merb::Config[:app])
end
end
end
© 2015 - 2025 Weber Informatics LLC | Privacy Policy