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 CHANGED
@@ -1,6 +1,6 @@
1
- # Aritcaptcha: A simple numeric captcha for Rails 3
1
+ # Aritcaptcha: A simple arithmetic captcha for Rails 3
2
2
 
3
- Aritcaptcha provides a simple way to display a numeric captcha inside a page.
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 numeric captcha inside a page:
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], :format => "image" %> # only the operations of addition and subtraction are displayed
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.2
1
+ 2.0.3
data/aritcaptcha.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{aritcaptcha}
8
- s.version = "2.0.2"
8
+ s.version = "2.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Guilherme Nascimento"]
@@ -49,7 +49,7 @@ module Aritcaptcha
49
49
  end
50
50
 
51
51
  def generate_image(equation_key, equation)
52
- relative_name = "#{equation_key}.png"
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: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 2
10
- version: 2.0.2
9
+ - 3
10
+ version: 2.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Guilherme Nascimento