humanizer 2.4.3 → 2.4.4
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.
- data/CHANGELOG.md +5 -0
- data/README.md +10 -1
- data/lib/generators/templates/locales/it.yml +43 -0
- data/lib/generators/templates/locales/zh-CN.yml +43 -0
- data/lib/humanizer.rb +3 -3
- data/lib/humanizer/version.rb +1 -1
- metadata +76 -82
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -57,7 +57,8 @@ To make sure the current question doesn't get asked again, you can pass the curr
|
|
|
57
57
|
|
|
58
58
|
## Live sites
|
|
59
59
|
|
|
60
|
-
* [ArcticStartup.com](http://arcticstartup.com/) -
|
|
60
|
+
* [ArcticStartup.com](http://arcticstartup.com/) - sign up form
|
|
61
|
+
* [Paspartout](http://paspartout.com/) - sign up form
|
|
61
62
|
|
|
62
63
|
## License
|
|
63
64
|
|
|
@@ -71,9 +72,17 @@ Humanizer is licensed under the MIT License, for more details see the LICENSE fi
|
|
|
71
72
|
* Brazilian Portuguese by [Britto](http://github.com/britto)
|
|
72
73
|
* Russian by [Shark](http://github.com/Serheo)
|
|
73
74
|
* Spanish by [Juanjo Bazán](https://github.com/xuanxu)
|
|
75
|
+
* Polish by [Maciek O](https://github.com/ohaleck)
|
|
76
|
+
* Italian by [Alberto Vena](https://github.com/kennyadsl)
|
|
77
|
+
* Chinese (Simplified) by [Crane Jin](https://github.com/cranej)
|
|
74
78
|
|
|
75
79
|
## Contributors
|
|
76
80
|
|
|
77
81
|
* [Florian Bertholin](https://github.com/Arkan)
|
|
78
82
|
* [seogrady](https://github.com/seogrady)
|
|
79
83
|
* [yairgo](https://github.com/yairgo)
|
|
84
|
+
* [woto](https://github.com/woto)
|
|
85
|
+
|
|
86
|
+
## CI Build Status
|
|
87
|
+
|
|
88
|
+
[](http://travis-ci.org/kiskolabs/humanizer)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
it:
|
|
2
|
+
humanizer:
|
|
3
|
+
validation:
|
|
4
|
+
error: Non sei un umano
|
|
5
|
+
questions:
|
|
6
|
+
- question: Due più due?
|
|
7
|
+
answers: ["4", "quattro"]
|
|
8
|
+
- question: Chi va a Roma perde la...
|
|
9
|
+
answer: "poltrona"
|
|
10
|
+
- question: Qual è il numero precedente al dodici?
|
|
11
|
+
answers: ["11", "undici"]
|
|
12
|
+
- question: Cinque volte due fa?
|
|
13
|
+
answers: ["10", "dieci"]
|
|
14
|
+
- question: "Inserisci il prossimo numero di questa sequenza: 10, 11, 12, 13, 14, .."
|
|
15
|
+
answers: ["15", "quindici"]
|
|
16
|
+
- question: "Quanto fa cinque volte cinque?"
|
|
17
|
+
answers: ["25", "venticinque"]
|
|
18
|
+
- question: "Dieci diviso due fa?"
|
|
19
|
+
answers: ["5", "cinque"]
|
|
20
|
+
- question: Che giorno viene dopo lunedì?
|
|
21
|
+
answers: ["martedì", "martedi"]
|
|
22
|
+
- question: Qual è l'ultimo mese dell'anno?
|
|
23
|
+
answer: "dicembre"
|
|
24
|
+
- question: Quanti minuti ci sono in un'ora?
|
|
25
|
+
answers: ["60", "sessanta"]
|
|
26
|
+
- question: Qual è il contrario di giù?
|
|
27
|
+
answers: ["su", "sù"]
|
|
28
|
+
- question: Qual è la direzione opposta al nord?
|
|
29
|
+
answer: "sud"
|
|
30
|
+
- question: Qual è il contrario di cattivo?
|
|
31
|
+
answer: "buono"
|
|
32
|
+
- question: Quanto fa 4 volte quattro?
|
|
33
|
+
answers: ["16", "sedici"]
|
|
34
|
+
- question: Che numero viene dopo il 20?
|
|
35
|
+
answers: ["21", "ventuno"]
|
|
36
|
+
- question: Che mese viene prima di luglio?
|
|
37
|
+
answer: "giugno"
|
|
38
|
+
- question: Quanto fa quindici dviso tre?
|
|
39
|
+
answers: ["cinque", "5"]
|
|
40
|
+
- question: Quanto fa 14 meno 4?
|
|
41
|
+
answers: ["10", "dieci"]
|
|
42
|
+
- question: "Cosa viene dopo? Lunedì, martedì, mercoledì, .."
|
|
43
|
+
answers: ["Giovedì", "Giovedi", "giovedì", "giovedi"]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
zh-CN:
|
|
2
|
+
humanizer:
|
|
3
|
+
validation:
|
|
4
|
+
error: '你不是人类'
|
|
5
|
+
questions:
|
|
6
|
+
- question: 二加二等于几?
|
|
7
|
+
answers: ["4", "four", "四"]
|
|
8
|
+
- question: 门前大桥下游过一群__
|
|
9
|
+
answer: 鸭
|
|
10
|
+
- question: 十二前面是什么数字?
|
|
11
|
+
answers: ["11", "eleven", "十一"]
|
|
12
|
+
- question: 五乘以二等于几?
|
|
13
|
+
answers: ["10", "ten", "十"]
|
|
14
|
+
- question: "写出下一个数字: 10, 11, 12, 13, 14, .."
|
|
15
|
+
answers: ["15", "fifteen","十五"]
|
|
16
|
+
- question: "五乘以五等于几?"
|
|
17
|
+
answers: ["25", "twenty-five", "二十五"]
|
|
18
|
+
- question: "十除以二等于几?"
|
|
19
|
+
answers: ["5", "five", "五"]
|
|
20
|
+
- question: 星期一过完是星期几?
|
|
21
|
+
answer: ["tuesday","周二", "二"]
|
|
22
|
+
- question: 一年的最后一个月是几月?
|
|
23
|
+
answer: ["december","十二月","十二"]
|
|
24
|
+
- question: 一小时有多少分钟?
|
|
25
|
+
answers: ["60", "sixty", "六十"]
|
|
26
|
+
- question: 下的反义词是什么?
|
|
27
|
+
answer: ["up","上"]
|
|
28
|
+
- question: 北的反义词是什么?
|
|
29
|
+
answer: ["south","南"]
|
|
30
|
+
- question: 坏的反义词是什么?
|
|
31
|
+
answer: ["good","好"]
|
|
32
|
+
- question: 四乘以4是多少?
|
|
33
|
+
answers: ["16", "sixteen", "十六"]
|
|
34
|
+
- question: 20后面的数字是?
|
|
35
|
+
answers: ["21", "twenty-one", "二十一"]
|
|
36
|
+
- question: 七月前面是几月?
|
|
37
|
+
answer: ["june","六月"]
|
|
38
|
+
- question: 十五除以三是多少?
|
|
39
|
+
answer: ["five", "5", "五"]
|
|
40
|
+
- question: 十四减四等于多少?
|
|
41
|
+
answers: ["10", "ten", "十"]
|
|
42
|
+
- question: "周一,周二 ,周三, __"
|
|
43
|
+
answer: ["Thursday","周四"]
|
data/lib/humanizer.rb
CHANGED
|
@@ -22,7 +22,7 @@ module Humanizer
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def humanizer_correct_answer?
|
|
25
|
-
humanizer_answer && humanizer_answers_for_id(humanizer_question_id).include?(humanizer_answer.downcase)
|
|
25
|
+
humanizer_answer && humanizer_answers_for_id(humanizer_question_id).include?(humanizer_answer.mb_chars.downcase)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
private
|
|
@@ -41,11 +41,11 @@ module Humanizer
|
|
|
41
41
|
|
|
42
42
|
def humanizer_answers_for_id(id)
|
|
43
43
|
question = humanizer_questions[id.to_i]
|
|
44
|
-
Array(question["answer"] || question["answers"]).map { |a| a.to_s.downcase }
|
|
44
|
+
Array(question["answer"] || question["answers"]).map { |a| a.to_s.mb_chars.downcase }
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def humanizer_check_answer
|
|
48
|
-
errors
|
|
48
|
+
errors.add(:humanizer_answer, I18n.translate("humanizer.validation.error")) unless humanizer_correct_answer?
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
module ClassMethods
|
data/lib/humanizer/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,88 +1,89 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: humanizer
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
- 2
|
|
7
|
-
- 4
|
|
8
|
-
- 3
|
|
9
|
-
version: 2.4.3
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 2.4.4
|
|
5
|
+
prerelease:
|
|
10
6
|
platform: ruby
|
|
11
|
-
authors:
|
|
7
|
+
authors:
|
|
12
8
|
- Antti Akonniemi
|
|
13
9
|
- Joao Carlos Cardoso
|
|
14
10
|
autorequire:
|
|
15
11
|
bindir: bin
|
|
16
12
|
cert_chain: []
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
dependencies:
|
|
21
|
-
- !ruby/object:Gem::Dependency
|
|
13
|
+
date: 2012-08-24 00:00:00.000000000 Z
|
|
14
|
+
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
22
16
|
name: bundler
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
requirements:
|
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
|
18
|
+
none: false
|
|
19
|
+
requirements:
|
|
26
20
|
- - ~>
|
|
27
|
-
- !ruby/object:Gem::Version
|
|
28
|
-
|
|
29
|
-
- 1
|
|
30
|
-
- 0
|
|
31
|
-
- 0
|
|
32
|
-
version: 1.0.0
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 1.1.3
|
|
33
23
|
type: :development
|
|
34
|
-
version_requirements: *id001
|
|
35
|
-
- !ruby/object:Gem::Dependency
|
|
36
|
-
name: rake
|
|
37
24
|
prerelease: false
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
none: false
|
|
27
|
+
requirements:
|
|
28
|
+
- - ~>
|
|
29
|
+
- !ruby/object:Gem::Version
|
|
30
|
+
version: 1.1.3
|
|
31
|
+
- !ruby/object:Gem::Dependency
|
|
32
|
+
name: rake
|
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
|
34
|
+
none: false
|
|
35
|
+
requirements:
|
|
36
|
+
- - ! '>='
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
45
39
|
type: :development
|
|
46
|
-
version_requirements: *id002
|
|
47
|
-
- !ruby/object:Gem::Dependency
|
|
48
|
-
name: rspec
|
|
49
40
|
prerelease: false
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
none: false
|
|
43
|
+
requirements:
|
|
44
|
+
- - ! '>='
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: rspec
|
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
|
50
|
+
none: false
|
|
51
|
+
requirements:
|
|
52
52
|
- - ~>
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
|
|
55
|
-
- 2
|
|
56
|
-
- 3
|
|
57
|
-
- 0
|
|
58
|
-
version: 2.3.0
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 2.11.0
|
|
59
55
|
type: :development
|
|
60
|
-
version_requirements: *id003
|
|
61
|
-
- !ruby/object:Gem::Dependency
|
|
62
|
-
name: activemodel
|
|
63
56
|
prerelease: false
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
58
|
+
none: false
|
|
59
|
+
requirements:
|
|
60
|
+
- - ~>
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: 2.11.0
|
|
63
|
+
- !ruby/object:Gem::Dependency
|
|
64
|
+
name: activemodel
|
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
|
66
|
+
none: false
|
|
67
|
+
requirements:
|
|
66
68
|
- - ~>
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
segments:
|
|
69
|
-
- 3
|
|
70
|
-
- 0
|
|
71
|
-
- 0
|
|
69
|
+
- !ruby/object:Gem::Version
|
|
72
70
|
version: 3.0.0
|
|
73
71
|
type: :development
|
|
74
|
-
|
|
72
|
+
prerelease: false
|
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
74
|
+
none: false
|
|
75
|
+
requirements:
|
|
76
|
+
- - ~>
|
|
77
|
+
- !ruby/object:Gem::Version
|
|
78
|
+
version: 3.0.0
|
|
75
79
|
description: reCAPTCHA was too much for us, so we created this. Simplest captcha ever.
|
|
76
|
-
email:
|
|
80
|
+
email:
|
|
77
81
|
- antti@kiskolabs.com
|
|
78
82
|
- joao@kiskolabs.com
|
|
79
83
|
executables: []
|
|
80
|
-
|
|
81
84
|
extensions: []
|
|
82
|
-
|
|
83
85
|
extra_rdoc_files: []
|
|
84
|
-
|
|
85
|
-
files:
|
|
86
|
+
files:
|
|
86
87
|
- lib/generators/humanizer_generator.rb
|
|
87
88
|
- lib/humanizer/version.rb
|
|
88
89
|
- lib/humanizer.rb
|
|
@@ -94,42 +95,35 @@ files:
|
|
|
94
95
|
- lib/generators/templates/locales/es.yml
|
|
95
96
|
- lib/generators/templates/locales/fi.yml
|
|
96
97
|
- lib/generators/templates/locales/fr.yml
|
|
98
|
+
- lib/generators/templates/locales/it.yml
|
|
97
99
|
- lib/generators/templates/locales/nl.yml
|
|
98
100
|
- lib/generators/templates/locales/pl.yml
|
|
99
101
|
- lib/generators/templates/locales/pt-BR.yml
|
|
100
102
|
- lib/generators/templates/locales/pt-PT.yml
|
|
101
103
|
- lib/generators/templates/locales/ru.yml
|
|
102
|
-
|
|
104
|
+
- lib/generators/templates/locales/zh-CN.yml
|
|
103
105
|
homepage: http://github.com/kiskolabs/humanizer
|
|
104
106
|
licenses: []
|
|
105
|
-
|
|
106
107
|
post_install_message:
|
|
107
108
|
rdoc_options: []
|
|
108
|
-
|
|
109
|
-
require_paths:
|
|
109
|
+
require_paths:
|
|
110
110
|
- lib
|
|
111
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
requirements:
|
|
120
|
-
- -
|
|
121
|
-
- !ruby/object:Gem::Version
|
|
122
|
-
segments:
|
|
123
|
-
- 1
|
|
124
|
-
- 3
|
|
125
|
-
- 6
|
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
|
+
none: false
|
|
113
|
+
requirements:
|
|
114
|
+
- - ! '>='
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0'
|
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
|
+
none: false
|
|
119
|
+
requirements:
|
|
120
|
+
- - ! '>='
|
|
121
|
+
- !ruby/object:Gem::Version
|
|
126
122
|
version: 1.3.6
|
|
127
123
|
requirements: []
|
|
128
|
-
|
|
129
124
|
rubyforge_project: humanizer
|
|
130
|
-
rubygems_version: 1.
|
|
125
|
+
rubygems_version: 1.8.23
|
|
131
126
|
signing_key:
|
|
132
127
|
specification_version: 3
|
|
133
128
|
summary: A really simple captcha solution
|
|
134
129
|
test_files: []
|
|
135
|
-
|