Groovy1.7ããå°å ¥ãããPower Assertã試ãã¦ã¿ãã ããã«ããassertã«ããæ¤è¨¼ã¨ã©ã¼ãçºçããå ´åã®å¼ã®ç¶æ ã詳細ã«è¡¨ç¤ºãããåé¡ã®åå ãç´ æ©ãç¹å®ã§ããã ã¾ãã¯å®è¡ assertãå©ç¨ããç°¡åãªã³ã¼ããè¨è¿°ããã test.groovy #!/usr/bin/env groovy def list = [1, 3, 4, 5, 2] assert 5 == list.max() - 1ã»ãã§å®è¡ã $ chmod 750 test.groovy $ ./test.groovy Caught: Assertion failed: assert 5 == list.max() - 1 | | | | | | 5 4 | [1, 3, 4, 5, 2] false at test.run(test.groovy:3) ããã¯ããããããããã ãããã¤ãçåç¹ãæµ®ãã
誰å¾ãªã¨ã³ããªããã¤ãããã¯ã²ã©ãããã¿ã ã¾ãã以ä¸ã®ãããªã³ã³ãã¤ã©è¨å®ãã¡ã¤ã«ãæ¸ãã¦ãããä¾ãã°~/.groovy/config.groovyãªã©ã«ä¿åãã¦ããã¾ãã import org.codehaus.groovy.control.* import org.codehaus.groovy.antlr.* import org.codehaus.groovy.syntax.* class Rubylizer extends ParserPluginFactory { ParserPlugin createParserPlugin() { new AntlrParserPlugin() { Reduction parseCST(SourceUnit sourceUnit, Reader reader) { def s = reader.text s = s.replaceAll(
ãã¡ãããNo.4ãã³ã³ãã³ãèªè¨¼ã¡ã¼ã«ãéä¿¡ãã¾ãã éããã¦ãã¾ãã 第4ã«ãã³ã³ãã³ããã«ã¼ãã4åéä¿¡ãããå ´åï¼èªåã§ä½æããå ´åã§ããèå°è£ã§å¼è·å£«ã«ç¸è«ãããã¨ãã§ãã¾ãï¼ éä¿¡ãããã±ã¼ã¹ã¯ãéä¿¡ãããã±ã¼ã¹ãããèå³æ·±ããã®ã§ã éãããæ°å®¿ã®ã²ã¤ã®ååã§2ã¤ã®ã±ã¼ã¹ãããã¾ã éãããã±ã¼ã¹ã®1ã¤ã¯ä¼ç¤¾ã§ãï¼é ã«æ¥ã¦ï¼ å¼è·å£«ã«ãªã£ã¦ãããããã æ°å®¿ã²ã¤ ç§ã¯ãéãæã«å ¥ãã¾ãã ãã1ã¤ã¯å°æ¹è°ä¼è°å¡ããã®ãã®ã§ã ãã®ç·ã¯éå»ã«ã»ãã¬ã«ã¬ã³ãã¼ã¢ãªãæã£ã¦ãã¾ã å 容ãè¦ãã®ã¯ã°ããã¦ããã®ã§ç¡è¦ãã¦ãã ãã 便å©ãªã³ã³ãã³ãèªè¨¼ å®å ¨ãªå ´æã«ä¿ç®¡ãã¦ãã ãã ãã¡ããç¸æã¯ãã®å¾ã§ã æ°å®¿ã®ã²ã¤ãã§ããªã å¤æ°ã®å¸æ°ã®åã§å¸é·é¸æä¸ã«å°æ´¥ï¼å¸è°ä¼è°å¡ï¼ã¨åºä¼ã£ã ãã®æ°å®¿ã®ã²ã¤ã®åã«ç«ã¡ãå½¼ãè¦ã¤ãã¾ã æããã¹ãã«ã®å½¢ã«ãã¦ããã®ç·ã®ãªãã³ãçã ç§ã¯ãã¼ã³ã
ç±³SpringSourceï¼ç±³VMwareåä¸ï¼ã¯1æ25æ¥ãJavaä»®æ³ãã·ã³ï¼JVMï¼åãã®ããã°ã©ãã³ã°è¨èªãGroovy 2.1.0ãããªãªã¼ã¹ãããJDK 7ã§æ°ãã«è¿½å ããããInvokeDynamicãæ©è½ã®ãã«ãµãã¼ãã«ããããã©ã¼ãã³ã¹ã®åä¸ãæ°æ©è½ã®è¿½å ãªã©ãç¹å¾´ã¨ãªãã Groovyã¯Javaã¨ã®è¦ªåæ§ã®é«ããç¹å¾´ã¨ããåçããã°ã©ãã³ã°è¨èªãGroovyã§ä½æãããããã°ã©ã ã¯JVMä¸ã§åä½ããJavaã®ãã¹ã¦ã®æ©è½ãAPIãå©ç¨ã§ãããç¾ä»£çãªããã°ã©ãã³ã°æ©è½ããã¡ã¤ã³åºæè¨èªï¼Domain Specific LanguagesãDSLï¼ã®ãµãã¼ããã¦ããããã¹ãæ©è½ã®å èµãªã©ãç¹å¾´ã§ãã©ã¤ã»ã³ã¹ã¯Apache License 2.0ã2008å¹´ã«Groovyã®éçºå ã§ããG2OneãSpringSourceãè²·åã以æ¥SpringSourceã®ä¸ã§éçºãé²ãã
JVMä¸ã®ã¹ã¯ãªããè¨èªgroovyã«èå³ãæã£ãã®ã§ãã¢ã¤ãã¢ãã©ããªã¡ã¢æ¸ãã ã¢ã¤ãã¢ãæ¸ãããã ãåèã æ¸è©ï¼ããã°ã©ãã³ã°Groovy - Digital Romanticism ã1ãæ®éã®Unixãµã¼ãã¼ãªãã°ãJavaã¯å½ããåã®ããã«ã¤ã³ã¹ãã¼ã«æ¸ã¿ã JVMã®æ大ã®å©ç¹ã¯ãOSã«ä¾åãããä¸ã¤ã®ããã°ã©ã ã§ã©ãã§ãåããããã¨ã Windowsãµã¼ãã¼ãªãbatãUnixãµã¼ããªãã·ã§ã«ã®ããã«ä½¿ãåãããã¨ã¯ãã¾ãããããªãããã ã¡ãã£ã¨ããããã°ã©ã ãããã«æ¸ãã¦ãã©ãã§ãåãããããã«ãããã æ¬æ¥ãªãPerlãæå¼·ãªã®ã ããJavaãæ¥åç³»Webã·ã¹ãã ã§éçºè¨èªã®çé ã¨ãªã£ãããã«ã¯ãJVMä¸ã§ç°¡åã«ã¹ã¯ãªããè¨èªãåãããã欲æ±ã¯å¤ãã JRubyãããã ããGroovyãããã Groovyã®ä½¿ãéãããã¤ãããã¦ã¿ãã ã2ããã«ãã¹ã¯ãªããã§ä½¿ã
Groovy WikiGroovy... is an agile and dynamic language for the Java Virtual Machine builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk makes modern programming features available to Java developers with almost-zero learning curve supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and ma
ããéä¿¡åã«ã確èªãã ããã ãå ¥åããã ããã¡ã¼ã«ã¢ãã¬ã¹ã¯ãæ¬ãã¼ã¸ã®ç®¡çè ã«æä¾ããã¾ãã 管çè ã«æä¾ãããã¡ã¼ã«ã¢ãã¬ã¹ã®åæ±ãã«ã¤ãã¦ã¯ã 管çè ã«ç´æ¥ãååãä¸ããã¾ããããé¡ãç³ãä¸ãã¾ãã æ ªå¼ä¼ç¤¾ãªã¯ã«ã¼ãã¯ã管çè ãä¿æããã¡ã¼ã«ã¢ãã¬ã¹ã«ã¤ãã¦ãçãã¾ã管çè ã«ä»£ãã£ã¦ã対å¿ããã³è²¬ä»»ãå¼ãåãããã¨ã¯ãä¸åãããããã¾ãã äºããäºæ¿ã®ããããèªèº«ã®è²¬ä»»ã«ããããéä¿¡ä¸ãã -æ°ããé³æ¥½ã«åºä¼ãã¦æ°è»½ã«è´ãã- ã¹ãã¼ããã©ã³å ã®æ¥½æ²ãåçãããã¬ã¤ã¤ã¼æ©è½ã«ãSNSæ©è½ãåããæ°ããé³æ¥½ãµã¼ãã¹ã§ããé³æ¥½ãä¸å¿ã¨ããã³ãã¥ãã±ã¼ã·ã§ã³ãéãã¦ãæ°ããé³æ¥½ã¨ã®åºä¼ããæåä½é¨ã®å ±æãè¡ãã¾ãï¼ æ ªå¼ä¼ç¤¾ãã£ã¼ã»ã¨ãã»ã¨ã¼ããæ¬ãµã¼ãã¹éå§ã®ãç¥ããããã³æ¬ãµã¼ãã¹ã«é¢ããæ å ±ã®ã¡ã¼ã«é ä¿¡ãå¸æãããæ¹ã¯ãä¸è¨ç»é²ãã¿ã³ããã¡ã¼ã«ã¢ãã¬ã¹ããç»é²ãã ãããâ»PCã¾ã
Gradleã£ã¦ãªã«ï¼ ç°¡åã«è¨ãã°Maven2ã®ãããªãã®ã§ããã ãããããæ§ã ãªæ©è½ããã©ã°ã¤ã³ã¨ãã¦ç¨æããã¦ãããã«ããã¼ã«ã§ãã åæã«é¸ãã 主ãªç¹å¾´ã®ããã3ã¯âã è¨å®ãã¡ã¤ã«ãXMLã§ã¯ãªããGroovyã«ããDSLã§æ¸ã(build.gradleãã¡ã¤ã«) Groovyã³ã¼ããå«ãããã¸ã§ã¯ãã®è¨å®ãé常ã«ç°¡å Maven2ã®ãã£ã¬ã¯ããªæ§æãè¸è¥²ãã¦ããã®ã§ãMaven2ã¨ã®åå± ãå¯è½ ã¨ãã£ãæãã§ãã¨ãããããã£ããã¨æµãã¦ããã¾ã å ¥æã»ã¤ã³ã¹ãã¼ã«ãªã© âãã¦ã³ãã¼ãã¯ãã¡ãããã©ããã http://www.gradle.org/ å±éãããã£ã¬ã¯ããªãGRADLE_HOMEç°å¢å¤æ°ã«æå®ãã¦ãPATHã«$GRADLE_HOME/binéãã ãã®ãããããã¤ã³ã¹ãã¼ã«æ¹æ³ã§ãã $ gradle --version ---------------------
CSV ãã¡ã¤ã«ãããã¼ã¿ãæ½åºããã®ã« SQL ã使ãããã±ã¼ã¹ãããã¨æãã¾ãããRDB ãã»ããã¢ããã㦠CSV ãã¡ã¤ã«ãã¤ã³ãã¼ããããããã®ã¯é常ã«é¢åã§ãã ããã§ãGroovy 㨠H2 ãã¼ã¿ãã¼ã¹ã使ã£ã¦æ軽ã«å®æ½ããæ¹æ³ããç´¹ä»ãã¾ãã å¿ è¦ãªç°å¢ã¯ä»¥ä¸ã®éãã§ãã Groovy 1.8.0 ãµã³ãã«ã½ã¼ã¹ã¯ http://github.com/fits/try_samples/tree/master/blog/20110702/ CSV ãã¡ã¤ã«ã®ç¨æ ä»åã¯ é§ ãã¼ã¿.jp ã®é§ æ å ± CSV ãã¡ã¤ã«ãããã¼ã¿ãæ½åºããäºã«ãã¾ãã é§ ãã¼ã¿.jp ã®ãµã¤ãããé§ ãã¼ã¿ã® CSV ãã¡ã¤ã«ããã¦ã³ãã¼ãããé½éåºçãã¹ã¿ã¼ããã¹ã¿ã¼ãã¼ã¿ãã¼ã¸ã®å 容ãå ã«ä½æãã¾ããã m_station.csvï¼é§ ãã¼ã¿ï¼ m_pref.csvï¼é½éåºçãã¹ã¿ã¼ï¼ ãªããæå
æ°ãã¤ãããTwitterã§id:t-wadaãããµããã¦ã*1ã®ã§ãã£ã¦ã¿ã¾ããã $ alias gython="groovyclient -cp /tmp/jython.jar -e 'import org.python.util.jython; jython.main(args)' --" ãããªaliasãæ¸ãã°ããã£ã½ãåãã¾ãããjython.jarã¯èªåã®ç°å¢ã«åããã¦ãã ããã $ time jython -c "print('hoge')" hoge real 0m2.503s user 0m2.891s sys 0m0.431s $ time jython -c "print('hoge')" hoge real 0m2.613s user 0m2.889s sys 0m0.435s $ time gython -c "print('hoge')" hoge real
å°å·ãã ã¡ã¼ã«ã§éã ããã¹ã HTML é»åæ¸ç± PDF ãã¦ã³ãã¼ã ããã¹ã é»åæ¸ç± PDF ã¯ãªããããè¨äºãMyãã¼ã¸ããèªããã¨ãã§ãã¾ã Groovy For OpenOfficeã¯ãGroovyã¨ããè¨èªã§OpenOfficeã®ãã¯ããéçºã§ããããã«ããæ¡å¼µæ©è½ã ãé å¸ã©ã¤ã»ã³ã¹ã¯LGPLv2.1ã§ãSourceForgeãããã¦ã³ãã¼ãã§ãããå®è¡ç°å¢ã«ã¯Java1.4以ä¸ãå¿ è¦ã ã Groovyã¯2003å¹´ããéçºãç¶ããJava VMä¸ã§åä½ããã¹ã¯ãªããè¨èªãJavaè¨èªããã¼ã¹ã«ãã¤ã¤ãRubyãPythonãªã©ä»£è¡¨çãªã¹ã¯ãªããè¨èªã®ææ³ãåãå ¥ãã¦ãããå®è¡ã¢ã¸ã¥ã¼ã«ã¯Javaããã°ã©ã ã¨ãã¤ããªäºæãä¿ãããã¨ããç¹å¾´ãæã¤ãGroovy For OpenOfficeã«ã¯ãGroovyãã¼ã¸ã§ã³1.0ãçµã¿è¾¼ã¾ãã¦ããã ãã¦ã³ãã¼ããµã¤ãã«ã¯3ã¤ã®ã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}