Class: Sass::Rails::SassTemplate
- Inherits:
-
Tilt::SassTemplate
- Object
- Tilt::SassTemplate
- Sass::Rails::SassTemplate
- Defined in:
- lib/sass/rails/template_handlers.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #evaluate(scope, locals, &block) ⇒ Object
- #importer(scope) ⇒ Object
- #initialize_engine ⇒ Object
- #prepare ⇒ Object
- #sass_options(scope) ⇒ Object
- #sass_options_from_rails(scope) ⇒ Object
- #syntax ⇒ Object
Class Method Details
.engine_initialized? ⇒ Boolean
34 35 36 |
# File 'lib/sass/rails/template_handlers.rb', line 34 def self.engine_initialized? defined?(::Sass::Engine) end |
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
74 75 76 |
# File 'lib/sass/rails/template_handlers.rb', line 74 def evaluate(scope, locals, &block) Sass::Engine.new(data, (scope)).render end |
#importer(scope) ⇒ Object
67 68 69 |
# File 'lib/sass/rails/template_handlers.rb', line 67 def importer(scope) Sass::Rails::Importer.new(scope) end |
#initialize_engine ⇒ Object
38 39 40 |
# File 'lib/sass/rails/template_handlers.rb', line 38 def initialize_engine require_template_library 'sass' end |
#prepare ⇒ Object
71 72 |
# File 'lib/sass/rails/template_handlers.rb', line 71 def prepare end |
#sass_options(scope) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/sass/rails/template_handlers.rb', line 50 def (scope) importer = self.importer(scope) = (scope) load_paths = ([:load_paths] || []).dup load_paths.unshift(importer) .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) ⇒ Object
46 47 48 |
# File 'lib/sass/rails/template_handlers.rb', line 46 def (scope) scope.environment.context_class.sass_config end |
#syntax ⇒ Object
42 43 44 |
# File 'lib/sass/rails/template_handlers.rb', line 42 def syntax :sass end |