{"id":17077800,"url":"https://github.com/torokmark/kovacs","last_synced_at":"2025-03-23T12:18:00.271Z","repository":{"id":56887604,"uuid":"159879023","full_name":"torokmark/kovacs","owner":"torokmark","description":":person_with_blond_hair: :woman: Simple fake person generator","archived":false,"fork":false,"pushed_at":"2019-02-05T10:09:02.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T18:31:13.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://torokmark.github.io/kovacs/","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/torokmark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-30T21:10:36.000Z","updated_at":"2019-10-23T09:21:53.000Z","dependencies_parsed_at":"2022-08-20T15:20:55.127Z","dependency_job_id":null,"html_url":"https://github.com/torokmark/kovacs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torokmark%2Fkovacs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torokmark%2Fkovacs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torokmark%2Fkovacs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torokmark%2Fkovacs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torokmark","download_url":"https://codeload.github.com/torokmark/kovacs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245097834,"owners_count":20560319,"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-10-14T12:17:00.856Z","updated_at":"2025-03-23T12:18:00.243Z","avatar_url":"https://github.com/torokmark.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kovacs\n\n[![Build Status](https://travis-ci.org/torokmark/kovacs.svg?branch=master)](https://travis-ci.org/torokmark/kovacs)\n[![Gem Version](https://badge.fury.io/rb/kovacs.svg)](https://badge.fury.io/rb/kovacs)\n\nKovacs is one of the most common surnames in Eastern Europe from Slovakia to Hungary to Croatia. (This is the Hungarian form). It means blacksmith in English. With this gem we can smith names based on nationalities.\n\nKovacs is a simple gem that helps you generate fake data for a person entity based on real life names, nationalities and sex.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'kovacs'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install kovacs\n\n## Usage\n\n### 1. Simpliest\n\nJust simply generate a person. It takes a nationality from the listed nationalities placed inside the `resources` folder. (nationality has to be a folder as well.)  \nThen it generates a sex and based on these two, it generates names.\n\n```ruby\np Kovacs.generate\n# =\u003e #\u003cKovacs::Person:0x0000560e4a3b54f8 @nationality=:slovak, @sex=:male, @forename=\"Elek\", @middle_name=\"Erno\", @surname=\"Toth\"\u003e\np Kovacs.generate.to_h\n# =\u003e {:nationality=\u003e:slovak, :sex=\u003e:male, :forename=\u003e\"Miroslav\", :middle_name=\u003e\"Jan\", :surname=\u003e\"Cvikota\"} \n```\n\n### 2. Generate just one of the attributes\n\n```ruby\np Kovacs.forename(['Jancsi', 'Julcsi'])\n# =\u003e \"Jancsi\" \n```\n\n### 3. Generate via config\n\n```ruby\nperson = Kovacs.config do |config|\n  config.surname     = :hungarian\n  config.forename    = 'Elek'\n  config.middle_name = ['Karoly', 'Erno', 'Ervin']\n  config.sex         = :male\n  config.nationality = [:hungarian, :slovak]\nend.generate\n\np person\n# =\u003e #\u003cKovacs::Person:0x0000560e4a3b54f8 @nationality=:slovak, @sex=:male, @forename=\"Elek\", @middle_name=\"Erno\", @surname=\"Toth\"\u003e \n```\n\n### 4. Acceptable arguments\n\n1. *None*: will be generated based on the nationalities, sex and list of names placed in `resources`.\n\n```ruby\nKovacs.forename\n```\n\n2. *Simple String*: the value will be the string argument itself.\n\n```ruby\nKovacs.forename('Jancsi')\n```\n\n3. *Symbol*: symbol represents the nationality. Value will be generated based on the specified nationality, and sex which is randomly generated.\n\n```ruby\nKovacs.forename(:hungarian)\n```\n\n4. *Nationality and sex*: Value will be generated based on the spedified nationality and the specified sex.\n\n```ruby\nKovacs.forename(:hungarian, :male)\n```\n\n5. *Array of Strings*: One of them will be taken randomly.\n\n```ruby\nKovacs.forename(['Jancsi', 'Julcsi'])\n```\n\n6. *Array of Symbols*: One of them will be taken randomly, name is taken randomly based on that nationality.\n\n```ruby\nKovacs.forename([:hungarian, :slovak])\n```\n\n7. *Array of Symbols and sex*: Nationality will be taken randomly, name is taken randomly based on that nationality and specified sex. \n\n```ruby\nKovacs.forename([:hungarian, :slovak], :female)\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Plugin for names\n\n1. Create a folder inside the `resources` folder. (from this time, this is considered as nationality, whichever name you would pick for it)\n2. Place the following files in the newly created folder:\n    * `male_forename.txt`\n    * `female_forename.txt`\n    * `surname.txt`\n3. Content of these files is considered as forenames and surnames grouped as female and male names.\n4. You can refere to this nationality by using symbols.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/torokmark/kovacs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## Code of Conduct\n\nEveryone interacting in the Kovacs project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/torokmark/kovacs/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorokmark%2Fkovacs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorokmark%2Fkovacs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorokmark%2Fkovacs/lists"}