flipper-api 0.18.0 → 0.20.0.beta3

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: 5786d14f2e90d02edd5861dd886113570984be4e6172473c86480e1b19706a78
4
- data.tar.gz: d5b3d7996165c36a8223218a413ed7b9e1ee061228e12459ed91e739fcd241a4
3
+ metadata.gz: 52b739e2f940783062fba2fe1fc991dde7d0aed18baf904f06fd295ad75a1fa6
4
+ data.tar.gz: f8d7032f149d9cd23ecdd0919fe96593593f9a584b1ee6cfdac9f09eaf6b6dec
5
5
  SHA512:
6
- metadata.gz: 78dd2b0565031689b1984c8d5bde1da3db5f96850e527916621fd8dc11956e443643ff536703560acec8c452f384bb94f348b022d7fd614756e6bc5ab6263e5a
7
- data.tar.gz: ff989c5a4498f16895eba22b137cd441ce14cce3fdc595d5f96f2c8ac9b66d4504c4f6293ed4001d648f84d33b9f34c86db08370a0ed9ee5dbea7c05c11a5e59
6
+ metadata.gz: 74333ee5b85d19770bc52ed437fcb75e9fd146b093307d08edbfe498ae538718f1395a879fa7e69c2094989966d525e277ffb9b5a2c5314fbac1cc56517203e8
7
+ data.tar.gz: a027b654071e90dfd849e68b0f7ee2ad9a081456b56ca7d18a3bd00853c81944c1e73dbf6e93304a1bca6b15755efc3fad856b3be86f6d12fb1a68e176652a76
@@ -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.18.0'.freeze
2
+ VERSION = '0.20.0.beta3'.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.18.0
4
+ version: 0.20.0.beta3
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-06-25 00:00:00.000000000 Z
11
+ date: 2020-12-17 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.18.0
39
+ version: 0.20.0.beta3
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.18.0
46
+ version: 0.20.0.beta3
47
47
  description:
48
48
  email:
49
49
  - nunemaker@gmail.com
@@ -101,9 +101,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - ">="
104
+ - - ">"
105
105
  - !ruby/object:Gem::Version
106
- version: '0'
106
+ version: 1.3.1
107
107
  requirements: []
108
108
  rubygems_version: 3.0.3
109
109
  signing_key: