From da0b85ce654a481b831eb982ac6720758df00e01 Mon Sep 17 00:00:00 2001 From: Quinten Powell Date: Thu, 9 Oct 2014 21:48:29 -0500 Subject: [PATCH 1/8] Remove readme comments on old version support --- README.mdown | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/README.mdown b/README.mdown index b8f24850..636e526d 100644 --- a/README.mdown +++ b/README.mdown @@ -53,29 +53,10 @@ and require it in your project: 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: @@ -163,8 +144,6 @@ 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 From 2818f9f88c5be60a7c8577dc374b41fbcfa62cb3 Mon Sep 17 00:00:00 2001 From: Quinten Powell Date: Thu, 9 Oct 2014 21:49:30 -0500 Subject: [PATCH 2/8] Add note about supported versions to README and CONTRIBUTING.md --- CONTRIBUTING.md | 3 +++ README.mdown | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f13604c0..c7772a79 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,7 @@ ## Contributing + +*Note*: Split requires Ruby 1.9.2 or higher. + * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a diff --git a/README.mdown b/README.mdown index 636e526d..ab973c1d 100644 --- a/README.mdown +++ b/README.mdown @@ -14,6 +14,8 @@ Split is designed to be hacker friendly, allowing for maximum customisation and ## Requirements +Split requires Ruby 1.9.2 or higher. + Split uses redis as a datastore. Split only supports redis 2.0 or greater. From ddae47b102a4b12c974778215948d8c3e226523e Mon Sep 17 00:00:00 2001 From: Quinten Powell Date: Thu, 9 Oct 2014 21:56:50 -0500 Subject: [PATCH 3/8] Remove 1.8.7 warning --- lib/split/helper.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/split/helper.rb b/lib/split/helper.rb index df4b09ae..6d2bffde 100644 --- a/lib/split/helper.rb +++ b/lib/split/helper.rb @@ -2,9 +2,6 @@ module Split module Helper def ab_test(metric_descriptor, control=nil, *alternatives) - if RUBY_VERSION.match(/1\.8/) && alternatives.length.zero? && ! control.nil? - puts 'WARNING: You should always pass the control alternative through as the second argument with any other alternatives as the third because the order of the hash is not preserved in ruby 1.8' - end # Check if array is passed to ab_test # e.g. ab_test('name', ['Alt 1', 'Alt 2', 'Alt 3']) From 403272c108b1309e5f4cf075ae15c8d447cbbcd0 Mon Sep 17 00:00:00 2001 From: Quinten Powell Date: Thu, 9 Oct 2014 22:00:00 -0500 Subject: [PATCH 4/8] Add required_ruby_version to gemspec --- split.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/split.gemspec b/split.gemspec index 799b1248..1a49128c 100644 --- a/split.gemspec +++ b/split.gemspec @@ -12,6 +12,8 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/andrew/split" s.summary = %q{Rack based split testing framework} + s.required_ruby_version = '>= 1.9.2' + s.rubyforge_project = "split" s.files = `git ls-files`.split("\n") From c697ec6e927fe96421b0bb8abbe4340b39ca780c Mon Sep 17 00:00:00 2001 From: Quinten Powell Date: Thu, 9 Oct 2014 22:01:22 -0500 Subject: [PATCH 5/8] Remove check for Rails > 3 --- lib/split.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/split.rb b/lib/split.rb index aaa14f23..4030c4fb 100755 --- a/lib/split.rb +++ b/lib/split.rb @@ -15,7 +15,6 @@ require "split/#{f}" end -require 'split/engine' if defined?(Rails) && Rails::VERSION::MAJOR >= 3 require 'redis/namespace' module Split From 07b194174417c1a452990181d25f6770b48fe70e Mon Sep 17 00:00:00 2001 From: Quinten Powell Date: Thu, 9 Oct 2014 22:08:54 -0500 Subject: [PATCH 6/8] Drop 1.8 json gemspec check --- split.gemspec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/split.gemspec b/split.gemspec index 1a49128c..9733a2ec 100644 --- a/split.gemspec +++ b/split.gemspec @@ -25,11 +25,6 @@ Gem::Specification.new do |s| s.add_dependency 'sinatra', '>= 1.2.6' s.add_dependency 'simple-random' - # Ruby 1.8 doesn't include JSON in the std lib - if RUBY_VERSION < "1.9" - s.add_dependency 'json', '>= 1.7.7' - end - s.add_development_dependency 'rake' s.add_development_dependency 'bundler', '~> 1.6' s.add_development_dependency 'rspec', '~> 3.0' From d3f0903942ac625af7835b02aff4950192d3d8ed Mon Sep 17 00:00:00 2001 From: Quinten Powell Date: Sat, 11 Oct 2014 19:18:43 -0500 Subject: [PATCH 7/8] Require engine if Rails is defined --- lib/split.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/split.rb b/lib/split.rb index 4030c4fb..84bad140 100755 --- a/lib/split.rb +++ b/lib/split.rb @@ -15,6 +15,7 @@ require "split/#{f}" end +require 'split/engine' if defined?(Rails) require 'redis/namespace' module Split From 82777156efc51d9a48d31045d25cfda67d1fbca2 Mon Sep 17 00:00:00 2001 From: Quinten Powell Date: Sat, 11 Oct 2014 19:23:38 -0500 Subject: [PATCH 8/8] Add readme note about support for Ruby 1.8.x and Rails 2.3 --- README.mdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index ab973c1d..11a1a7c1 100644 --- a/README.mdown +++ b/README.mdown @@ -14,7 +14,7 @@ Split is designed to be hacker friendly, allowing for maximum customisation and ## Requirements -Split requires Ruby 1.9.2 or higher. +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.