Skip to content

Instantly share code, notes, and snippets.

@squarepegsys
Last active August 29, 2015 14:03
Show Gist options
  • Save squarepegsys/2389ac43663d10125020 to your computer and use it in GitHub Desktop.
Save squarepegsys/2389ac43663d10125020 to your computer and use it in GitHub Desktop.
import groovy.text.SimpleTemplateEngine
def text = '${firstName} ${lastName} is a member of the ${lodge}'
def binding = [firstName: "Fred", lastName: "Flintstone", lodge:"Water Buffaloes"]
def engine = new SimpleTemplateEngine()
template = engine.createTemplate(text).make(binding)
assert template.toString()=="Fred Flintstone is a member of the Water Buffaloes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment