recaptcha 4.3.1 → 4.4.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
  SHA1:
3
- metadata.gz: 91a422cb91f169dd8b16d4c2aaabaf8d8501dc2f
4
- data.tar.gz: 11a287fd4d8ef0274af222feef7c77bfbb6f2c38
3
+ metadata.gz: afcac99e8320b419d5b69964022d2dfb52787a35
4
+ data.tar.gz: dc49f2c7ac4f4cd78224cd3c1cdb8aa0ef794ef4
5
5
  SHA512:
6
- metadata.gz: 480304f23c3411ad9386b7eb7e99846b26ccc4667d8bec27ebdf02bbd7b398736939996118d0ed0b37753af6b1c75a77c4fd4bfa61b3b1c9a9207bd399cc4087
7
- data.tar.gz: 3ff8277354b3b38306d80ba10f39b91bc7036eef99f8478f106656f53a97f5d5d9d29daf309b2cbb8306542d0a24ba6671e9d50bc848402075a7acdae2c18090
6
+ metadata.gz: 73dfefd7474f71251c2e196f7a56f22ab2fa994383002b8aae79b15df3ed4bc6d2e45f4eb6bad85de0afd2f10a27bb3b51c7cd650abfc495f0c97f18e2c7ed69
7
+ data.tar.gz: edc37ce377e3d51788dbcee70d832cb86e68d27aa284ec65a5e72cc42868ecd7b57ca7986478bfe1edb0f16525725f7558177ec6a82bd946adbbd5b918732a49
data/README.md CHANGED
@@ -109,7 +109,7 @@ Some of the options available:
109
109
  ```Erb
110
110
  <%= form_for @foo, html: {id: 'invisible-recaptcha-form'} do |f| %>
111
111
  # ... other tags
112
- <%= invisible_recaptcha_tags callback: 'submitInvisibleRecaptchaForm' %>
112
+ <%= invisible_recaptcha_tags callback: 'submitInvisibleRecaptchaForm', text: 'Submit form' %>
113
113
  <% end %>
114
114
  ```
115
115
 
@@ -57,24 +57,27 @@ module Recaptcha
57
57
  def self.recaptcha_components(options = {})
58
58
  site_key = options.delete(:site_key) || Recaptcha.configuration.site_key!
59
59
  html = ""
60
- attributes = {
61
- class: ["g-recaptcha", options.delete(:class)].join(" ")
62
- }
60
+ attributes = {}
61
+ fallback_uri = ""
63
62
 
64
- hl = options.delete(:hl)
65
- script_url = Recaptcha.configuration.api_server_url
66
- script_url += "?hl=#{hl}" unless hl.to_s == ""
67
- html << %(<script src="#{script_url}" async defer></script>\n) unless options.delete(:script) == false
68
- fallback_uri = "#{script_url.chomp('.js')}/fallback?k=#{site_key}"
63
+ attributes["class"] = "g-recaptcha #{options.delete(:class)}"
69
64
 
70
- # Pull out reCaptcha specific data attributes.
71
- [:badge, :theme, :type, :callback, :expired_callback, :size].each do |data_attribute|
72
- if value = options.delete(data_attribute)
73
- attributes["data-#{data_attribute}"] = value
65
+ unless Recaptcha::Verify.skip?(options[:env])
66
+ hl = options.delete(:hl).to_s
67
+ script_url = Recaptcha.configuration.api_server_url
68
+ script_url << "?hl=#{hl}" unless hl == ""
69
+ html << %(<script src="#{script_url}" async defer></script>\n) unless options.delete(:script) == false
70
+ fallback_uri = %(#{script_url.chomp(".js")}/fallback?k=#{site_key})
71
+
72
+ # Pull out reCaptcha specific data attributes.
73
+ [:badge, :theme, :type, :callback, :expired_callback, :size].each do |data_attribute|
74
+ value = options.delete(data_attribute)
75
+
76
+ attributes["data-#{data_attribute}"] = value if value
74
77
  end
75
- end
76
78
 
77
- attributes["data-sitekey"] = site_key
79
+ attributes["data-sitekey"] = site_key
80
+ end
78
81
 
79
82
  # Append whatever that's left of options to be attributes on the tag.
80
83
  tag_attributes = attributes.merge(options).map { |k, v| %(#{k}="#{v}") }.join(" ")
@@ -1,3 +1,3 @@
1
1
  module Recaptcha
2
- VERSION = "4.3.1".freeze
2
+ VERSION = "4.4.0".freeze
3
3
  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.3.1
4
+ version: 4.4.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: 2017-04-28 00:00:00.000000000 Z
11
+ date: 2017-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json