recaptcha 4.8.0 → 4.9.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 +1 -1
- data/lib/recaptcha.rb +9 -2
- data/lib/recaptcha/client_helper.rb +7 -6
- data/lib/recaptcha/configuration.rb +2 -0
- data/lib/recaptcha/rails.rb +2 -9
- data/lib/recaptcha/railtie.rb +15 -0
- data/lib/recaptcha/verify.rb +2 -0
- data/lib/recaptcha/version.rb +3 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc4c5713b3894cd42422e8e60c5410c5e15d2555eb78fadfcbd643bd7a6c3a82
|
4
|
+
data.tar.gz: 3ce3f69e5a16bff9e5fa60dcec5b20896044a95a91c049b1a6f5a8b53cabb10d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be65178c04de055f2e2544eaa82d2620e882b2c76975797d8898b7e147587a2adc660b4d8674c7f1a5991102ce1054f47c3b9aa925247f176a55720c8d19f527
|
7
|
+
data.tar.gz: 1a3848e4dd61cc27990e6fc6c8dade61b12b74a61835e611e8f378e371da71813939d81c400afb610b9a1cc8814ca4f3025ddc7e047c5b3df6a262562c4415c9
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ which throws an error on failiure.
|
|
16
16
|
[obtain a reCAPTCHA API key](https://www.google.com/recaptcha/admin). Note: Use localhost or 127.0.0.1 in domain if using localhost:3000.
|
17
17
|
|
18
18
|
```Ruby
|
19
|
-
gem "recaptcha"
|
19
|
+
gem "recaptcha"
|
20
20
|
```
|
21
21
|
|
22
22
|
Keep keys out of the code base with environment variables.<br/>
|
data/lib/recaptcha.rb
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'recaptcha/configuration'
|
2
|
-
require 'recaptcha/client_helper'
|
3
|
-
require 'recaptcha/verify'
|
4
4
|
require 'uri'
|
5
5
|
require 'net/http'
|
6
6
|
|
7
|
+
if defined?(Rails)
|
8
|
+
require 'recaptcha/railtie'
|
9
|
+
else
|
10
|
+
require 'recaptcha/client_helper'
|
11
|
+
require 'recaptcha/verify'
|
12
|
+
end
|
13
|
+
|
7
14
|
module Recaptcha
|
8
15
|
CONFIG = {
|
9
16
|
'server_url' => 'https://www.google.com/recaptcha/api.js',
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Recaptcha
|
2
4
|
module ClientHelper
|
3
5
|
# Your public API can be specified in the +options+ hash or preferably
|
@@ -23,9 +25,8 @@ module Recaptcha
|
|
23
25
|
<div style="width: 302px; height: 422px; position: absolute;">
|
24
26
|
<iframe
|
25
27
|
src="#{fallback_uri}"
|
26
|
-
|
27
|
-
style="width: 302px; height:422px; border-style: none;">
|
28
|
-
title="ReCAPTCHA"
|
28
|
+
scrolling="no" name="ReCAPTCHA"
|
29
|
+
style="width: 302px; height: 422px; border-style: none; border: 0;">
|
29
30
|
</iframe>
|
30
31
|
</div>
|
31
32
|
</div>
|
@@ -35,7 +36,7 @@ module Recaptcha
|
|
35
36
|
<textarea id="g-recaptcha-response" name="g-recaptcha-response"
|
36
37
|
class="g-recaptcha-response"
|
37
38
|
style="width: 250px; height: 40px; border: 1px solid #c1c1c1;
|
38
|
-
margin: 10px 25px; padding: 0px; resize: none;"
|
39
|
+
margin: 10px 25px; padding: 0px; resize: none;">
|
39
40
|
</textarea>
|
40
41
|
</div>
|
41
42
|
</div>
|
@@ -57,9 +58,9 @@ module Recaptcha
|
|
57
58
|
end
|
58
59
|
|
59
60
|
def self.recaptcha_components(options = {})
|
60
|
-
html =
|
61
|
+
html = ''.dup
|
61
62
|
attributes = {}
|
62
|
-
fallback_uri =
|
63
|
+
fallback_uri = ''.dup
|
63
64
|
|
64
65
|
# Since leftover options get passed directly through as tag
|
65
66
|
# attributes, we must unconditionally delete all our options
|
data/lib/recaptcha/rails.rb
CHANGED
@@ -1,10 +1,3 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# deprecated, but let's not blow everyone up
|
1
3
|
require 'recaptcha'
|
2
|
-
|
3
|
-
module Recaptcha
|
4
|
-
class Railtie < Rails::Railtie
|
5
|
-
initializer :recaptcha do
|
6
|
-
ActionView::Base.send(:include, ::Recaptcha::ClientHelper)
|
7
|
-
ActionController::Base.send(:include, ::Recaptcha::Verify)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Recaptcha
|
4
|
+
class Railtie < Rails::Railtie
|
5
|
+
ActiveSupport.on_load(:action_view) do
|
6
|
+
require 'recaptcha/client_helper'
|
7
|
+
include Recaptcha::ClientHelper
|
8
|
+
end
|
9
|
+
|
10
|
+
ActiveSupport.on_load(:action_controller) do
|
11
|
+
require 'recaptcha/verify'
|
12
|
+
include Recaptcha::Verify
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/recaptcha/verify.rb
CHANGED
data/lib/recaptcha/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason L Perry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- lib/recaptcha/client_helper.rb
|
165
165
|
- lib/recaptcha/configuration.rb
|
166
166
|
- lib/recaptcha/rails.rb
|
167
|
+
- lib/recaptcha/railtie.rb
|
167
168
|
- lib/recaptcha/verify.rb
|
168
169
|
- lib/recaptcha/version.rb
|
169
170
|
homepage: http://github.com/ambethia/recaptcha
|
@@ -186,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
187
|
version: '0'
|
187
188
|
requirements: []
|
188
189
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.7.
|
190
|
+
rubygems_version: 2.7.6
|
190
191
|
signing_key:
|
191
192
|
specification_version: 4
|
192
193
|
summary: Helpers for the reCAPTCHA API
|