flipper-api 0.19.0 → 0.20.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
  SHA256:
3
- metadata.gz: '08461dd21ab6b4fb7ab7921157badc993a6c97e6de03d2dd3eebaeecef3b91bf'
4
- data.tar.gz: 350c857406ef2b41385625d851aedf1ab5a3563954dca634f87fd2e70ec1273e
3
+ metadata.gz: 36b908794b663b31d3c33518c1719eeac908c0d79c4d756dd887e9670b92648b
4
+ data.tar.gz: 9952c9259f9a0d0bbae6e7c87a3244f14fa4fee149d89231ad5009f17109abd6
5
5
  SHA512:
6
- metadata.gz: 77471902ea2139e432317d42413f1afefcebbfd247abf2eed0474f8b42b549f386daaebc0b66c88dcd8f3b59ed4392df15525d2721c2f19ec160c8fa9ffcd157
7
- data.tar.gz: 168e6f33cb6eb8a4a9af894dc9175bfe2310d2770f55da260d40166285140a8ab37ebeee69feee26723837be0646603771bd691cb5464258adaacecd1c81c48f
6
+ metadata.gz: 5b407a469637bedbe0d5094a62e6310041a2e16c5b6c042f1987f2c7f4632dbcabea242e0c696a421f9c9b1eb02f8bcba8b6187e1fb306b0c28ae348508c664e
7
+ data.tar.gz: 57602b98343f6be918be82ac4b0cd33275f940c7a9a0b655c05fb585553b011627b2691d56c58a86ce3fa8fa0f28d586696d7045bf79598b66de99c34be3773a
@@ -9,12 +9,14 @@ module Flipper
9
9
 
10
10
  def self.app(flipper = nil, options = {})
11
11
  env_key = options.fetch(:env_key, 'flipper')
12
+ memoizer_options = options.fetch(:memoizer_options, {})
13
+
12
14
  app = ->(_) { [404, { 'Content-Type'.freeze => CONTENT_TYPE }, ['{}'.freeze]] }
13
15
  builder = Rack::Builder.new
14
16
  yield builder if block_given?
15
17
  builder.use Flipper::Api::JsonParams
16
18
  builder.use Flipper::Middleware::SetupEnv, flipper, env_key: env_key
17
- builder.use Flipper::Middleware::Memoizer, env_key: env_key
19
+ builder.use Flipper::Middleware::Memoizer, memoizer_options.merge(env_key: env_key)
18
20
  builder.use Flipper::Api::Middleware, env_key: env_key
19
21
  builder.run app
20
22
  klass = self
@@ -11,19 +11,19 @@ module Flipper
11
11
  def get
12
12
  keys = params['keys']
13
13
  features = if keys
14
- names = keys.split(',')
15
- if names.empty?
16
- []
17
- else
18
- existing_feature_names = names.keep_if do |feature_name|
19
- feature_exists?(feature_name)
20
- end
21
-
22
- flipper.preload(existing_feature_names)
23
- end
24
- else
25
- flipper.features
26
- end
14
+ names = keys.split(',')
15
+ if names.empty?
16
+ []
17
+ else
18
+ existing_feature_names = names.keep_if do |feature_name|
19
+ feature_exists?(feature_name)
20
+ end
21
+
22
+ flipper.preload(existing_feature_names)
23
+ end
24
+ else
25
+ flipper.features
26
+ end
27
27
 
28
28
  decorated_features = features.map do |feature|
29
29
  Decorators::Feature.new(feature).as_json
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.19.0'.freeze
2
+ VERSION = '0.20.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flipper-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-25 00:00:00.000000000 Z
11
+ date: 2020-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.19.0
39
+ version: 0.20.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.19.0
46
+ version: 0.20.0
47
47
  description:
48
48
  email:
49
49
  - nunemaker@gmail.com