Class: Moft::GistTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/moft/tags/gist.rb

Instance Method Summary collapse

Instance Method Details

#render(context) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/moft/tags/gist.rb', line 9

def render(context)
  if tag_contents = @markup.strip.match(/\A(\d+) ?(\S*)\Z/)
    gist_id, filename = tag_contents[1].strip, tag_contents[2].strip
    gist_script_tag(gist_id, filename)
  else
    "Error parsing gist id"
  end
end