diff --git a/README.md b/README.md index 04c4518..a5aaf6e 100644 --- a/README.md +++ b/README.md @@ -11,18 +11,6 @@ Installation `gem install voight_kampff` -If you're using Rails and want to add `ActionDispatch::Request#bot?` and `ActionDispatch::Request#human?` methods, require `voight_kampff/rails`: - -```Gemfile -gem 'voight_kampff', require: 'voight_kampff/rails' -``` - -if you're using pure Rack, require it the following way: - -```Gemfile -gem 'voight_kampff', require: 'voight_kampff/rack' -``` - Configuration ------------- @@ -62,23 +50,6 @@ In general the `#bot?` command tends to include all of these and I'm sure it's u 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. -Upgrading to version 2.0 ------------------------- - -If you use Rails and `ActionDispatch::Request#bot?` and `ActionDispatch::Request#human?` methods, change your gemfile: - -```diff --gem 'voight_kampff' -+gem 'voight_kampff', require: 'voight_kampff/rails' -``` - -If you use Rack, change your gemfile: - -```diff --gem 'voight_kampff' -+gem 'voight_kampff', require: 'voight_kampff/rack' -``` - FAQ --- __Q:__ __What's with the name?__ diff --git a/lib/voight_kampff.rb b/lib/voight_kampff.rb index 20329eb..6ba80a9 100644 --- a/lib/voight_kampff.rb +++ b/lib/voight_kampff.rb @@ -26,3 +26,6 @@ def test(user_agent_string) end end end + +require 'voight_kampff/rack' if defined?(Rack) +require 'voight_kampff/rails' if defined?(Rails::Railtie)