ab-split 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ab-split.gemspec +9 -9
- data/lib/split/helper.rb +5 -1
- data/lib/split/trial.rb +1 -1
- data/lib/split/user.rb +2 -2
- data/lib/split/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc480d9ca64951caaaf7530faed72be3384e2a217e4eeabc7d3e16be3d15d067
|
4
|
+
data.tar.gz: 1242b45c328f3d7e1526660985c496387c242bdbc3adc4364a0a67123f2f6506
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1016e9680c56ebe41803f0ab7aaeecb4fb8a7dd260a93b511a6b7e835971de651b7f27ddeba6546e130f12ff5f9491820295d90537280573c910f8fb3937886
|
7
|
+
data.tar.gz: '058a3e4f741fa6e6f9adec8815f9d4b175652871b47bfbe382733336e72991557659b6629fdcd2075e6a25db865726f18aa21d59455c93fb6ba544d39a0042c6'
|
data/ab-split.gemspec
CHANGED
@@ -8,18 +8,18 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.version = Split::VERSION
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.licenses = ['MIT']
|
11
|
-
s.authors
|
12
|
-
s.email
|
13
|
-
s.homepage = "https://github.com/
|
11
|
+
s.authors = ["aibotyu"]
|
12
|
+
s.email = ["284894567@qq.com"]
|
13
|
+
s.homepage = "https://github.com/splitrb/split"
|
14
14
|
s.summary = "Rack based split testing framework"
|
15
15
|
|
16
16
|
s.metadata = {
|
17
|
-
"homepage_uri" => "https://github.com/
|
18
|
-
"changelog_uri" => "https://github.com/
|
19
|
-
"source_code_uri" => "https://github.com/
|
20
|
-
"bug_tracker_uri" => "https://github.com/
|
21
|
-
"wiki_uri" => "https://github.com/
|
22
|
-
"mailing_list_uri" => "https://
|
17
|
+
"homepage_uri" => "https://github.com/splitrb/split",
|
18
|
+
"changelog_uri" => "https://github.com/splitrb/split/blob/master/CHANGELOG.md",
|
19
|
+
"source_code_uri" => "https://github.com/splitrb/split",
|
20
|
+
"bug_tracker_uri" => "https://github.com/splitrb/split/issues",
|
21
|
+
"wiki_uri" => "https://github.com/splitrb/split/wiki",
|
22
|
+
"mailing_list_uri" => "https://groups.google.com/d/forum/split-ruby"
|
23
23
|
}
|
24
24
|
|
25
25
|
s.required_ruby_version = '>= 1.9.3'
|
data/lib/split/helper.rb
CHANGED
@@ -9,7 +9,6 @@ module Split
|
|
9
9
|
begin
|
10
10
|
experiment = ExperimentCatalog.find_or_initialize(metric_descriptor, control, *alternatives)
|
11
11
|
alternative = if Split.configuration.enabled && !exclude_visitor?
|
12
|
-
experiment.save
|
13
12
|
raise(Split::InvalidExperimentsFormatError) unless (Split.configuration.experiments || {}).fetch(experiment.name.to_sym, {})[:combined_experiments].nil?
|
14
13
|
trial = Trial.new(:user => ab_user, :experiment => experiment,
|
15
14
|
:override => override_alternative(experiment.name), :exclude => exclude_visitor?,
|
@@ -39,6 +38,11 @@ module Split
|
|
39
38
|
end
|
40
39
|
end
|
41
40
|
|
41
|
+
def self.ab_test_config(metric_descriptor, control = nil, *alternatives)
|
42
|
+
experiment = ExperimentCatalog.find_or_initialize(metric_descriptor, control, *alternatives)
|
43
|
+
experiment.save
|
44
|
+
end
|
45
|
+
|
42
46
|
def reset!(experiment)
|
43
47
|
ab_user.delete(experiment.key)
|
44
48
|
end
|
data/lib/split/trial.rb
CHANGED
@@ -49,7 +49,7 @@ module Split
|
|
49
49
|
# method is guaranteed to only run once, and will skip the alternative choosing process if run
|
50
50
|
# a second time.
|
51
51
|
def choose!(context = nil)
|
52
|
-
@user.cleanup_old_experiments!
|
52
|
+
@user.cleanup_old_experiments! self.experiment
|
53
53
|
# Only run the process once
|
54
54
|
return alternative if @alternative_choosen
|
55
55
|
|
data/lib/split/user.rb
CHANGED
@@ -12,10 +12,10 @@ module Split
|
|
12
12
|
@cleaned_up = false
|
13
13
|
end
|
14
14
|
|
15
|
-
def cleanup_old_experiments!
|
15
|
+
def cleanup_old_experiments! experiment
|
16
16
|
return if @cleaned_up
|
17
17
|
keys_without_finished(user.keys).each do |key|
|
18
|
-
|
18
|
+
return unless experiment.name == key_without_version(key)
|
19
19
|
if experiment.nil? || experiment.has_winner? || experiment.start_time.nil?
|
20
20
|
user.delete key
|
21
21
|
user.delete Experiment.finished_key(key)
|
data/lib/split/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ab-split
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aibotyu
|
@@ -263,16 +263,16 @@ files:
|
|
263
263
|
- spec/support/cookies_mock.rb
|
264
264
|
- spec/trial_spec.rb
|
265
265
|
- spec/user_spec.rb
|
266
|
-
homepage: https://github.com/
|
266
|
+
homepage: https://github.com/splitrb/split
|
267
267
|
licenses:
|
268
268
|
- MIT
|
269
269
|
metadata:
|
270
|
-
homepage_uri: https://github.com/
|
271
|
-
changelog_uri: https://github.com/
|
272
|
-
source_code_uri: https://github.com/
|
273
|
-
bug_tracker_uri: https://github.com/
|
274
|
-
wiki_uri: https://github.com/
|
275
|
-
mailing_list_uri: https://
|
270
|
+
homepage_uri: https://github.com/splitrb/split
|
271
|
+
changelog_uri: https://github.com/splitrb/split/blob/master/CHANGELOG.md
|
272
|
+
source_code_uri: https://github.com/splitrb/split
|
273
|
+
bug_tracker_uri: https://github.com/splitrb/split/issues
|
274
|
+
wiki_uri: https://github.com/splitrb/split/wiki
|
275
|
+
mailing_list_uri: https://groups.google.com/d/forum/split-ruby
|
276
276
|
post_install_message:
|
277
277
|
rdoc_options: []
|
278
278
|
require_paths:
|