Adding brief documentation of the Javascript, Groovy and JRuby scripting libraries.
Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/506b155a Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/506b155a Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/506b155a Branch: refs/heads/develop Commit: 506b155a04c27fa72e16c84730f65eaa53ab9466 Parents: beb9f68 Author: Niclas Hedhman <[email protected]> Authored: Sat Jan 10 21:17:27 2015 +0800 Committer: Niclas Hedhman <[email protected]> Committed: Sat Jan 10 21:17:27 2015 +0800 ---------------------------------------------------------------------- build.gradle | 2 +- .../entitystore-neo4j/src/docs/es-neo4j.txt | 2 +- libraries/lang-groovy/dev-status.xml | 2 +- libraries/lang-groovy/src/docs/lang-groovy.txt | 26 ++++++++++++++++++ .../java/org/qi4j/lang/groovy/HelloSpeaker.java | 26 ++++++++++++++++++ .../src/docs/lang-javascript.txt | 21 ++++++++++---- .../lang/javascript/DocumentationSupport.java | 29 -------------------- .../org/qi4j/lang/javascript/HelloSpeaker.java | 24 ++++++++++++++++ libraries/lang-jruby/dev-status.xml | 2 +- libraries/lang-jruby/src/docs/lang-jruby.txt | 22 +++++++++++++-- .../java/org/qi4j/lang/jruby/HelloSpeaker.java | 24 ++++++++++++++++ 11 files changed, 139 insertions(+), 41 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index c8fdcd3..51e47fe 100644 --- a/build.gradle +++ b/build.gradle @@ -250,7 +250,7 @@ allprojects { systemProperties = testProperties systemProperties['user.dir'] = workingDir // GRADLE-2859 ignoreFailures = true - testReport = true + reports.html.enabled(true) afterSuite { descriptor, result -> if( result.resultType == TestResult.ResultType.FAILURE ) { http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/extensions/entitystore-neo4j/src/docs/es-neo4j.txt ---------------------------------------------------------------------- diff --git a/extensions/entitystore-neo4j/src/docs/es-neo4j.txt b/extensions/entitystore-neo4j/src/docs/es-neo4j.txt index 2f9cc99..ae3692d 100644 --- a/extensions/entitystore-neo4j/src/docs/es-neo4j.txt +++ b/extensions/entitystore-neo4j/src/docs/es-neo4j.txt @@ -17,7 +17,7 @@ include::../../build/docs/buildinfo/artifact.txt[] There is currently no provided Assembler, and one has to declare the use explicitly. Note that we recommend [snippet,java] ---- -source=extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/SimpleNeoStoreTest.java +source=extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java tag=assembly ---- http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/libraries/lang-groovy/dev-status.xml ---------------------------------------------------------------------- diff --git a/libraries/lang-groovy/dev-status.xml b/libraries/lang-groovy/dev-status.xml index 654d3aa..cefc98a 100644 --- a/libraries/lang-groovy/dev-status.xml +++ b/libraries/lang-groovy/dev-status.xml @@ -8,7 +8,7 @@ <codebase>beta</codebase> <!-- none, brief, good, complete --> - <documentation>none</documentation> + <documentation>brief</documentation> <!-- none, some, good, complete --> <unittests>some</unittests> http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/libraries/lang-groovy/src/docs/lang-groovy.txt ---------------------------------------------------------------------- diff --git a/libraries/lang-groovy/src/docs/lang-groovy.txt b/libraries/lang-groovy/src/docs/lang-groovy.txt index 030c087..9abe50b 100644 --- a/libraries/lang-groovy/src/docs/lang-groovy.txt +++ b/libraries/lang-groovy/src/docs/lang-groovy.txt @@ -11,3 +11,29 @@ Groovy Scripting Library NOTE: This Library has no documentation yet. Learn how to contribute in <<community-docs>>. include::../../build/docs/buildinfo/artifact.txt[] + +The Groovy Scripting Library is a Generic mixin that implements interfaces +by delegating to Groovy functions using Groovy. Each method in an interface +is declared by a Groovy method in a file located in classpath with the name +"<interface>.groovy", where the interface name includes the package, and has +"." replaced with "/". + +Example + + org/qi4j/samples/hello/domain/HelloWorldSpeaker.groovy + org/qi4j/samples/hello/domain/HelloWorldSpeaker.sayAgain.groovy + +That means that the HelloWorldSpeaker.groovy file may be co-located with the +class files in the same package. It is currently not supported to place +the Javascript implementation of the mixin in a different package than the +interface it implements. + +To use Groovy to implement the Mixin functionality for a given interface, +simply declare the +GroovyMixin+ like any other mixin, either in the interface +or at assembly time. + +[snippet,java] +---- +source=libraries/lang-groovy/src/test/java/org/qi4j/lang/groovy/HelloSpeaker.java +tag=mixin +---- http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/libraries/lang-groovy/src/test/java/org/qi4j/lang/groovy/HelloSpeaker.java ---------------------------------------------------------------------- diff --git a/libraries/lang-groovy/src/test/java/org/qi4j/lang/groovy/HelloSpeaker.java b/libraries/lang-groovy/src/test/java/org/qi4j/lang/groovy/HelloSpeaker.java new file mode 100644 index 0000000..a4527f0 --- /dev/null +++ b/libraries/lang-groovy/src/test/java/org/qi4j/lang/groovy/HelloSpeaker.java @@ -0,0 +1,26 @@ +/* + * Copyright 2007 Rickard Ãberg + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +package org.qi4j.lang.groovy; + +import org.qi4j.api.mixin.Mixins; + +// START SNIPPET: mixin +import org.qi4j.lang.groovy.GroovyMixin; +// END SNIPPET: mixin + +// START SNIPPET: mixin +@Mixins(GroovyMixin.class) +public interface HelloSpeaker +{ + void sayHello(); +} +// END SNIPPET: mixin http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/libraries/lang-javascript/src/docs/lang-javascript.txt ---------------------------------------------------------------------- diff --git a/libraries/lang-javascript/src/docs/lang-javascript.txt b/libraries/lang-javascript/src/docs/lang-javascript.txt index 3fb9908..394a8f3 100644 --- a/libraries/lang-javascript/src/docs/lang-javascript.txt +++ b/libraries/lang-javascript/src/docs/lang-javascript.txt @@ -10,16 +10,27 @@ The Javascript Scripting Library allows Mixin methods to be implemented in Javas include::../../build/docs/buildinfo/artifact.txt[] -The Javascript Scripting Library is a Generic mixin class that implements Composite interfaces by delegating to JavaScript functions using Rhino. Each method in an interface is declared as a JS function in a file located in classpath with the name "<interface>.<method>.js", where the interface name includes the package, and has "." replaced with "/". +The Javascript Scripting Library is a Generic mixin class that implements +Composite interfaces by delegating to JavaScript functions using Rhino. Each +method in an interface is declared as a JS function in a file located in +classpath with the name "<interface>.<method>.js", where the interface name +includes the package, and has "." replaced with "/". -Example: org/qi4j/samples/hello/domain/HelloWorldSpeaker.say.js +Example: -That means that the HelloWorldSpeaker.say.js file may be co-located with the class files in the same package. It is currently not supported to place the Javascript implementation of the mixin in a different package than the interface it implements. + org/qi4j/samples/hello/domain/HelloWorldSpeaker.say.js -To use Javascript to implement the Mixin functionality for a given interface, simply declare the +JavaScriptMixin+ like any other mixin, either in the interface or at assembly time. +That means that the HelloWorldSpeaker.say.js file may be co-located with the +class files in the same package. It is currently not supported to place the +Javascript implementation of the mixin in a different package than the +interface it implements. + +To use Javascript to implement the Mixin functionality for a given interface, +simply declare the +JavaScriptMixin+ like any other mixin, either in the +interface or at assembly time. [snippet,java] ---- -source=libraries/lang-javascript/src/test/java/org/qi4j/library/lang/javascript/DocumentationSupport.java +source=libraries/lang-javascript/src/test/java/org/qi4j/lang/javascript/HelloSpeaker.java tag=mixin ---- http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/libraries/lang-javascript/src/test/java/org/qi4j/lang/javascript/DocumentationSupport.java ---------------------------------------------------------------------- diff --git a/libraries/lang-javascript/src/test/java/org/qi4j/lang/javascript/DocumentationSupport.java b/libraries/lang-javascript/src/test/java/org/qi4j/lang/javascript/DocumentationSupport.java deleted file mode 100644 index 36aa9f4..0000000 --- a/libraries/lang-javascript/src/test/java/org/qi4j/lang/javascript/DocumentationSupport.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2007 Rickard Ãberg - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ -package org.qi4j.lang.javascript; - -import org.qi4j.api.mixin.Mixins; - -// START SNIPPET: mixin -import org.qi4j.lang.javascript.JavaScriptMixin; -// END SNIPPET: mixin - -public interface DocumentationSupport -{ - // START SNIPPET: mixin - @Mixins(JavaScriptMixin.class) - public interface HelloSpeaker - { - void sayHello(); - } - // END SNIPPET: mixin -} http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/libraries/lang-javascript/src/test/java/org/qi4j/lang/javascript/HelloSpeaker.java ---------------------------------------------------------------------- diff --git a/libraries/lang-javascript/src/test/java/org/qi4j/lang/javascript/HelloSpeaker.java b/libraries/lang-javascript/src/test/java/org/qi4j/lang/javascript/HelloSpeaker.java new file mode 100644 index 0000000..a7c1b9c --- /dev/null +++ b/libraries/lang-javascript/src/test/java/org/qi4j/lang/javascript/HelloSpeaker.java @@ -0,0 +1,24 @@ +/* + * Copyright 2007 Rickard Ãberg + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +package org.qi4j.lang.javascript; + +import org.qi4j.api.mixin.Mixins; + +// START SNIPPET: mixin +import org.qi4j.lang.javascript.JavaScriptMixin; + +@Mixins(JavaScriptMixin.class) +public interface HelloSpeaker +{ + void sayHello(); +} +// END SNIPPET: mixin http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/libraries/lang-jruby/dev-status.xml ---------------------------------------------------------------------- diff --git a/libraries/lang-jruby/dev-status.xml b/libraries/lang-jruby/dev-status.xml index 654d3aa..cefc98a 100644 --- a/libraries/lang-jruby/dev-status.xml +++ b/libraries/lang-jruby/dev-status.xml @@ -8,7 +8,7 @@ <codebase>beta</codebase> <!-- none, brief, good, complete --> - <documentation>none</documentation> + <documentation>brief</documentation> <!-- none, some, good, complete --> <unittests>some</unittests> http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/libraries/lang-jruby/src/docs/lang-jruby.txt ---------------------------------------------------------------------- diff --git a/libraries/lang-jruby/src/docs/lang-jruby.txt b/libraries/lang-jruby/src/docs/lang-jruby.txt index c946b0a..a7113c2 100644 --- a/libraries/lang-jruby/src/docs/lang-jruby.txt +++ b/libraries/lang-jruby/src/docs/lang-jruby.txt @@ -6,8 +6,24 @@ source=libraries/lang-jruby/dev-status.xml -------------- -JRuby Scripting Library - -NOTE: This Library has no documentation yet. Learn how to contribute in <<community-docs>>. +The JRuby Scripting Library allows Mixin methods to be implemented in Ruby and loaded dynamically on first use. include::../../build/docs/buildinfo/artifact.txt[] + +The JRuby Scripting Library is a Generic mixin that implements interfaces by delegating to Ruby functions using JRuby. Each method in an interface is declared by a Ruby method in a file located in classpath with the name "<interface>.rb", where the interface name includes the package, and has "." replaced with "/". + +Example: + + org/qi4j/samples/hello/domain/HelloWorldSpeaker.rb + +That means that the HelloWorldSpeaker.rb file may be co-located with the class files in the same package. It is currently not supported to place the JRuby implementation of the mixin in a different package than the interface it implements. + +To use JRuby to implement the Mixin functionality for a given interface, +simply declare the +JRubyMixin+ like any other mixin, either in the interface +or at assembly time. + +[snippet,java] +---- +source=libraries/lang-jruby/src/test/java/org/qi4j/lang/jruby/HelloSpeaker.java +tag=mixin +---- http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/506b155a/libraries/lang-jruby/src/test/java/org/qi4j/lang/jruby/HelloSpeaker.java ---------------------------------------------------------------------- diff --git a/libraries/lang-jruby/src/test/java/org/qi4j/lang/jruby/HelloSpeaker.java b/libraries/lang-jruby/src/test/java/org/qi4j/lang/jruby/HelloSpeaker.java new file mode 100644 index 0000000..1aa9641 --- /dev/null +++ b/libraries/lang-jruby/src/test/java/org/qi4j/lang/jruby/HelloSpeaker.java @@ -0,0 +1,24 @@ +/* + * Copyright 2007 Rickard Ãberg + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +package org.qi4j.lang.jruby; + +import org.qi4j.api.mixin.Mixins; + +// START SNIPPET: mixin +import org.qi4j.lang.jruby.JRubyMixin; + +@Mixins(JRubyMixin.class) +public interface HelloSpeaker +{ + void sayHello(); +} +// END SNIPPET: mixin
