Class: Awestruct::Handlers::BaseSassHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- Awestruct::Handlers::BaseSassHandler
- Defined in:
- lib/awestruct/handlers/base_sass_handler.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#syntax ⇒ Object
readonly
Returns the value of attribute syntax.
Attributes inherited from BaseHandler
Instance Method Summary collapse
-
#initialize(site, delegate, syntax) ⇒ BaseSassHandler
constructor
A new instance of BaseSassHandler.
- #output_filename ⇒ Object
- #rendered_content(context, with_layouts = true) ⇒ Object
- #simple_name ⇒ Object
Methods inherited from BaseHandler
#content_line_offset, #content_syntax, #front_matter, #inherit_front_matter, #input_mtime, #output_extension, #output_path, #path, #raw_content, #relative_source_path, #stale?, #to_chain
Constructor Details
#initialize(site, delegate, syntax) ⇒ BaseSassHandler
Returns a new instance of BaseSassHandler.
14 15 16 17 |
# File 'lib/awestruct/handlers/base_sass_handler.rb', line 14 def initialize(site, delegate, syntax) super( site, delegate ) @syntax = syntax end |
Instance Attribute Details
#syntax ⇒ Object (readonly)
Returns the value of attribute syntax.
12 13 14 |
# File 'lib/awestruct/handlers/base_sass_handler.rb', line 12 def syntax @syntax end |
Instance Method Details
#output_filename ⇒ Object
23 24 25 |
# File 'lib/awestruct/handlers/base_sass_handler.rb', line 23 def output_filename simple_name + '.css' end |
#rendered_content(context, with_layouts = true) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/awestruct/handlers/base_sass_handler.rb', line 27 def rendered_content(context, with_layouts=true) sass_opts = Compass. sass_opts[:load_paths] ||= [] Compass::Frameworks::ALL.each do |framework| sass_opts[:load_paths] << framework.stylesheets_directory end sass_opts[:load_paths] << File.dirname( context.page.source_path ) sass_opts[:syntax] = syntax sass_opts[:custom] = site sass_engine = Sass::Engine.new( raw_content, sass_opts ) sass_engine.render end |
#simple_name ⇒ Object
19 20 21 |
# File 'lib/awestruct/handlers/base_sass_handler.rb', line 19 def simple_name File.basename( relative_source_path, ".#{syntax}" ) end |