<commit_before>[![Gem Version](https://badge.fury.io/rb/makers.svg)](http://badge.fury.io/rb/makers)
[![Code Climate](https://codeclimate.com/github/mmontossi/makers/badges/gpa.svg)](https://codeclimate.com/github/mmontossi/makers)
[![Build Status](https://travis-ci.org/mmontossi/makers.svg)](https://travis-ci.org/mmontossi/makers)
[![Dependency Status](https://gemnasium.com/mmontossi/makers.svg)](https://gemnasium.com/mmontossi/makers)

# Makers

Minimalistic factories to replace fixtures in rails.

## Why

I did this gem to:

- Enforce better practices removing unnecessary options.
- Avoid the need to use another method to build/create lists.
- Quicker syntax to handle associations.

## Install

Put this line in your Gemfile:
```ruby
gem 'makers', group: [:development, :test]
```

Then bundle:
```
$ bundle
```

## Usage

### Configuration

Run the install generator:
```
$ bundle exec rails g makers:install
```

Define makers in test/makers.rb or spec/makers.rb:
```ruby
Makers.define do

  maker :user do
    name 'example'
  end

end
```

### Methods

There are two methods available in tests:
```ruby
build<commit_msg>Improve readme<commit_after>[![Gem Version](https://badge.fury.io/rb/makers.svg)](http://badge.fury.io/rb/makers)
[![Code Climate](https://codeclimate.com/github/mmontossi/makers/badges/gpa.svg)](https://codeclimate.com/github/mmontossi/makers)
[![Build Status](https://travis-ci.org/mmontossi/makers.svg)](https://travis-ci.org/mmontossi/makers)
[![Dependency Status](https://gemnasium.com/mmontossi/makers.svg)](https://gemnasium.com/mmontossi/makers)

# Makers

Minimalistic factories to replace fixtures in rails.

## Why

I did this gem to:

- Enforce better practices removing unnecessary options.
- Avoid the need to use another method to build/create lists.
- Quicker syntax to handle associations.

## Install

Put this line in your Gemfile:
```ruby
gem 'makers', group: [:development, :test]
```

Then bundle:
```
$ bundle
```

## Usage

### Configuration

Run the install generator:
```
$ bundle exec rails g makers:install
```

Define makers in test/makers.rb or spec/makers.rb:
```ruby
Makers.define do

  maker :user do
    name 'example'
  end

end
```

### Methods

There are two new methods available in tests:
```ruby
build
{'fraction_non_alphanumeric': 0.15195432586736934, 'fraction_numerical': 0.0, 'mean_word_length': 4.624691358024691, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, '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': '5149078', 'n_tokens_mistral': 806, 'n_tokens_neox': 754, 'n_words': 193}