Sha256: 377bf7bb527434c55fbf356edaca874597d0057b2fe66996e6d0cf03f776e30d

Contents?: true

Size: 1.01 KB

Versions: 113

Compression:

Stored size: 1.01 KB

Contents

require 'tilt/template'

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'

    begin
      require 'sassc'
      Sass = ::SassC
    rescue LoadError => err
      begin
        require 'sass'
        Sass = ::Sass
      rescue LoadError
        raise err
      end
    end

    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

113 entries across 79 versions & 11 rubygems

Version Path
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/tilt-2.0.10/lib/tilt/sass.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/brakeman-4.7.0/bundle/ruby/2.6.0/gems/tilt-2.0.10/lib/tilt/sass.rb
brakeman-4.7.0 bundle/ruby/2.6.0/gems/tilt-2.0.10/lib/tilt/sass.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/tilt-2.0.10/lib/tilt/sass.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb
tilt-2.0.10 lib/tilt/sass.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/sass.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/sass.rb