This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~ $ java -version | |
| openjdk version "1.8.0_202" | |
| OpenJDK Runtime Environment (Zulu 8.36.0.1-CA-macosx) (build 1.8.0_202-b05) | |
| OpenJDK 64-Bit Server VM (Zulu 8.36.0.1-CA-macosx) (build 25.202-b05, mixed mode) | |
| ~ $ | |
| ~ $ groovy -version | |
| Groovy Version: 2.5.14 JVM: 1.8.0_202 Vendor: Azul Systems, Inc. OS: Mac OS X | |
| ~ $ | |
| ~ $ cat doit.groovy | |
| sb = new StringBuffer('demo') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cat doit.groovy | |
| sb = new StringBuffer('demo') | |
| sb.metaClass.toString = { -> 'upated' } | |
| println sb.toString() | |
| $ | |
| $ | |
| $ groovy doit | |
| demo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.te | |
| import io.kotest.core.spec.style.BehaviorSpec | |
| import io.kotest.matchers.shouldBe | |
| import io.micronaut.http.client.HttpClient | |
| import io.micronaut.http.client.annotation.Client | |
| import io.micronaut.runtime.server.EmbeddedServer | |
| import io.micronaut.test.extensions.kotest.annotation.MicronautTest | |
| @MicronautTest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| groovy:000> sb = new StringBuffer('demo') | |
| ===> demo | |
| groovy:000> | |
| groovy:000> sb.metaClass.toString = { -> 'updated' } | |
| ===> groovysh_evaluate$_run_closure1@5c8504fd | |
| groovy:000> sb | |
| ===> demo | |
| groovy:000> sb.toString() | |
| ===> demo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io.micronaut.health.HealthStatus; | |
| import io.micronaut.management.health.indicator.HealthIndicator; | |
| import io.micronaut.management.health.indicator.HealthResult; | |
| import io.micronaut.management.health.indicator.annotation.Liveness; | |
| import io.reactivex.Flowable; | |
| import org.reactivestreams.Publisher; | |
| import javax.inject.Singleton; | |
| @Singleton |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class GroovyTest { | |
| static void main(args) { | |
| examine() { | |
| examine() { | |
| println "${owner}" | |
| } | |
| } | |
| } | |
| static examine(closure) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ javap -classpath demoapp/build/classes/groovy/main demoapp.DemoController | |
| Compiled from "DemoController.groovy" | |
| public class demoapp.DemoController implements grails.artefact.gsp.TagLibraryInvoker,grails.artefact.Controller,grails.artefact.controller.RestResponder,org.grails.compiler.web.converters.RenderConverterTrait,grails.artefact.controller.RestResponder$Trait$FieldHelper,grails.artefact.Controller$Trait$FieldHelper,grails.web.api.ServletAttributes$Trait$FieldHelper,grails.web.api.WebAttributes$Trait$FieldHelper,grails.artefact.controller.support.RequestForwarder$Trait$FieldHelper,grails.artefact.controller.support.ResponseRedirector$Trait$FieldHelper,grails.artefact.controller.support.ResponseRenderer$Trait$FieldHelper,grails.artefact.gsp.TagLibraryInvoker$Trait$FieldHelper,groovy.lang.GroovyObject { | |
| public static transient boolean __$stMC; | |
| public demoapp.DemoController(); | |
| public java.lang.Object renderMessage(java.lang.String); | |
| public java.lang.Object pigLatin(java.lang.String); | |
| public java |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ diff -r mngrailsdemo mngrailsdemo-norabbit | |
| diff -r mngrailsdemo/build.gradle mngrailsdemo-norabbit/build.gradle | |
| 82,84d81 | |
| < | |
| < implementation "io.micronaut.configuration:micronaut-rabbitmq:1.2.0" | |
| < implementation "com.rabbitmq:amqp-client:5.9.0" | |
| diff -r mngrailsdemo/grails-app/conf/application.yml mngrailsdemo-norabbit/grails-app/conf/application.yml | |
| 156,158d155 | |
| < --- | |
| < rabbitmq: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~ $ cat htmlTest.groovy | |
| import groovy.xml.MarkupBuilder | |
| def writer = new StringWriter() | |
| def markup = new MarkupBuilder(writer) | |
| markup.html { | |
| body { | |
| div { | |
| h1 "Test Page" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def m1 = new Money('4.2') | |
| def m2 = new Money('21.12') | |
| def moneys = [m1, m2] | |
| // this call will evaluate to false | |
| // because of the way that your | |
| // equals(Object) method is implemented | |
| println moneys.contains(m1) |