Skip to content

Commit

Permalink
Merge branch 'master' into humanizer_helper_class
Browse files Browse the repository at this point in the history
  • Loading branch information
akonan authored Dec 19, 2024
2 parents 5452434 + d94d20f commit 1dbe399
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
script: "rspec spec"
language: "ruby"
rvm:
- 2.0.0
- 2.3.1
- 3.0.4
- 3.1.2
- jruby
gemfile:
- Gemfile
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.rails-7.0.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "http://rubygems.org"
gemspec

gem "activemodel", "~> 7.0.3"
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Humanizer

Humanizer 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 and 4.
Humanizer 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.

## Installation

Add `humanizer` to your Gemfile:

```ruby
gem 'humanizer'
gem "humanizer"
```

Bundle and run the generator in terminal:
Expand Down Expand Up @@ -98,7 +98,7 @@ You can just have a simple attribute on your model and use it to bypass the vali

```ruby
attr_accessor :bypass_humanizer
require_human_on :create, :unless => :bypass_humanizer
require_human_on :create, unless: :bypass_humanizer
```

Now when bypass_humanizer is true, validation will be skipped.
Expand All @@ -113,11 +113,6 @@ To make sure the current question doesn't get asked again, you can pass the curr
@user.change_humanizer_question(params[:user][:humanizer_question_id])
```

## Live sites

* [ArcticStartup.com](http://arcticstartup.com/) - sign up form
* [Paspartout](http://paspartout.com/) - sign up form

## License

Humanizer is licensed under the MIT License, for more details see the LICENSE file.
Expand Down
29 changes: 29 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rake' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

bundle_binstub = File.expand_path("../bundle", __FILE__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rake", "rake")
10 changes: 0 additions & 10 deletions lib/generators/templates/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ en:
validation:
error: You're not a human
questions:
- question: Two plus two?
answers: ["4", "four"]
- question: Jack and Jill went up the...
answer: hill
- question: What is the number before twelve?
answers: ["11", "eleven"]
- question: Five times two is what?
answers: ["10", "ten"]
- question: "Insert the next number in this sequence: 10, 11, 12, 13, 14, .."
answers: ["15", "fifteen"]
- question: "What is five times five?"
answers: ["25", "twenty-five"]
- question: "Ten divided by two is what?"
answers: ["5", "five"]
- question: What day comes after Monday?
Expand All @@ -29,15 +23,11 @@ en:
answer: "south"
- question: What is the opposite of bad?
answer: "good"
- question: What is 4 times four?
answers: ["16", "sixteen"]
- question: What number comes after 20?
answers: ["21", "twenty-one"]
- question: What month comes before July?
answer: "june"
- question: What is fifteen divided by three?
answer: ["five", "5"]
- question: What is 14 minus 4?
answers: ["10", "ten"]
- question: "What comes next? Monday, Tuesday, Wednesday.."
answer: "Thursday"

0 comments on commit 1dbe399

Please sign in to comment.