Skip to content

Instantly share code, notes, and snippets.

@grimrose
grimrose / gist:2002168
Created March 8, 2012 17:18
とりあえず考え中
class Parser {
void parse(String docbase){
Result result = getBuilder().build(docbase);
print result.result
}
Builder getBuilder() {
return new Builder();
}
@grimrose
grimrose / build.gradle
Created April 9, 2012 09:22
Arquillian Getting Started
apply plugin: 'eclipse'
def langs = ['java', 'groovy']
langs.each {
apply plugin : it
}
group = 'org.arquillian.example'
@grimrose
grimrose / gist:2399667
Created April 16, 2012 16:02
簡易メモ
public interface Finder {
List<String> find()
}
class A_Finder implements Finder {
List<String> find() {
[ "1","2" ]
}
}
T1 = '| '
T2 = '|---'
width = 5
if ARGV[0] != nil
number = ARGV[0].to_i
if number > 52
number = 52
end
@grimrose
grimrose / SampleSpec.groovy
Created June 14, 2012 15:35
Spock GroovyScript Spec
import spock.lang.Specification
import spock.lang.Unroll
class SampleSpec extends Specification {
@Unroll
def "#scriptfile evaluate"() {
setup:
def content = new StringWriter()
@grimrose
grimrose / build.gradle
Created August 3, 2012 16:37
quickstart gradle
/* language */
apply {
plugin 'groovy'
plugin 'java'
}
/* ide */
apply {
plugin 'idea'
plugin 'eclipse'
@grimrose
grimrose / logback.groovy
Created September 21, 2012 01:22
groovy script with logback
//
// Built on Fri Sep 21 02:55:59 CEST 2012 by logback-translator
// For more information on configuration files in Groovy
// please see http://logback.qos.ch/manual/groovy.html
// For assistance related to this tool or configuration files
// in general, please contact the logback user mailing list at
// http://qos.ch/mailman/listinfo/logback-user
// For professional support please see
@grimrose
grimrose / file0.java
Created November 23, 2012 07:58
Intellij IDEAにJUnitの@testのLive templateを追加する。 ref: http://qiita.com/items/3bd318eec63d98c80563
@Test
public void should_assert_a_behaviour() throws Exception {
// Setup
// Exercise
// Verify
}
@grimrose
grimrose / HogeBean.groovy
Created November 27, 2012 13:06
GroovyObject#invokeMethodのオーバーライドとMetaClass#invokeMethodの違い
package sample
class HogeBean {
Object invokeMethod(String name, Object args) {
println "invoke method $name, $args"
null
}