voight_kampff 1.1.4 → 2.0.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/.github/workflows/ci.yml +37 -0
- data/.ruby-version +1 -1
- data/README.md +30 -0
- data/lib/voight_kampff/rack.rb +2 -0
- data/lib/voight_kampff/rails.rb +3 -0
- data/lib/voight_kampff/test.rb +1 -1
- data/lib/voight_kampff/version.rb +1 -1
- data/lib/voight_kampff.rb +0 -2
- data/spec/lib/voight_kampff/test_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/voight_kampff.gemspec +2 -2
- metadata +8 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c69b1d4e546df4f4ab198fbec224b3cb55ac3bc5dfa8f89b02e98ce438335479
|
4
|
+
data.tar.gz: 18cf54d7053b41d3f9619b1cfdf851c0cc610fdba4a1996c54b9d3ede1b483e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a23c1eb73c61bb1db3dd5c1f0a43f4a27cbbc39cf898d78b143dd15c924961454ff7da7041e79efe8aba3ac614eba973da46c6dfff9170d791ee8e6141474d1e
|
7
|
+
data.tar.gz: 020c12b9fdf01106b7997d3c1052304352da0930baadd2bee8382e59624bea3066f0637a9cf0fee0ef0b9fc4504461927b0e97ceb62d45f15804adc0801691d1
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
name: CI
|
3
|
+
|
4
|
+
on:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- '**'
|
8
|
+
pull_request:
|
9
|
+
branches:
|
10
|
+
- '**'
|
11
|
+
schedule:
|
12
|
+
- cron: '0 4 1 * *'
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
rspec:
|
16
|
+
runs-on: ubuntu-20.04
|
17
|
+
strategy:
|
18
|
+
fail-fast: false
|
19
|
+
matrix:
|
20
|
+
ruby:
|
21
|
+
- '3.2'
|
22
|
+
- '3.1'
|
23
|
+
- '3.0'
|
24
|
+
- '2.7'
|
25
|
+
|
26
|
+
steps:
|
27
|
+
- name: Checkout
|
28
|
+
uses: actions/checkout@v2
|
29
|
+
|
30
|
+
- name: Setup Ruby
|
31
|
+
uses: ruby/setup-ruby@v1
|
32
|
+
with:
|
33
|
+
ruby-version: ${{ matrix.ruby }}
|
34
|
+
bundler-cache: true
|
35
|
+
|
36
|
+
- name: RSpec
|
37
|
+
run: bundle exec rspec
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
3.2.0
|
data/README.md
CHANGED
@@ -8,8 +8,21 @@ Voight-Kampff relies on a [user agent](http://en.wikipedia.org/wiki/User_agent)
|
|
8
8
|
|
9
9
|
Installation
|
10
10
|
------------
|
11
|
+
|
11
12
|
`gem install voight_kampff`
|
12
13
|
|
14
|
+
If you're using Rails and want to add `ActionDispatch::Request#bot?` and `ActionDispatch::Request#human?` methods, require `voight_kampff/rails`:
|
15
|
+
|
16
|
+
```Gemfile
|
17
|
+
gem 'voight_kampff', require: 'voight_kampff/rails'
|
18
|
+
```
|
19
|
+
|
20
|
+
if you're using pure Rack, require it the following way:
|
21
|
+
|
22
|
+
```Gemfile
|
23
|
+
gem 'voight_kampff', require: 'voight_kampff/rack'
|
24
|
+
```
|
25
|
+
|
13
26
|
Configuration
|
14
27
|
-------------
|
15
28
|
|
@@ -49,6 +62,23 @@ In general the `#bot?` command tends to include all of these and I'm sure it's u
|
|
49
62
|
|
50
63
|
Also, the gem no longer extends `ActionDispatch::Request` instead it extends `Rack::Request` which `ActionDispatch::Request` inherits from. This allows the same functionality for Rails while opening the gem up to other rack-based projects.
|
51
64
|
|
65
|
+
Upgrading to version 2.0
|
66
|
+
------------------------
|
67
|
+
|
68
|
+
If you use Rails and `ActionDispatch::Request#bot?` and `ActionDispatch::Request#human?` methods, change your gemfile:
|
69
|
+
|
70
|
+
```diff
|
71
|
+
-gem 'voight_kampff'
|
72
|
+
+gem 'voight_kampff', require: 'voight_kampff/rails'
|
73
|
+
```
|
74
|
+
|
75
|
+
If you use Rack, change your gemfile:
|
76
|
+
|
77
|
+
```diff
|
78
|
+
-gem 'voight_kampff'
|
79
|
+
+gem 'voight_kampff', require: 'voight_kampff/rack'
|
80
|
+
```
|
81
|
+
|
52
82
|
FAQ
|
53
83
|
---
|
54
84
|
__Q:__ __What's with the name?__
|
data/lib/voight_kampff/test.rb
CHANGED
data/lib/voight_kampff.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/voight_kampff.gemspec
CHANGED
@@ -21,9 +21,9 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.test_files = `git ls-files -- {tests}/**/*`.split("\n")
|
22
22
|
s.require_path = 'lib'
|
23
23
|
|
24
|
-
s.add_dependency 'rack', ['>= 1.4'
|
24
|
+
s.add_dependency 'rack', ['>= 1.4']
|
25
25
|
|
26
26
|
s.add_development_dependency 'combustion', '~> 1.1'
|
27
|
-
s.add_development_dependency 'rails', '
|
27
|
+
s.add_development_dependency 'rails', '>= 5.2'
|
28
28
|
s.add_development_dependency 'rspec-rails', '~> 3.8'
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voight_kampff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.4'
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '3.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '1.4'
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '3.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: combustion
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -48,14 +42,14 @@ dependencies:
|
|
48
42
|
name: rails
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
|
-
- - "
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '5.2'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
|
-
- - "
|
52
|
+
- - ">="
|
59
53
|
- !ruby/object:Gem::Version
|
60
54
|
version: '5.2'
|
61
55
|
- !ruby/object:Gem::Dependency
|
@@ -78,6 +72,7 @@ executables: []
|
|
78
72
|
extensions: []
|
79
73
|
extra_rdoc_files: []
|
80
74
|
files:
|
75
|
+
- ".github/workflows/ci.yml"
|
81
76
|
- ".gitignore"
|
82
77
|
- ".ruby-version"
|
83
78
|
- Gemfile
|
@@ -89,7 +84,9 @@ files:
|
|
89
84
|
- lib/voight_kampff.rb
|
90
85
|
- lib/voight_kampff/engine.rb
|
91
86
|
- lib/voight_kampff/methods.rb
|
87
|
+
- lib/voight_kampff/rack.rb
|
92
88
|
- lib/voight_kampff/rack_request.rb
|
89
|
+
- lib/voight_kampff/rails.rb
|
93
90
|
- lib/voight_kampff/test.rb
|
94
91
|
- lib/voight_kampff/version.rb
|
95
92
|
- spec/controllers/replicants_controller_spec.rb
|
@@ -123,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
120
|
- !ruby/object:Gem::Version
|
124
121
|
version: '0'
|
125
122
|
requirements: []
|
126
|
-
rubygems_version: 3.0.3
|
123
|
+
rubygems_version: 3.0.3.1
|
127
124
|
signing_key:
|
128
125
|
specification_version: 4
|
129
126
|
summary: Voight-Kampff bot detection
|