SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Downloaden Sie, um offline zu lesen
JGGUG
                                             japan grails/groovy user group




def speaker = new Cast(name:”T.Yamamoto”,version:”G*-2010-03-30”)
class A {
                   static class B {}
                 }
                 new A.B()




boolean called = false
Timer timer = new Timer()
timer.schedule(new TimerTask() {
  void run() {
    called = true
  }
}, 0)
sleep 100
assert called
import   @Grab
@Grab(group='net.sf.json-lib',
      module='json-lib', version='2.3',
      classifier='jdk15')
import net.sf.json.groovy.*


         @Grab
@Grab('net.sf.json-lib:json-lib:2.3:jdk15')
def builder =
   new net.sf.json.groovy.JsonGroovyBuilder()
assert new File('foo.bar') == new File('example.txt')




Caught: Assertion failed:

assert new File('foo.bar') == new File
('example.txt')
       |                   |  |
       foo.bar             |  example.txt
                           false
import grails.test.*
import org.junit.*   //
//                     Test   OK
//       XxxxxTests
class ItemTest extends GrailsUnitTestCase {
    @Before void initialize() {
      super.setUp()  //
         println "initialize()"
     }

     @After void goodby() {
       super.tearDown()  //
         println "goodby()"
     }
@Test //                test
void                        () {
    assertEquals 0,0
}
//@Test         test
void test              OK      () {
    shouldFail{
      asdsdagdrgasf
    }
}
@Ignore // JUnit4
    void              () {
        assertEquals 0,0
    }

    @Test(timeout=2000L) // JUnit4
    void                   () {
        Thread.sleep(3000)
        assertEquals 0,0
    }
}
import org.junit.*
import static org.junit.Assert.*
class SomeTest {

! //...   ...
}
grails.project.dependency.resolution = {
 ! pom true
! ..
}
%grails maven-install
!
%grails maven-deploy
!
groupId                   group
String group = 'jp.xmldo.grails'

                      "org.grails.plugins"


def version = '0.1'
% grails maven-deploy --repository=myRepo




grails.project.dependency.distribution = {
  remoteRepository(id:"myRepo",
    u r l : " f i l e : / / 1 2 7 . 0 . 0 . 1 / U s e r s / t y a m a / m y r e p o s / m a v e n 2 / ")
}



grails.project.dependency.distribution = {
  remoteRepository(id:"myRepoScp",
    u r l : " s c p : / / 1 0 . 2 1 1 . 5 5 . 6 / v a r / w w w / h t m l / m y r e p o ") {
        authentication username:"tyama",
                                      privateKey:"${userHome}/.ssh/id_dsa"
    }
}
grails.project.dependency.resolution = {
  plugins {
    runtime 'jp.xmldo.grails:example-wiki:0.1'
  }
}
weceem
def dependsOn = [
    searchable:'0.5.4 > *',
    quartz:'0.4.1 > *',
]




            excludes
      plugins {
      ! ru n t i m e ( ' : w e c e e m : 0 . 8 ' ) {
      ! ! ex c l u d e s " s e a r c h a b l e "
      ! }
      ! ru n t i m e ' : s e a r c h a b l e : 0 . 5 . 4 '
      }
plugins {
  runtime( ':weceem:0.8' ) {
    transitive = false
  }
  runtime ':searchable:0.5.4'
}
def item = Item.get(1)
assert !item.isDirty() //     false
item.properties = params
if (item.isDirty()) {
   //
}




def item = Item.get(1)
assert !item.isDirty() //     false
item.properties = params
if (item.isDirty('name')) {
   //        name
}
class Item {
  static mapping = {
    priceWithTax formula: 'price * 1.05' //
    }

    String name
    Float price
    Float priceWithTax
    //...   ...
}
Grails-1.2                 :
   static namedQueries = {
     shippedInThree {
       def now = new Date()
       lt 'shipped', now + 3
     }
   }



def list = Item.shippedInThree.list(max: 10, offset: 5)
def list = Item.shippedInThree.count()
d e f l i s t = I t e m . s h i p p e d I n T h r e e . f i n d A l l B y N a m e L i k e (’ % ‘)
def list = Item.shippedInThree {
  and {
    lt 'price',20000F
  }
}
<g:join
  in="['Grails', 'Groovy', 'Gradle']"
  delimiter="_"/>

       Grails_Groovy_Gradle




% ./gradlew clean assemble
|--   application.properties
|--   grails-app
|--   plugins
|     |-- exampleHongo ←
|     |   |--plugin.xml ← 1.2.x
|     |-- exampleShibuya ←
% grails run-app
Welcome to Grails 1.2.1 - http://grails.org/
 ..   ..
