easy_ab 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/easy_ab/helpers.rb +6 -4
- data/lib/easy_ab/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f87ddfb6f4894ca1611d3efeb0b38f636fba532b
|
4
|
+
data.tar.gz: 2288f1d27981f4cbfd4460b835e65ef8ad8dac83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9e1e94284427577422d86493157dbd97e63377903add57b5e8c17b76f3da46e684db408ce86c25ffa7910b735589b6423d2182161cf7b698cbc56a91b301f3d
|
7
|
+
data.tar.gz: cbea37f3b2c844b0d50b02aa24b722af9659530d8402f5fad249413fdf86d78457832fbc31b0575fea648d10dd377ca180dbe976431a899f6c254ceb117c3257
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.6.2 (2017-09-01)
|
2
|
+
- [BF] Calling ab_test multiple times with different experiment name in one request may cause unwanted result if the definitions of experiments contain scope or rules.
|
3
|
+
|
4
|
+
## 0.6.1 (2017-08-31)
|
5
|
+
- Include EasyAb::RSpec with mailer type. Now you can use `#assign_variant!` in mailer spec
|
6
|
+
|
1
7
|
## 0.6.0 (2017-08-25)
|
2
8
|
- Add new API (`assign_variant!`)
|
3
9
|
- Rename spec helper #assign_variant to #assign_variant! and return instance of EasyAb::Grouping instead of true/false
|
data/lib/easy_ab/helpers.rb
CHANGED
@@ -17,14 +17,16 @@ module EasyAb
|
|
17
17
|
|
18
18
|
# Obtain context for rules
|
19
19
|
if experiment.rules.present?
|
20
|
-
@rules_with_current_context ||=
|
21
|
-
|
20
|
+
@rules_with_current_context ||= {}
|
21
|
+
@rules_with_current_context[experiment_name] ||= experiment.rules.map { |rule| Proc.new { instance_exec(&rule)} }
|
22
|
+
options[:contexted_rules] = @rules_with_current_context[experiment_name]
|
22
23
|
end
|
23
24
|
|
24
25
|
# Obtain context for scope
|
25
26
|
if experiment.scope.present?
|
26
|
-
@scope ||=
|
27
|
-
|
27
|
+
@scope ||= {}
|
28
|
+
@scope[experiment_name] ||= Proc.new { instance_exec(&experiment.scope) }
|
29
|
+
options[:scope] = @scope[experiment_name]
|
28
30
|
end
|
29
31
|
|
30
32
|
@variant_cache ||= {}
|
data/lib/easy_ab/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_ab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary Chu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-core
|