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
| # Say we're both working on the same project, and I've just created | |
| # a new branch for my cool new feature and pushed it up to my | |
| # github-hosted repo on a branch called "feature". | |
| # Inside your local copy of the repo: | |
| # create a new remote called "johnreilly" for the repo located at github | |
| git remote add johnreilly git://github.com/johnreilly/project.git | |
| # do a fetch of the remote repository |
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
| usePlugin 'groovy' | |
| usePlugin(com.smokejumperit.gradle.CukePlugin) | |
| buildscript { | |
| repositories { | |
| mavenRepo urls:'http://repo.smokejumperit.com' | |
| } | |
| dependencies { | |
| classpath 'com.smokejumperit:gradle-plugins:0.5.1' | |
| } |
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
| Running data flow operator demo | |
| x was set to 23 | |
| x was set to 23 | |
| An exception occurred in the Actor thread Actor Thread 2 | |
| java.lang.IllegalStateException: A DataFlowVariable can only be assigned once. | |
| at groovyx.gpars.dataflow.DataFlowExpression.bind(DataFlowExpression.java:292) | |
| at groovyx.gpars.dataflow.DataFlowVariable.leftShift(DataFlowVariable.java:50) | |
| at groovyx.gpars.dataflow.DataFlowVariable$leftShift.call(Unknown Source) | |
| at groovyx.gpars.dataflow.operator.DataFlowOperator.bindOutput(DataFlowOperator.groovy:82) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) |
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
| let foo = 42 in exec(foo); | |
| let foo = 42 in { | |
| doSomething(foo); | |
| somethingElse(foo) | |
| } | |
| let foo = { arg1, arg2 -> | |
| someAnonymousFunctionImpl(arg1, arg2) | |
| }; |
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
| loop (x, y, z); | |
| if(x == true) recur(false, y, z); | |
| return y + z; |
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(foo,bar,baz) @@ | |
| import groovy.xml.* | |
| println "This totally isn't ashlar code!" | |
| @@@ | |
| @groovy(foo,bar,baz) <<< | |
| import groovy.xml.* | |
| println "This totally isn't ashlar code!" |
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
| // This works | |
| class Foo(bar:Int) { | |
| def this(bar1:Int, bar2:Int) = this(bar1 + bar2) | |
| } |
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
| abstract class X { | |
| val foo:String | |
| val bar = makeBar(foo) | |
| } | |
| class Y extends X { | |
| val foo = "Hello, World!" | |
| } |
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 x(String a, int b, Object... c) { "1" } | |
| def x(String a, Object... c) { "2" } | |
| System.out.println(x("a", 1, new Object())) |
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
| object X { | |
| def x(a:String, b:Int, c:Object*):String = { "1" } | |
| def x(a:String, c:Object*):String = { "2" } | |
| def doIt() = { | |
| System.out.println(x("a", 2, new Object())) | |
| } | |
| } |
OlderNewer