split 1.4.5 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -2
- data/CHANGELOG.md +11 -0
- data/README.md +1 -0
- data/lib/split/persistence/redis_adapter.rb +2 -0
- data/lib/split/user.rb +2 -2
- data/lib/split/version.rb +2 -2
- data/spec/spec_helper.rb +5 -0
- data/spec/user_spec.rb +13 -0
- data/split.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee14a60caa6a0c07d046a7496ed7134f8fcc2693
|
4
|
+
data.tar.gz: 81f5c53dbb61c759e28d646f38ec498354d6b02d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd05eba6701c96c861f688416e56ee4fc7086a2fcbba07ce81ca6cfa0a9bc5b0c070f135bc1de99693610009b557dff082a9882a8e129109284beaefbb4cdc4a
|
7
|
+
data.tar.gz: cdc9d7430bba23a5ca53656b3cd3509de65b605821126853cdee23424cd017097bacb534d64f0cd3631907cf88b28dee49d6bd800cb2a10235a2ddeefea5a183
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 1.5.0 (June 8th, 2016)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Add `expire_seconds:` TTL option to RedisAdapter (@karmakaze, #409)
|
6
|
+
- Optional custom persistence adapter (@ndelage, #411)
|
7
|
+
|
8
|
+
Misc:
|
9
|
+
|
10
|
+
- Use fakeredis for testing (@andrew, #412)
|
11
|
+
|
1
12
|
## 1.4.5 (June 7th, 2016)
|
2
13
|
|
3
14
|
Bugfixes:
|
data/README.md
CHANGED
@@ -221,6 +221,7 @@ end
|
|
221
221
|
Options:
|
222
222
|
* `lookup_by`: method to invoke per request for uniquely identifying ab_users (mandatory configuration)
|
223
223
|
* `namespace`: separate namespace to store these persisted values (default "persistence")
|
224
|
+
* `expire_seconds`: sets TTL for user key. (if a user is in multiple experiments most recent update will reset TTL for all their assignments)
|
224
225
|
|
225
226
|
#### Custom Adapter
|
226
227
|
|
data/lib/split/user.rb
CHANGED
@@ -4,8 +4,8 @@ module Split
|
|
4
4
|
def_delegators :@user, :keys, :[], :[]=, :delete
|
5
5
|
attr_reader :user
|
6
6
|
|
7
|
-
def initialize(context)
|
8
|
-
@user = Split::Persistence.adapter.new(context)
|
7
|
+
def initialize(context, adapter=nil)
|
8
|
+
@user = adapter || Split::Persistence.adapter.new(context)
|
9
9
|
end
|
10
10
|
|
11
11
|
def cleanup_old_experiments!
|
data/lib/split/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -14,10 +14,15 @@ require 'complex' if RUBY_VERSION.match(/1\.8/)
|
|
14
14
|
|
15
15
|
Dir['./spec/support/*.rb'].each { |f| require f }
|
16
16
|
|
17
|
+
require "fakeredis"
|
18
|
+
|
19
|
+
fakeredis = Redis.new
|
20
|
+
|
17
21
|
RSpec.configure do |config|
|
18
22
|
config.order = 'random'
|
19
23
|
config.before(:each) do
|
20
24
|
Split.configuration = Split::Configuration.new
|
25
|
+
Split.redis = fakeredis
|
21
26
|
Split.redis.flushall
|
22
27
|
@ab_user = mock_user
|
23
28
|
params = nil
|
data/spec/user_spec.rb
CHANGED
@@ -60,4 +60,17 @@ describe Split::User do
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
context "instantiated with custom adapter" do
|
65
|
+
let(:custom_adapter) { double(:persistence_adapter) }
|
66
|
+
|
67
|
+
before do
|
68
|
+
@subject = described_class.new(context, custom_adapter)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "sets user to the custom adapter" do
|
72
|
+
expect(@subject.user).to eq(custom_adapter)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
63
76
|
end
|
data/split.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: split
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.10'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: fakeredis
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.5.0
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.5.0
|
153
167
|
description:
|
154
168
|
email:
|
155
169
|
- andrewnez@gmail.com
|