Re: Official Docker Groovy images

2017-03-01 Thread Keegan Witt
I'm preparing to update for 2.4.9 and am considering two significant
changes to the initial image.  First, to create a volume to prevent Grape
caches from being put into downstream images (PR #6
), and using a user other
than root for the container (PR #7
).  I'm pretty sure I'm
going to do #6, should be pretty safe.  But I'm still weighing #7.  I wanna
get that decided this week so that we pick something and stick with it, to
avoid breaking anything later.  Please weigh in if you have any opinion.

-Keegan

On Wed, Mar 1, 2017 at 3:20 AM, Guillaume Laforge 
wrote:

> Well done, Keegan!
>
> On Wed, Mar 1, 2017 at 8:12 AM, Daniel Sun 
> wrote:
>
>> Nice!
>>
>>
>>
>> --
>> View this message in context: http://groovy.329449.n5.nabble
>> .com/Official-Docker-Groovy-images-tp5738848p5738851.html
>> Sent from the Groovy Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Guillaume Laforge
> Apache Groovy committer & PMC Vice-President
> Developer Advocate @ Google Cloud Platform
>
> Blog: http://glaforge.appspot.com/
> Social: @glaforge  / Google+
> 
>


Re: Override a method without knowing its parameters

2017-03-01 Thread Douglas Mendes
Answering my own question:

It can be done if the metaClass is an ExpandoMetaClass. Like this:

expandoMetaClass.registerInstanceMethod(
new TransformMetaMethod(originalMetaMethod) {
@Override
Object invoke(Object object, Object[] arguments) {
println "Done! Method overriden!"
super.invoke(object, arguments)
}
}
)

Anyway, in grails it didn't work (it kept calling the original method). Had
to use an AST.

Regards,
Douglas

Em qui, 23 de fev de 2017 às 16:12, Douglas Mendes 
escreveu:

Hi.

How can I properly override a method given a java.lang.reflect.Method and
its respective MetaClass?

I know that can be achieved by overriding the MetaClass's *invokeMethod *but
I can't do that (even if I could, would like to avoid).

Pseudocode:

*void doAnOverride(MetaClass metaClass, Method method) {*
*metaClass."${method.name }" = { args ->*
*println "done"*
*}*
*}*

Thanks,
Douglas