The inplace plugin at [/works/experiment/20100330/tokyo/plugins/exampleHongo]
does not have a plugin.xml. Please run the package-plugin command inside the
plugin directory.
Grails/Groovy
http://www.jggug.org/

Weitere ähnliche Inhalte

Was ist angesagt?

The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189Mahmoud Samir Fayed
 
GPars For Beginners
GPars For BeginnersGPars For Beginners
GPars For BeginnersMatt Passell
 
The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196Mahmoud Samir Fayed
 
Javascript ES6 generators
Javascript ES6 generatorsJavascript ES6 generators
Javascript ES6 generatorsRamesh Nair
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQLPeter Eisentraut
 
Stubる - Mockingjayを使ったHTTPクライアントのテスト -
Stubる - Mockingjayを使ったHTTPクライアントのテスト -Stubる - Mockingjayを使ったHTTPクライアントのテスト -
Stubる - Mockingjayを使ったHTTPクライアントのテスト -Kenji Tanaka
 
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」matuura_core
 
Workshop 5: JavaScript testing
Workshop 5: JavaScript testingWorkshop 5: JavaScript testing
Workshop 5: JavaScript testingVisual Engineering
 
Python postgre sql a wonderful wedding
Python postgre sql   a wonderful weddingPython postgre sql   a wonderful wedding
Python postgre sql a wonderful weddingStéphane Wirtel
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeMongoDB
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3Simon Su
 
Ramda, a functional JavaScript library
Ramda, a functional JavaScript libraryRamda, a functional JavaScript library
Ramda, a functional JavaScript libraryDerek Willian Stavis
 
Xlab #1: Advantages of functional programming in Java 8
Xlab #1: Advantages of functional programming in Java 8Xlab #1: Advantages of functional programming in Java 8
Xlab #1: Advantages of functional programming in Java 8XSolve
 
The Rule of 10,000 Spark Jobs - Learning from Exceptions and Serializing Your...
The Rule of 10,000 Spark Jobs - Learning from Exceptions and Serializing Your...The Rule of 10,000 Spark Jobs - Learning from Exceptions and Serializing Your...
The Rule of 10,000 Spark Jobs - Learning from Exceptions and Serializing Your...Matthew Tovbin
 
The Rule of 10,000 Spark Jobs: Learning From Exceptions and Serializing Your ...
The Rule of 10,000 Spark Jobs: Learning From Exceptions and Serializing Your ...The Rule of 10,000 Spark Jobs: Learning From Exceptions and Serializing Your ...
The Rule of 10,000 Spark Jobs: Learning From Exceptions and Serializing Your ...Databricks
 
"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014Henning Jacobs
 
Psycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python ScriptPsycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python ScriptSurvey Department
 

Was ist angesagt? (20)

The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189
 
Introduction kot iin
Introduction kot iinIntroduction kot iin
Introduction kot iin
 
GPars For Beginners
GPars For BeginnersGPars For Beginners
GPars For Beginners
 
The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196
 
Javascript ES6 generators
Javascript ES6 generatorsJavascript ES6 generators
Javascript ES6 generators
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
Miracle of std lib
Miracle of std libMiracle of std lib
Miracle of std lib
 
Stubる - Mockingjayを使ったHTTPクライアントのテスト -
Stubる - Mockingjayを使ったHTTPクライアントのテスト -Stubる - Mockingjayを使ったHTTPクライアントのテスト -
Stubる - Mockingjayを使ったHTTPクライアントのテスト -
 
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」
 
ES6 in Real Life
ES6 in Real LifeES6 in Real Life
ES6 in Real Life
 
Workshop 5: JavaScript testing
Workshop 5: JavaScript testingWorkshop 5: JavaScript testing
Workshop 5: JavaScript testing
 
Python postgre sql a wonderful wedding
Python postgre sql   a wonderful weddingPython postgre sql   a wonderful wedding
Python postgre sql a wonderful wedding
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
 
Ramda, a functional JavaScript library
Ramda, a functional JavaScript libraryRamda, a functional JavaScript library
Ramda, a functional JavaScript library
 
Xlab #1: Advantages of functional programming in Java 8
Xlab #1: Advantages of functional programming in Java 8Xlab #1: Advantages of functional programming in Java 8
Xlab #1: Advantages of functional programming in Java 8
 
The Rule of 10,000 Spark Jobs - Learning from Exceptions and Serializing Your...
The Rule of 10,000 Spark Jobs - Learning from Exceptions and Serializing Your...The Rule of 10,000 Spark Jobs - Learning from Exceptions and Serializing Your...
The Rule of 10,000 Spark Jobs - Learning from Exceptions and Serializing Your...
 
