Sha256: 3645b31d6b36a8a4e316e260627fbf24f9025acfffdc17a3204ee263d045ff74

Contents?: true

Size: 432 Bytes

Versions: 4

Compression:

Stored size: 432 Bytes

Contents

require 'tilt'

module Amiba
  class Tilt

    def self.new(obj, options={}, &block)
      if obj.is_a?(String) && File.exist?(obj)
        ::Tilt.new(obj, options)
      else
        if template_class = ::Tilt[obj.filename]
          block ||= proc { obj.content }
          template_class.new(obj.filename, nil, options, &block)
        else
          raise "Can't find a template loader!"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
amiba-1.0.2 lib/amiba/tilt.rb
amiba-1.0.1 lib/amiba/tilt.rb
amiba-1.0.0 lib/amiba/tilt.rb
amiba-0.0.9 lib/amiba/tilt.rb