Sha256: 22b8a9b5ba2cc3d6a85306dca86d3b9fd7c7e28733efb1dd3794ff7e38c56c07

Contents?: true

Size: 1.63 KB

Versions: 39

Compression:

Stored size: 1.63 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',
                              :always_check       => 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 # :nodoc:
      def call_with_sass(env)
        if !Sass::Plugin.checked_for_updates ||
            Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
          Sass::Plugin.update_stylesheets
        end

        call_without_sass(env)
      end
      alias_method :call_without_sass, :call
      alias_method :call, :call_with_sass
    end

  else

    class MerbHandler # :nodoc:
      def process_with_sass(request, response)
        if !Sass::Plugin.checked_for_updates ||
            Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
          Sass::Plugin.update_stylesheets
        end

        process_without_sass(request, response)
      end
      alias_method :process_without_sass, :process
      alias_method :process, :process_with_sass
    end

  end
end

Version data entries

39 entries across 39 versions & 11 rubygems

Version Path
honkster-haml-2.1.0 lib/sass/plugin/merb.rb
honkster-haml-2.1.1 lib/sass/plugin/merb.rb
jwhitmire-haml-2.1.0.1 lib/sass/plugin/merb.rb
jwhitmire-haml-2.1.0.2 lib/sass/plugin/merb.rb
jwhitmire-haml-2.1.0.3 lib/sass/plugin/merb.rb
wireframe-haml-2.1.0 lib/sass/plugin/merb.rb
wireframe-haml-2.1.1 lib/sass/plugin/merb.rb
radiantcms-couchrest_model-0.2.4 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiantcms-couchrest_model-0.2.2 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiantcms-couchrest_model-0.2.1 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiantcms-couchrest_model-0.2 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiantcms-couchrest_model-0.1.9 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiantcms-couchrest_model-0.1.8 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiantcms-couchrest_model-0.1.7 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiantcms-couchrest_model-0.1.6 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiantcms-couchrest_model-0.1.5 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiant-0.8.2 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiant-rc-0.9.0 vendor/plugins/haml/lib/sass/plugin/merb.rb
radiant-0.8.1 vendor/plugins/haml/lib/sass/plugin/merb.rb
haml-2.0.10 lib/sass/plugin/merb.rb