acts_as_textcaptcha 4.6.0 → 4.7.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: 7cd97fc4b0edc1a595beef3a1e871ff8b5937e6edfdea0dfa03ca530d691b326
4
- data.tar.gz: 8336141cfe3f343e3947bf535c1c272780e5fde2cef8aae361b744eaa742fc42
3
+ metadata.gz: 97a85cf9e199655854243a2a751cd00e4c9c8b45b19eb6ae0b14293b7c1964b2
4
+ data.tar.gz: a26d0dbfb3a8a6a278099879f432ea2928a4add8388ba818421aaa665482f463
5
5
  SHA512:
6
- metadata.gz: cd6b5ac95853b10106180ba45b8ec003470479f099908f79d3aede8143df3026eaa331668605ab64f74cee152f4a6eefe9d169df450b7a8c1ead66a0152f2df0
7
- data.tar.gz: 65a7bb0302f22b8d583a918002b5fe1c6b2ffaa5ad68ddbb8df1dbc0cde1a549cf007326cad0e6ae6b4c97ded7a9b28b4d9ced4f5afcea10596013fb51aacac3
6
+ metadata.gz: f5756a2a22abc5bceae0a7303cb2f1a13213307d4b02a8e00cc8704ee372e16758f583da250e309858ff52bb4421559cba099459f95c2de2bb41c65813dee17b
7
+ data.tar.gz: 88acda928cfd9789e5d9334ef2644b2449066024f9f3e6f0e4c2b90ca343e6c298f06f9c82921c8be408a1eb4a187fbdd95811538c640a3b56aa7266366b2b61
@@ -0,0 +1,40 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ strategy:
15
+ matrix:
16
+ ruby-version:
17
+ - "3.1"
18
+ - "3.2"
19
+ - "3.3"
20
+ - "3.4"
21
+ gemfile:
22
+ - Gemfile
23
+ - gemfiles/rails_6.gemfile
24
+ exclude:
25
+ - ruby-version: "3.4"
26
+ gemfile: gemfiles/rails_6.gemfile
27
+ runs-on: ubuntu-latest
28
+ name: ${{ format('Tests (Ruby {0})', matrix.ruby-version) }}
29
+ continue-on-error: true
30
+ env:
31
+ BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - name: Set up Ruby
35
+ uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby-version }}
38
+ bundler-cache: true
39
+ - name: Run tests
40
+ run: bundle exec rake
@@ -0,0 +1,25 @@
1
+ name: Publish gem to RubyGems.org
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ jobs:
9
+ push:
10
+ name: Push gem to RubyGems.org
11
+ runs-on: ubuntu-latest
12
+
13
+ permissions:
14
+ id-token: write
15
+ contents: write
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ bundler-cache: true
23
+ ruby-version: ruby
24
+
25
+ - uses: rubygems/release-gem@v1
data/Appraisals CHANGED
@@ -1,19 +1,7 @@
1
- appraise "rails-4" do
2
- gem "rails", "4.2.11.3"
3
- gem "sqlite3", "~> 1.3.5"
4
- end
5
-
6
- appraise "rails-5" do
7
- gem "rails", "5.2.4.4"
8
- gem "sqlite3", "~> 1.4.2"
9
- end
10
-
11
1
  appraise "rails-6" do
12
- gem "rails", "6.0.3.4"
13
- gem "sqlite3", "~> 1.4.2"
2
+ gem "rails", "6.1.7.8"
14
3
  end
15
4
 
16
5
  appraise "rails-7" do
17
- gem "rails", "7.0.2.2"
18
- gem "sqlite3", "~> 1.4.2"
6
+ gem "rails", "7.2.0"
19
7
  end
data/CHANGELOG.md CHANGED
@@ -9,6 +9,13 @@ adheres to [Semantic Versioning][Semver].
9
9
 
10
10
  - Your contribution here!
11
11
 
12
+ ## [4.7.0] - 2024-10-03
13
+ ### Changed
14
+ - CI covers Latest Rails version 7, 6 and Ruby 3.1 -> 3.4
15
+ - Removed Apprasial
16
+ - Added GH workflow
17
+ - Dropped rubocop, simplecov
18
+
12
19
  ## [4.6.0] - 2022-02-14
13
20
  ### Changed
14
21
  - CI covers Latest Rails version 7 and Ruby 3.1
