recaptcha_check 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/recaptcha_check.rb +7 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5aa064a9eac3bab96394c495866efae18a3d4f208ec6ea7d1348f169ad77dfa
4
- data.tar.gz: cc5df9e982a043753e04caf2c5948f9a89498c2c578565bdd7fe7600b734a975
3
+ metadata.gz: 5464736b10d278eca81f52020cea05c716fa74dc4da300bf911042eae92ff640
4
+ data.tar.gz: f98a3f7e233735ca8e4dbc21134c4ea49408465fab0f65369228167661389090
5
5
  SHA512:
6
- metadata.gz: 4beecbb25ddaa0116e7abd209789a1288f6f2b303ba2b8544340ad606355f8aa8b976fbadcdef1edf8c3d0de9caa93613bed261730cc8ffb1c7094f86d17322d
7
- data.tar.gz: 301c5d4f178c9488b0e89d3e262fd66c015bfa5ab15878853562fd4dc4a46150928e7696ce6f3b2ab326b70594a6576dff55b29ed497c1bcf5935af2dc1ee8e4
6
+ metadata.gz: ff582f31ff5a06c1c3661b1cba6ed3650d1cf0e063350401ffa7ada5dcceba6ddf38a5733d873210074f8a224a8cab2dfc77a4a8b36d0bf6f13bbea75f934463
7
+ data.tar.gz: c1e1e0c9d2997fb738c620b421e9cba2ee4cdf88dcb1fd3e24c331265a77f4f171a710bcb9b0a77f2a473b2bc972fbcfc49c3eaef68ccc83795dd8df91b648e1
@@ -1,11 +1,17 @@
1
1
  class RecaptchaCheck
2
2
  def self.verify(params, ip = nil)
3
- new(params['g-recaptcha-response'], ip).verify
3
+ new(params['g-recaptcha-response'], ip).verify_recaptcha
4
4
  end
5
5
 
6
6
  def self.register(recaptcha_secret_key)
7
7
  ENV[RECAPTCHACHECK_SECRET_KEY] = recaptcha_secret_key
8
8
  end
9
+
10
+ def verify_recaptcha
11
+ require 'httparty'
12
+ recaptcha_response = HTTParty.get(recaptcha_url(@response, self.secret, @ip))
13
+ self.response_success?(recaptcha_response)
14
+ end
9
15
 
10
16
  private
11
17
 
@@ -16,12 +22,6 @@ class RecaptchaCheck
16
22
  @ip = ip
17
23
  end
18
24
 
19
- def verify
20
- require 'httparty'
21
- recaptcha_response = HTTParty.get(recaptcha_url(@response, self.secret, @ip))
22
- self.response_success?(recaptcha_response)
23
- end
24
-
25
25
  def recaptcha_url(response, secret, ip)
26
26
  "https://www.google.com/recaptcha/api/siteverify?secret=#{secret}&response=#{response}&remoteip=#{ip}"
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recaptcha_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Stauffer