humanizer 2.6.4 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 39cae7e98d9aeae247f774ada51fdebbf6e09e22
4
- data.tar.gz: ddf26702c8247fc659c6c7a77fe1b220d63692ba
2
+ SHA256:
3
+ metadata.gz: b268345d6d2c138180c0524c04609775fa7bbd52741661fd4b23879be4eb6c9a
4
+ data.tar.gz: 9eb10255a421623d61b2ce64e9ec47674ad6409285db530362f75d56e66850c5
5
5
  SHA512:
6
- metadata.gz: 5a0bbcbe08c9f8ec9d567a01cc48af0e34c86519565a0347e6f66524de4f6d2c2d9066a895586187c9291074cd121ec0ee0083de96f599c668c92a9799aad3fb
7
- data.tar.gz: 05411bf9b0f79c32ac732b03c48558a0c58275acc4259daf033822e6be027945506046da78641fdcbb4f8d0b64c876a0f25fd2c1f53f4abf1e13430ab84a0145
6
+ metadata.gz: be4b6b44404226559c6a0e44fa97200408cfb40560e12d818bd6e79d6dbda8704acdb8dd7bca243fc0dfb6c3ccb970bad3ac6ed5057d0b1a523e8d795b555144
7
+ data.tar.gz: b5644e9aec6361012880742613db454a691c6b2fa0bd7eb7844565490c4c2d0d4104588e3a9237201ef720dfb5b4e8e67383adb459f530eeb0592b5502e5a171
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Humanizer
2
2
 
3
- 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.
3
+ 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.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Add `humanizer` to your Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'humanizer'
10
+ gem "humanizer"
11
11
  ```
12
12
 
13
13
  Bundle and run the generator in terminal:
@@ -60,7 +60,7 @@ You can just have a simple attribute on your model and use it to bypass the vali
60
60
 
61
61
  ```ruby
62
62
  attr_accessor :bypass_humanizer
63
- require_human_on :create, :unless => :bypass_humanizer
63
+ require_human_on :create, unless: :bypass_humanizer
64
64
  ```
65
65
 
66
66
  Now when bypass_humanizer is true, validation will be skipped.
@@ -75,11 +75,6 @@ To make sure the current question doesn't get asked again, you can pass the curr
75
75
  @user.change_humanizer_question(params[:user][:humanizer_question_id])
76
76
  ```
77
77
 
78
- ## Live sites
79
-
80
- * [ArcticStartup.com](http://arcticstartup.com/) - sign up form
81
- * [Paspartout](http://paspartout.com/) - sign up form
82
-
83
78
  ## License
84
79
 
85
80
  Humanizer is licensed under the MIT License, for more details see the LICENSE file.
data/bin/rake ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rake", "rake")
@@ -1,3 +1,3 @@
1
1
  module Humanizer
2
- VERSION = "2.6.4"
2
+ VERSION = "2.7.0"
3
3
  end
data/lib/humanizer.rb CHANGED
@@ -32,14 +32,15 @@ module Humanizer
32
32
  questions = I18n.translate!("humanizer.questions")
33
33
  # Poor man's HashWithIndifferentAccess
34
34
  questions.map do |question|
35
- question.default_proc = proc do |h, k|
36
- case k
37
- when String then sym = k.to_sym; h[sym] if h.key?(sym)
38
- when Symbol then str = k.to_s; h[str] if h.key?(str)
39
- end
35
+ config = Hash.new
36
+ config.default_proc = proc do |h, k|
37
+ case k
38
+ when String then sym = k.to_sym; h[sym] if h.key?(sym)
39
+ when Symbol then str = k.to_s; h[str] if h.key?(str)
40
+ end
40
41
  end
42
+ config.merge(question)
41
43
  end
42
- questions
43
44
  end
44
45
  end
45
46
 
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humanizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.4
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antti Akonniemi
8
8
  - Joao Carlos Cardoso
9
9
  - Matias Korhonen
10
10
  - Vesa Vänskä
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-07-07 00:00:00.000000000 Z
14
+ date: 2023-06-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -82,6 +82,7 @@ files:
82
82
  - CHANGELOG.md
83
83
  - LICENSE
84
84
  - README.md
85
+ - bin/rake
85
86
  - lib/generators/humanizer_generator.rb
86
87
  - lib/generators/templates/locales/da.yml
87
88
  - lib/generators/templates/locales/de.yml
@@ -108,7 +109,7 @@ homepage: http://github.com/kiskolabs/humanizer
108
109
  licenses:
109
110
  - MIT
110
111
  metadata: {}
111
- post_install_message:
112
+ post_install_message:
112
113
  rdoc_options: []
113
114
  require_paths:
114
115
  - lib
@@ -123,9 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
124
  - !ruby/object:Gem::Version
124
125
  version: 1.3.6
125
126
  requirements: []
126
- rubyforge_project: humanizer
127
- rubygems_version: 2.6.8
128
- signing_key:
127
+ rubygems_version: 3.1.2
128
+ signing_key:
129
129
  specification_version: 4
130
130
  summary: A really simple captcha solution
131
131
  test_files: []