this_feature-adapters-split_io 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +16 -12
- data/lib/this_feature/adapters/split_io.rb +12 -11
- data/lib/this_feature/version.rb +1 -1
- data/memory +0 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3baa6768cea449520a3097c133327b0cfee4e83048c82a6f56fe94e7c6d13f2
|
4
|
+
data.tar.gz: f34cabaf31f55034a63576dbabe7ffb8fe1de40ab60ff6157ce6d35b0c3bdf23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c0c45812e5c726b7bc7b71ab172dc811e6ab7468981fd08690208b5d7f3188162c15cbced72f429402eb2ba33f8a4ee75bb9d9b46031aca3984a5d530adf24f
|
7
|
+
data.tar.gz: 4126867a64ef38f3bd683941dc26e35275de43448fe9f5c32a6da4eb38ebf1ee80cf10c1698f9475af8afebb578dab268d8cf3f3c972eeb3090a714e7a28b14b
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
this_feature (0.
|
5
|
-
this_feature-adapters-flipper (0.
|
4
|
+
this_feature (0.6.0)
|
5
|
+
this_feature-adapters-flipper (0.6.0)
|
6
6
|
flipper (~> 0.16)
|
7
7
|
flipper-active_record (~> 0.16)
|
8
8
|
this_feature
|
9
|
-
this_feature-adapters-split_io (0.
|
9
|
+
this_feature-adapters-split_io (0.6.0)
|
10
10
|
splitclient-rb
|
11
11
|
this_feature
|
12
12
|
|
@@ -33,23 +33,26 @@ GEM
|
|
33
33
|
activerecord
|
34
34
|
database_cleaner (~> 1.8.0)
|
35
35
|
diff-lcs (1.3)
|
36
|
-
faraday (1.0
|
36
|
+
faraday (1.3.0)
|
37
|
+
faraday-net_http (~> 1.0)
|
37
38
|
multipart-post (>= 1.2, < 3)
|
38
|
-
|
39
|
-
|
39
|
+
ruby2_keywords
|
40
|
+
faraday-net_http (1.0.1)
|
41
|
+
flipper (0.20.3)
|
42
|
+
flipper-active_record (0.20.3)
|
40
43
|
activerecord (>= 5.0, < 7)
|
41
|
-
flipper (~> 0.
|
44
|
+
flipper (~> 0.20.3)
|
42
45
|
gem-release (2.1.1)
|
43
46
|
hitimes (1.3.1)
|
44
47
|
i18n (1.8.5)
|
45
48
|
concurrent-ruby (~> 1.0)
|
46
|
-
json (2.
|
49
|
+
json (2.5.1)
|
47
50
|
jwt (2.2.2)
|
48
51
|
lru_redux (1.1.0)
|
49
52
|
method_source (1.0.0)
|
50
53
|
minitest (5.14.1)
|
51
54
|
multipart-post (2.1.1)
|
52
|
-
net-http-persistent (4.0.
|
55
|
+
net-http-persistent (4.0.1)
|
53
56
|
connection_pool (~> 2.2)
|
54
57
|
pry (0.13.1)
|
55
58
|
coderay (~> 1.1)
|
@@ -58,7 +61,7 @@ GEM
|
|
58
61
|
byebug (~> 11.0)
|
59
62
|
pry (~> 0.13.0)
|
60
63
|
rake (13.0.1)
|
61
|
-
redis (4.2.
|
64
|
+
redis (4.2.5)
|
62
65
|
rspec (3.9.0)
|
63
66
|
rspec-core (~> 3.9.0)
|
64
67
|
rspec-expectations (~> 3.9.0)
|
@@ -72,16 +75,17 @@ GEM
|
|
72
75
|
diff-lcs (>= 1.2.0, < 2.0)
|
73
76
|
rspec-support (~> 3.9.0)
|
74
77
|
rspec-support (3.9.2)
|
78
|
+
ruby2_keywords (0.0.4)
|
75
79
|
socketry (0.5.1)
|
76
80
|
hitimes (~> 1.2)
|
77
|
-
splitclient-rb (7.
|
81
|
+
splitclient-rb (7.2.2)
|
78
82
|
concurrent-ruby (~> 1.0)
|
79
83
|
faraday (>= 0.8)
|
80
84
|
json (>= 1.8)
|
81
85
|
jwt (>= 2.2.1)
|
82
86
|
lru_redux
|
83
87
|
net-http-persistent (>= 2.9)
|
84
|
-
redis (>=
|
88
|
+
redis (>= 4.2.2)
|
85
89
|
socketry (~> 0.5.1)
|
86
90
|
thread_safe (>= 0.3)
|
87
91
|
sqlite3 (1.4.2)
|
@@ -6,8 +6,9 @@ class ThisFeature
|
|
6
6
|
# used as treatment key when none is given, it's required by split
|
7
7
|
UNDEFINED_KEY = 'undefined_key'
|
8
8
|
|
9
|
-
def initialize(client: nil)
|
9
|
+
def initialize(client: nil, context_key_method: nil)
|
10
10
|
@client = client || default_split_client
|
11
|
+
@context_key_method = context_key_method
|
11
12
|
|
12
13
|
@client.block_until_ready
|
13
14
|
end
|
@@ -30,18 +31,18 @@ class ThisFeature
|
|
30
31
|
|
31
32
|
private
|
32
33
|
|
33
|
-
attr_reader :client
|
34
|
+
attr_reader :client, :context_key_method
|
34
35
|
|
35
36
|
def treatment(flag_name, context: UNDEFINED_KEY, data: {})
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
37
|
+
client.get_treatment(context_key(context), flag_name, data)
|
38
|
+
end
|
39
|
+
|
40
|
+
def context_key(context)
|
41
|
+
return UNDEFINED_KEY if context.nil? || context.eql?(UNDEFINED_KEY)
|
42
|
+
return context.send(context_key_method) unless context_key_method.nil?
|
43
|
+
return context.to_s if context.respond_to?(:to_s)
|
44
|
+
|
45
|
+
context
|
45
46
|
end
|
46
47
|
|
47
48
|
def default_split_client
|
data/lib/this_feature/version.rb
CHANGED
data/memory
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: this_feature-adapters-split_io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Pleaner
|
8
8
|
- Matt Fong
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: this_feature
|
@@ -73,7 +73,7 @@ homepage: http://hover.to
|
|
73
73
|
licenses:
|
74
74
|
- MIT
|
75
75
|
metadata: {}
|
76
|
-
post_install_message:
|
76
|
+
post_install_message:
|
77
77
|
rdoc_options: []
|
78
78
|
require_paths:
|
79
79
|
- lib
|
@@ -88,8 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
|
-
rubygems_version: 3.
|
92
|
-
signing_key:
|
91
|
+
rubygems_version: 3.1.2
|
92
|
+
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: "[summary]"
|
95
95
|
test_files: []
|