easy_ab 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07c293753d7830d31252051706b746e4920a97cc
4
- data.tar.gz: c803e602635e92e0a31dc2917f74b60b86b2c894
3
+ metadata.gz: 8cd5663800f95a25d8b2f0f2d99b8508ecd6d6bc
4
+ data.tar.gz: ea5e1e9ff71f6cda662273f46e8ef2e5508fe8fa
5
5
  SHA512:
6
- metadata.gz: 2909f6fd65c57619be708b6461b6349da786da69349bb077c81d05e0c3b6d165d1cab086d403fc7b45a2f3a4a58509bb23c9986e650b7a1d8227b01b8bb8a962
7
- data.tar.gz: 70485129c8ecc62756e7c5691c08429f473c792c6dc544b067e920932c33b53d3c5c8bcffaa686b86dcbaad7d18bb1ba02dde30e098da76b7e25060743af29c1
6
+ metadata.gz: 778ccea1ce66bcb4471af2484eaa86017dce4359816c5c22229ac0fb4018aeda2d00a96661c80a969ad0c4977c6bbc2c90c56b42b36b5c628c532bfd9df6e2a5
7
+ data.tar.gz: dc67c24dadb423e971e49d4ddcdc77dbe03aed2feedaf46d04c897434ccaf94e696496eb6dae66ef1ebd70dd6770915d8361e547bce5f794549b6952e76b16e8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.6.0 (2017-08-25)
2
+ - Add new API (`assign_variant!`)
3
+ - Rename spec helper #assign_variant to #assign_variant! and return instance of EasyAb::Grouping instead of true/false
4
+
1
5
  ## 0.5.1 (2017-08-25)
2
6
  - Add new API (`easy_ab_test`) for internal use.
3
7
 
@@ -77,6 +77,13 @@ module EasyAb
77
77
  block_given? ? yield(variant) : variant
78
78
  end
79
79
 
80
+ def assign_variant!(user, experiment, variant)
81
+ g = EasyAb::Grouping.find_or_initialize_by(user_id: user.id, experiment: experiment)
82
+ g.variant = variant
83
+ g.save!
84
+ g
85
+ end
86
+
80
87
  private
81
88
 
82
89
  def find_ab_test_user_recognition(options = {})
@@ -1,10 +1,11 @@
1
1
  module EasyAb
2
2
  module RSpec
3
3
  module SpecHelper
4
- def assign_variant(user, experiment, variant)
4
+ def assign_variant!(user, experiment, variant)
5
5
  g = EasyAb::Grouping.find_or_initialize_by(user_id: user.id, experiment: experiment)
6
6
  g.variant = variant
7
7
  g.save!
8
+ g
8
9
  end
9
10
  end
10
11
  end
@@ -1,3 +1,3 @@
1
1
  module EasyAb
2
- VERSION = '0.5.1'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_ab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Chu