{"id":14969818,"url":"https://github.com/kiskolabs/humanizer","last_synced_at":"2025-10-08T18:14:55.509Z","repository":{"id":668157,"uuid":"741745","full_name":"kiskolabs/humanizer","owner":"kiskolabs","description":"Very simple captcha with Rails 3 \u0026 4 \u0026 5 \u0026 6 \u0026 7 support","archived":false,"fork":false,"pushed_at":"2024-12-19T06:38:04.000Z","size":124,"stargazers_count":258,"open_issues_count":0,"forks_count":51,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-06T12:05:46.081Z","etag":null,"topics":["captcha","rails","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://kiskolabs.github.io/humanizer","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/kiskolabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-06-26T11:57:53.000Z","updated_at":"2024-12-19T06:38:09.000Z","dependencies_parsed_at":"2024-10-11T03:42:15.106Z","dependency_job_id":"8e7dd9ae-fe89-4857-99df-b227cb084cad","html_url":"https://github.com/kiskolabs/humanizer","commit_stats":{"total_commits":136,"total_committers":40,"mean_commits":3.4,"dds":0.7941176470588236,"last_synced_commit":"b995d6fdba6b2aa9b0284dc304a051166ed92b7c"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiskolabs%2Fhumanizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiskolabs%2Fhumanizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiskolabs%2Fhumanizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiskolabs%2Fhumanizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiskolabs","download_url":"https://codeload.github.com/kiskolabs/humanizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732486,"owners_count":21152852,"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":["captcha","rails","ruby","ruby-on-rails"],"created_at":"2024-09-24T13:42:26.644Z","updated_at":"2025-10-08T18:14:50.472Z","avatar_url":"https://github.com/kiskolabs.png","language":"Ruby","readme":"# Humanizer\n\nHumanizer is a very simple CAPTCHA method. It has a localized YAML file with questions and answers which is used to validate that the user is an actual human. Any model that includes ActiveModel::Validations should work. Our aim is to be database and mapper agnostic, so if it doesn't work for you, open an issue. Humanizer works with Rails 3–7.\n\n## Installation\n\nAdd `humanizer` to your Gemfile:\n\n```ruby\ngem \"humanizer\"\n```\n\nBundle and run the generator in terminal:\n\n```sh\nbundle\nrails g humanizer\n```\n\n## Advanced Installation\n\n* Install all locales: `rails g humanizer --all-locales`\n* Show available locales: `rails g humanizer --show-locales`\n* Install selected locales: `rails g humanizer en fi de`\n\n## Usage\n\n1. In your model, include Humanizer and add the #require_human_on method, example:\n\n```ruby\nclass User \u003c ActiveRecord::Base\n  include Humanizer\n  require_human_on :create\nend\n```\n\n2. Ask the question in the form, example:\n\n```erb\n\u003c%= f.label :humanizer_answer, @model.humanizer_question %\u003e\n\u003c%= f.text_field :humanizer_answer %\u003e\n\u003c%= f.hidden_field :humanizer_question_id %\u003e\n```\n\n3. If you are using attr_accessible, remember to whitelist `:humanizer_answer` and `:humanizer_question_id`.\n\n4. If you are using strong_parameters, remember to permit `:humanizer_answer` and `:humanizer_question_id`.\n\n## Usage without a model\n\nAlternatively, you many use the built in HumanizerHelper class instead of using your own model (useful for something like a contact form if you don't have a model/class for this). Behavior is the same including `Humanizer` on a model, but all setters are available as optional arguments when initializing a HumanizerHelper instance.\n\n1. Example initialization code(controller):\n\n```ruby\n@humanizer_helper = HumanizerHelper.new\n```\n\n2. Example rails form usage:\n\n```erb\n\u003c%= label_tag :humanizer_answer, @humanizer_helper.humanizer_question %\u003e\n\u003c%= text_field_tag :humanizer_answer %\u003e\n\u003c%= hidden_field_tag :humanizer_question_id, @humanizer_helper.humanizer_question_id %\u003e\n```\n\n3. Example response handling:\n\n```ruby\nhumanizer_helper = HumanizerHelper.new(humanizer_answer: params[:humanizer_answer], humanizer_question_id: params[:humanizer_question_id])\nif humanizer_helper.humanizer_correct_answer?\n  do_stuff\nend\n```\n\n## Testing\n\nA HumanizerHelper instance provides an additional `get_correct_humanizer_answer` method to make testing easier. Example:\n\n```ruby\n  question_id = find('#humanizer_question_id', visible: false).value #gets humanizer question id from example form above\n  humanizer_helper = HumanizerHelper.new(humanizer_question_id: question_id)\n  fill_in 'humanizer_answer', with: humanizer_helper.get_correct_humanizer_answer #fills in answer field from example above with the correct answer\n```\n\n\n## Configuration\n\nDefault translations can be found in config/locales/\n\nYou might want to add/change question and answer pairs. This can be easily done by adding/modifying entries in locales file.\n\n## Skipping validation\n\nYou might want to skip the humanizer validations on your tests or rails console.\n\nYou can just have a simple attribute on your model and use it to bypass the validation. Here's an example:\n\n```ruby\nattr_accessor :bypass_humanizer\nrequire_human_on :create, unless: :bypass_humanizer\n```\n\nNow when bypass_humanizer is true, validation will be skipped.\n\n## Reloading questions\n\nIn case you want to give your users the option to change the question, there's a #change_humanizer_question method to help you.\n\nTo make sure the current question doesn't get asked again, you can pass the current question id to the method. For example:\n\n```ruby\n@user.change_humanizer_question(params[:user][:humanizer_question_id])\n```\n\n## License\n\nHumanizer is licensed under the MIT License, for more details see the LICENSE file.\n\n## Question/Answer Translations\n\n* English, Finnish and Portuguese translations by [Kisko Labs](http://kiskolabs.com/)\n* German by [Sven Schwyn](http://github.com/svoop)\n* Dutch by [Joren De Groof](http://github.com/joren)\n* Brazilian Portuguese by [Britto](http://github.com/britto)\n* Russian by [Shark](http://github.com/Serheo)\n* Spanish by [Juanjo Bazán](https://github.com/xuanxu)\n* Polish by [Maciek O](https://github.com/ohaleck)\n* Italian by [Alberto Vena](https://github.com/kennyadsl)\n* Chinese (Simplified) by [Crane Jin](https://github.com/cranej)\n\n## Contributors\n\n* [Florian Bertholin](https://github.com/Arkan)\n* [seogrady](https://github.com/seogrady)\n* [yairgo](https://github.com/yairgo)\n* [woto](https://github.com/woto)\n* [Calvin Delamere](https://github.com/elbartostrikesagain)\n\n## CI Build Status\n\n[![Build Status](https://travis-ci.org/kiskolabs/humanizer.png?branch=master)](https://travis-ci.org/kiskolabs/humanizer)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiskolabs%2Fhumanizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiskolabs%2Fhumanizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiskolabs%2Fhumanizer/lists"}