Sha256: 04a49c1ce0629d52856c27fe1e822b3d4cbe285709a4f1a0cf7421e940f2e305

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

unless defined?(Sass::MERB_LOADED)
  Sass::MERB_LOADED = true

  module Sass::Plugin::Configuration
    # Different default options in a m environment.
    def default_options
      @default_options ||= begin
        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

        {
          :always_update      => false,
          :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"
        }.freeze
      end
    end
  end

  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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sass-4.0.0.alpha.1 lib/sass/plugin/merb.rb
sass-3.4.20 lib/sass/plugin/merb.rb