Open ysb33r opened 4 years ago
You should allow for the elements in Message to be lazy-evaluated. This allows evolving state to be included. For instance you can rewrite Message.channel to be
Message
Message.channel
void setChannel(Object o) { this.channel = o } String getChannel() { StringUtils.stringize(this.channel) } private Object channel
IN this way plugin authors can for instance select the channel dependent on the result
slack { message { channel = { -> tasks.getByName('build').state.failure ? '#failed_build; : '#passed_build' } } }
You can get the StringUtils.stringize method from the Grolifant library (https://ysb33rOrg.gitlab.io/grolifant)
StringUtils.stringize
Sounds great for the lazy evaluation. I like this idea. I'll consider it.
You should allow for the elements in
Message
to be lazy-evaluated. This allows evolving state to be included. For instance you can rewriteMessage.channel
to beIN this way plugin authors can for instance select the channel dependent on the result
You can get the
StringUtils.stringize
method from the Grolifant library (https://ysb33rOrg.gitlab.io/grolifant)