<commit_before>== What is Asteroid

AST transformations, have been historically a hard topic in
Groovy. Asteroid is a set of utilities and ideas trying to reduce the
complexity of dealing with transformations.

[sidebar]
.Apache
****
The *Asteroid* project is open sourced under the http://www.apache.org/licenses/LICENSE-2.0.html[Apache 2 License].
****

If you have never done any AST transformation I'd recommend you to
take a look both the
http://groovy-lang.org/metaprogramming.html#developing-ast-xforms[Groovy]
documentation and the theory chapter. If you already now the stuff
then read on.

WARNING: At the moment **Asteroid** development is in an alpha
state. Please check the changelog file to follow the progress of the
project.

== Show me the code

=== Gradle

In order to use `Asteroid` in your Groovy code you can find it in Bintray:

[source,groovy]
----
repositories {
    maven {
        url  "http://dl.bintray.com/grooviter/maven"
    }
}
----

Then you can add the dependency to your project:

[source,groovy]
----
compile 'com.github.grooviter:asteroid:0.2.0'
----

=== Example

To show the benefit of using Asteroid, I will be following the
tutorial about local transformation available at the
http://www.groovy-lang.org/metaprogramming.html#transforms-local[Groovy
official site]. The code of the following example is available at the<commit_msg>Add current gradle version in docs<commit_after>== What is Asteroid

AST transformations, have been historically a hard topic in
Groovy. Asteroid is a set of utilities and ideas trying to reduce the
complexity of dealing with transformations.

[sidebar]
.Apache
****
The *Asteroid* project is open sourced under the http://www.apache.org/licenses/LICENSE-2.0.html[Apache 2 License].
****

If you have never done any AST transformation I'd recommend you to
take a look both the
http://groovy-lang.org/metaprogramming.html#developing-ast-xforms[Groovy]
documentation and the theory chapter. If you already now the stuff
then read on.

WARNING: At the moment **Asteroid** development is in an alpha
state. Please check the changelog file to follow the progress of the
project.

== Show me the code

=== Gradle

In order to use `Asteroid` in your Groovy code you can find it in Bintray:

[source,groovy]
----
repositories {
    maven {
        url  "http://dl.bintray.com/grooviter/maven"
    }
}
----

Then you can add the dependency to your project:

[source,groovy, subs="attributes"]
----
compile 'com.github.grooviter:asteroid:{project-version}'
----

=== Example

To show the benefit of using Asteroid, I will be following the
tutorial about local transformation available at the
http://www.groovy-lang.org/metaprogramming.html#transforms-local[Groovy
official site]. The code of the following example is available at the
{'fraction_non_alphanumeric': 0.09126700071581961, 'fraction_numerical': 0.0032211882605583395, 'mean_word_length': 4.119047619047619, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3736560', 'n_tokens_mistral': 866, 'n_tokens_neox': 808, 'n_words': 343}