Permalink
Browse files

Bumped version number

  • Loading branch information...
1 parent 2cc0c64 commit 0c5fa9fbef47ce37c1b61287e8e3ebfe75131abf @genki committed Dec 24, 2011
Showing with 33 additions and 8 deletions.
  1. +9 −0 README.md
  2. +21 −3 lib/rack-turing-test.rb
  3. +2 −4 lib/rack-turing-test/version.rb
  4. +1 −1 rack-turing-test.gemspec
View
@@ -0,0 +1,9 @@
+Rack Turing Test
+================
+
+The bot detector for Rack::Request
+
+USAGE
+-----
+
+ request.bot? #=> true or false
View
@@ -1,9 +1,27 @@
require "rack-turing-test/version"
module Rack
- module Turing
- module Test
- # Your code goes here...
+ module TuringTest
+ PATTERN = Regexp.union(
+ /googlebot/i,
+ /mediapartners-google/i,
+ /slurp/i,
+ /ask.com/i,
+ /crawler/i,
+ /nutch/i,
+ /msnbot/i,
+ /bingbot/i,
+ /baidu/i,
+ /yetibot/i,
+ /teoma/i,
+ ).freeze
+
+ def bot?
+ !!user_agent.match(PATTERN)
end
end
+
+ class Request
+ include TuringTest
+ end
end
@@ -1,7 +1,5 @@
module Rack
- module Turing
- module Test
- VERSION = "0.0.1"
- end
+ module TuringTest
+ VERSION = "0.1.0"
end
end
View
@@ -4,7 +4,7 @@ require "rack-turing-test/version"
Gem::Specification.new do |s|
s.name = "rack-turing-test"
- s.version = Rack::Turing::Test::VERSION
+ s.version = Rack::TuringTest::VERSION
s.authors = ["Genki Takiuchi"]
s.email = ["genki@s21g.com"]
s.homepage = ""

0 comments on commit 0c5fa9f

Please sign in to comment.