split 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +15 -1
- data/Appraisals +19 -0
- data/CHANGELOG.mdown +11 -0
- data/Gemfile +2 -0
- data/README.mdown +12 -3
- data/Rakefile +1 -0
- data/gemfiles/3.0.gemfile +9 -0
- data/gemfiles/3.0.gemfile.lock +111 -0
- data/gemfiles/3.1.gemfile +9 -0
- data/gemfiles/3.1.gemfile.lock +124 -0
- data/gemfiles/3.2.gemfile +9 -0
- data/gemfiles/3.2.gemfile.lock +123 -0
- data/gemfiles/4.0.gemfile +9 -0
- data/gemfiles/4.0.gemfile.lock +118 -0
- data/lib/split.rb +1 -1
- data/lib/split/configuration.rb +1 -0
- data/lib/split/helper.rb +1 -0
- data/lib/split/version.rb +1 -1
- data/spec/configuration_spec.rb +4 -0
- data/spec/helper_spec.rb +16 -0
- data/split.gemspec +2 -2
- metadata +71 -23
data/.travis.yml
CHANGED
@@ -12,4 +12,18 @@ rvm:
|
|
12
12
|
- rbx-19mode
|
13
13
|
matrix:
|
14
14
|
allow_failures:
|
15
|
-
- rvm: ruby-head
|
15
|
+
- rvm: ruby-head
|
16
|
+
exclude:
|
17
|
+
- rvm: 1.8.7
|
18
|
+
gemfile: gemfiles/4.0.gemfile
|
19
|
+
- rvm: 1.9.2
|
20
|
+
gemfile: gemfiles/4.0.gemfile
|
21
|
+
- rvm: jruby-18mode
|
22
|
+
gemfile: gemfiles/4.0.gemfile
|
23
|
+
- rvm: rbx-18mode
|
24
|
+
gemfile: gemfiles/4.0.gemfile
|
25
|
+
gemfile:
|
26
|
+
- gemfiles/3.0.gemfile
|
27
|
+
- gemfiles/3.1.gemfile
|
28
|
+
- gemfiles/3.2.gemfile
|
29
|
+
- gemfiles/4.0.gemfile
|
data/Appraisals
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
appraise "3.0" do
|
2
|
+
gem "rails", "~> 3.0.20"
|
3
|
+
gem "split", :path => "../"
|
4
|
+
end
|
5
|
+
|
6
|
+
appraise "3.1" do
|
7
|
+
gem "rails", "~> 3.1.12"
|
8
|
+
gem "split", :path => "../"
|
9
|
+
end
|
10
|
+
|
11
|
+
appraise "3.2" do
|
12
|
+
gem "rails", "~> 3.2.13"
|
13
|
+
gem "split", :path => "../"
|
14
|
+
end
|
15
|
+
|
16
|
+
appraise "4.0" do
|
17
|
+
gem "rails", "4.0.0.rc1"
|
18
|
+
gem "split", :path => "../"
|
19
|
+
end
|
data/CHANGELOG.mdown
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 0.6.2 (June 6, 2013)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Rails 2.3 compatibility (@bhcarpenter, #167)
|
6
|
+
- Adding possibility to store overridden alternative (@duksis, #173)
|
7
|
+
|
8
|
+
Misc:
|
9
|
+
|
10
|
+
- Now testing against multiple versions of rails
|
11
|
+
|
1
12
|
## 0.6.1 (May 4, 2013)
|
2
13
|
|
3
14
|
Bugfixes:
|
data/Gemfile
CHANGED
data/README.mdown
CHANGED
@@ -62,10 +62,19 @@ Put the following in your gemfile as well:
|
|
62
62
|
gem 'SystemTimer'
|
63
63
|
```
|
64
64
|
|
65
|
-
### Rails
|
65
|
+
### Rails 3
|
66
66
|
|
67
67
|
Split is autoloaded when rails starts up, as long as you've configured redis it will 'just work'.
|
68
68
|
|
69
|
+
### Rails 2.3
|
70
|
+
|
71
|
+
To configure Rails 2.3 with Split you need to mix in the helper methods. Add the following lines to config/initializers.split.rb:
|
72
|
+
|
73
|
+
```ruby
|
74
|
+
ActionController::Base.send :include, Split::Helper
|
75
|
+
ActionController::Base.helper Split::Helper
|
76
|
+
```
|
77
|
+
|
69
78
|
### Sinatra
|
70
79
|
|
71
80
|
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:
|
@@ -153,7 +162,7 @@ If you have an experiment called `button_color` with alternatives called `red` a
|
|
153
162
|
|
154
163
|
http://myawesomesite.com?button_color=red
|
155
164
|
|
156
|
-
will always have red buttons. This won't be stored in your session or count towards to results.
|
165
|
+
will always have red buttons. This won't be stored in your session or count towards to results, unless you set the `store_override` configuration option.
|
157
166
|
|
158
167
|
### Reset after completion
|
159
168
|
|
@@ -476,7 +485,7 @@ conduct experiments that are not tied to a web session.
|
|
476
485
|
# create a new experiment
|
477
486
|
experiment = Split::Experiment.find_or_create('color', 'red', 'blue')
|
478
487
|
# create a new trial
|
479
|
-
trial = Trial.new(:experiment => experiment)
|
488
|
+
trial = Split::Trial.new(:experiment => experiment)
|
480
489
|
# run trial
|
481
490
|
trial.choose!
|
482
491
|
# get the result, returns either red or blue
|
data/Rakefile
CHANGED
@@ -0,0 +1,111 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/andrew/code/split
|
3
|
+
specs:
|
4
|
+
split (0.6.1)
|
5
|
+
redis (>= 2.1)
|
6
|
+
redis-namespace (>= 1.1.0)
|
7
|
+
simple-random
|
8
|
+
sinatra (>= 1.2.6)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
abstract (1.0.0)
|
14
|
+
actionmailer (3.0.20)
|
15
|
+
actionpack (= 3.0.20)
|
16
|
+
mail (~> 2.2.19)
|
17
|
+
actionpack (3.0.20)
|
18
|
+
activemodel (= 3.0.20)
|
19
|
+
activesupport (= 3.0.20)
|
20
|
+
builder (~> 2.1.2)
|
21
|
+
erubis (~> 2.6.6)
|
22
|
+
i18n (~> 0.5.0)
|
23
|
+
rack (~> 1.2.5)
|
24
|
+
rack-mount (~> 0.6.14)
|
25
|
+
rack-test (~> 0.5.7)
|
26
|
+
tzinfo (~> 0.3.23)
|
27
|
+
activemodel (3.0.20)
|
28
|
+
activesupport (= 3.0.20)
|
29
|
+
builder (~> 2.1.2)
|
30
|
+
i18n (~> 0.5.0)
|
31
|
+
activerecord (3.0.20)
|
32
|
+
activemodel (= 3.0.20)
|
33
|
+
activesupport (= 3.0.20)
|
34
|
+
arel (~> 2.0.10)
|
35
|
+
tzinfo (~> 0.3.23)
|
36
|
+
activeresource (3.0.20)
|
37
|
+
activemodel (= 3.0.20)
|
38
|
+
activesupport (= 3.0.20)
|
39
|
+
activesupport (3.0.20)
|
40
|
+
appraisal (0.5.1)
|
41
|
+
bundler
|
42
|
+
rake
|
43
|
+
arel (2.0.10)
|
44
|
+
builder (2.1.2)
|
45
|
+
diff-lcs (1.2.2)
|
46
|
+
erubis (2.6.6)
|
47
|
+
abstract (>= 1.0.0)
|
48
|
+
i18n (0.5.0)
|
49
|
+
json (1.7.7)
|
50
|
+
mail (2.2.19)
|
51
|
+
activesupport (>= 2.3.6)
|
52
|
+
i18n (>= 0.4.0)
|
53
|
+
mime-types (~> 1.16)
|
54
|
+
treetop (~> 1.4.8)
|
55
|
+
mime-types (1.23)
|
56
|
+
polyglot (0.3.3)
|
57
|
+
rack (1.2.7)
|
58
|
+
rack-mount (0.6.14)
|
59
|
+
rack (>= 1.0.0)
|
60
|
+
rack-test (0.5.7)
|
61
|
+
rack (>= 1.0)
|
62
|
+
rails (3.0.20)
|
63
|
+
actionmailer (= 3.0.20)
|
64
|
+
actionpack (= 3.0.20)
|
65
|
+
activerecord (= 3.0.20)
|
66
|
+
activeresource (= 3.0.20)
|
67
|
+
activesupport (= 3.0.20)
|
68
|
+
bundler (~> 1.0)
|
69
|
+
railties (= 3.0.20)
|
70
|
+
railties (3.0.20)
|
71
|
+
actionpack (= 3.0.20)
|
72
|
+
activesupport (= 3.0.20)
|
73
|
+
rake (>= 0.8.7)
|
74
|
+
rdoc (~> 3.4)
|
75
|
+
thor (~> 0.14.4)
|
76
|
+
rake (10.0.4)
|
77
|
+
rdoc (3.12.2)
|
78
|
+
json (~> 1.4)
|
79
|
+
redis (3.0.3)
|
80
|
+
redis-namespace (1.2.1)
|
81
|
+
redis (~> 3.0.0)
|
82
|
+
rspec (2.13.0)
|
83
|
+
rspec-core (~> 2.13.0)
|
84
|
+
rspec-expectations (~> 2.13.0)
|
85
|
+
rspec-mocks (~> 2.13.0)
|
86
|
+
rspec-core (2.13.1)
|
87
|
+
rspec-expectations (2.13.0)
|
88
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
89
|
+
rspec-mocks (2.13.0)
|
90
|
+
simple-random (0.9.3)
|
91
|
+
sinatra (1.2.8)
|
92
|
+
rack (~> 1.1)
|
93
|
+
tilt (>= 1.2.2, < 2.0)
|
94
|
+
thor (0.14.6)
|
95
|
+
tilt (1.3.7)
|
96
|
+
treetop (1.4.12)
|
97
|
+
polyglot
|
98
|
+
polyglot (>= 0.3.1)
|
99
|
+
tzinfo (0.3.37)
|
100
|
+
|
101
|
+
PLATFORMS
|
102
|
+
ruby
|
103
|
+
|
104
|
+
DEPENDENCIES
|
105
|
+
appraisal
|
106
|
+
bundler (~> 1.3)
|
107
|
+
rack-test (>= 0.5.7)
|
108
|
+
rails (~> 3.0.20)
|
109
|
+
rake
|
110
|
+
rspec (~> 2.12)
|
111
|
+
split!
|
@@ -0,0 +1,124 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/andrew/code/split
|
3
|
+
specs:
|
4
|
+
split (0.6.1)
|
5
|
+
redis (>= 2.1)
|
6
|
+
redis-namespace (>= 1.1.0)
|
7
|
+
simple-random
|
8
|
+
sinatra (>= 1.2.6)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
actionmailer (3.1.12)
|
14
|
+
actionpack (= 3.1.12)
|
15
|
+
mail (~> 2.4.4)
|
16
|
+
actionpack (3.1.12)
|
17
|
+
activemodel (= 3.1.12)
|
18
|
+
activesupport (= 3.1.12)
|
19
|
+
builder (~> 3.0.0)
|
20
|
+
erubis (~> 2.7.0)
|
21
|
+
i18n (~> 0.6)
|
22
|
+
rack (~> 1.3.6)
|
23
|
+
rack-cache (~> 1.2)
|
24
|
+
rack-mount (~> 0.8.2)
|
25
|
+
rack-test (~> 0.6.1)
|
26
|
+
sprockets (~> 2.0.4)
|
27
|
+
activemodel (3.1.12)
|
28
|
+
activesupport (= 3.1.12)
|
29
|
+
builder (~> 3.0.0)
|
30
|
+
i18n (~> 0.6)
|
31
|
+
activerecord (3.1.12)
|
32
|
+
activemodel (= 3.1.12)
|
33
|
+
activesupport (= 3.1.12)
|
34
|
+
arel (~> 2.2.3)
|
35
|
+
tzinfo (~> 0.3.29)
|
36
|
+
activeresource (3.1.12)
|
37
|
+
activemodel (= 3.1.12)
|
38
|
+
activesupport (= 3.1.12)
|
39
|
+
activesupport (3.1.12)
|
40
|
+
multi_json (~> 1.0)
|
41
|
+
appraisal (0.5.2)
|
42
|
+
bundler
|
43
|
+
rake
|
44
|
+
arel (2.2.3)
|
45
|
+
builder (3.0.4)
|
46
|
+
diff-lcs (1.2.4)
|
47
|
+
erubis (2.7.0)
|
48
|
+
hike (1.2.2)
|
49
|
+
i18n (0.6.4)
|
50
|
+
json (1.7.7)
|
51
|
+
mail (2.4.4)
|
52
|
+
i18n (>= 0.4.0)
|
53
|
+
mime-types (~> 1.16)
|
54
|
+
treetop (~> 1.4.8)
|
55
|
+
mime-types (1.23)
|
56
|
+
multi_json (1.7.2)
|
57
|
+
polyglot (0.3.3)
|
58
|
+
rack (1.3.10)
|
59
|
+
rack-cache (1.2)
|
60
|
+
rack (>= 0.4)
|
61
|
+
rack-mount (0.8.3)
|
62
|
+
rack (>= 1.0.0)
|
63
|
+
rack-protection (1.5.0)
|
64
|
+
rack
|
65
|
+
rack-ssl (1.3.3)
|
66
|
+
rack
|
67
|
+
rack-test (0.6.2)
|
68
|
+
rack (>= 1.0)
|
69
|
+
rails (3.1.12)
|
70
|
+
actionmailer (= 3.1.12)
|
71
|
+
actionpack (= 3.1.12)
|
72
|
+
activerecord (= 3.1.12)
|
73
|
+
activeresource (= 3.1.12)
|
74
|
+
activesupport (= 3.1.12)
|
75
|
+
bundler (~> 1.0)
|
76
|
+
railties (= 3.1.12)
|
77
|
+
railties (3.1.12)
|
78
|
+
actionpack (= 3.1.12)
|
79
|
+
activesupport (= 3.1.12)
|
80
|
+
rack-ssl (~> 1.3.2)
|
81
|
+
rake (>= 0.8.7)
|
82
|
+
rdoc (~> 3.4)
|
83
|
+
thor (~> 0.14.6)
|
84
|
+
rake (10.0.4)
|
85
|
+
rdoc (3.12.2)
|
86
|
+
json (~> 1.4)
|
87
|
+
redis (3.0.4)
|
88
|
+
redis-namespace (1.3.0)
|
89
|
+
redis (~> 3.0.0)
|
90
|
+
rspec (2.13.0)
|
91
|
+
rspec-core (~> 2.13.0)
|
92
|
+
rspec-expectations (~> 2.13.0)
|
93
|
+
rspec-mocks (~> 2.13.0)
|
94
|
+
rspec-core (2.13.1)
|
95
|
+
rspec-expectations (2.13.0)
|
96
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
97
|
+
rspec-mocks (2.13.1)
|
98
|
+
simple-random (0.9.3)
|
99
|
+
sinatra (1.3.3)
|
100
|
+
rack (~> 1.3, >= 1.3.6)
|
101
|
+
rack-protection (~> 1.2)
|
102
|
+
tilt (~> 1.3, >= 1.3.3)
|
103
|
+
sprockets (2.0.4)
|
104
|
+
hike (~> 1.2)
|
105
|
+
rack (~> 1.0)
|
106
|
+
tilt (~> 1.1, != 1.3.0)
|
107
|
+
thor (0.14.6)
|
108
|
+
tilt (1.4.0)
|
109
|
+
treetop (1.4.12)
|
110
|
+
polyglot
|
111
|
+
polyglot (>= 0.3.1)
|
112
|
+
tzinfo (0.3.37)
|
113
|
+
|
114
|
+
PLATFORMS
|
115
|
+
ruby
|
116
|
+
|
117
|
+
DEPENDENCIES
|
118
|
+
appraisal
|
119
|
+
bundler (~> 1.3)
|
120
|
+
rack-test (>= 0.5.7)
|
121
|
+
rails (~> 3.1.12)
|
122
|
+
rake
|
123
|
+
rspec (~> 2.12)
|
124
|
+
split!
|
@@ -0,0 +1,123 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/andrew/code/split
|
3
|
+
specs:
|
4
|
+
split (0.6.1)
|
5
|
+
redis (>= 2.1)
|
6
|
+
redis-namespace (>= 1.1.0)
|
7
|
+
simple-random
|
8
|
+
sinatra (>= 1.2.6)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
actionmailer (3.2.13)
|
14
|
+
actionpack (= 3.2.13)
|
15
|
+
mail (~> 2.5.3)
|
16
|
+
actionpack (3.2.13)
|
17
|
+
activemodel (= 3.2.13)
|
18
|
+
activesupport (= 3.2.13)
|
19
|
+
builder (~> 3.0.0)
|
20
|
+
erubis (~> 2.7.0)
|
21
|
+
journey (~> 1.0.4)
|
22
|
+
rack (~> 1.4.5)
|
23
|
+
rack-cache (~> 1.2)
|
24
|
+
rack-test (~> 0.6.1)
|
25
|
+
sprockets (~> 2.2.1)
|
26
|
+
activemodel (3.2.13)
|
27
|
+
activesupport (= 3.2.13)
|
28
|
+
builder (~> 3.0.0)
|
29
|
+
activerecord (3.2.13)
|
30
|
+
activemodel (= 3.2.13)
|
31
|
+
activesupport (= 3.2.13)
|
32
|
+
arel (~> 3.0.2)
|
33
|
+
tzinfo (~> 0.3.29)
|
34
|
+
activeresource (3.2.13)
|
35
|
+
activemodel (= 3.2.13)
|
36
|
+
activesupport (= 3.2.13)
|
37
|
+
activesupport (3.2.13)
|
38
|
+
i18n (= 0.6.1)
|
39
|
+
multi_json (~> 1.0)
|
40
|
+
appraisal (0.5.2)
|
41
|
+
bundler
|
42
|
+
rake
|
43
|
+
arel (3.0.2)
|
44
|
+
builder (3.0.4)
|
45
|
+
diff-lcs (1.2.4)
|
46
|
+
erubis (2.7.0)
|
47
|
+
hike (1.2.2)
|
48
|
+
i18n (0.6.1)
|
49
|
+
journey (1.0.4)
|
50
|
+
json (1.7.7)
|
51
|
+
mail (2.5.3)
|
52
|
+
i18n (>= 0.4.0)
|
53
|
+
mime-types (~> 1.16)
|
54
|
+
treetop (~> 1.4.8)
|
55
|
+
mime-types (1.23)
|
56
|
+
multi_json (1.7.2)
|
57
|
+
polyglot (0.3.3)
|
58
|
+
rack (1.4.5)
|
59
|
+
rack-cache (1.2)
|
60
|
+
rack (>= 0.4)
|
61
|
+
rack-protection (1.5.0)
|
62
|
+
rack
|
63
|
+
rack-ssl (1.3.3)
|
64
|
+
rack
|
65
|
+
rack-test (0.6.2)
|
66
|
+
rack (>= 1.0)
|
67
|
+
rails (3.2.13)
|
68
|
+
actionmailer (= 3.2.13)
|
69
|
+
actionpack (= 3.2.13)
|
70
|
+
activerecord (= 3.2.13)
|
71
|
+
activeresource (= 3.2.13)
|
72
|
+
activesupport (= 3.2.13)
|
73
|
+
bundler (~> 1.0)
|
74
|
+
railties (= 3.2.13)
|
75
|
+
railties (3.2.13)
|
76
|
+
actionpack (= 3.2.13)
|
77
|
+
activesupport (= 3.2.13)
|
78
|
+
rack-ssl (~> 1.3.2)
|
79
|
+
rake (>= 0.8.7)
|
80
|
+
rdoc (~> 3.4)
|
81
|
+
thor (>= 0.14.6, < 2.0)
|
82
|
+
rake (10.0.4)
|
83
|
+
rdoc (3.12.2)
|
84
|
+
json (~> 1.4)
|
85
|
+
redis (3.0.4)
|
86
|
+
redis-namespace (1.3.0)
|
87
|
+
redis (~> 3.0.0)
|
88
|
+
rspec (2.13.0)
|
89
|
+
rspec-core (~> 2.13.0)
|
90
|
+
rspec-expectations (~> 2.13.0)
|
91
|
+
rspec-mocks (~> 2.13.0)
|
92
|
+
rspec-core (2.13.1)
|
93
|
+
rspec-expectations (2.13.0)
|
94
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
95
|
+
rspec-mocks (2.13.1)
|
96
|
+
simple-random (0.9.3)
|
97
|
+
sinatra (1.3.4)
|
98
|
+
rack (~> 1.4)
|
99
|
+
rack-protection (~> 1.3)
|
100
|
+
tilt (~> 1.3, >= 1.3.3)
|
101
|
+
sprockets (2.2.2)
|
102
|
+
hike (~> 1.2)
|
103
|
+
multi_json (~> 1.0)
|
104
|
+
rack (~> 1.0)
|
105
|
+
tilt (~> 1.1, != 1.3.0)
|
106
|
+
thor (0.18.1)
|
107
|
+
tilt (1.4.0)
|
108
|
+
treetop (1.4.12)
|
109
|
+
polyglot
|
110
|
+
polyglot (>= 0.3.1)
|
111
|
+
tzinfo (0.3.37)
|
112
|
+
|
113
|
+
PLATFORMS
|
114
|
+
ruby
|
115
|
+
|
116
|
+
DEPENDENCIES
|
117
|
+
appraisal
|
118
|
+
bundler (~> 1.3)
|
119
|
+
rack-test (>= 0.5.7)
|
120
|
+
rails (~> 3.2.13)
|
121
|
+
rake
|
122
|
+
rspec (~> 2.12)
|
123
|
+
split!
|
@@ -0,0 +1,118 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/andrew/code/split
|
3
|
+
specs:
|
4
|
+
split (0.6.1)
|
5
|
+
redis (>= 2.1)
|
6
|
+
redis-namespace (>= 1.1.0)
|
7
|
+
simple-random
|
8
|
+
sinatra (>= 1.2.6)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
actionmailer (4.0.0.rc1)
|
14
|
+
actionpack (= 4.0.0.rc1)
|
15
|
+
mail (~> 2.5.3)
|
16
|
+
actionpack (4.0.0.rc1)
|
17
|
+
activesupport (= 4.0.0.rc1)
|
18
|
+
builder (~> 3.1.0)
|
19
|
+
erubis (~> 2.7.0)
|
20
|
+
rack (~> 1.5.2)
|
21
|
+
rack-test (~> 0.6.2)
|
22
|
+
activemodel (4.0.0.rc1)
|
23
|
+
activesupport (= 4.0.0.rc1)
|
24
|
+
builder (~> 3.1.0)
|
25
|
+
activerecord (4.0.0.rc1)
|
26
|
+
activemodel (= 4.0.0.rc1)
|
27
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
28
|
+
activesupport (= 4.0.0.rc1)
|
29
|
+
arel (~> 4.0.0)
|
30
|
+
activerecord-deprecated_finders (1.0.2)
|
31
|
+
activesupport (4.0.0.rc1)
|
32
|
+
i18n (~> 0.6, >= 0.6.4)
|
33
|
+
minitest (~> 4.2)
|
34
|
+
multi_json (~> 1.3)
|
35
|
+
thread_safe (~> 0.1)
|
36
|
+
tzinfo (~> 0.3.37)
|
37
|
+
appraisal (0.5.2)
|
38
|
+
bundler
|
39
|
+
rake
|
40
|
+
arel (4.0.0)
|
41
|
+
atomic (1.1.8)
|
42
|
+
builder (3.1.4)
|
43
|
+
diff-lcs (1.2.4)
|
44
|
+
erubis (2.7.0)
|
45
|
+
hike (1.2.2)
|
46
|
+
i18n (0.6.4)
|
47
|
+
mail (2.5.3)
|
48
|
+
i18n (>= 0.4.0)
|
49
|
+
mime-types (~> 1.16)
|
50
|
+
treetop (~> 1.4.8)
|
51
|
+
mime-types (1.23)
|
52
|
+
minitest (4.7.4)
|
53
|
+
multi_json (1.7.2)
|
54
|
+
polyglot (0.3.3)
|
55
|
+
rack (1.5.2)
|
56
|
+
rack-protection (1.5.0)
|
57
|
+
rack
|
58
|
+
rack-test (0.6.2)
|
59
|
+
rack (>= 1.0)
|
60
|
+
rails (4.0.0.rc1)
|
61
|
+
actionmailer (= 4.0.0.rc1)
|
62
|
+
actionpack (= 4.0.0.rc1)
|
63
|
+
activerecord (= 4.0.0.rc1)
|
64
|
+
activesupport (= 4.0.0.rc1)
|
65
|
+
bundler (>= 1.3.0, < 2.0)
|
66
|
+
railties (= 4.0.0.rc1)
|
67
|
+
sprockets-rails (~> 2.0.0.rc4)
|
68
|
+
railties (4.0.0.rc1)
|
69
|
+
actionpack (= 4.0.0.rc1)
|
70
|
+
activesupport (= 4.0.0.rc1)
|
71
|
+
rake (>= 0.8.7)
|
72
|
+
thor (>= 0.18.1, < 2.0)
|
73
|
+
rake (10.0.4)
|
74
|
+
redis (3.0.4)
|
75
|
+
redis-namespace (1.3.0)
|
76
|
+
redis (~> 3.0.0)
|
77
|
+
rspec (2.13.0)
|
78
|
+
rspec-core (~> 2.13.0)
|
79
|
+
rspec-expectations (~> 2.13.0)
|
80
|
+
rspec-mocks (~> 2.13.0)
|
81
|
+
rspec-core (2.13.1)
|
82
|
+
rspec-expectations (2.13.0)
|
83
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
84
|
+
rspec-mocks (2.13.1)
|
85
|
+
simple-random (0.9.3)
|
86
|
+
sinatra (1.4.2)
|
87
|
+
rack (~> 1.5, >= 1.5.2)
|
88
|
+
rack-protection (~> 1.4)
|
89
|
+
tilt (~> 1.3, >= 1.3.4)
|
90
|
+
sprockets (2.9.3)
|
91
|
+
hike (~> 1.2)
|
92
|
+
multi_json (~> 1.0)
|
93
|
+
rack (~> 1.0)
|
94
|
+
tilt (~> 1.1, != 1.3.0)
|
95
|
+
sprockets-rails (2.0.0.rc4)
|
96
|
+
actionpack (>= 3.0)
|
97
|
+
activesupport (>= 3.0)
|
98
|
+
sprockets (~> 2.8)
|
99
|
+
thor (0.18.1)
|
100
|
+
thread_safe (0.1.0)
|
101
|
+
atomic
|
102
|
+
tilt (1.4.0)
|
103
|
+
treetop (1.4.12)
|
104
|
+
polyglot
|
105
|
+
polyglot (>= 0.3.1)
|
106
|
+
tzinfo (0.3.37)
|
107
|
+
|
108
|
+
PLATFORMS
|
109
|
+
ruby
|
110
|
+
|
111
|
+
DEPENDENCIES
|
112
|
+
appraisal
|
113
|
+
bundler (~> 1.3)
|
114
|
+
rack-test (>= 0.5.7)
|
115
|
+
rails (= 4.0.0.rc1)
|
116
|
+
rake
|
117
|
+
rspec (~> 2.12)
|
118
|
+
split!
|
data/lib/split.rb
CHANGED
data/lib/split/configuration.rb
CHANGED
data/lib/split/helper.rb
CHANGED
@@ -166,6 +166,7 @@ module Split
|
|
166
166
|
experiment = trial.experiment
|
167
167
|
if override_present?(experiment.name)
|
168
168
|
ret = override_alternative(experiment.name)
|
169
|
+
ab_user[experiment.key] = ret if Split.configuration.store_override
|
169
170
|
elsif ! experiment.winner.nil?
|
170
171
|
ret = experiment.winner.name
|
171
172
|
else
|
data/lib/split/version.rb
CHANGED
data/spec/configuration_spec.rb
CHANGED
@@ -26,6 +26,10 @@ describe Split::Configuration do
|
|
26
26
|
@config.disabled?.should be_true
|
27
27
|
end
|
28
28
|
|
29
|
+
it "should not store the overridden test group per default" do
|
30
|
+
@config.store_override.should be_false
|
31
|
+
end
|
32
|
+
|
29
33
|
it "should provide a default pattern for robots" do
|
30
34
|
%w[Baidu Gigabot Googlebot libwww-perl lwp-trivial msnbot SiteUptime Slurp WordPress ZIBB ZyBorg YandexBot AdsBot-Google Wget curl bitlybot facebookexternalhit spider].each do |robot|
|
31
35
|
@config.robot_regex.should =~ robot
|
data/spec/helper_spec.rb
CHANGED
@@ -96,6 +96,22 @@ describe Split::Helper do
|
|
96
96
|
alternative.should eql('red')
|
97
97
|
end
|
98
98
|
|
99
|
+
it "should not store the via params forced alternative" do
|
100
|
+
@params = {'link_color' => 'blue'}
|
101
|
+
ab_user.should_not_receive(:[]=)
|
102
|
+
ab_test('link_color', 'blue', 'red')
|
103
|
+
end
|
104
|
+
|
105
|
+
context "when store_override is set" do
|
106
|
+
before { Split.configuration.store_override = true }
|
107
|
+
|
108
|
+
it "should store the forced alternative" do
|
109
|
+
@params = {'link_color' => 'blue'}
|
110
|
+
ab_user.should_receive(:[]=).with('link_color', 'blue')
|
111
|
+
ab_test('link_color', 'blue', 'red')
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
99
115
|
it "should allow passing a block" do
|
100
116
|
alt = ab_test('link_color', 'blue', 'red')
|
101
117
|
ret = ab_test('link_color', 'blue', 'red') { |alternative| "shared/#{alternative}" }
|
data/split.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
end
|
29
29
|
|
30
30
|
s.add_development_dependency 'rake'
|
31
|
-
s.add_development_dependency 'bundler', '~> 1.
|
31
|
+
s.add_development_dependency 'bundler', '~> 1.3'
|
32
32
|
s.add_development_dependency 'rspec', '~> 2.12'
|
33
|
-
s.add_development_dependency 'rack-test', '
|
33
|
+
s.add_development_dependency 'rack-test', '>= 0.5.7'
|
34
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: split
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '2.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.1'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: redis-namespace
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: 1.1.0
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.1.0
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: sinatra
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: 1.2.6
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.2.6
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: simple-random
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: rake
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,21 +85,31 @@ dependencies:
|
|
65
85
|
version: '0'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: bundler
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ~>
|
75
100
|
- !ruby/object:Gem::Version
|
76
|
-
version: '1.
|
101
|
+
version: '1.3'
|
77
102
|
type: :development
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.3'
|
80
110
|
- !ruby/object:Gem::Dependency
|
81
111
|
name: rspec
|
82
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
114
|
requirements:
|
85
115
|
- - ~>
|
@@ -87,18 +117,28 @@ dependencies:
|
|
87
117
|
version: '2.12'
|
88
118
|
type: :development
|
89
119
|
prerelease: false
|
90
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '2.12'
|
91
126
|
- !ruby/object:Gem::Dependency
|
92
127
|
name: rack-test
|
93
|
-
requirement:
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
94
129
|
none: false
|
95
130
|
requirements:
|
96
|
-
- -
|
131
|
+
- - ! '>='
|
97
132
|
- !ruby/object:Gem::Version
|
98
|
-
version:
|
133
|
+
version: 0.5.7
|
99
134
|
type: :development
|
100
135
|
prerelease: false
|
101
|
-
version_requirements:
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: 0.5.7
|
102
142
|
description:
|
103
143
|
email:
|
104
144
|
- andrewnez@gmail.com
|
@@ -108,12 +148,21 @@ extra_rdoc_files: []
|
|
108
148
|
files:
|
109
149
|
- .gitignore
|
110
150
|
- .travis.yml
|
151
|
+
- Appraisals
|
111
152
|
- CHANGELOG.mdown
|
112
153
|
- CONTRIBUTING.md
|
113
154
|
- Gemfile
|
114
155
|
- LICENSE
|
115
156
|
- README.mdown
|
116
157
|
- Rakefile
|
158
|
+
- gemfiles/3.0.gemfile
|
159
|
+
- gemfiles/3.0.gemfile.lock
|
160
|
+
- gemfiles/3.1.gemfile
|
161
|
+
- gemfiles/3.1.gemfile.lock
|
162
|
+
- gemfiles/3.2.gemfile
|
163
|
+
- gemfiles/3.2.gemfile.lock
|
164
|
+
- gemfiles/4.0.gemfile
|
165
|
+
- gemfiles/4.0.gemfile.lock
|
117
166
|
- lib/split.rb
|
118
167
|
- lib/split/algorithms.rb
|
119
168
|
- lib/split/algorithms/weighted_sample.rb
|
@@ -178,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
227
|
version: '0'
|
179
228
|
requirements: []
|
180
229
|
rubyforge_project: split
|
181
|
-
rubygems_version: 1.8.
|
230
|
+
rubygems_version: 1.8.23
|
182
231
|
signing_key:
|
183
232
|
specification_version: 3
|
184
233
|
summary: Rack based split testing framework
|
@@ -198,4 +247,3 @@ test_files:
|
|
198
247
|
- spec/spec_helper.rb
|
199
248
|
- spec/support/cookies_mock.rb
|
200
249
|
- spec/trial_spec.rb
|
201
|
-
has_rdoc:
|