skeletal
skeletal copied to clipboard
document using a dollar property for Groovy classes
When using a template for a Groovy classes you may have a GString with a Variable ${variable} inside a GString
. When the template is processed it will throw an error since it expects a property to replace it with. One solution is to to try to escape the characters but the solution I usually use it to make a variable for the $.
Example _result:
println("${operand1} + ${operand2} = ${result}")
To get this... In lazybones.groovy
props.dollar='$'
In the template:
println("${dollar}{operand1} + ${dollar}{operand2} = ${dollar}{result}")