{"id":13747486,"url":"https://github.com/sevenwire/forgery","last_synced_at":"2025-05-09T08:33:15.573Z","repository":{"id":65333179,"uuid":"322","full_name":"sevenwire/forgery","owner":"sevenwire","description":"Easy and customizable generation of forged data.","archived":false,"fork":false,"pushed_at":"2020-07-23T17:18:23.000Z","size":285,"stargazers_count":788,"open_issues_count":2,"forks_count":114,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-17T00:19:13.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sevenwire.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-02-06T22:33:31.000Z","updated_at":"2025-04-14T20:41:59.000Z","dependencies_parsed_at":"2023-01-17T13:15:48.018Z","dependency_job_id":null,"html_url":"https://github.com/sevenwire/forgery","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevenwire%2Fforgery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevenwire%2Fforgery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevenwire%2Fforgery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevenwire%2Fforgery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sevenwire","download_url":"https://codeload.github.com/sevenwire/forgery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253217299,"owners_count":21873063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T06:01:30.891Z","updated_at":"2025-05-09T08:33:15.285Z","avatar_url":"https://github.com/sevenwire.png","language":"Ruby","readme":"# Forgery\n\n[![Build Status](https://travis-ci.org/sevenwire/forgery.svg)](https://travis-ci.org/sevenwire/forgery)\n[![Code Climate](https://codeclimate.com/github/sevenwire/forgery.svg)](https://codeclimate.com/github/sevenwire/forgery)\n\n**A Problem**:\nIt's harder than _absolutely easy_ to make meaningful, simple, data for testing and development.\n\n**A Solution**:\nA fake data generator that provides not only a host of basics and a rememberable syntax, but a customizable library to boot.\n\nWelcome to Forgery, an excellent solution to a problem so hard you didn't know it was there.\n\n## Using\n\nYou'll want to read individual Forgery categories for more information, but these are the basics:\n\n```ruby\nForgery(:basic).password\n  #=\u003e \"b6qZTQEH\"\n\nForgery(:internet).email_address\n  #=\u003e \"krainboltgreene@crt.net\"\n\nForgery(:monetary).money\n  #=\u003e \"1.58\"\n\nForgery(:lorem_ipsum).words(10)\n  #=\u003e \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam egestas.\"\n\nForgery(:monetary).formatted_money :min =\u003e 100, :max =\u003e 1000\n  #=\u003e \"$923.36\"\n```\n\nAnd many many more!\n\nAlternatively you can write it like this:\n\n```ruby\nForgery::Basic.hex_color\nForgery::Name.full_name\nForgery::Personal.shirt_size\n```\n\nIn addition, you can always write your own dictionaries and formats, overriding the ones in the gem.\nFully explained here.\n\n## Installing\n\nLike any gem, you can install Forgery two ways depending on it's use.\n\nFor normal Ruby development, you need simply use:\n\n```bash\ngem install forgery\n```\n\nThis will add it to your gem library, just like any normal gem.\nYou can then use it like any normal gem library.\nSee examples for more.\n\n### Rails 3.x\n\nIf you're using Rails 3.x you need to do a few extra things (that are probably rote).\nFirst step is to add it to your `Rails.root/Gemfile`, we also suggest specifying the latest version (found on rubygems):\n\n```ruby\ngem 'forgery', '0.6.0'\n```\n\nThen you'll need to run `bundle install` to install and lock in your new gem.\nNext you'll want to run the special Rails 3 generator:\n\n```bash\nbundle exec rails generate forgery\n```\n\n### Rails 2.x\n\nFor **Rails 2.x** you'll need to do something a little different, by first editing your `Rails.root/config/environment.rb` and adding this to the configuration block:\n\n```ruby\nconfig.gem 'forgery'\n```\n\nThen you'll need to run this in your command line:\n\n```bash\nscript/generate forgery\n```\n\n### Generators\n\nThis Rails generators will make these directories in your Rails.root directory:\n\n- Rails.root/lib/forgery\n- Rails.root/lib/forgery/dictionaries\n- Rails.root/lib/forgery/extensions\n- Rails.root/lib/forgery/forgeries\n- Rails.root/lib/forgery/formats\n\nYou can then use these directories to write your own dictionaries, class extensions, forgeries, and formats.\n\n## Full List of Methods\n\n| Address                              | Example Output    |\n| :----------------------------------- | :---------------- |\n| `Forgery('address').city`            | Loomis            |\n| `Forgery('address').continent`       | South America     |\n| `Forgery('address').country`         | Cameroon          |\n| `Forgery('address').phone`           | +1 (693) 901-4549 |\n| `Forgery('address').province`        | Alberta           |\n| `Forgery('address').province_abbrev` | NT                |\n| `Forgery('address').state`           | Alabama           |\n| `Forgery('address').state_abbrev`    | SC                |\n| `Forgery('address').street_address`  | 21 Hayes Park     |\n| `Forgery('address').street_name`     | Oneill            |\n| `Forgery('address').street_number`   | 222               |\n| `Forgery('address').street_suffix`   | Drive             |\n| `Forgery('address').zip`             | 11281-5568        |\n\n| Basic                              | Example Output                           |\n| :--------------------------------- | :--------------------------------------- |\n| `Forgery('basic').boolean`         | `true` (`TrueClass`)                     |\n| `Forgery('basic').color`           | Red                                      |\n| `Forgery('basic').encrypt`         | fc0d835dd4e4df144a33a6a346298b0f23dcd14a |\n| `Forgery('basic').frequency`       | Never                                    |\n| `Forgery('basic').hex_color`       | #e1d82a                                  |\n| `Forgery('basic').number`          | 4                                        |\n| `Forgery('basic').password`        | KcLBHCv6                                 |\n| `Forgery('basic').short_hex_color` | #c1d                                     |\n| `Forgery('basic').text`            | G8gECFfvDs2                              |\n\n| Credit Card                                  | Example Output     |\n| :------------------------------------------- | :----------------- |\n| `Forgery('credit_card').check_digit(number)` | 5                  |\n| `Forgery('credit_card').number`              | 343682330855371    |\n| `Forgery('credit_card').type`                | American Express   |\n| `Forgery('currency').code`                   | XPF                |\n| `Forgery('currency').description`            | Austria Schillings |\n\n| Date                             | Example Output            |\n| :------------------------------- | :------------------------ |\n| `Forgery('date').date`           | Fri, 20 Mar 2009 (`Date`) |\n| `Forgery('date').day`            | 15                        |\n| `Forgery('date').day_of_week`    | Monday                    |\n| `Forgery('date').delta(options)` | 3                         |\n| `Forgery('date').month`          | January                   |\n| `Forgery('date').year`           | 1994                      |\n\n| Email                      | Example Output                               |\n| :------------------------- | :------------------------------------------- |\n| `Forgery('email').address` | gsmith@kamba.org                             |\n| `Forgery('email').body`    | Lorem ipsum dolor sit amet, consectetuer ... |\n| `Forgery('email').subject` | Lorem Ipsum Dolor Sit Amet...                |\n\n| Geo                                  | Example Output               |\n| :----------------------------------- | :--------------------------- |\n| `Forgery('geo').latitude`            | -8.095096815540515 (`Float`) |\n| `Forgery('geo').latitude_degrees`    | -49                          |\n| `Forgery('geo').latitude_direction`  | N                            |\n| `Forgery('geo').latitude_minutes`    | 14                           |\n| `Forgery('geo').latitude_seconds`    | 45                           |\n| `Forgery('geo').longitude`           | -22.56746406884514 (`Float`) |\n| `Forgery('geo').longitude_degrees`   | 100                          |\n| `Forgery('geo').longitude_direction` | W                            |\n| `Forgery('geo').longitude_minutes`   | 47                           |\n| `Forgery('geo').longitude_seconds`   | 41                           |\n\n| Internet                               | Example Output                          |\n| :------------------------------------- | :-------------------------------------- |\n| `Forgery('internet').cctld`            | cf                                      |\n| `Forgery('internet').domain_name`      | bubbletube.net                          |\n| `Forgery('internet').email_address`    | cwalker@quire.name                      |\n| `Forgery('internet').email_subject`    | Lorem Ipsum Dolor Sit Amet...           |\n| `Forgery('internet').ip_v4`            | 94.120.51.103                           |\n| `Forgery('internet').ip_v6`            | c61e:5926:15e6:d225:8eef:fb39:7412:e9d5 |\n| `Forgery('internet').top_level_domain` | com                                     |\n| `Forgery('internet').user_name`        | sdixon                                  |\n\n| Lorem Ipsum                                            | Example Output                            |\n| :----------------------------------------------------- | :---------------------------------------- |\n| `Forgery('lorem_ipsum').character`                     | l                                         |\n| `Forgery('lorem_ipsum').characters`                    | lorem ipsu                                |\n| `Forgery('lorem_ipsum').lorem_ipsum_characters`        | lorem ipsum dolor sit amet...             |\n| `Forgery('lorem_ipsum').lorem_ipsum_words`             | [\"lorem\", \"ipsum\", \"dolor\", ...](`Array`) |\n| `Forgery('lorem_ipsum').paragraph`                     | Lorem ipsum dolor sit amet...             |\n| `Forgery('lorem_ipsum').paragraphs`                    | Lorem ipsum dolor sit amet...             |\n| `Forgery('lorem_ipsum').range_from_quantity(quantity)` | 0..4 (`Range`)                            |\n| `Forgery('lorem_ipsum').sentence`                      | Lorem ipsum dolor sit amet...             |\n| `Forgery('lorem_ipsum').sentences`                     | Lorem ipsum dolor sit amet...             |\n| `Forgery('lorem_ipsum').text`                          | Lorem ipsum dolor sit amet...             |\n| `Forgery('lorem_ipsum').title`                         | Lorem Ipsum Dolor Sit Amet...             |\n| `Forgery('lorem_ipsum').word`                          | lorem                                     |\n| `Forgery('lorem_ipsum').words`                         | lorem ipsum dolor sit amet...             |\n\n| Monetary                              | Example Output  |\n| :------------------------------------ | :-------------- |\n| `Forgery('monetary').formatted_money` | \\$5.49          |\n| `Forgery('monetary').money`           | 9.20 (`String`) |\n\n| Name                                | Example Output     |\n| :---------------------------------- | :----------------- |\n| `Forgery('name').company_name`      | Bubbletube         |\n| `Forgery('name').female_first_name` | Judy               |\n| `Forgery('name').first_name`        | Albert             |\n| `Forgery('name').full_name`         | Evelyn Wallace     |\n| `Forgery('name').industry`          | Toy \u0026 Hobby Stores |\n| `Forgery('name').job_title`         | Analyst Programmer |\n| `Forgery('name').job_title_suffix`  | III                |\n| `Forgery('name').last_name`         | Jackson            |\n| `Forgery('name').location`          | Try-N-Save         |\n| `Forgery('name').male_first_name`   | Donald             |\n| `Forgery('name').suffix`            | Sr                 |\n| `Forgery('name').title`             | Mr                 |\n\n| Personal                                 | Example Output |\n| :--------------------------------------- | :------------- |\n| `Forgery('personal').abbreviated_gender` | F              |\n| `Forgery('personal').gender`             | Female         |\n| `Forgery('personal').language`           | Bislama        |\n| `Forgery('personal').race`               | Indonesian     |\n| `Forgery('personal').shirt_size`         | 2XL            |\n\n| Bank Account                   | Example Output   |\n| :----------------------------- | :--------------- |\n| `Forgery('bank_account').iban` | BE68539007547034 |\n| `Forgery('bank_account').bic`  | VBRSDE33345      |\n\n| Russian Tax                             | Example Output       |\n| :-------------------------------------- | :------------------- |\n| `Forgery('russian_tax').account_number` | 56335652786612121479 |\n| `Forgery('russian_tax').bik`            | 046533860            |\n| `Forgery('russian_tax').inn`            | 7366543467           |\n| `Forgery('russian_tax').legal_inn`      | 7822838630           |\n| `Forgery('russian_tax').legal_ogrn`     | 3483465598635        |\n| `Forgery('russian_tax').ogrn`           | 666325227817763      |\n| `Forgery('russian_tax').person_inn`     | 451559765443         |\n| `Forgery('russian_tax').person_ogrn`    | 195478617554621      |\n\n| Time                   | Example Output       |\n| :--------------------- | :------------------- |\n| `Forgery('time').zone` | Amsterdam (`String`) |\n\n## Contributing\n\nThis is a work in progress and an open source project, so feel free to contribute.\n\nWe'll take pull requests via git or suggestions via the issues tab.\nAny work done on Forgery will get you into the credits list and in our hearts.\n","funding_links":[],"categories":["Ruby","Testing"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevenwire%2Fforgery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsevenwire%2Fforgery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevenwire%2Fforgery/lists"}