captcher 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/controllers/concerns/captcher/captcha_aware.rb +4 -4
- data/lib/captcher/version.rb +1 -1
- metadata +2 -4
- data/spec/dummy/tmp/pids/server.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b308e19833b1334f3679d81759e743eaecdea0e90521362a63b3bc2eeea65c4f
|
4
|
+
data.tar.gz: 36dc88101bfde8ef8e531f19a41d14015982b79c1edec09aabc748608653dae1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ee7d6c0f8026794644cc02d990ca6a71bae8dcca7d69cca527d7f40c0c2279046112df706cfdd38c4563a3263051f5908bb6a318167c2262e8f5db69e78a3b4
|
7
|
+
data.tar.gz: 0c5825b78edbfc5b7ceedeb8aedb1e77e6eff1f4bceac3e1ee025ca71729626555ff0c46256f974aa73d8b9d8fa2671586e99917abfea37e9bf388b8c0e37e73
|
data/README.md
CHANGED
@@ -69,13 +69,13 @@ end
|
|
69
69
|
|
70
70
|
class MyController < ApplicationController
|
71
71
|
def index
|
72
|
-
reload_captcha
|
72
|
+
reload_captcha # Reload the captcha
|
73
73
|
# render response with success code ...
|
74
74
|
end
|
75
75
|
|
76
76
|
def create
|
77
77
|
@comment = Comment.new(comment_params)
|
78
|
-
captcha_check = confirm_captcha?(
|
78
|
+
captcha_check = confirm_captcha?(params[:captcha])
|
79
79
|
if @comment.valid? && captcha_check && @comment.save
|
80
80
|
# render response with success code ...
|
81
81
|
else
|
@@ -2,18 +2,18 @@ module Captcher
|
|
2
2
|
module CaptchaAware
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
|
-
def load_captcha
|
5
|
+
def load_captcha
|
6
6
|
Captcher.captcha_class.restore_or_create(Captcher.config, session)
|
7
7
|
end
|
8
8
|
|
9
|
-
def reload_captcha
|
9
|
+
def reload_captcha
|
10
10
|
captcha = Captcher.captcha_class.new(config: Captcher.config)
|
11
11
|
captcha.store(session)
|
12
12
|
captcha
|
13
13
|
end
|
14
14
|
|
15
|
-
def confirm_captcha(
|
16
|
-
captcha = load_captcha
|
15
|
+
def confirm_captcha(confirmation)
|
16
|
+
captcha = load_captcha
|
17
17
|
captcha.validate(confirmation)
|
18
18
|
end
|
19
19
|
alias confirm_captcha? confirm_captcha
|
data/lib/captcher/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: captcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Zinovyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -204,7 +204,6 @@ files:
|
|
204
204
|
- spec/dummy/tmp/cache/D56/E70/captcher__cached__%3Acode_captcha%3A7
|
205
205
|
- spec/dummy/tmp/cache/FB2/D60/captcher__cached__%3A542081068251d2ec3b7f3e453b29750c
|
206
206
|
- spec/dummy/tmp/development_secret.txt
|
207
|
-
- spec/dummy/tmp/pids/server.pid
|
208
207
|
- spec/helpers.rb
|
209
208
|
- spec/lib/captcher/captchas/cached_captcha_spec.rb
|
210
209
|
- spec/lib/captcher/captchas/code_captcha_spec.rb
|
@@ -300,7 +299,6 @@ test_files:
|
|
300
299
|
- spec/dummy/tmp/cache/FB2/D60/captcher__cached__%3A542081068251d2ec3b7f3e453b29750c
|
301
300
|
- spec/dummy/tmp/cache/111/E31/captcher__cached__%3A5688ef242c39cd01f3bf4f2c7c6ebb5f
|
302
301
|
- spec/dummy/tmp/development_secret.txt
|
303
|
-
- spec/dummy/tmp/pids/server.pid
|
304
302
|
- spec/spec_helper.rb
|
305
303
|
- spec/requests/captcha_management_spec.rb
|
306
304
|
- spec/helpers.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
19175
|