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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2b845f0207215f181222b59d2efc2800dcc266142507cd3b556c684a7505574
4
- data.tar.gz: 81f27e0eefc00395702ba116c044616cef27068200873fd365d5bcb44580d982
3
+ metadata.gz: b308e19833b1334f3679d81759e743eaecdea0e90521362a63b3bc2eeea65c4f
4
+ data.tar.gz: 36dc88101bfde8ef8e531f19a41d14015982b79c1edec09aabc748608653dae1
5
5
  SHA512:
6
- metadata.gz: 9f0e311f96c9494233936704f82dbabf1902c67d636962586d82fe60ed8c3359aeea3992a7db29ad7bb2512b98dc67b4fe2495e3a264d7499ac89d4f2e184bfb
7
- data.tar.gz: 851da009708ee7a42958e5cb1747e6549c811842655996a5dccd2c13276de0f08948401ab2618bcd8a2eb064292de0ef71fe6136b23e4c898d4ee55f8eed2c4b
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(session) # Reload the 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?(session, params[: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(session)
5
+ def load_captcha
6
6
  Captcher.captcha_class.restore_or_create(Captcher.config, session)
7
7
  end
8
8
 
9
- def reload_captcha(session)
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(session, confirmation)
16
- captcha = load_captcha(session)
15
+ def confirm_captcha(confirmation)
16
+ captcha = load_captcha
17
17
  captcha.validate(confirmation)
18
18
  end
19
19
  alias confirm_captcha? confirm_captcha
@@ -1,3 +1,3 @@
1
1
  module Captcher
2
- VERSION = "0.2.1".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
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.2.1
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-27 00:00:00.000000000 Z
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