<commit_before># What Happened

[![Build Status](https://travis-ci.org/tawan/what-happened.svg?branch=master)](https://travis-ci.org/tawan/what-happened)


## Usage

```ruby
# config/what_happened.rb
specify do
  creating_group_membership do
    notifies { |group_membership| group_membership.group.users }
    label_as :one_of_your_groups_has_a_new_member

    notifies { |group_membership| group_membership.group }
    label_as :group_has_new_member
  end
end
```<commit_msg>Extend example in README<commit_after># What Happened

[![Build Status](https://travis-ci.org/tawan/what-happened.svg?branch=master)](https://travis-ci.org/tawan/what-happened)


## Usage

```ruby
# config/what_happened.rb
specify do
  creating_group_membership do
    notifies { |group_membership| group_membership.group.users }
    label_as :one_of_your_groups_has_a_new_member

    notifies { |group_membership| group_membership.group }
    label_as :group_has_new_member
  end

  creating_comment do
    notifies { |comment| comment.commentable.users }
    only_if { |comment| comment.commentable.is_a? Group }
    only_if { |comment| comment.creator_id == comment.commentable.organizer_id }
    label_as :new_comment_in_group

    notifies { |comment| comment.commentable.users }
    only_if { |comment| comment.commentable.is_a? Group }
    label_as :new_comment_in_group
  end
end
```
{'fraction_non_alphanumeric': 0.10891812865497076, 'fraction_numerical': 0.0, 'mean_word_length': 4.825531914893617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, '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': '1388823', 'n_tokens_mistral': 503, 'n_tokens_neox': 481, 'n_words': 76}