Class: Dryml::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/dryml13-firemarker.rb

Instance Method Summary collapse

Instance Method Details

#wrap_source_with_metadata(content, kind, name, line, *args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/dryml13-firemarker.rb', line 10

def (content, kind, name, line, *args)
  return content if name.in?(NO_METADATA_TAGS)
  json = DrymlFireMarker.(@template_path, kind, name, line, *args)
  uid = rand(10000000000)
  <<-source
    <% timestamp#{uid} = Time.now.to_f; safe_concat(%(<!--[dryml]#{json}-->)) %>
    #{content}
    <% safe_concat(%(<!--[/dryml]{"time":"\#{(Time.now.to_f - timestamp#{uid})*1000}ms"}-->)) %>
  source
end