Class: Jasmine::Headless::JSTemplate

Inherits:
Tilt::Template
  • Object
show all
Includes:
FileChecker
Defined in:
lib/jasmine/headless/js_template.rb

Instance Method Summary collapse

Methods included from FileChecker

#alert_bad_format, #alert_if_bad_format?, #bad_format?

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/jasmine/headless/js_template.rb', line 10

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

#prepareObject



8
# File 'lib/jasmine/headless/js_template.rb', line 8

def prepare ; end