module Sass::Rails::SassImporter::ERB - sass-rails-5.0.3 Documentation

# module Sass::Rails::SassImporter::ERB

### Public Instance Methods

erb_extensions() click to toggle source

    # File lib/sass/rails/importer.rb, line 71
    def erb_extensions
      {
        :scss_erb => :scss,
        :sass_erb => :sass
      }
    end

extensions() click to toggle source
Calls superclass method

    # File lib/sass/rails/importer.rb, line 63
    def extensions
      {
        'css.erb'  => :scss_erb,
        'scss.erb' => :scss_erb,
        'sass.erb' => :sass_erb
      }.merge(super)
    end

find(*args) click to toggle source
Calls superclass method

    # File lib/sass/rails/importer.rb, line 82
    def find(*args)
      process_erb_engine(super)
    end

find_relative(*args) click to toggle source
Calls superclass method

    # File lib/sass/rails/importer.rb, line 78
    def find_relative(*args)
      process_erb_engine(super)
    end

### Private Instance Methods

process_erb_engine(engine) click to toggle source

    # File lib/sass/rails/importer.rb, line 87
    def process_erb_engine(engine)
      if engine && engine.options[:sprockets] && syntax = erb_extensions[engine.options[:syntax]]
        template = Tilt::ERBTemplate.new(engine.options[:filename])
        contents = template.render(engine.options[:sprockets][:context], {})

        Sass::Engine.new(contents, engine.options.merge(:syntax => syntax))
      else
        engine
      end
    end