The Rule of 10,000 Spark Jobs: Learning From Exceptions and Serializing Your ...
The Rule of 10,000 Spark Jobs: Learning From Exceptions and Serializing Your ...The Rule of 10,000 Spark Jobs: Learning From Exceptions and Serializing Your ...
The Rule of 10,000 Spark Jobs: Learning From Exceptions and Serializing Your ...
 
"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014
 
Psycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python ScriptPsycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python Script
 

Andere mochten auch

Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。Tsuyoshi Yamamoto
 
Groovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークGroovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークTsuyoshi Yamamoto
 
「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」
「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」
「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」Tsuyoshi Yamamoto
 
groovyプラプラとか「はやい、はやいよ」
groovyプラプラとか「はやい、はやいよ」groovyプラプラとか「はやい、はやいよ」
groovyプラプラとか「はやい、はやいよ」Tsuyoshi Yamamoto
 
G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~Tsuyoshi Yamamoto
 

Andere mochten auch (7)

Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。
 
Groovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークGroovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトーク
 
JGGUG 2011-02 LT
JGGUG 2011-02 LTJGGUG 2011-02 LT
JGGUG 2011-02 LT
 
「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」
「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」
「Grails-1.1を斬る!〜Grails-1.1からのチーム開発〜」
 
groovyプラプラとか「はやい、はやいよ」
groovyプラプラとか「はやい、はやいよ」groovyプラプラとか「はやい、はやいよ」
groovyプラプラとか「はやい、はやいよ」
 
G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~
 
JGGUG grails-spring-boot
JGGUG grails-spring-bootJGGUG grails-spring-boot
JGGUG grails-spring-boot
 

Ähnlich wie Jggug 2010 330 Grails 1.3 観察

Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesAnkit Rastogi
 
LinkedIn TBC JavaScript 100: Functions
 LinkedIn TBC JavaScript 100: Functions LinkedIn TBC JavaScript 100: Functions
LinkedIn TBC JavaScript 100: FunctionsAdam Crabtree
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oopLearningTech
 
Implement threads and a GUI interface using advanced Java Swing clas.pdf
Implement threads and a GUI interface using advanced Java Swing clas.pdfImplement threads and a GUI interface using advanced Java Swing clas.pdf
Implement threads and a GUI interface using advanced Java Swing clas.pdfamrishinda
 
Get started with YUI
Get started with YUIGet started with YUI
Get started with YUIAdam Lu
 
33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good TestsTomek Kaczanowski
 
JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)Anders Jönsson
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascriptkvangork
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScriptkvangork
 
Groovy grails types, operators, objects
Groovy grails types, operators, objectsGroovy grails types, operators, objects
Groovy grails types, operators, objectsHusain Dalal
 
2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good TestsTomek Kaczanowski
 
Creating Gradle Plugins - Oredev
Creating Gradle Plugins - OredevCreating Gradle Plugins - Oredev
Creating Gradle Plugins - OredevAnnyce Davis
 
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docxcase3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docxtidwellveronique
 
Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScriptAndrew Dupont
 
2013 DevFest Vienna - Bad Tests, Good Tests
2013 DevFest Vienna - Bad Tests, Good Tests2013 DevFest Vienna - Bad Tests, Good Tests
2013 DevFest Vienna - Bad Tests, Good TestsTomek Kaczanowski
 
Groovy Api Tutorial
Groovy Api  TutorialGroovy Api  Tutorial
Groovy Api Tutorialguligala
 

Ähnlich wie Jggug 2010 330 Grails 1.3 観察 (20)

Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
 
Say It With Javascript
Say It With JavascriptSay It With Javascript
Say It With Javascript
 
LinkedIn TBC JavaScript 100: Functions
 LinkedIn TBC JavaScript 100: Functions LinkedIn TBC JavaScript 100: Functions
LinkedIn TBC JavaScript 100: Functions
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oop
 
Implement threads and a GUI interface using advanced Java Swing clas.pdf
Implement threads and a GUI interface using advanced Java Swing clas.pdfImplement threads and a GUI interface using advanced Java Swing clas.pdf
Implement threads and a GUI interface using advanced Java Swing clas.pdf
 
Oojs 1.1
Oojs 1.1Oojs 1.1
Oojs 1.1
 
25-functions.ppt
25-functions.ppt25-functions.ppt
25-functions.ppt
 
Get started with YUI
Get started with YUIGet started with YUI
Get started with YUI
 
33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests33rd Degree 2013, Bad Tests, Good Tests
33rd Degree 2013, Bad Tests, Good Tests
 
JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)JavaScript - i och utanför webbläsaren (2010-03-03)
JavaScript - i och utanför webbläsaren (2010-03-03)
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascript
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScript
 
Groovy grails types, operators, objects
Groovy grails types, operators, objectsGroovy grails types, operators, objects
Groovy grails types, operators, objects
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests
 
Creating Gradle Plugins - Oredev
Creating Gradle Plugins - OredevCreating Gradle Plugins - Oredev
Creating Gradle Plugins - Oredev
 
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docxcase3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
 
Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScript
 
2013 DevFest Vienna - Bad Tests, Good Tests
2013 DevFest Vienna - Bad Tests, Good Tests2013 DevFest Vienna - Bad Tests, Good Tests
2013 DevFest Vienna - Bad Tests, Good Tests
 
Groovy Api Tutorial
Groovy Api  TutorialGroovy Api  Tutorial
Groovy Api Tutorial
 

Mehr von Tsuyoshi Yamamoto

JJUG CCC 20150411 grails3 Spring-boot
JJUG CCC 20150411 grails3 Spring-bootJJUG CCC 20150411 grails3 Spring-boot
JJUG CCC 20150411 grails3 Spring-bootTsuyoshi Yamamoto
 
Groovy Grails eXchage 2014 報告
Groovy Grails eXchage 2014 報告Groovy Grails eXchage 2014 報告
Groovy Grails eXchage 2014 報告Tsuyoshi Yamamoto
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門Tsuyoshi Yamamoto
 
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」Tsuyoshi Yamamoto
 
JGGUG Camp 2009 いっぽう熱海では、
JGGUG Camp 2009 いっぽう熱海では、JGGUG Camp 2009 いっぽう熱海では、
JGGUG Camp 2009 いっぽう熱海では、Tsuyoshi Yamamoto
 
GrailsでSpringをGroovyにしよう!
GrailsでSpringをGroovyにしよう!GrailsでSpringをGroovyにしよう!
GrailsでSpringをGroovyにしよう!Tsuyoshi Yamamoto
 
Grails-1.1を斬る!~Grails-1.1からのチーム開発~ in Tokyo
Grails-1.1を斬る!~Grails-1.1からのチーム開発~ in TokyoGrails-1.1を斬る!~Grails-1.1からのチーム開発~ in Tokyo
Grails-1.1を斬る!~Grails-1.1からのチーム開発~ in TokyoTsuyoshi Yamamoto
 

Mehr von Tsuyoshi Yamamoto (15)

JJUG CCC 20150411 grails3 Spring-boot
JJUG CCC 20150411 grails3 Spring-bootJJUG CCC 20150411 grails3 Spring-boot
JJUG CCC 20150411 grails3 Spring-boot
 
Groovy Grails eXchage 2014 報告
Groovy Grails eXchage 2014 報告Groovy Grails eXchage 2014 報告
Groovy Grails eXchage 2014 報告
 
Grailsx@London 2011 報告
Grailsx@London 2011 報告Grailsx@London 2011 報告
Grailsx@London 2011 報告
 
Grails 2.0.0.M1の話
Grails 2.0.0.M1の話 Grails 2.0.0.M1の話
Grails 2.0.0.M1の話
 
Grails 1.4.0.M1 メモLT
Grails 1.4.0.M1 メモLTGrails 1.4.0.M1 メモLT
Grails 1.4.0.M1 メモLT
 
G * magazine 1
G * magazine 1G * magazine 1
G * magazine 1
 
G * magazine 0
G * magazine 0G * magazine 0
G * magazine 0
 
Grailsのススメ(仮)
Grailsのススメ(仮)Grailsのススメ(仮)
Grailsのススメ(仮)
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門
 
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
 
JGGUG Camp 2009 いっぽう熱海では、
JGGUG Camp 2009 いっぽう熱海では、JGGUG Camp 2009 いっぽう熱海では、
JGGUG Camp 2009 いっぽう熱海では、
 
ExtJS勉強会@名古屋
ExtJS勉強会@名古屋ExtJS勉強会@名古屋
ExtJS勉強会@名古屋
 
G* on GAE/J 挑戦編
G* on GAE/J 挑戦編G* on GAE/J 挑戦編
G* on GAE/J 挑戦編
 
GrailsでSpringをGroovyにしよう!
GrailsでSpringをGroovyにしよう!GrailsでSpringをGroovyにしよう!
GrailsでSpringをGroovyにしよう!
 
Grails-1.1を斬る!~Grails-1.1からのチーム開発~ in Tokyo
Grails-1.1を斬る!~Grails-1.1からのチーム開発~ in TokyoGrails-1.1を斬る!~Grails-1.1からのチーム開発~ in Tokyo
Grails-1.1を斬る!~Grails-1.1からのチーム開発~ in Tokyo
 

