Sha256: b67280240772ee728bec766c76a10a523a946a541bcdfb85351c9c4a2af6ab6f

Contents?: true

Size: 1.46 KB

Versions: 31

Compression:

Stored size: 1.46 KB

Contents

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)

  if version[0] > 0 || version[1] >= 9

    class Merb::Rack::Application
      def call_with_sass(env)
        Sass::Plugin.check_for_updates
        call_without_sass(env)
      end
      alias_method :call_without_sass, :call
      alias_method :call, :call_with_sass
    end

  else

    class MerbHandler
      def process_with_sass(request, response)
        Sass::Plugin.check_for_updates
        process_without_sass(request, response)
      end
      alias_method :process_without_sass, :process
      alias_method :process, :process_with_sass
    end

  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
haml-edge-2.3.224 lib/sass/plugin/merb.rb
haml-edge-2.3.223 lib/sass/plugin/merb.rb
haml-edge-2.3.222 lib/sass/plugin/merb.rb
haml-3.0.0.rc.2 lib/sass/plugin/merb.rb
haml-edge-2.3.221 lib/sass/plugin/merb.rb
haml-edge-2.3.220 lib/sass/plugin/merb.rb
haml-edge-2.3.219 lib/sass/plugin/merb.rb
haml-edge-2.3.218 lib/sass/plugin/merb.rb
haml-edge-2.3.217 lib/sass/plugin/merb.rb
haml-edge-2.3.216 lib/sass/plugin/merb.rb
haml-edge-2.3.215 lib/sass/plugin/merb.rb
haml-edge-2.3.214 lib/sass/plugin/merb.rb
haml-edge-2.3.213 lib/sass/plugin/merb.rb
haml-edge-2.3.212 lib/sass/plugin/merb.rb
haml-edge-2.3.211 lib/sass/plugin/merb.rb
haml-edge-2.3.210 lib/sass/plugin/merb.rb
haml-3.0.0.rc.1 lib/sass/plugin/merb.rb
haml-edge-2.3.209 lib/sass/plugin/merb.rb
haml-3.0.0.beta.3 lib/sass/plugin/merb.rb
haml-edge-2.3.208 lib/sass/plugin/merb.rb