aritcaptcha 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +10 -4
- data/VERSION +1 -1
- data/aritcaptcha.gemspec +1 -1
- data/lib/aritcaptcha/aritcaptcha_helper.rb +1 -1
- metadata +3 -3
data/README.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Aritcaptcha: A simple
|
1
|
+
# Aritcaptcha: A simple arithmetic captcha for Rails 3
|
2
2
|
|
3
|
-
Aritcaptcha provides a simple way to display a
|
3
|
+
Aritcaptcha provides a simple way to display a arithmetic captcha inside a page.
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
@@ -8,7 +8,7 @@ Use RubyGems to install:
|
|
8
8
|
|
9
9
|
$ gem install aritcaptcha
|
10
10
|
|
11
|
-
After the installation you can generate a simple
|
11
|
+
After the installation you can generate a simple arithmetic captcha inside a page:
|
12
12
|
|
13
13
|
<%= raw aritcaptcha_tag %>
|
14
14
|
|
@@ -18,7 +18,13 @@ If you want to use a numeric captcha that renders an image:
|
|
18
18
|
|
19
19
|
If you want to restrict the arithmetic operations:
|
20
20
|
|
21
|
-
<%= raw aritcaptcha_tag :operations => [:add, :sub]
|
21
|
+
<%= raw aritcaptcha_tag :operations => [:add, :sub] %> # only the operations of addition and subtraction are displayed
|
22
|
+
|
23
|
+
To validate the answer entered by the user, put this verification inside an action:
|
24
|
+
|
25
|
+
<% if verify_aritcaptcha(params) %>
|
26
|
+
# correct answer
|
27
|
+
<% end >
|
22
28
|
|
23
29
|
## Contributing to Aritcaptcha
|
24
30
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.3
|
data/aritcaptcha.gemspec
CHANGED
@@ -49,7 +49,7 @@ module Aritcaptcha
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def generate_image(equation_key, equation)
|
52
|
-
relative_name = "
|
52
|
+
relative_name = "equacao-#{equation_key}.png"
|
53
53
|
full_path = "#{Rails.root}/public/images/#{relative_name}"
|
54
54
|
|
55
55
|
unless File.file?(full_path)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aritcaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 3
|
10
|
+
version: 2.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Guilherme Nascimento
|