Update README
This commit is contained in:
parent
a8d031559a
commit
0203ae018e
73
README.md
73
README.md
@ -1,24 +1,69 @@
|
|||||||
# ReallySimpleCaptcha
|
# ReallySimpleCaptcha
|
||||||
|
|
||||||
TODO: Write a gem description
|
ReallySimpleCaptcha is just another captcha gem.
|
||||||
|
|
||||||
## Installation
|
## Requirements
|
||||||
|
|
||||||
Add this line to your application's Gemfile:
|
- Rails >= 3
|
||||||
|
- RMagick
|
||||||
gem 'really_simple_captcha'
|
|
||||||
|
|
||||||
And then execute:
|
|
||||||
|
|
||||||
$ bundle
|
|
||||||
|
|
||||||
Or install it yourself as:
|
|
||||||
|
|
||||||
$ gem install really_simple_captcha
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
TODO: Write usage instructions here
|
### 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.text_length = 6
|
||||||
|
|
||||||
|
# colors
|
||||||
|
config.fill = 'darkblue'
|
||||||
|
config.background_color = 'white'
|
||||||
|
# font size
|
||||||
|
config.pointsize = 22
|
||||||
|
# image modification options
|
||||||
|
config.implode_amount = 0.2
|
||||||
|
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
|
## Contributing
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user