rack-turing-test 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack-turing-test.rb +4 -1
- data/lib/rack-turing-test/version.rb +1 -1
- metadata +5 -4
data/lib/rack-turing-test.rb
CHANGED
@@ -16,8 +16,11 @@ module Rack
|
|
16
16
|
/teoma/i,
|
17
17
|
]).freeze
|
18
18
|
|
19
|
+
# Returns true if the request came from bot.
|
20
|
+
# Sometimes, there's a case that the HTTP_USERAGENT is nil.
|
21
|
+
# It's very rare for ordinary browsers. So, simply we observe it as a bot.
|
19
22
|
def bot?
|
20
|
-
!!user_agent.match(PATTERN)
|
23
|
+
user_agent.nil? || !!user_agent.match(PATTERN)
|
21
24
|
end
|
22
25
|
end
|
23
26
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-turing-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Genki Takiuchi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-01-22 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: You can test if sender of request has intelligence.
|
@@ -70,3 +70,4 @@ specification_version: 3
|
|
70
70
|
summary: Bot detector for Rack::Request
|
71
71
|
test_files: []
|
72
72
|
|
73
|
+
has_rdoc:
|