recaptcha 4.8.0 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c434e585eb9173141c68b0d58ef1768f94b022ae1cdd36b8e05c3c492ce10fcf
4
- data.tar.gz: 7dd6cf798980cfadfede4bc86e0a5500573ba04e5123f445e9109f9fcdc96ef1
3
+ metadata.gz: bc4c5713b3894cd42422e8e60c5410c5e15d2555eb78fadfcbd643bd7a6c3a82
4
+ data.tar.gz: 3ce3f69e5a16bff9e5fa60dcec5b20896044a95a91c049b1a6f5a8b53cabb10d
5
5
  SHA512:
6
- metadata.gz: e5f40f9c46f92729779145ec5a85fd6ee1def8b2a9bab652f8064012ac41d4068fd60733f8bf7ae20189d27dfefdb1b0f378dbd8ee1ba917f3e3db398e0ff89a
7
- data.tar.gz: 82e4fdcfee5d2d306419c7c82fffe3c42f7673b28ed584cd19f61c174668fd3c6d54dae528ae988ba93856aa086e88a3f1d56693130119182ad005a0a18d7e06
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", require: "recaptcha/rails"
19
+ gem "recaptcha"
20
20
  ```
21
21
 
22
22
  Keep keys out of the code base with environment variables.<br/>
@@ -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
- frameborder="0" scrolling="no"
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;" value="">
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Recaptcha
2
4
  # This class enables detailed configuration of the recaptcha services.
3
5
  #
@@ -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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
 
3
5
  module Recaptcha
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Recaptcha
2
- VERSION = "4.8.0".freeze
4
+ VERSION = '4.9.0'
3
5
  end
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.8.0
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-04-06 00:00:00.000000000 Z
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.3
190
+ rubygems_version: 2.7.6
190
191
  signing_key:
191
192
  specification_version: 4
192
193
  summary: Helpers for the reCAPTCHA API