@@ -100,7 +107,8 @@ adheres to [Semantic Versioning][Semver].
100
107
  - README updated.
101
108
  - Test coverage improved.
102
109
 
103
- [Unreleased]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.6.0...HEAD
110
+ [Unreleased]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.7.0...HEAD
111
+ [4.7.0]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.6.0...v4.7.0
104
112
  [4.6.0]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.5.2...v4.6.0
105
113
  [4.5.2]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.5.1...v4.5.2
106
114
  [4.5.1]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.5.0...v4.5.1
data/README.md CHANGED
@@ -1,10 +1,8 @@
1
1
  ## ActAsTextcaptcha
2
2
 
3
+ [![Build](https://img.shields.io/github/actions/workflow/status/matthutchinson/acts_as_textcaptcha/build.yml?branch=main&style=flat)](https://github.com/matthutchinson/acts_as_textcaptcha/actions/workflows/build.yml)
3
4
  [![Gem](https://img.shields.io/gem/v/acts_as_textcaptcha.svg?style=flat)](http://rubygems.org/gems/acts_as_textcaptcha)
4
- [![Travis](https://img.shields.io/travis/com/matthutchinson/acts_as_textcaptcha/master.svg?style=flat)](https://travis-ci.com/matthutchinson/acts_as_textcaptcha)
5
5
  [![Depfu](https://img.shields.io/depfu/matthutchinson/acts_as_textcaptcha.svg?style=flat)](https://depfu.com/github/matthutchinson/acts_as_textcaptcha)
6
- [![Maintainability](https://api.codeclimate.com/v1/badges/c67969dd7b921477bdcc/maintainability)](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/maintainability)
7
- [![Test Coverage](https://api.codeclimate.com/v1/badges/c67969dd7b921477bdcc/test_coverage)](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/test_coverage)
8
6
 
9
7
  ActsAsTextcaptcha provides spam protection for Rails models with text-based
10
8
  logic question captchas. Questions are fetched from [Rob
@@ -18,16 +16,13 @@ are a good idea visit [textcaptcha.com](https://textcaptcha.com).
18
16
 
19
17
  ## Requirements
20
18
 
21
- * [Ruby](http://ruby-lang.org/) >= 2.5
22
- * [Rails](http://github.com/rails/rails) >= 4
19
+ * [Ruby](http://ruby-lang.org/) >= 3.1
20
+ * [Rails](http://github.com/rails/rails) >= 6.1
23
21
  * A valid [Rails.cache](http://guides.rubyonrails.org/caching_with_rails.html#cache-stores) (not `:null_store`)
24
22
 
25
23
  ## Demo
26
24
 
27
- Try a [working demo here](https://acts-as-textcaptcha-demo.herokuapp.com)!
28
- Or one-click deploy your own [demo app](https://github.com/matthutchinson/acts_as_textcaptcha_demo) to Heroku.
29
-
30
- [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy?template=https://github.com/matthutchinson/acts_as_textcaptcha_demo/tree/master)
25
+ Try a [working demo here](https://acts-as-textcaptcha.hiddenloop.dev)!
31
26
 
32
27
  ## Installation
33
28
 
@@ -210,8 +205,7 @@ The API may be unresponsive or return an unexpected response. If you've set
210
205
  ## Development
211
206
 
212
207
  Check out this repo and run `bin/setup`, this will install gem dependencies and
213
- generate docs. Use `bundle exec rake` to run tests and generate a coverage
214
- report.
208
+ generate docs. Use `bundle exec rake` to run tests.
215
209
 
216
210
  You can also run `bin/console` for an interactive prompt to experiment with the
217
211
  code.
@@ -257,10 +251,11 @@ Covenant](http://contributor-covenant.org) code of conduct. See
257
251
  [here](https://github.com/matthutchinson/acts_as_textcaptcha/blob/master/CODE_OF_CONDUCT.md)
258
252
  for more details.
259
253
 
260
- ## Todo
254
+ ## Ideas
261
255
 
256
+ * Check if AI models can beat this approach
262
257
  * Allow translatable user supplied questions and answers in config
263
- * Allow `Net::HTTP` to be swapped out for any another HTTP client.
258
+ * Allow `Net::HTTP` to be swapped out for any HTTP client.
264
259
 
265
260
  ## License
266
261
 
@@ -274,10 +269,8 @@ The code is available as open source under the terms of
274
269
 
275
270
  ## Links
276
271
 
277
- * [Demo](https://acts-as-textcaptcha-demo.herokuapp.com)
278
- * [Travis CI](http://travis-ci.com/matthutchinson/acts_as_textcaptcha)
279
- * [Maintainability](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/maintainability)
280
- * [Test Coverage](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/test_coverage)
272
+ * [CI](https://github.com/matthutchinson/acts_as_textcaptcha/actions/workflows/build.yml)
273
+ * [Demo](https://acts-as-textcaptcha.hiddenloop.dev)
281
274
  * [RDoc](http://rdoc.info/projects/matthutchinson/acts_as_textcaptcha)
282
275
  * [Wiki](http://wiki.github.com/matthutchinson/acts_as_textcaptcha/)
283
276
  * [Issues](http://github.com/matthutchinson/acts_as_textcaptcha/issues)
data/Rakefile CHANGED
@@ -3,7 +3,6 @@
3
3
  require "bundler/gem_tasks"
4
4
  require "rake/testtask"
5
5
  require "rdoc/task"
6
- require "rubocop/rake_task"
7
6
 
8
7
  # generate docs
9
8
  RDoc::Task.new do |rd|
@@ -21,19 +20,4 @@ Rake::TestTask.new(:test) do |t|
21
20
  t.test_files = FileList["test/**/*_test.rb"]
22
21
  end
23
22
 
24
- # run lint
25
- RuboCop::RakeTask.new(:rubocop) do |t|
26
- t.options = ["--display-cop-names"]
27
- end
28
-
29
- # run tests with code coverage (default)
30
- namespace :test do
31
- desc "Run all tests and features and generate a code coverage report"
32
- task :coverage do
33
- ENV["COVERAGE"] = "true"
34
- Rake::Task["test"].execute
35
- Rake::Task["rubocop"].execute
36
- end
37
- end
38
-
39
- task default: [:rubocop, "test:coverage"]
23
+ task default: ["test"]
@@ -30,7 +30,6 @@ Gem::Specification.new do |spec|
30
30
  }
31
31
 
32
32
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
33
- spec.test_files = `git ls-files -- {test}/*`.split("\n")
34
33
  spec.bindir = "bin"
35
34
  spec.require_paths = ["lib"]
36
35
 
@@ -39,24 +38,18 @@ Gem::Specification.new do |spec|
39
38
  spec.rdoc_options << "--title" << "ActAsTextcaptcha" << "--main" << "README.md" << "-ri"
40
39
 
41
40
  # non-gem dependecies
42
- spec.required_ruby_version = ">= 2.5"
41
+ spec.required_ruby_version = ">= 3.1"
43
42
 
44
43
  # dev gems
45
44
  spec.add_development_dependency("bundler")
46
- spec.add_development_dependency("pry-byebug")
47
45
  spec.add_development_dependency "rake"
48
46
 
49
- # Lint
50
- spec.add_development_dependency("rubocop")
51
-
52
47
  # docs
53
48
  spec.add_development_dependency("rdoc")
54
49
 
55
50
  # testing
56
- spec.add_development_dependency("appraisal")
51
+ spec.add_development_dependency("rails", "~> 7.2")
57
52
  spec.add_development_dependency("minitest")
58
- spec.add_development_dependency("rails", "~> 7.0.2.2")
59
- spec.add_development_dependency("simplecov", "~> 0.19.1")
60
53
  spec.add_development_dependency("sqlite3")
61
54
  spec.add_development_dependency("webmock")
62
55
  end
@@ -1,8 +1,6 @@
1
- # This file was generated by Appraisal
2
-
3
1
  source "https://rubygems.org"
4
2
 
5
- gem "rails", "6.0.3.4"
6
- gem "sqlite3", "~> 1.4.2"
3
+ gem "rails", "6.1.7.8"
4
+ gem "sqlite3", "1.4.2"
7
5
 
8
6
  gemspec path: "../"
@@ -7,11 +7,8 @@ module ActsAsTextcaptcha
7
7
  BASE_URL = "http://textcaptcha.com"
8
8
 
9
9
  def initialize(api_key: nil, api_endpoint: nil, raise_errors: false)
10
- self.uri = if api_endpoint
11
- URI(api_endpoint)
12
- else
13
- URI("#{BASE_URL}/#{api_key}.json")
14
- end
10
+ self.uri = URI(api_endpoint || "#{BASE_URL}/#{api_key}.json")
11
+
15
12
  self.raise_errors = raise_errors || false
16
13
  rescue URI::InvalidURIError => e
17
14
  raise ApiKeyError.new(api_key, e)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActsAsTextcaptcha
4
- VERSION = "4.6.0"
4
+ VERSION = "4.7.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.6.0
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Hutchinson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-14 00:00:00.000000000 Z
11
+ date: 2024-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: pry-byebug
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rake
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,20 +38,6 @@ dependencies:
52
38
  - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
41
  - !ruby/object:Gem::Dependency
70
42
  name: rdoc
71
43
  requirement: !ruby/object:Gem::Requirement
@@ -81,19 +53,19 @@ dependencies:
81
53
  - !ruby/object:Gem::Version
82
54
  version: '0'
83
55
  - !ruby/object:Gem::Dependency
84
- name: appraisal
56
+ name: rails
85
57
  requirement: !ruby/object:Gem::Requirement
86
58
  requirements:
87
- - - ">="
59
+ - - "~>"
88
60
  - !ruby/object:Gem::Version
89
- version: '0'
61
+ version: '7.2'
90
62
  type: :development
91
63
  prerelease: false
92
64
  version_requirements: !ruby/object:Gem::Requirement
93
65
  requirements:
94
- - - ">="
66
+ - - "~>"
95
67
  - !ruby/object:Gem::Version
96
- version: '0'
68
+ version: '7.2'
97
69
  - !ruby/object:Gem::Dependency
98
70
  name: minitest
99
71
  requirement: !ruby/object:Gem::Requirement
@@ -108,34 +80,6 @@ dependencies:
108
80
  - - ">="
109
81
  - !ruby/object:Gem::Version
110
82
  version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rails
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: 7.0.2.2
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: 7.0.2.2
125
- - !ruby/object:Gem::Dependency
126
- name: simplecov
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 0.19.1
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 0.19.1
139
83
  - !ruby/object:Gem::Dependency
140
84
  name: sqlite3
141
85
  requirement: !ruby/object:Gem::Requirement
@@ -177,10 +121,10 @@ extra_rdoc_files:
177
121
  - README.md
178
122
  - LICENSE
179
123
  files:
124
+ - ".github/workflows/build.yml"
125
+ - ".github/workflows/push_gem.yml"
180
126
  - ".gitignore"
181
- - ".rubocop.yml"
182
127
  - ".simplecov"
183
- - ".travis.yml"
184
128
  - Appraisals
185
129
  - CHANGELOG.md
186
130
  - CODE_OF_CONDUCT.md
@@ -193,11 +137,7 @@ files:
193
137
  - acts_as_textcaptcha.gemspec
194
138
  - bin/console
195
139
  - bin/setup
196
- - gemfiles/rails_3.gemfile
197
- - gemfiles/rails_4.gemfile
198
- - gemfiles/rails_5.gemfile
199
140
  - gemfiles/rails_6.gemfile
200
- - gemfiles/rails_7.gemfile
201
141
  - lib/acts_as_textcaptcha.rb
202
142
  - lib/acts_as_textcaptcha/errors.rb
203
143
  - lib/acts_as_textcaptcha/framework/rails.rb
@@ -219,7 +159,7 @@ metadata:
219
159
  bug_tracker_uri: https://github.com/matthutchinson/acts_as_textcaptcha/issues
220
160
  allowed_push_host: https://rubygems.org
221
161
  rubygems_mfa_required: 'true'
222
- post_install_message:
162
+ post_install_message:
223
163
  rdoc_options:
224
164
  - "--title"
225
165
  - ActAsTextcaptcha
@@ -232,15 +172,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
232
172
  requirements:
233
173
  - - ">="
234
174
  - !ruby/object:Gem::Version
235
- version: '2.5'
175
+ version: '3.1'
236
176
  required_rubygems_version: !ruby/object:Gem::Requirement
237
177
  requirements:
238
178
  - - ">="
239
179
  - !ruby/object:Gem::Version
240
180
  version: '0'
241
181
  requirements: []
242
- rubygems_version: 3.3.3
243
- signing_key:
182
+ rubygems_version: 3.5.16
183
+ signing_key:
244
184
  specification_version: 4
245
185
  summary: A text-based logic question captcha for Rails
246
186
  test_files: []