rucaptcha 0.3.2.1 → 0.3.3

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
  SHA1:
3
- metadata.gz: 7ddf04eddc583be35415502ee00f014a113122b2
4
- data.tar.gz: c8bbe3e0d1637cd3f56e98ade1067972df9e5dbc
3
+ metadata.gz: ada49e11068101a36ddaa013cfd4f27cc424778e
4
+ data.tar.gz: 06ceaea4535e0ac78e327fb20ec976ed8d5282d6
5
5
  SHA512:
6
- metadata.gz: 78c9f3d52cf0123a7568402b378ec050b45c19015d59c789f31020e8179ea2591ea6e6f1e23d0baf62a7a98b4c6385a5e003f1e25d7ebdcc58044a25fd298a68
7
- data.tar.gz: 581c4bb3660c6ac96ef2da1a06be97103e99c0324722744332fef13f85189db099140bbcd314e8ba66a76cfe9f03879e6881af1919be32159d676279bc812b74
6
+ metadata.gz: 3b02d25df3976d381077272bae3a77f7a10398e3d359206eb40283df983cc1f805969707c3044fabb6ebd0db26fa99dff5f034ce36aba025892489595ad365e7
7
+ data.tar.gz: e4075f1cf9642c44f0a1b1ad1bafe65f47920d0bb3f69ebab08e156333191f4fa58cf0a52456d8dee4cc6c25d249f16d899ab7e9ca12a3e3984ad9e4c5c10cc7
@@ -1,3 +1,8 @@
1
+ 0.3.3
2
+ -----
3
+
4
+ - Add `config.expires_in` to allow change captcha code expire time.
5
+
1
6
  0.3.2.1
2
7
  -------
3
8
 
data/README.md CHANGED
@@ -65,6 +65,8 @@ RuCaptcha.configure do
65
65
  # Cache generated images in file store, this is config files limit, default: 100
66
66
  # set 0 to disable file cache.
67
67
  self.cache_limit = 100
68
+ # Custom captcha code expire time if you need, default: 2 minutes
69
+ # self.expires_in = 120
68
70
  end
69
71
  ```
70
72
 
@@ -18,6 +18,7 @@ module RuCaptcha
18
18
  @config.font_size = 45
19
19
  @config.implode = 0.4
20
20
  @config.cache_limit = 100
21
+ @config.expires_in = 2.minutes
21
22
  @config
22
23
  end
23
24
 
@@ -11,5 +11,7 @@ module RuCaptcha
11
11
  # Number of Captcha codes limit
12
12
  # set 0 to disable limit and file cache, default: 100
13
13
  attr_accessor :cache_limit
14
+ # session[:_rucaptcha] expire time, default 2 minutes
15
+ attr_accessor :expires_in
14
16
  end
15
17
  end
@@ -16,7 +16,7 @@ module RuCaptcha
16
16
  def verify_rucaptcha?(resource = nil)
17
17
  rucaptcha_at = session[:_rucaptcha_at].to_i
18
18
  # Captcha chars in Session expire in 2 minutes
19
- if (Time.now.to_i - rucaptcha_at) > 120
19
+ if (Time.now.to_i - rucaptcha_at) > RuCaptcha.config.expires_in
20
20
  return false
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  module RuCaptcha
2
- VERSION = '0.3.2.1'
2
+ VERSION = '0.3.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rucaptcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-28 00:00:00.000000000 Z
11
+ date: 2016-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: posix-spawn