Jggug 2010 330 Grails 1.3 観察

  • 1. JGGUG japan grails/groovy user group def speaker = new Cast(name:”T.Yamamoto”,version:”G*-2010-03-30”)
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. class A { static class B {} } new A.B() boolean called = false Timer timer = new Timer() timer.schedule(new TimerTask() { void run() { called = true } }, 0) sleep 100 assert called
  • 9. import @Grab @Grab(group='net.sf.json-lib', module='json-lib', version='2.3', classifier='jdk15') import net.sf.json.groovy.* @Grab @Grab('net.sf.json-lib:json-lib:2.3:jdk15') def builder = new net.sf.json.groovy.JsonGroovyBuilder()
  • 10. assert new File('foo.bar') == new File('example.txt') Caught: Assertion failed: assert new File('foo.bar') == new File ('example.txt') | | | foo.bar | example.txt false
  • 11.
  • 12.
  • 13.
  • 14. import grails.test.* import org.junit.* // // Test OK // XxxxxTests class ItemTest extends GrailsUnitTestCase { @Before void initialize() { super.setUp() // println "initialize()" } @After void goodby() { super.tearDown() // println "goodby()" }
  • 15. @Test // test void () { assertEquals 0,0 } //@Test test void test OK () { shouldFail{ asdsdagdrgasf } }
  • 16. @Ignore // JUnit4 void () { assertEquals 0,0 } @Test(timeout=2000L) // JUnit4 void () { Thread.sleep(3000) assertEquals 0,0 } }
  • 17. import org.junit.* import static org.junit.Assert.* class SomeTest { ! //... ... }
  • 18.
  • 19.
  • 22. groupId group String group = 'jp.xmldo.grails' "org.grails.plugins" def version = '0.1'
  • 23. % grails maven-deploy --repository=myRepo grails.project.dependency.distribution = { remoteRepository(id:"myRepo", u r l : " f i l e : / / 1 2 7 . 0 . 0 . 1 / U s e r s / t y a m a / m y r e p o s / m a v e n 2 / ") } grails.project.dependency.distribution = { remoteRepository(id:"myRepoScp", u r l : " s c p : / / 1 0 . 2 1 1 . 5 5 . 6 / v a r / w w w / h t m l / m y r e p o ") { authentication username:"tyama", privateKey:"${userHome}/.ssh/id_dsa" } }
  • 24. grails.project.dependency.resolution = { plugins { runtime 'jp.xmldo.grails:example-wiki:0.1' } }
  • 25. weceem def dependsOn = [ searchable:'0.5.4 > *', quartz:'0.4.1 > *', ] excludes plugins { ! ru n t i m e ( ' : w e c e e m : 0 . 8 ' ) { ! ! ex c l u d e s " s e a r c h a b l e " ! } ! ru n t i m e ' : s e a r c h a b l e : 0 . 5 . 4 ' }
  • 26. plugins { runtime( ':weceem:0.8' ) { transitive = false } runtime ':searchable:0.5.4' }
  • 27.
  • 28.
  • 29.
  • 30. def item = Item.get(1) assert !item.isDirty() // false item.properties = params if (item.isDirty()) { // } def item = Item.get(1) assert !item.isDirty() // false item.properties = params if (item.isDirty('name')) { // name }
  • 31. class Item { static mapping = { priceWithTax formula: 'price * 1.05' // } String name Float price Float priceWithTax //... ... }
  • 32. Grails-1.2 : static namedQueries = { shippedInThree { def now = new Date() lt 'shipped', now + 3 } } def list = Item.shippedInThree.list(max: 10, offset: 5) def list = Item.shippedInThree.count() d e f l i s t = I t e m . s h i p p e d I n T h r e e . f i n d A l l B y N a m e L i k e (’ % ‘)
  • 33. def list = Item.shippedInThree { and { lt 'price',20000F } }
  • 34.
  • 35. <g:join in="['Grails', 'Groovy', 'Gradle']" delimiter="_"/> Grails_Groovy_Gradle % ./gradlew clean assemble
  • 36. |-- application.properties |-- grails-app |-- plugins | |-- exampleHongo ← | | |--plugin.xml ← 1.2.x | |-- exampleShibuya ← % grails run-app Welcome to Grails 1.2.1 - http://grails.org/ .. .. The inplace plugin at [/works/experiment/20100330/tokyo/plugins/exampleHongo] does not have a plugin.xml. Please run the package-plugin command inside the plugin directory.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.