Class: Henshin::SassPlugin

Inherits:
Generator show all
Defined in:
lib/henshin/plugins/sass.rb

Instance Attribute Summary

Attributes inherited from Plugin

#config, #extensions, #priority

Instance Method Summary collapse

Methods inherited from Plugin

#<=>, subclasses

Constructor Details

#initialize(site) ⇒ SassPlugin

Returns a new instance of SassPlugin.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/henshin/plugins/sass.rb', line 6

def initialize(site)
  @extensions = {:input => ['sass', 'scss'],
                 :output => 'css'}
  @config = {'ignore_layouts' => true,
             'style' => :nested,
             'load_paths' => Dir.glob((site.root + '*').to_s),
             'syntax' => :sass}
  
  @config.merge!(site.config['sass']) if site.config['sass']
  
  @priority = 5
end

Instance Method Details

#generate(content) ⇒ Object



19
20
21
# File 'lib/henshin/plugins/sass.rb', line 19

def generate( content )
  Sass::Engine.new(content, @config.to_options).render
end