Class: SiteFuel::Processor::SASSProcessor

Inherits:
AbstractStringBasedProcessor show all
Defined in:
lib/sitefuel/processors/SASSProcessor.rb

Instance Attribute Summary

Attributes inherited from AbstractStringBasedProcessor

#document

Attributes inherited from AbstractProcessor

#execution_list, #original_size, #processed_size, #resource_name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractStringBasedProcessor

filter_string, #generate, #generate_string, #open_file, #open_string, process_file, process_string, #processor_symbol, processor_type, #save

Methods inherited from AbstractProcessor

#add_filter, #add_filterset, #clear_filters, #create_file, #drop_filter, #execute, file_pattern_match?, #filter?, filter?, filters, filters_in_filterset, filterset?, filterset_ignore, filtersets, find_processors, #finish_filters, #initialize, processes_file?, processor_name, #processor_symbol, processor_type, #run_filter, #run_filterset, #save, #setup_filters

Methods included from ClassLogging

#debug, #error, #fatal, #info, #warn

Methods included from Configurable

#configuration_options, #configure, #ensure_configurable_option, #post_configuration, #pre_configuration, #set_configuration

Methods included from Logging

#debug, #error, #fatal, #info, #logger=, #warn

Constructor Details

This class inherits a constructor from SiteFuel::Processor::AbstractProcessor

Class Method Details

.default_filtersetObject



27
28
29
# File 'lib/sitefuel/processors/SASSProcessor.rb', line 27

def self.default_filterset
  :generate
end

.file_patternsObject



23
24
25
# File 'lib/sitefuel/processors/SASSProcessor.rb', line 23

def self.file_patterns
  ['.sass']
end

.filterset_generateObject



31
32
33
# File 'lib/sitefuel/processors/SASSProcessor.rb', line 31

def self.filterset_generate
  [:generate, :minify]
end

Instance Method Details

#filter_generateObject

generates the raw .css file from a .sass file

TODO it’s very important that generate be the first filter run



38
39
40
41
# File 'lib/sitefuel/processors/SASSProcessor.rb', line 38

def filter_generate
  engine = Sass::Engine.new(document)
  @document = engine.render
end

#filter_minifyObject

runs the CSSProcessor’s minify filter



44
45
46
# File 'lib/sitefuel/processors/SASSProcessor.rb', line 44

def filter_minify
  @document = CSSProcessor.filter_string(:minify, document)
end