ab-split 1.0.0 → 1.0.1
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: 47759e39db6fc259f34e839328343c53b7ca8e1eb824d58e6f2ddc900a170ea6
|
4
|
+
data.tar.gz: ab97c9dab5dbe1161def9884f9b89028c6f14f8e4c5e8eb4b0d9fc6f92621b16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3e45a591fa2c72bcbebd4ea5d2900ede17adba222f683477baaf3a2b5da0c3826e0cc3e24459eb5610e02e086ae4ac625f90914501c2442fa73b69057127e2e
|
7
|
+
data.tar.gz: 878332197608d922d8bc794a5506cbe26190963f145009cf7346bae968ec372ff52dffdcb78ff00b5670908a21ab1ea9667f09a3777b593c9ee48e3214e7194d
|
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 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.1
|
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:
|