Sha256: 1d770260110da5ccd534bf71ab3780001c6a8f4f3fe5a80801b60b84790d2abe

Contents?: true

Size: 388 Bytes

Versions: 3

Compression:

Stored size: 388 Bytes

Contents

require 'tilt/template'

module Jasmine::Headless
  class JSTemplate < Tilt::Template
    self.default_mime_type = 'application/javascript'

    def prepare ; end

    def evaluate(scope, locals, &block)
      if data[%r{^<script type="text/javascript"}]
        data
      else
        file ? %{<script type="text/javascript" src="#{file}"></script>} : data
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jasmine-headless-webkit-0.8.1 lib/jasmine/headless/js_template.rb
jasmine-headless-webkit-0.8.0 lib/jasmine/headless/js_template.rb
jasmine-headless-webkit-0.8.0.alpha.1 lib/jasmine/headless/js_template.rb