README.mdown in split-0.8.0 vs README.mdown in split-1.0.0

- old
+ new

@@ -12,10 +12,12 @@ [![Code Climate](https://codeclimate.com/github/andrew/split.svg)](https://codeclimate.com/github/andrew/split) [![Coverage Status](http://img.shields.io/coveralls/andrew/split.svg)](https://coveralls.io/r/andrew/split) ## Requirements +Split currently requires Ruby 1.9.2 or higher. If your project requires compatibility with Ruby 1.8.x and Rails 2.3, please use v0.8.0. + Split uses redis as a datastore. Split only supports redis 2.0 or greater. If you're on OS X, Homebrew is the simplest way to install Redis: @@ -51,33 +53,14 @@ ```ruby require 'split' ``` -### SystemTimer - -If you are using Redis on Ruby 1.8.x then you will likely want to also use the SystemTimer gem if you want to make sure the Redis client will not hang. - -Put the following in your gemfile as well: - -``` -gem 'SystemTimer' -``` - ### Rails 3 Split is autoloaded when rails starts up, as long as you've configured redis it will 'just work'. -### Rails 2.3 - -To configure Rails 2.3 with Split you need to mix in the helper methods. Add the following lines to config/initializers.split.rb: - -```ruby -ActionController::Base.send :include, Split::Helper -ActionController::Base.helper Split::Helper -``` - ### Sinatra To configure sinatra with Split you need to enable sessions and mix in the helper methods. Add the following lines at the top of your sinatra app: ```ruby @@ -161,12 +144,10 @@ ab_test('homepage design', 'Old', {'New' => 0.1}) ab_test('homepage design', {'Old' => 10}, 'New') ``` -Note: If using ruby 1.8.x and weighted alternatives you should always pass the control alternative through as the second argument with any other alternatives as a third argument because the order of the hash is not preserved in ruby 1.8, ruby 1.9.1+ users are not affected by this bug. - This will only show the new alternative to visitors 1 in 10 times, the default weight for an alternative is 1. ### Overriding alternatives For development and testing, you may wish to force your app to always return an alternative. @@ -352,10 +333,10 @@ end ``` You can even use Devise or any other Warden-based authentication method to authorize users. Just replace `mount Split::Dashboard, :at => 'split'` in `config/routes.rb` with the following: ```ruby -match "/split" => Split::Dashboard, :anchor => false, :constraints => lambda { |request| +match "/split" => Split::Dashboard, :anchor => false, :via => [:get, :post], :constraints => lambda { |request| request.env['warden'].authenticated? # are we authenticated? request.env['warden'].authenticate! # authenticate if not already # or even check any other condition such as request.env['warden'].user.is_admin? } ```