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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ba5d7a6850914fa3a242be57f5f37f6f552efd6
4
- data.tar.gz: ee5b8cc787ffb6b084a6ec3485adad861d16234f
3
+ metadata.gz: 340d78f53c8a30589720517996d8241d027eca81
4
+ data.tar.gz: ec5f0f7440220f889439a0e3efb0fbcb0f679a84
5
5
  SHA512:
6
- metadata.gz: 3365d8aa277ed07b057500768e4709e7e351f831260d77267be0430f6439e8eecefd0a620340a516ffb44dea6b5146277bc5451969dd8773d54c4e24482ea42b
7
- data.tar.gz: 38d83babf3c5de17347986a11c10475c9dbe29ff29a7791087a1b168d6e20fda8dc2022a77fd7cbe01f7c2fba8b2bf2b7b4f4b38ffa94d4d96b1d5f2c308c7eb
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
- find(FeaturesKey).fetch('features') { Set.new }.to_set
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
- docs = find_many(features.map(&:key))
55
- result = {}
56
- features.each do |feature|
57
- result[feature.key] = result_for_feature(feature, docs[feature.key])
58
- end
59
- result
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"
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.11.0.beta9'.freeze
2
+ VERSION = '0.11.0.rc1'.freeze
3
3
  end
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.beta9
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-10-28 00:00:00.000000000 Z
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.beta9
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.beta9
26
+ version: 0.11.0.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mongo
29
29
  requirement: !ruby/object:Gem::Requirement