This file contains 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 static eu.appsatori.gdata.gsql.SSQL.* | |
// Groovy 1.7 syntax | |
select(all).from("Spreadsheet").sheet("Worksheet").limit(10).offset(5) | |
select(1, "test", 5, "it").from("Spreadsheet") | |
select(all).from("Spreadsheet").order(by).column("Column Name").sort(desc) | |
// fancy new 1.8 syntax | |
select all from "Spreadsheet" sheet "Worksheet" limit 10 offset 5 | |
select 1, "test", 5, "it" from "Spreadsheet" |
This file contains 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
@Canonical | |
class SelectBuilder { | |
boolean all | |
List<Object> columns = [] | |
String spreadsheet | |
QueryBuilder from(String spreadsheet){ | |
QueryBuilder builder = [] | |
builder.all = this.all | |
builder.columns = this.columns |
This file contains 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 "Order by column"(){ | |
when: | |
QueryBuilder query = select all from "Spreadsheet" order by column "Column Name" | |
then: | |
query.all == true | |
query.spreadsheet == "Spreadsheet" | |
query.order == "column:columnname" | |
} |
This file contains 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 groovyx.gaelyk | |
import groovyx.gaelyk.logging.LoggerAccessor; | |
import spock.lang.Specification | |
import spock.lang.Unroll; | |
import com.google.appengine.api.LifecycleManager; | |
import com.google.appengine.api.NamespaceManager; | |
import com.google.appengine.api.backends.BackendService; | |
import com.google.appengine.api.blobstore.BlobstoreService; |
This file contains 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
// some configurations | |
// this is your username, not an email! you can find it | |
// at https://grandcentral.cloudbees.com/account/settings | |
def cloudbeesUsername = 'vlada.appsatori' | |
def cloudbeesPassword = '#!@$***' | |
// this is your account name which could be found | |
// right bellow your username at the same page | |
def cloudbeesAccountName = 'appsatori' | |
apply plugin: 'groovy' |
This file contains 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
// some configurations | |
// this is your username, not an email! you can find it | |
// at https://grandcentral.cloudbees.com/account/settings | |
def cloudbeesUsername = 'vlada.appsatori' | |
def cloudbeesPassword = '#!@$***' | |
// this is your account name which could be found | |
// right bellow your username at the same page | |
def cloudbeesAccountName = 'appsatori' | |
repositories { |
This file contains 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
[myEntityKind: 15].fetch() | |
[myEntityKind: 15].delete() | |
[myEntityKind: 15].update(property: newValue, propertyTwo: otherValue) | |
[myEntityKind: 15].updateIfNotSet(property: newValue) | |
'myEntityKind'.getAll() | |
'myEntityKind'.entityCount() | |
'myEntityKind'.create(property: newValue, propertyTwo: otherValue) |
This file contains 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
public class StartSeach implements Node<SerialPipe, Collection<Haystack>> { | |
public NodeResult execute(SerialPipe pipe, Collection<HayStack> haystacks){ | |
return pipe.fork(FindNeedle.class, haystacks); | |
} | |
} |
This file contains 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 GaelykPrecompileTemplateTask extends DefaultTask { | |
static HiJackGroovyShell hjgs = [] | |
static SimpleTemplateEngine ste = [hjgs] | |
static String getTemplateAsScript(String template){ | |
ste.createTemplate(template) | |
hjgs.scriptText | |
} | |
} |
This file contains 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 org.gradle.api.file.FileCollection | |
apply plugin: 'java' | |
apply plugin: 'war' | |
dependencies { | |
compile fileTree(dir: 'lib', includes: [ | |
'a.jar', | |
'b.jar' | |
]) |