diff --git a/.travis.yml b/.travis.yml index 4721b28..f47c026 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Gemfile.rails-7.0.3 b/Gemfile.rails-7.0.3 new file mode 100644 index 0000000..62565e5 --- /dev/null +++ b/Gemfile.rails-7.0.3 @@ -0,0 +1,4 @@ +source "http://rubygems.org" +gemspec + +gem "activemodel", "~> 7.0.3" diff --git a/README.md b/README.md index 6a5958e..8b21bba 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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. @@ -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. diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..9275675 --- /dev/null +++ b/bin/rake @@ -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") diff --git a/lib/generators/templates/locales/en.yml b/lib/generators/templates/locales/en.yml index 8e90349..24597e2 100644 --- a/lib/generators/templates/locales/en.yml +++ b/lib/generators/templates/locales/en.yml @@ -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? @@ -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"