acts_as_textcaptcha 4.5.2 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -0
- data/Appraisals +5 -0
- data/CHANGELOG.md +7 -1
- data/README.md +22 -4
- data/acts_as_textcaptcha.gemspec +3 -2
- data/gemfiles/rails_6.gemfile +1 -1
- data/gemfiles/rails_7.gemfile +8 -0
- data/lib/acts_as_textcaptcha/textcaptcha.rb +1 -3
- data/lib/acts_as_textcaptcha/textcaptcha_config.rb +1 -1
- data/lib/acts_as_textcaptcha/version.rb +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cd97fc4b0edc1a595beef3a1e871ff8b5937e6edfdea0dfa03ca530d691b326
|
4
|
+
data.tar.gz: 8336141cfe3f343e3947bf535c1c272780e5fde2cef8aae361b744eaa742fc42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd6b5ac95853b10106180ba45b8ec003470479f099908f79d3aede8143df3026eaa331668605ab64f74cee152f4a6eefe9d169df450b7a8c1ead66a0152f2df0
|
7
|
+
data.tar.gz: 65a7bb0302f22b8d583a918002b5fe1c6b2ffaa5ad68ddbb8df1dbc0cde1a549cf007326cad0e6ae6b4c97ded7a9b28b4d9ced4f5afcea10596013fb51aacac3
|
data/.travis.yml
CHANGED
@@ -4,12 +4,14 @@ gemfile:
|
|
4
4
|
- gemfiles/rails_4.gemfile
|
5
5
|
- gemfiles/rails_5.gemfile
|
6
6
|
- gemfiles/rails_6.gemfile
|
7
|
+
- gemfiles/rails_7.gemfile
|
7
8
|
|
8
9
|
rvm:
|
9
10
|
- 2.5.8
|
10
11
|
- 2.6.6
|
11
12
|
- 2.7.2
|
12
13
|
- 3.0.0
|
14
|
+
- 3.1.0
|
13
15
|
- ruby-head
|
14
16
|
|
15
17
|
matrix:
|
@@ -20,12 +22,20 @@ matrix:
|
|
20
22
|
gemfile: gemfiles/rails_4.gemfile
|
21
23
|
- rvm: 3.0.0
|
22
24
|
gemfile: gemfiles/rails_4.gemfile
|
25
|
+
- rvm: 3.1.0
|
26
|
+
gemfile: gemfiles/rails_4.gemfile
|
23
27
|
- rvm: 3.0.0
|
24
28
|
gemfile: gemfiles/rails_5.gemfile
|
29
|
+
- rvm: 3.1.0
|
30
|
+
gemfile: gemfiles/rails_5.gemfile
|
25
31
|
- rvm: ruby-head
|
26
32
|
gemfile: gemfiles/rails_4.gemfile
|
27
33
|
- rvm: ruby-head
|
28
34
|
gemfile: gemfiles/rails_5.gemfile
|
35
|
+
- rvm: 2.5.8
|
36
|
+
gemfile: gemfiles/rails_7.gemfile
|
37
|
+
- rvm: 2.6.6
|
38
|
+
gemfile: gemfiles/rails_7.gemfile
|
29
39
|
|
30
40
|
deploy:
|
31
41
|
provider: rubygems
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,11 @@ adheres to [Semantic Versioning][Semver].
|
|
9
9
|
|
10
10
|
- Your contribution here!
|
11
11
|
|
12
|
+
## [4.6.0] - 2022-02-14
|
13
|
+
### Changed
|
14
|
+
- CI covers Latest Rails version 7 and Ruby 3.1
|
15
|
+
- Use `YAML.safe_load` and allow aliases
|
16
|
+
|
12
17
|
## [4.5.2] - 2021-01-28
|
13
18
|
### Changed
|
14
19
|
- CI covers Latest Rails version 6,5,4 and Ruby 3,2.7,2.6,2.5
|
@@ -95,7 +100,8 @@ adheres to [Semantic Versioning][Semver].
|
|
95
100
|
- README updated.
|
96
101
|
- Test coverage improved.
|
97
102
|
|
98
|
-
[Unreleased]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.
|
103
|
+
[Unreleased]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.6.0...HEAD
|
104
|
+
[4.6.0]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.5.2...v4.6.0
|
99
105
|
[4.5.2]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.5.1...v4.5.2
|
100
106
|
[4.5.1]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.5.0...v4.5.1
|
101
107
|
[4.5.0]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.4.1...v4.5.0
|
data/README.md
CHANGED
@@ -59,7 +59,26 @@ def new
|
|
59
59
|
end
|
60
60
|
```
|
61
61
|
|
62
|
-
|
62
|
+
Make sure these textcaptcha params
|
63
|
+
(`:textcaptcha_answer, :textcaptcha_key`) are permitted in your create (or update) action:
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
def create
|
67
|
+
@comment = Comment.create(commment_params)
|
68
|
+
# ... etc
|
69
|
+
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def commment_params
|
74
|
+
params.require(:comment).permit(:textcaptcha_answer, :textcaptcha_key, :name, :comment_text)
|
75
|
+
end
|
76
|
+
```
|
77
|
+
|
78
|
+
**NOTE**: if the captcha is submitted incorrectly, a new captcha will be
|
79
|
+
automatically generated on the `@comment` object.
|
80
|
+
|
81
|
+
Next, add the question and answer fields to your form using the
|
63
82
|
`textcaptcha_fields` helper. Arrange the HTML within this block as you like.
|
64
83
|
|
65
84
|
```ruby
|
@@ -79,12 +98,11 @@ Finally set a valid [cache
|
|
79
98
|
store](https://guides.rubyonrails.org/caching_with_rails.html#cache-stores) (not `:null_store`) for your environments:
|
80
99
|
|
81
100
|
```ruby
|
82
|
-
# e.g. in
|
101
|
+
# e.g. in config/environments/*.rb
|
83
102
|
config.cache_store = :memory_store
|
84
103
|
```
|
85
104
|
|
86
|
-
You can run `rails dev:cache` on a
|
87
|
-
a memory store cache in the development environment.
|
105
|
+
You can run `rails dev:cache` on to enable a memory store cache in the development environment.
|
88
106
|
|
89
107
|
## Configuration
|
90
108
|
|
data/acts_as_textcaptcha.gemspec
CHANGED
@@ -25,7 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
"changelog_uri" => "https://github.com/matthutchinson/acts_as_textcaptcha/blob/master/CHANGELOG.md",
|
26
26
|
"source_code_uri" => "https://github.com/matthutchinson/acts_as_textcaptcha",
|
27
27
|
"bug_tracker_uri" => "https://github.com/matthutchinson/acts_as_textcaptcha/issues",
|
28
|
-
"allowed_push_host" => "https://rubygems.org"
|
28
|
+
"allowed_push_host" => "https://rubygems.org",
|
29
|
+
"rubygems_mfa_required" => "true"
|
29
30
|
}
|
30
31
|
|
31
32
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
@@ -54,7 +55,7 @@ Gem::Specification.new do |spec|
|
|
54
55
|
# testing
|
55
56
|
spec.add_development_dependency("appraisal")
|
56
57
|
spec.add_development_dependency("minitest")
|
57
|
-
spec.add_development_dependency("rails", "~>
|
58
|
+
spec.add_development_dependency("rails", "~> 7.0.2.2")
|
58
59
|
spec.add_development_dependency("simplecov", "~> 0.19.1")
|
59
60
|
spec.add_development_dependency("sqlite3")
|
60
61
|
spec.add_development_dependency("webmock")
|
data/gemfiles/rails_6.gemfile
CHANGED
@@ -122,17 +122,15 @@ module ActsAsTextcaptcha
|
|
122
122
|
|
123
123
|
private
|
124
124
|
|
125
|
-
# rubocop:disable Security/YAMLLoad
|
126
125
|
def build_textcaptcha_config(options)
|
127
126
|
if options.is_a?(Hash)
|
128
127
|
options
|
129
128
|
else
|
130
|
-
YAML.
|
129
|
+
YAML.safe_load(ERB.new(read_textcaptcha_config).result, aliases: true)[Rails.env]
|
131
130
|
end
|
132
131
|
rescue StandardError
|
133
132
|
raise ArgumentError, "could not find any textcaptcha options, in config/textcaptcha.yml or model - run rake textcaptcha:config to generate a template config file"
|
134
133
|
end
|
135
|
-
# rubocop:enable Security/YAMLLoad
|
136
134
|
|
137
135
|
def read_textcaptcha_config
|
138
136
|
File.read("#{Rails.root || "."}/config/textcaptcha.yml")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_textcaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Hutchinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 7.0.2.2
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 7.0.2.2
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: simplecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- gemfiles/rails_4.gemfile
|
198
198
|
- gemfiles/rails_5.gemfile
|
199
199
|
- gemfiles/rails_6.gemfile
|
200
|
+
- gemfiles/rails_7.gemfile
|
200
201
|
- lib/acts_as_textcaptcha.rb
|
201
202
|
- lib/acts_as_textcaptcha/errors.rb
|
202
203
|
- lib/acts_as_textcaptcha/framework/rails.rb
|
@@ -217,6 +218,7 @@ metadata:
|
|
217
218
|
source_code_uri: https://github.com/matthutchinson/acts_as_textcaptcha
|
218
219
|
bug_tracker_uri: https://github.com/matthutchinson/acts_as_textcaptcha/issues
|
219
220
|
allowed_push_host: https://rubygems.org
|
221
|
+
rubygems_mfa_required: 'true'
|
220
222
|
post_install_message:
|
221
223
|
rdoc_options:
|
222
224
|
- "--title"
|
@@ -237,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
239
|
- !ruby/object:Gem::Version
|
238
240
|
version: '0'
|
239
241
|
requirements: []
|
240
|
-
rubygems_version: 3.
|
242
|
+
rubygems_version: 3.3.3
|
241
243
|
signing_key:
|
242
244
|
specification_version: 4
|
243
245
|
summary: A text-based logic question captcha for Rails
|