Sha256: 263b62aa20f13f3e17112199389d674f3a8a2565ba4298d6bca4e57a140d6615

Contents?: true

Size: 1.08 KB

Versions: 14

Compression:

Stored size: 1.08 KB

Contents

require "tilt"
require "sass"
require "compass"
require "handlebars.rb"
require "coffee_script"

module Tilt
  class JavascriptTemplate < PlainTemplate
    self.default_mime_type = 'application/javascript'
  end

  class CSSTemplate < PlainTemplate
    self.default_mime_type = 'text/css'
  end

  class CompassSassTemplate < SassTemplate
    self.default_mime_type = 'text/css'

  private
    def sass_options
      super.merge(Linner.sass_engine_options)
    end
  end

  class CompassScssTemplate < CompassSassTemplate
    self.default_mime_type = 'text/css'

  private
    def sass_options
      super.merge(:syntax => :scss)
    end
  end

  class HandlebarsTemplate < Template
    self.default_mime_type = 'text/template'

    def prepare; end

    def evaluate(scope, locals, &block)
      @output ||= Handlebars.precompile(data)
    end
  end

  register CSSTemplate, "css"
  register JavascriptTemplate, "js"
  register HandlebarsTemplate, "hbs", "handlebars"

  register CompassSassTemplate, "sass"
  prefer CompassSassTemplate

  register CompassScssTemplate, "scss"
  prefer CompassScssTemplate
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
linner-0.7.3 lib/linner/template.rb
linner-0.7.2 lib/linner/template.rb
linner-0.7.1 lib/linner/template.rb
linner-0.7.0 lib/linner/template.rb
linner-0.6.7 lib/linner/template.rb
linner-0.6.6 lib/linner/template.rb
linner-0.6.5 lib/linner/template.rb
linner-0.6.4 lib/linner/template.rb
linner-0.6.3 lib/linner/template.rb
linner-0.6.2 lib/linner/template.rb
linner-0.6.1 lib/linner/template.rb
linner-0.6.0 lib/linner/template.rb
linner-0.5.1 lib/linner/template.rb
linner-0.5.0 lib/linner/template.rb