rack-turing-test 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +8 -0
- data/lib/rack-turing-test/version.rb +1 -1
- data/lib/rack-turing-test.rb +1 -0
- data/rack-turing-test.gemspec +1 -1
- data/spec/rack_turing_test_spec.rb +17 -0
- metadata +40 -43
data/Rakefile
CHANGED
data/lib/rack-turing-test.rb
CHANGED
data/rack-turing-test.gemspec
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. lib rack-turing-test])
|
2
|
+
require 'rspec'
|
3
|
+
|
4
|
+
describe Rack::TuringTest do
|
5
|
+
class TestRequest
|
6
|
+
include Rack::TuringTest
|
7
|
+
|
8
|
+
def initialize(ua) @ua = ua end
|
9
|
+
def user_agent; @ua end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should detect New-Sogou-Spider as a bot" do
|
13
|
+
ua = "New-Sogou-Spider/1.0 (compatible; MSIE 5.5; Windows 98)"
|
14
|
+
req = TestRequest.new ua
|
15
|
+
req.should be_bot
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,33 +1,39 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-turing-test
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 2
|
10
|
-
version: 0.1.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Genki Takiuchi
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
12
|
+
date: 2013-04-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
21
30
|
description: You can test if sender of request has intelligence.
|
22
|
-
email:
|
31
|
+
email:
|
23
32
|
- genki@s21g.com
|
24
33
|
executables: []
|
25
|
-
|
26
34
|
extensions: []
|
27
|
-
|
28
35
|
extra_rdoc_files: []
|
29
|
-
|
30
|
-
files:
|
36
|
+
files:
|
31
37
|
- .gitignore
|
32
38
|
- Gemfile
|
33
39
|
- README.md
|
@@ -35,39 +41,30 @@ files:
|
|
35
41
|
- lib/rack-turing-test.rb
|
36
42
|
- lib/rack-turing-test/version.rb
|
37
43
|
- rack-turing-test.gemspec
|
38
|
-
|
44
|
+
- spec/rack_turing_test_spec.rb
|
45
|
+
homepage: ''
|
39
46
|
licenses: []
|
40
|
-
|
41
47
|
post_install_message:
|
42
48
|
rdoc_options: []
|
43
|
-
|
44
|
-
require_paths:
|
49
|
+
require_paths:
|
45
50
|
- lib
|
46
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
52
|
none: false
|
48
|
-
requirements:
|
49
|
-
- -
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
|
52
|
-
|
53
|
-
- 0
|
54
|
-
version: "0"
|
55
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ! '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
58
|
none: false
|
57
|
-
requirements:
|
58
|
-
- -
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
segments:
|
62
|
-
- 0
|
63
|
-
version: "0"
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
64
63
|
requirements: []
|
65
|
-
|
66
64
|
rubyforge_project: rack-turing-test
|
67
|
-
rubygems_version: 1.8.
|
65
|
+
rubygems_version: 1.8.24
|
68
66
|
signing_key:
|
69
67
|
specification_version: 3
|
70
68
|
summary: Bot detector for Rack::Request
|
71
|
-
test_files:
|
72
|
-
|
73
|
-
has_rdoc:
|
69
|
+
test_files:
|
70
|
+
- spec/rack_turing_test_spec.rb
|