racaptcha 0.2.0 → 0.2.1

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: dec1a0d703eb8ccfc53f47566764dc8250d8fcb37612399fe4c52597647b4541
4
- data.tar.gz: be5d3f05420806f2eacb170f776a2390fb53296873fed58017e6df0fb0e0875e
3
+ metadata.gz: a80c7408ad417d8f3fea20f1d934334f37de3289fc90165d16f23b3c84715d13
4
+ data.tar.gz: f1d66f613aee6a35590db8ead09bb92cebe8bb75e44f371c80290eeaf2e3597d
5
5
  SHA512:
6
- metadata.gz: a863263bc814cc5be17262ff1d11a4fc143231ff9e1aad4c7153987a059d0c5a1b33245908546d551031fbbc7726bf045bceef9a50c19287614df9a5d9868985
7
- data.tar.gz: aa74be8f8891145e26f9e144256e129d2b53eb00bad6a443dba371ae2c42d2ff86e0418dfe81e2e55b0054194d63c47157bdfa3edf0c3f9c44394a433710b699
6
+ metadata.gz: 4ef9ca7b1aa9eef11426535e5c09e3ce64325e5674c691c1e3c2e87d42980c5ec1082262c2cd73c6ae6ba934f3919134709e8921a78de01517e2841cd5e1d3ac
7
+ data.tar.gz: 22c419b540e631434119e0bc6903f4c564493d4154a7d805c9afa4b20dffb6193b9713fedbfc26e412adc5d0b78b23b7e45e1163638d2d1e2239f1f03966de40
data/lib/racaptcha.rb CHANGED
@@ -2,7 +2,6 @@ require "active_support/all"
2
2
  require "racaptcha/racaptcha"
3
3
  require "racaptcha/version"
4
4
  require "racaptcha/configuration"
5
- require "racaptcha/cache"
6
5
  require "racaptcha/errors/configuration"
7
6
 
8
7
  module RaCaptcha
@@ -27,6 +26,13 @@ module RaCaptcha
27
26
  config.instance_exec(&block)
28
27
  end
29
28
 
29
+ def cache
30
+ return @cache if defined? @cache
31
+
32
+ @cache = ActiveSupport::Cache.lookup_store(RaCaptcha.config.cache_store)
33
+ @cache
34
+ end
35
+
30
36
  # generate new captcha without cache
31
37
  def generate
32
38
  style = config.style == :colorful ? 1 : 0
@@ -1,3 +1,3 @@
1
1
  module RaCaptcha
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racaptcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - wangrui