Sha256: ea7409e52fe130939149ac2170626444abe4ce5da6111bae040e17e62f041e95

Contents?: true

Size: 664 Bytes

Versions: 5

Compression:

Stored size: 664 Bytes

Contents

# -*- encoding: utf-8 -*-

module Webgen::ContentProcessor

  # Processes content in Sass markup (used for writing CSS files) using the +haml+ library.
  class Sass

    # Convert the content in +sass+ markup to CSS.
    def call(context)
      require 'sass'

      context.content = ::Sass::Engine.new(context.content, :filename => context.ref_node.alcn).render
      context
    rescue LoadError
      raise Webgen::LoadError.new('sass', self.class.name, context.dest_node, 'haml')
    rescue ::Sass::SyntaxError => e
      raise Webgen::RenderError.new(e, self.class.name, context.dest_node, context.ref_node, (e.sass_line if e.sass_line))
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
webgen-0.5.17 lib/webgen/contentprocessor/sass.rb
webgen-0.5.15 lib/webgen/contentprocessor/sass.rb
webgen-0.5.14 lib/webgen/contentprocessor/sass.rb
webgen-0.5.13 lib/webgen/contentprocessor/sass.rb
webgen-0.5.12 lib/webgen/contentprocessor/sass.rb