voight_kampff 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/voight_kampff/engine.rb +6 -0
- data/lib/voight_kampff/methods.rb +10 -0
- data/lib/voight_kampff/rack_request.rb +2 -9
- data/lib/voight_kampff/version.rb +1 -1
- data/lib/voight_kampff.rb +2 -1
- data/spec/controllers/replicants_controller_spec.rb +1 -1
- data/voight_kampff.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d84469d1aed5ee0786d045d4a064d96a9c96c6a1
|
4
|
+
data.tar.gz: 14e7e52f8fd161842dfd36eefc003dc4acf68c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b20c3443891cc19f27c0fe8f278330f2e7077a023a237f728b2ef8803a423d730378b6b312eced348c61cbf0d5e8f95b18006502c39c9171812984f02baffd43
|
7
|
+
data.tar.gz: 7fa0cfba7a668b9cdd760aeb04f2073b997908e429236aaf6e2c8bab2563448b14972b413eb5878abb7da132ee7e4cc419fc5dc574947067ed52fe94ddaf5816
|
data/lib/voight_kampff/engine.rb
CHANGED
@@ -1,11 +1,4 @@
|
|
1
1
|
# Reopen the Rack::Request class to add bot detection methods
|
2
|
-
|
3
|
-
|
4
|
-
VoightKampff::Test.new(user_agent).human?
|
5
|
-
end
|
6
|
-
|
7
|
-
def bot?
|
8
|
-
VoightKampff::Test.new(user_agent).bot?
|
9
|
-
end
|
10
|
-
alias :replicant? :bot?
|
2
|
+
Rack::Request.class_eval do
|
3
|
+
include VoightKampff::Methods
|
11
4
|
end
|
data/lib/voight_kampff.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require 'json'
|
2
2
|
|
3
3
|
require 'voight_kampff/test'
|
4
|
-
require 'voight_kampff/
|
4
|
+
require 'voight_kampff/methods'
|
5
|
+
require 'voight_kampff/rack_request' if defined?(Rack::Request)
|
5
6
|
require 'voight_kampff/engine' if defined?(Rails)
|
6
7
|
|
7
8
|
module VoightKampff
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe ReplicantsController, type: :controller do
|
4
4
|
let(:user_agent_string) { '' }
|
5
5
|
before do
|
6
|
-
|
6
|
+
expect_any_instance_of(ActionController::TestRequest).to receive(:user_agent).and_return user_agent_string
|
7
7
|
get :index
|
8
8
|
end
|
9
9
|
|
data/voight_kampff.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
|
24
24
|
s.add_dependency 'rack', ['>= 1.4', '< 3.0']
|
25
25
|
|
26
|
-
s.add_development_dependency 'rails', '~>
|
26
|
+
s.add_development_dependency 'rails', '~> 5.0'
|
27
27
|
s.add_development_dependency 'rspec-rails', '~> 3.3'
|
28
28
|
s.add_development_dependency 'combustion', '~> 0.5'
|
29
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voight_kampff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '5.0'
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '5.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec-rails
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/tasks/voight_kampff.rake
|
89
89
|
- lib/voight_kampff.rb
|
90
90
|
- lib/voight_kampff/engine.rb
|
91
|
+
- lib/voight_kampff/methods.rb
|
91
92
|
- lib/voight_kampff/rack_request.rb
|
92
93
|
- lib/voight_kampff/test.rb
|
93
94
|
- lib/voight_kampff/version.rb
|