<commit_before>Groovy Decorator
================
Python-inspired method decorator for Groovy.

Tested on
---------
- Groovy 2.4.6
- Java 1.7.0_75

Example
-------
```groovy
// Guard.groovy in its own project
import com.github.yihtserns.groovy.deco.MethodDecorator
import org.codehaus.groovy.transform.GroovyASTTransformationClass
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
import java.lang.annotation.ElementType

@MethodDecorator({ func ->
    return { args ->
        String username = args[0]

        if (username == 'hacker') {
            throw new UnsupportedOperationException("hacker not allowed")
        } else {
            func(args) // Call original method
        }
    }<commit_msg>Add shields/badges in doc.<commit_after>Groovy Decorator
================
Python-inspired method decorator for Groovy.

[![Groovy 2.4.6](https://img.shields.io/badge/groovy-2.4.6-blue.svg)](http://www.groovy-lang.org/) [![Java 1.7.0_75](https://img.shields.io/badge/java-1.7.0__75-red.svg)](https://java.com)

[![Build Status](https://travis-ci.org/yihtserns/groovy-decorator.svg?branch=master)](https://travis-ci.org/yihtserns/groovy-decorator)

Example
-------
```groovy
// Guard.groovy in its own project
import com.github.yihtserns.groovy.deco.MethodDecorator
import org.codehaus.groovy.transform.GroovyASTTransformationClass
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
import java.lang.annotation.ElementType

@MethodDecorator({ func ->
    return { args ->
        String username = args[0]

        if (username == 'hacker') {
            throw new UnsupportedOperationException("hacker not allowed")
        } else {
            func(args) // Call original method
        }
    }
{'fraction_non_alphanumeric': 0.14847161572052403, 'fraction_numerical': 0.014192139737991267, 'mean_word_length': 3.4168674698795183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 5, 'lorem ipsum': 0, 'www.': 1, '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': '1929246', 'n_tokens_mistral': 619, 'n_tokens_neox': 571, 'n_words': 107}