Sha256: c57e5480f0f0dbeb004c6c699405ad0cb2c6e9008c1b5270f1241301d5c3b77a

Contents?: true

Size: 855 Bytes

Versions: 69

Compression:

Stored size: 855 Bytes

Contents

require 'tilt/template'
require 'sass'

module Tilt
  # Sass template implementation. See:
  # http://haml.hamptoncatlin.com/
  #
  # Sass templates do not support object scopes, locals, or yield.
  class SassTemplate < Template
    self.default_mime_type = 'text/css'

    def prepare
      @engine = ::Sass::Engine.new(data, sass_options)
    end

    def evaluate(scope, locals, &block)
      @output ||= @engine.render
    end

    def allows_script?
      false
    end

  private
    def sass_options
      options.merge(:filename => eval_file, :line => line, :syntax => :sass)
    end
  end

  # Sass's new .scss type template implementation.
  class ScssTemplate < SassTemplate
    self.default_mime_type = 'text/css'

  private
    def sass_options
      options.merge(:filename => eval_file, :line => line, :syntax => :scss)
    end
  end

end

Version data entries

69 entries across 68 versions & 19 rubygems

Version Path
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/tilt-2.0.7/lib/tilt/sass.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/tilt-2.0.7/lib/tilt/sass.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/tilt-2.0.8/lib/tilt/sass.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-4.3.1 bundle/ruby/2.5.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/sass.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/tilt-2.0.7/lib/tilt/sass.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/tilt-2.0.7/lib/tilt/sass.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-3.7.2 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/sass.rb
brakeman-3.7.1 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/sass.rb
tilt-2.0.8 lib/tilt/sass.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/tilt-2.0.7/lib/tilt/sass.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/tilt-2.0.7/lib/tilt/sass.rb