Sha256: 20a526a55060ba9889bfa35e91897ba03a1f0244552ba1e585348aa5b767a970

Contents?: true

Size: 1.68 KB

Versions: 134

Compression:

Stored size: 1.68 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",
                              :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)
        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
      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

134 entries across 134 versions & 4 rubygems

Version Path
drnic-haml-2.3.1 lib/sass/plugin/merb.rb
middleman-0.10.17 vendor/gems/gems/haml-2.2.13/lib/sass/plugin/merb.rb
middleman-0.10.16 vendor/gems/gems/haml-2.2.13/lib/sass/plugin/merb.rb
middleman-0.10.15 vendor/gems/gems/haml-2.2.13/lib/sass/plugin/merb.rb
middleman-0.10.14 vendor/gems/gems/haml-2.2.13/lib/sass/plugin/merb.rb
haml-edge-2.3.80 lib/sass/plugin/merb.rb
haml-edge-2.3.79 lib/sass/plugin/merb.rb
haml-edge-2.3.78 lib/sass/plugin/merb.rb
haml-2.2.13 lib/sass/plugin/merb.rb
haml-edge-2.3.77 lib/sass/plugin/merb.rb
haml-edge-2.3.76 lib/sass/plugin/merb.rb
haml-edge-2.3.75 lib/sass/plugin/merb.rb
haml-2.2.12 lib/sass/plugin/merb.rb
haml-edge-2.3.74 lib/sass/plugin/merb.rb
haml-edge-2.3.73 lib/sass/plugin/merb.rb
haml-2.2.11 lib/sass/plugin/merb.rb
haml-edge-2.3.72 lib/sass/plugin/merb.rb
haml-edge-2.3.71 lib/sass/plugin/merb.rb
haml-edge-2.3.70 lib/sass/plugin/merb.rb
haml-edge-2.3.69 lib/sass/plugin/merb.rb