You may at times need to get the value of the environment. To do so
import grails.util.Environment println Environment.current.name
import grails.util.Environment println Environment.current.name
def doWith(x,c) { | |
c.call() | |
} | |
def param = { i-> | |
println "## Params $i" | |
} | |
def noparam = { | |
println "#### No params" | |
} | |
doWith(4, {param "asdfasdf"}) | |
doWith(5,noparam) |
## Params asdfasdf #### No paramsIf you choose to pass a closure that requires paramaters then one would need o sourround the closure in curly brackets
doWith(4, {param "asdfasdf"})Otherwise
doWith(5,noparam)
git commit --amend
throw
new Exception()But a rollback was not issued because the exception thrown wasn't a RuntimeException.
objectInstance.dirtyPropertyNames
def stringMap = "['a':['c':'true'],'b':4]" def map = evaluate(stringMap)
if [[ foo || bar || baz ]] ; then ... fiFor more info look at this stackoverflow
If [ conditional expression1 ] then statement1 statement2 . elif [ conditional expression2 ] then statement3 statement4 . . . else statement5 fiI wont take all the credit, I got the info from HERE
total=`expr $val_1 + $val_2 + $val_3`