Sha256: 71ee25c12e53a094e01db74da142fd841345eea98cba988e72b5e657bb5b69a6

Contents?: true

Size: 397 Bytes

Versions: 1

Compression:

Stored size: 397 Bytes

Contents

require 'tilt'
require 'sass'
require 'coffee_script'

module Linner
  class Template

    def initialize(path)
      @path = path
    end

    def render
      if supported_template? @path
        Tilt.new(@path).render
      else
        File.read @path
      end
    end

    private
    def supported_template?(path)
      %w[.coffee .sass .scss].include? File.extname(path)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
linner-0.1.0 lib/linner/template.rb