Permalink
Browse files

Use multi_json for max compatibility

  • Loading branch information...
1 parent 65c4858 commit fbf3c1360e9312d143f74ed89df1205b75f3ffe3 @andrew andrew committed Mar 11, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/split/api.rb
  2. +1 −1 split-api.gemspec
View
@@ -1,6 +1,6 @@
require 'sinatra/base'
require 'split'
-require 'json'
+require 'multi_json'
module Split
class API < Sinatra::Base
@@ -12,7 +12,7 @@ class API < Sinatra::Base
control = params[:control]
alternatives = params[:alternatives]
alternative = ab_test(experiment, control, alternatives)
- {:alternative => alternative}.to_json
+ MultiJson.encode({:alternative => alternative})
end
post '/finished' do
View
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'split'
gem.add_dependency 'sinatra'
- gem.add_dependency 'json'
+ gem.add_dependency 'multi_json'
gem.add_development_dependency 'bundler', '~> 1.0'
gem.add_development_dependency 'rspec', '~> 2.6'

0 comments on commit fbf3c13

Please sign in to comment.