acts_as_textcaptcha 4.4.1 → 4.6.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 +4 -4
- data/.rubocop.yml +1165 -0
- data/.simplecov +4 -2
- data/.travis.yml +36 -9
- data/Appraisals +14 -6
- data/CHANGELOG.md +35 -3
- data/CODE_OF_CONDUCT.md +1 -2
- data/Gemfile +3 -1
- data/PULL_REQUEST_TEMPLATE.md +16 -0
- data/README.md +42 -14
- data/Rakefile +18 -10
- data/acts_as_textcaptcha.gemspec +35 -38
- data/gemfiles/rails_3.gemfile +2 -1
- data/gemfiles/rails_4.gemfile +3 -2
- data/gemfiles/rails_5.gemfile +3 -2
- data/gemfiles/rails_6.gemfile +8 -0
- data/gemfiles/rails_7.gemfile +8 -0
- data/lib/acts_as_textcaptcha/errors.rb +2 -0
- data/lib/acts_as_textcaptcha/framework/rails.rb +3 -1
- data/lib/acts_as_textcaptcha/railtie.rb +9 -0
- data/lib/{tasks → acts_as_textcaptcha/tasks}/textcaptcha.rake +6 -5
- data/lib/acts_as_textcaptcha/textcaptcha.rb +89 -95
- data/lib/acts_as_textcaptcha/textcaptcha_api.rb +36 -37
- data/lib/acts_as_textcaptcha/textcaptcha_cache.rb +8 -9
- data/lib/acts_as_textcaptcha/textcaptcha_config.rb +37 -36
- data/lib/acts_as_textcaptcha/textcaptcha_helper.rb +12 -13
- data/lib/acts_as_textcaptcha/version.rb +3 -1
- data/lib/acts_as_textcaptcha.rb +9 -6
- metadata +48 -29
data/.simplecov
CHANGED
data/.travis.yml
CHANGED
@@ -1,16 +1,42 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
gemfile:
|
4
|
-
- gemfiles/rails_3.gemfile
|
5
4
|
- gemfiles/rails_4.gemfile
|
6
5
|
- gemfiles/rails_5.gemfile
|
6
|
+
- gemfiles/rails_6.gemfile
|
7
|
+
- gemfiles/rails_7.gemfile
|
8
|
+
|
7
9
|
rvm:
|
8
|
-
- 2.
|
9
|
-
- 2.
|
10
|
-
- 2.
|
11
|
-
-
|
12
|
-
|
13
|
-
-
|
10
|
+
- 2.5.8
|
11
|
+
- 2.6.6
|
12
|
+
- 2.7.2
|
13
|
+
- 3.0.0
|
14
|
+
- 3.1.0
|
15
|
+
- ruby-head
|
16
|
+
|
17
|
+
matrix:
|
18
|
+
allow_failures:
|
19
|
+
- rvm: ruby-head
|
20
|
+
exclude:
|
21
|
+
- rvm: 2.7.2
|
22
|
+
gemfile: gemfiles/rails_4.gemfile
|
23
|
+
- rvm: 3.0.0
|
24
|
+
gemfile: gemfiles/rails_4.gemfile
|
25
|
+
- rvm: 3.1.0
|
26
|
+
gemfile: gemfiles/rails_4.gemfile
|
27
|
+
- rvm: 3.0.0
|
28
|
+
gemfile: gemfiles/rails_5.gemfile
|
29
|
+
- rvm: 3.1.0
|
30
|
+
gemfile: gemfiles/rails_5.gemfile
|
31
|
+
- rvm: ruby-head
|
32
|
+
gemfile: gemfiles/rails_4.gemfile
|
33
|
+
- rvm: ruby-head
|
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
|
39
|
+
|
14
40
|
deploy:
|
15
41
|
provider: rubygems
|
16
42
|
api_key:
|
@@ -22,9 +48,10 @@ deploy:
|
|
22
48
|
env:
|
23
49
|
global:
|
24
50
|
- CC_TEST_REPORTER_ID=3ff570478529bcdd11ef42d33229702118aa36b17a3de01c3f6d5a9c58fc7a4c
|
51
|
+
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
|
25
52
|
before_script:
|
26
53
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
27
54
|
- chmod +x ./cc-test-reporter
|
28
|
-
- ./cc-test-reporter before-build
|
55
|
+
- ./cc-test-reporter before-build - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
|
29
56
|
after_script:
|
30
|
-
- ./cc-test-reporter after-build
|
57
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -t simplecov
|
data/Appraisals
CHANGED
@@ -1,11 +1,19 @@
|
|
1
|
-
appraise "rails-3" do
|
2
|
-
gem "rails", "3.2.22.5"
|
3
|
-
end
|
4
|
-
|
5
1
|
appraise "rails-4" do
|
6
|
-
gem "rails", "4.2.
|
2
|
+
gem "rails", "4.2.11.3"
|
3
|
+
gem "sqlite3", "~> 1.3.5"
|
7
4
|
end
|
8
5
|
|
9
6
|
appraise "rails-5" do
|
10
|
-
gem "rails", "5.2.
|
7
|
+
gem "rails", "5.2.4.4"
|
8
|
+
gem "sqlite3", "~> 1.4.2"
|
9
|
+
end
|
10
|
+
|
11
|
+
appraise "rails-6" do
|
12
|
+
gem "rails", "6.0.3.4"
|
13
|
+
gem "sqlite3", "~> 1.4.2"
|
14
|
+
end
|
15
|
+
|
16
|
+
appraise "rails-7" do
|
17
|
+
gem "rails", "7.0.2.2"
|
18
|
+
gem "sqlite3", "~> 1.4.2"
|
11
19
|
end
|
data/CHANGELOG.md
CHANGED
@@ -2,13 +2,38 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
The format is based on [Keep a Changelog]
|
6
|
-
adheres to [Semantic Versioning]
|
5
|
+
The format is based on [Keep a Changelog][KeepAChangelog] and this project
|
6
|
+
adheres to [Semantic Versioning][Semver].
|
7
7
|
|
8
8
|
## [Unreleased]
|
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
|
+
|
17
|
+
## [4.5.2] - 2021-01-28
|
18
|
+
### Changed
|
19
|
+
- CI covers Latest Rails version 6,5,4 and Ruby 3,2.7,2.6,2.5
|
20
|
+
### Removed
|
21
|
+
- Support for Ruby < 2.5 (EOL versions not supported)
|
22
|
+
- No longer testing against Rails 3 in CI
|
23
|
+
|
24
|
+
## [4.5.1] - 2020-01-28
|
25
|
+
### Fixed
|
26
|
+
- add Rails Railtie to fix rake task loading
|
27
|
+
### Removed
|
28
|
+
- Support for Ruby < 2.4 (EOL versions not supported)
|
29
|
+
|
30
|
+
## [4.5.0] - 2019-04-22
|
31
|
+
### Added
|
32
|
+
- `# frozen_string_literal: true` to all Ruby files
|
33
|
+
|
34
|
+
### Removed
|
35
|
+
- Support for Ruby < 2.3 (earlier versions no longer supported)
|
36
|
+
|
12
37
|
## [4.4.1] - 2018-05-20
|
13
38
|
### Changed
|
14
39
|
- Fetch from JSON endpoint, rather than XML
|
@@ -21,6 +46,9 @@ adheres to [Semantic Versioning](Semver).
|
|
21
46
|
- Allow API/network errors to be raised with `raise_errors` option
|
22
47
|
- Allow endpoint to be configured with `api_endpoint` option
|
23
48
|
|
49
|
+
### Removed
|
50
|
+
- Coveralls (now Code Climate & SimpleCov)
|
51
|
+
|
24
52
|
## [4.3.0] - 2018-02-18
|
25
53
|
### Changed
|
26
54
|
- Update README, fixed Code Climate
|
@@ -72,7 +100,11 @@ adheres to [Semantic Versioning](Semver).
|
|
72
100
|
- README updated.
|
73
101
|
- Test coverage improved.
|
74
102
|
|
75
|
-
[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
|
105
|
+
[4.5.2]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.5.1...v4.5.2
|
106
|
+
[4.5.1]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.5.0...v4.5.1
|
107
|
+
[4.5.0]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.4.1...v4.5.0
|
76
108
|
[4.4.1]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.3.0...v4.4.1
|
77
109
|
[4.3.0]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.2.0...v4.3.0
|
78
110
|
[4.2.0]: https://github.com/matthutchinson/acts_as_textcaptcha/compare/v4.1.3...v4.2.0
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
55
55
|
## Enforcement
|
56
56
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at
|
58
|
+
reported by contacting the project team at matt@hiddenloop.com. All
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
60
60
|
is deemed necessary and appropriate to the circumstances. The project team is
|
61
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
@@ -71,4 +71,3 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi
|
|
71
71
|
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
72
|
|
73
73
|
[homepage]: https://www.contributor-covenant.org
|
74
|
-
[maintainer]: https://github.com/matthutchinson
|
data/Gemfile
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
Explain what you're changing and why here.
|
3
|
+
|
4
|
+
---
|
5
|
+
#### :memo: Checklist
|
6
|
+
|
7
|
+
Please check this list and leave it intact for the reviewer. Thanks! :heart:
|
8
|
+
|
9
|
+
- [ ] Commit messages provide context (why not just what, some tips [here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)).
|
10
|
+
- [ ] If relevant, mention GitHub issue number above and include in a commit message.
|
11
|
+
- [ ] Latest code from master merged.
|
12
|
+
- [ ] New behaviour has test coverage.
|
13
|
+
- [ ] Avoid duplicating code.
|
14
|
+
- [ ] No commented out code.
|
15
|
+
- [ ] Avoid comments for your code, write code that explains itself.
|
16
|
+
- [ ] Changes are simple, useful, clear and brief.
|
data/README.md
CHANGED
@@ -1,32 +1,31 @@
|
|
1
1
|
## ActAsTextcaptcha
|
2
2
|
|
3
3
|
[](http://rubygems.org/gems/acts_as_textcaptcha)
|
4
|
-
[](https://travis-ci.
|
4
|
+
[](https://travis-ci.com/matthutchinson/acts_as_textcaptcha)
|
5
5
|
[](https://depfu.com/github/matthutchinson/acts_as_textcaptcha)
|
6
6
|
[](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/maintainability)
|
7
7
|
[](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/test_coverage)
|
8
8
|
|
9
|
-
ActsAsTextcaptcha provides spam protection for Rails models with
|
10
|
-
logic question
|
9
|
+
ActsAsTextcaptcha provides spam protection for Rails models with text-based
|
10
|
+
logic question captchas. Questions are fetched from [Rob
|
11
11
|
Tuley's](https://twitter.com/robtuley)
|
12
|
-
[textcaptcha.com](
|
12
|
+
[textcaptcha.com](https://textcaptcha.com/). They can be solved easily by humans
|
13
13
|
but are tough for robots to crack.
|
14
14
|
|
15
15
|
The gem can also be configured with your own questions; as an alternative, or as
|
16
16
|
a fallback to handle any API issues. For reasons on why logic based captchas
|
17
|
-
are a good idea visit [textcaptcha.com](
|
17
|
+
are a good idea visit [textcaptcha.com](https://textcaptcha.com).
|
18
18
|
|
19
19
|
## Requirements
|
20
20
|
|
21
|
-
* [Ruby](http://ruby-lang.org/) >= 2.
|
22
|
-
* [Rails](http://github.com/rails/rails) >=
|
23
|
-
* [Rails.cache](http://guides.rubyonrails.org/caching_with_rails.html#cache-stores)
|
21
|
+
* [Ruby](http://ruby-lang.org/) >= 2.5
|
22
|
+
* [Rails](http://github.com/rails/rails) >= 4
|
23
|
+
* A valid [Rails.cache](http://guides.rubyonrails.org/caching_with_rails.html#cache-stores) (not `:null_store`)
|
24
24
|
|
25
25
|
## Demo
|
26
26
|
|
27
27
|
Try a [working demo here](https://acts-as-textcaptcha-demo.herokuapp.com)!
|
28
|
-
|
29
|
-
[here](https://github.com/matthutchinson/acts_as_textcaptcha_demo) for details.
|
28
|
+
Or one-click deploy your own [demo app](https://github.com/matthutchinson/acts_as_textcaptcha_demo) to Heroku.
|
30
29
|
|
31
30
|
[](https://www.heroku.com/deploy?template=https://github.com/matthutchinson/acts_as_textcaptcha_demo/tree/master)
|
32
31
|
|
@@ -60,7 +59,26 @@ def new
|
|
60
59
|
end
|
61
60
|
```
|
62
61
|
|
63
|
-
|
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
|
64
82
|
`textcaptcha_fields` helper. Arrange the HTML within this block as you like.
|
65
83
|
|
66
84
|
```ruby
|
@@ -76,6 +94,16 @@ If you'd prefer to construct your own form elements, take a look at the HTML
|
|
76
94
|
produced
|
77
95
|
[here](https://github.com/matthutchinson/acts_as_textcaptcha/blob/master/lib/acts_as_textcaptcha/textcaptcha_helper.rb).
|
78
96
|
|
97
|
+
Finally set a valid [cache
|
98
|
+
store](https://guides.rubyonrails.org/caching_with_rails.html#cache-stores) (not `:null_store`) for your environments:
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
# e.g. in config/environments/*.rb
|
102
|
+
config.cache_store = :memory_store
|
103
|
+
```
|
104
|
+
|
105
|
+
You can run `rails dev:cache` on to enable a memory store cache in the development environment.
|
106
|
+
|
79
107
|
## Configuration
|
80
108
|
|
81
109
|
The following options are available (only `api_key` is required):
|
@@ -218,7 +246,7 @@ Bug [reports](https://github.com/matthutchinson/acts_as_textcaptcha/issues) and
|
|
218
246
|
[pull requests](https://github.com/matthutchinson/acts_as_textcaptcha/pulls) are
|
219
247
|
welcome on GitHub. When submitting pull requests, remember to add tests covering
|
220
248
|
any new behaviour, and ensure all tests are passing on
|
221
|
-
[Travis](https://travis-ci.
|
249
|
+
[Travis](https://travis-ci.com/matthutchinson/acts_as_textcaptcha). Read the
|
222
250
|
[contributing
|
223
251
|
guidelines](https://github.com/matthutchinson/acts_as_textcaptcha/blob/master/CONTRIBUTING.md)
|
224
252
|
for more details.
|
@@ -242,12 +270,12 @@ The code is available as open source under the terms of
|
|
242
270
|
## Who's who?
|
243
271
|
|
244
272
|
* [ActsAsTextcaptcha](http://github.com/matthutchinson/acts_as_textcaptcha) and [little robot drawing](http://www.flickr.com/photos/hiddenloop/4541195635/) by [Matthew Hutchinson](http://matthewhutchinson.net)
|
245
|
-
* [TextCaptcha](
|
273
|
+
* [TextCaptcha](https://textcaptcha.com) API and service by [Rob Tuley](https://twitter.com/robtuley)
|
246
274
|
|
247
275
|
## Links
|
248
276
|
|
249
277
|
* [Demo](https://acts-as-textcaptcha-demo.herokuapp.com)
|
250
|
-
* [Travis CI](http://travis-ci.
|
278
|
+
* [Travis CI](http://travis-ci.com/matthutchinson/acts_as_textcaptcha)
|
251
279
|
* [Maintainability](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/maintainability)
|
252
280
|
* [Test Coverage](https://codeclimate.com/github/matthutchinson/acts_as_textcaptcha/test_coverage)
|
253
281
|
* [RDoc](http://rdoc.info/projects/matthutchinson/acts_as_textcaptcha)
|
data/Rakefile
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
3
5
|
require "rdoc/task"
|
4
|
-
|
6
|
+
require "rubocop/rake_task"
|
5
7
|
|
6
8
|
# generate docs
|
7
9
|
RDoc::Task.new do |rd|
|
8
|
-
rd.main
|
9
|
-
rd.title
|
10
|
-
rd.rdoc_dir =
|
11
|
-
rd.options
|
10
|
+
rd.main = "README.md"
|
11
|
+
rd.title = "ActsAsTextcaptcha"
|
12
|
+
rd.rdoc_dir = "doc"
|
13
|
+
rd.options << "--all"
|
12
14
|
rd.rdoc_files.include("README.md", "LICENSE", "lib/**/*.rb")
|
13
15
|
end
|
14
16
|
|
@@ -19,13 +21,19 @@ Rake::TestTask.new(:test) do |t|
|
|
19
21
|
t.test_files = FileList["test/**/*_test.rb"]
|
20
22
|
end
|
21
23
|
|
24
|
+
# run lint
|
25
|
+
RuboCop::RakeTask.new(:rubocop) do |t|
|
26
|
+
t.options = ["--display-cop-names"]
|
27
|
+
end
|
28
|
+
|
22
29
|
# run tests with code coverage (default)
|
23
30
|
namespace :test do
|
24
31
|
desc "Run all tests and features and generate a code coverage report"
|
25
32
|
task :coverage do
|
26
|
-
ENV[
|
27
|
-
Rake::Task[
|
33
|
+
ENV["COVERAGE"] = "true"
|
34
|
+
Rake::Task["test"].execute
|
35
|
+
Rake::Task["rubocop"].execute
|
28
36
|
end
|
29
37
|
end
|
30
38
|
|
31
|
-
task :
|
39
|
+
task default: [:rubocop, "test:coverage"]
|
data/acts_as_textcaptcha.gemspec
CHANGED
@@ -1,65 +1,62 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require "acts_as_textcaptcha/version"
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
8
|
+
spec.name = "acts_as_textcaptcha"
|
9
|
+
spec.version = ActsAsTextcaptcha::VERSION
|
10
|
+
spec.authors = ["Matthew Hutchinson"]
|
11
|
+
spec.email = ["matt@hiddenloop.com"]
|
11
12
|
spec.homepage = "http://github.com/matthutchinson/acts_as_textcaptcha"
|
12
|
-
spec.license
|
13
|
-
spec.summary
|
13
|
+
spec.license = "MIT"
|
14
|
+
spec.summary = "A text-based logic question captcha for Rails"
|
14
15
|
|
15
|
-
spec.description = <<-
|
16
|
-
ActsAsTextcaptcha provides spam protection for Rails models with
|
17
|
-
logic question
|
18
|
-
They can be solved easily by humans but are tough for robots
|
19
|
-
|
20
|
-
|
16
|
+
spec.description = <<-DESCRIPTION
|
17
|
+
ActsAsTextcaptcha provides spam protection for Rails models with text-based
|
18
|
+
logic question captchas. Questions are fetched from Rob Tuley's
|
19
|
+
textcaptcha.com They can be solved easily by humans but are tough for robots
|
20
|
+
to crack.
|
21
|
+
DESCRIPTION
|
21
22
|
|
22
23
|
spec.metadata = {
|
23
|
-
"homepage_uri"
|
24
|
-
"changelog_uri"
|
24
|
+
"homepage_uri" => "https://github.com/matthutchinson/acts_as_textcaptcha",
|
25
|
+
"changelog_uri" => "https://github.com/matthutchinson/acts_as_textcaptcha/blob/master/CHANGELOG.md",
|
25
26
|
"source_code_uri" => "https://github.com/matthutchinson/acts_as_textcaptcha",
|
26
27
|
"bug_tracker_uri" => "https://github.com/matthutchinson/acts_as_textcaptcha/issues",
|
28
|
+
"allowed_push_host" => "https://rubygems.org",
|
29
|
+
"rubygems_mfa_required" => "true"
|
27
30
|
}
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
33
|
-
else
|
34
|
-
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
35
|
-
end
|
36
|
-
|
37
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
38
|
-
spec.test_files = `git ls-files -- {test}/*`.split("\n")
|
39
|
-
spec.bindir = "bin"
|
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
|
+
spec.bindir = "bin"
|
40
35
|
spec.require_paths = ["lib"]
|
41
36
|
|
42
37
|
# documentation
|
43
|
-
spec.has_rdoc = true
|
44
38
|
spec.extra_rdoc_files = ["README.md", "LICENSE"]
|
45
39
|
spec.rdoc_options << "--title" << "ActAsTextcaptcha" << "--main" << "README.md" << "-ri"
|
46
40
|
|
47
41
|
# non-gem dependecies
|
48
|
-
spec.required_ruby_version = ">= 2.
|
42
|
+
spec.required_ruby_version = ">= 2.5"
|
49
43
|
|
50
44
|
# dev gems
|
51
|
-
spec.add_development_dependency(
|
45
|
+
spec.add_development_dependency("bundler")
|
46
|
+
spec.add_development_dependency("pry-byebug")
|
52
47
|
spec.add_development_dependency "rake"
|
53
|
-
|
48
|
+
|
49
|
+
# Lint
|
50
|
+
spec.add_development_dependency("rubocop")
|
54
51
|
|
55
52
|
# docs
|
56
|
-
spec.add_development_dependency(
|
53
|
+
spec.add_development_dependency("rdoc")
|
57
54
|
|
58
55
|
# testing
|
59
|
-
spec.add_development_dependency(
|
60
|
-
spec.add_development_dependency(
|
61
|
-
spec.add_development_dependency(
|
62
|
-
spec.add_development_dependency(
|
63
|
-
spec.add_development_dependency(
|
64
|
-
spec.add_development_dependency(
|
56
|
+
spec.add_development_dependency("appraisal")
|
57
|
+
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
|
+
spec.add_development_dependency("sqlite3")
|
61
|
+
spec.add_development_dependency("webmock")
|
65
62
|
end
|
data/gemfiles/rails_3.gemfile
CHANGED
data/gemfiles/rails_4.gemfile
CHANGED
data/gemfiles/rails_5.gemfile
CHANGED
@@ -1,16 +1,17 @@
|
|
1
|
-
|
2
|
-
require 'acts_as_textcaptcha/textcaptcha_config'
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
3
|
+
require "rails"
|
4
|
+
require "acts_as_textcaptcha/textcaptcha_config"
|
5
5
|
|
6
|
+
namespace :textcaptcha do
|
6
7
|
desc "Creates an example textcaptcha config at config/textcaptcha.yml"
|
7
8
|
task :config do
|
8
|
-
path = File.join((Rails.root
|
9
|
+
path = File.join((Rails.root || "."), "config", "textcaptcha.yml")
|
9
10
|
if File.exist?(path)
|
10
11
|
puts "Ooops, a textcaptcha config file at #{path} already exists ... aborting."
|
11
12
|
else
|
12
13
|
ActsAsTextcaptcha::TextcaptchaConfig.create(path: path)
|
13
|
-
puts "Done, config generated at #{path}\nEdit this file to add your TextCaptcha API key (see
|
14
|
+
puts "Done, config generated at #{path}\nEdit this file to add your TextCaptcha API key (see https://textcaptcha.com)."
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|