re_captcha 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/LICENSE +1 -1
- data/README.md +13 -25
- data/lib/re_captcha/rails/helpers.rb +1 -1
- data/lib/re_captcha/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1eba206968dce044b36e2eaafa4d9c8634b042a
|
4
|
+
data.tar.gz: de66b0441b7098cb3ccc63dcfa4c491b01356f0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 392cd5eb41b0490225884e757f866bba25117d00b9954a244b4f59371d76ac5fb5620710eb998b3139b3e706a9948a8fe872f64b420f3226dd7d8795e4c40d18
|
7
|
+
data.tar.gz: 0432cefb448559c917bbeacbcc901eb8878dd49e2816459b87d0d68df354206e14a045d30d535b383f1e2ece04964d55289f30536b681db84afae673ebec91d0
|
data/.travis.yml
ADDED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Run console with preloaded library with ``` rake console ```
|
|
8
8
|
|
9
9
|
## Getting started
|
10
10
|
|
11
|
-
You
|
11
|
+
You may need to configure the gem with non default values:
|
12
12
|
|
13
13
|
```
|
14
14
|
ReCaptcha.configure do |config|
|
@@ -18,7 +18,9 @@ end
|
|
18
18
|
|
19
19
|
```
|
20
20
|
|
21
|
-
|
21
|
+
The options are:
|
22
|
+
- private_key (default: ENV['RECAPTCHA_PRIVATE_KEY'])
|
23
|
+
- public_key (default: ENV['RECAPTCHA_PUBLIC_KEY'])
|
22
24
|
- api_endpoint (default: https://www.google.com/recaptcha/)
|
23
25
|
- skipped_env (default: ['test', 'cucumber'])
|
24
26
|
- language_table: the table to map locale with language code
|
@@ -44,27 +46,15 @@ The default language table is the following:
|
|
44
46
|
|
45
47
|
## Display
|
46
48
|
|
47
|
-
|
48
|
-
such as ApplicationHelper (Rails)
|
49
|
+
The view helpers are automatically included in a Rails app. If you're not using Rails, include the helpers with ```include ReCaptcha::Helpers```.
|
49
50
|
|
50
|
-
|
51
|
-
module ApplicationHelper
|
52
|
-
include ReCaptcha::Helper
|
53
|
-
end
|
54
|
-
```
|
51
|
+
The available helper methods are the following:
|
55
52
|
|
56
|
-
|
57
|
-
```
|
58
|
-
recaptcha_script(language: nil)
|
59
|
-
```
|
60
|
-
language is one of the locale defined in the language table.
|
53
|
+
- ```recaptcha_script(language: nil)``` includes the script tag in the view. Language is one of the locale defined in the language table.
|
61
54
|
|
62
|
-
|
63
|
-
```
|
64
|
-
recaptcha_tags(options = {})
|
65
|
-
```
|
55
|
+
- ```recaptcha_tags(options = {})``` adds the reCaptcha box in the view.
|
66
56
|
|
67
|
-
The options are the following:
|
57
|
+
The options are the following (the default value is given):
|
68
58
|
- theme: 'light'
|
69
59
|
- type: 'image'
|
70
60
|
- size: 'normal'
|
@@ -76,11 +66,9 @@ Check the reCaptcha doc for the available values (https://developers.google.com/
|
|
76
66
|
|
77
67
|
## Verification
|
78
68
|
|
79
|
-
Assuming that your application uses Rails, verify the reCaptcha response using the method
|
80
|
-
|
81
|
-
|
82
|
-
```
|
69
|
+
Assuming that your application uses Rails, verify the reCaptcha response in your controller using the method ```recaptcha_valid?(model: nil, message: nil)```.
|
70
|
+
|
71
|
+
model and message are optional and enables you to set an error message on the :base attribute of the provided model.
|
83
72
|
|
84
|
-
This method can be called like this in a controller: ```ReCaptcha.client.recaptcha_valid?(...)```
|
85
73
|
|
86
|
-
|
74
|
+
If you're not using Rails, this method can be called like this: ```ReCaptcha.client.recaptcha_valid?(response, remote_ip: nil)```. No model nor message can be provided.
|
data/lib/re_captcha/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: re_captcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Jeusette
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
77
|
- ".rubocop.yml"
|
78
|
+
- ".travis.yml"
|
78
79
|
- CHANGELOG.md
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE
|