class Sass::Rails::SassTemplate

Public Class Methods

engine_initialized?() click to toggle source
# File lib/sass/rails/template_handlers.rb, line 54
def self.engine_initialized?
  defined?(::Sass::Engine)
end

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source
# File lib/sass/rails/template_handlers.rb, line 94
def evaluate(scope, locals, &block)
  Sass::Engine.new(data, sass_options(scope)).render
end
importer(scope) click to toggle source
# File lib/sass/rails/template_handlers.rb, line 87
def importer(scope)
  Sass::Rails::Importer.new(scope)
end
initialize_engine() click to toggle source
# File lib/sass/rails/template_handlers.rb, line 58
def initialize_engine
  require_template_library 'sass'
end
prepare() click to toggle source
# File lib/sass/rails/template_handlers.rb, line 91
def prepare
end
sass_options(scope) click to toggle source
# File lib/sass/rails/template_handlers.rb, line 70
def sass_options(scope)
  importer = self.importer(scope)
  options = sass_options_from_rails(scope)
  load_paths = (options[:load_paths] || []).dup
  load_paths.unshift(importer)
  options.merge(
    :filename => eval_file,
    :line => line,
    :syntax => syntax,
    :importer => importer,
    :load_paths => load_paths,
    :custom => {
      :resolver => Resolver.new(scope)
    }
  )
end
sass_options_from_rails(scope) click to toggle source
# File lib/sass/rails/template_handlers.rb, line 66
def sass_options_from_rails(scope)
  scope.environment.context_class.sass_config
end
syntax() click to toggle source
# File lib/sass/rails/template_handlers.rb, line 62
def syntax
  :sass
end