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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e756b5583199fa18a33fa9ca992d48acebffd43d290948a5fa5b857fddb6f2d
4
- data.tar.gz: 31ed6774f374b928be23b38b725c37d7bb5a163af6522d4e6365ba99be573cd5
3
+ metadata.gz: 7cd97fc4b0edc1a595beef3a1e871ff8b5937e6edfdea0dfa03ca530d691b326
4
+ data.tar.gz: 8336141cfe3f343e3947bf535c1c272780e5fde2cef8aae361b744eaa742fc42
5
5
  SHA512:
6
- metadata.gz: 77b9415ca1476acbf17f839675d6d97371fe3641d5512be3aed86d058acfbde2e4a41bc73a2c6be370c34f963b70ff0e2468f8393326a108d4c458bbe87cfc62
7
- data.tar.gz: c6309e86be034e61672ad0193d39657c2bf21a2a5bcd9e714cbcc91bb5ab4d0fc397dfa57542ff50604a5b8a1383f1b74613702d6f348bca849eba6f999967df
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
@@ -12,3 +12,8 @@ appraise "rails-6" do
12
12
  gem "rails", "6.0.3.4"
13
13
  gem "sqlite3", "~> 1.4.2"
14
14
  end
15
+
16
+ appraise "rails-7" do
17
+ gem "rails", "7.0.2.2"
18
+ gem "sqlite3", "~> 1.4.2"
19
+ end
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.5.2...HEAD
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
- Add the question and answer fields to your form using the
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 each config/environments/*.rb
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 modern generated Rails app to enable
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
 
@@ -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", "~> 6.0.3.4")
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")
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "6.1.1"
5
+ gem "rails", "6.0.3.4"
6
6
  gem "sqlite3", "~> 1.4.2"
7
7
 
8
8
  gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "7.0.2.2"
6
+ gem "sqlite3", "~> 1.4.2"
7
+
8
+ gemspec path: "../"
@@ -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.load(ERB.new(read_textcaptcha_config).result)[Rails.env]
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")
@@ -41,7 +41,7 @@ module ActsAsTextcaptcha
41
41
 
42
42
  def self.create(path: "./config/textcaptcha.yml")
43
43
  FileUtils.mkdir_p(File.dirname(path))
44
- File.open(path, "w") { |f| f.write(YAML) }
44
+ File.write(path, YAML)
45
45
  end
46
46
  end
47
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActsAsTextcaptcha
4
- VERSION = "4.5.2"
4
+ VERSION = "4.6.0"
5
5
  end
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.5.2
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: 2021-01-28 00:00:00.000000000 Z
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: 6.0.3.4
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: 6.0.3.4
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.2.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