A really simple captcha gem
Go to file
Guillaume Dott d05f1b25ac Bump version to 0.1.2 2015-10-19 10:36:42 +02:00
lib Bump version to 0.1.2 2015-10-19 10:36:42 +02:00
.gitignore Ignore swap files 2013-01-11 10:44:51 +01:00
Gemfile First commit 2013-01-10 15:06:12 +01:00
LICENSE.txt Change license to AGPLv3 2013-01-15 15:54:16 +01:00
README.md Change license to AGPLv3 2013-01-15 15:54:16 +01:00
Rakefile First commit 2013-01-10 15:06:12 +01:00
really_simple_captcha.gemspec Update homepage in gemspec 2013-01-15 15:59:18 +01:00

README.md

ReallySimpleCaptcha

ReallySimpleCaptcha is just another captcha gem.

Requirements

  • Rails >= 3
  • RMagick

Usage

PlainCaptcha

The plain captcha display an image with distorted text and a text field.

To use it, add this line in the view file within the form tag :

<%= plain_captcha_tag %>

To verify the captcha in the controller, use :

plain_captcha_valid?

ReverseCaptcha

The reverse captcha add a text field hidden with CSS to trick bot into filling this field.

To use it, add this line in the view file within the form tag :

<%= reverse_captcha_tag %>

To verify the captcha in the controller, use :

reverse_captcha_valid?

Configuration

ReverseCaptcha and PlainCaptcha must be configured separately.

PlainCaptcha

ReallySimpleCaptcha::Captcha::PlainCaptcha.configure do |config|
  config.field_name = :plain_captcha

  config.text_length = 6
  # colors
  config.fill = 'darkblue'
  config.background_color = 'white'
  # font size
  config.pointsize = 22
  # image modification options
  config.width = 120
  config.height = 40
  config.implode_amount = 0.3
  config.wave_amplitude = 4.0
  config.wave_length = 60.0
end

ReverseCaptcha

ReallySimpleCaptcha::Captcha::ReverseCaptcha.configure do |config|
  config.field_name = :reverse_captcha
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

ReallySimpleCaptcha is released under the AGPLv3. Copyright (c) 2013 La Fourmi Immo.