Class: SassC::Rails::Importer::SassERBExtension

Inherits:
Extension
  • Object
show all
Defined in:
lib/sassc/rails/importer.rb

Instance Method Summary collapse

Methods inherited from Extension

#initialize

Constructor Details

This class inherits a constructor from SassC::Rails::Importer::Extension

Instance Method Details

#import_for(full_path, parent_dir, options) ⇒ Object



59
60
61
62
63
64
# File 'lib/sassc/rails/importer.rb', line 59

def import_for(full_path, parent_dir, options)
  template = Tilt::ERBTemplate.new(full_path)
  parsed_erb = template.render(options[:sprockets][:context], {})
  parsed_scss = SassC::Sass2Scss.convert(parsed_erb)
  SassC::Importer::Import.new(full_path, source: parsed_scss)
end

#postfixObject



55
56
57
# File 'lib/sassc/rails/importer.rb', line 55

def postfix
  ".sass.erb"
end