Module | CAPTCHA |
In: |
lib/captcha.rb
|
CAPTCHA stands for "Completely Automated Public Turing Test to Tell Computers and Humans Apart." This module provides classes that allow web sites to use randomly generated images, in concert with randomly generated keys and encrypted digests, to do such things as preventing automated registrations.
VERSION | = | "0.1.2" |
USE_CHARS | = | "123456789abcdefghijkmnpqrstuvwxyz!@&%$?+ABDEFGHMNQRT" |
FONT | = | "/usr/share/fonts/ttf-bitstream-vera/Vera.ttf" |
FONT_SIZE | = | 32.0 |
IMAGE_DIR | = | "/var/www/htdocs/img" |
IMAGE_URI | = | "/img/" |
CLEAN_UP_INTERVAL | = | 6.hours |
KEY_LENGTH | = | 6 |
X_SPACING | = | 15 |
Y_WIGGLE | = | 40 |
ROTATION | = | 20 |
TEMPLATE | = | File.join( default_template_path, "default.html" ) |
Determine the default template path. It first checks to see if there is a gem version of Ruby/CAPTCHA installed, and uses that as the base path. If there is no gem installed, it uses /usr/share/captcha/templates.