<commit_before># Falcor

![Falcor YEAH](http://epicyearproject.files.wordpress.com/2011/05/bastian-falcor-whoop-490.gif)

Falcor is intended to solve several problems, namely, to be able to quickly define fixture data and use it for things like example JSON web services, mocking out tests, and seeding test data into document stores. The DSL should be very familiar to users of tools like FactoryGirl, but it doesn't require the class to exist before you define the factory.

### TODO:

* Traits
* Port over tests
* Examples of usage for README

## Installation

Add this line to your application's Gemfile:

    gem 'falcor'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install falcor

## Usage



## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request<commit_msg>Add some usage notes to readme<commit_after># Falcor

![Falcor YEAH](http://epicyearproject.files.wordpress.com/2011/05/bastian-falcor-whoop-490.gif)

Falcor is intended to solve several problems, namely, to be able to quickly define fixture data and use it for things like example JSON web services, mocking out tests, and seeding test data into document stores. The DSL should be very familiar to users of tools like FactoryGirl, but it doesn't require the class to exist before you define the factory.

### TODO:

* Traits
* Port over tests
* Examples of usage for README

## Installation

Add this line to your application's Gemfile:

    gem 'falcor'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install falcor

## Usage

Here's how you'd define some factories, create an instance of the new `user` factory, and then turn it into JSON:

```ruby
Falcor::Fabricator.define :blog_post do
  field :title, "My post"
  field :body, "Lots of text"
end

Falcor::Fabricator.define :user do
  field :email, "<EMAIL>"
  field :full_name, "<NAME>"

  create_list :blog_posts, 2, Factory(:blog_post)
end

user = Factory :user

user.to_json
#=> {:email=>"<EMAIL>",
 :full_name=>"<NAME>",
 :blog_posts=>
  [{:title=>"My post", :body=>"Lots of text"},
   {:title=>"My post", :body=>"Lots of text"}]}
```

You can also override defaults:

```ruby
post = Factory :blog_post, title: "My really cool post"

post.title
#=> "My really cool blog post"
```

And much more! (To be continued...)

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
{'fraction_non_alphanumeric': 0.10309278350515463, 'fraction_numerical': 0.010677466863033874, 'mean_word_length': 4.1555977229601515, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, 'https://': 0, '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': '1100616', 'n_tokens_mistral': 881, 'n_tokens_neox': 818, 'n_words': 365}