flipper-mongo 0.11.0.beta9 → 0.11.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flipper/adapters/mongo.rb +22 -7
- data/lib/flipper/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 340d78f53c8a30589720517996d8241d027eca81
|
4
|
+
data.tar.gz: ec5f0f7440220f889439a0e3efb0fbcb0f679a84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e58a8073621802270d328f94b0fa3e4f3f320c886e2f6dd72385332ffa11944c41b9acb3135cdf3b9d434bd2c6d8024afaccf178087c9894d3c1b84d6ed58aca
|
7
|
+
data.tar.gz: 3ef593ea565764b14828bbfaa8db652fe493eab5278b5f365b841bdbcb57bad25cdd8a9c568ff36cda987b58cf31b20a34812c3aeac37af2bd18d4991c8b704a
|
@@ -20,7 +20,7 @@ module Flipper
|
|
20
20
|
|
21
21
|
# Public: The set of known features.
|
22
22
|
def features
|
23
|
-
|
23
|
+
read_feature_keys
|
24
24
|
end
|
25
25
|
|
26
26
|
# Public: Adds a feature to the set of known features.
|
@@ -51,12 +51,12 @@ module Flipper
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def get_multi(features)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
read_many_features(features)
|
55
|
+
end
|
56
|
+
|
57
|
+
def get_all
|
58
|
+
features = read_feature_keys.map { |key| Flipper::Feature.new(key, self) }
|
59
|
+
read_many_features(features)
|
60
60
|
end
|
61
61
|
|
62
62
|
# Public: Enables a gate for a given thing.
|
@@ -105,6 +105,21 @@ module Flipper
|
|
105
105
|
true
|
106
106
|
end
|
107
107
|
|
108
|
+
private
|
109
|
+
|
110
|
+
def read_feature_keys
|
111
|
+
find(FeaturesKey).fetch('features') { Set.new }.to_set
|
112
|
+
end
|
113
|
+
|
114
|
+
def read_many_features(features)
|
115
|
+
docs = find_many(features.map(&:key))
|
116
|
+
result = {}
|
117
|
+
features.each do |feature|
|
118
|
+
result[feature.key] = result_for_feature(feature, docs[feature.key])
|
119
|
+
end
|
120
|
+
result
|
121
|
+
end
|
122
|
+
|
108
123
|
# Private
|
109
124
|
def unsupported_data_type(data_type)
|
110
125
|
raise "#{data_type} is not supported by this adapter"
|
data/lib/flipper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper-mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.0.
|
4
|
+
version: 0.11.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flipper
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.11.0.
|
19
|
+
version: 0.11.0.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.11.0.
|
26
|
+
version: 0.11.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mongo
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|