flipper-api 0.16.2 → 0.19.1

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
- SHA1:
3
- metadata.gz: cbe93b2309e4e2ddfa27a7cd1062c12984567995
4
- data.tar.gz: 868ec720e0089dcb3696b2651eb0775dcd66d062
2
+ SHA256:
3
+ metadata.gz: e2a20ed74c53f298c743e1196fe68bffe00ddef8138924832fe0da19503ce3f3
4
+ data.tar.gz: 50f09fd2472203145805db82c980d73327db8159731fcde34c24e2c3b6665c23
5
5
  SHA512:
6
- metadata.gz: 8596dca6b97cc864a0f352739e80d9d5c43699fb4d645c8b67e5243848233b13787cfb6e65983dfc657045de62e4235416d5cc599e46cda6b8015978a18f6baf
7
- data.tar.gz: da9db0e12b8dba3ce3d027d10228000f433c2d540a6473729c189a5ce38495396cda5e33140e7c3cf23e02914c5985dccde9b49ab29b420ae45e6d9e1e707931
6
+ metadata.gz: b667d0f3f04d4e8ead757f8165e65f1625db78dee361a25d4c5d102034cda81e93fa35682ed6cd9e0227187a5c2cc28a389e9f34eb3a9515fd364c5938f6939f
7
+ data.tar.gz: 132f2460b18d2e29bac3cb21da6c4565d5ca13ae6fef8c64ae7f2ec903a8fc5feabd665de51b8be18df90a7cbf23a1b20cb3810e2482acf6d860e7ecf80b609c
@@ -10,7 +10,6 @@ Gem::Specification.new do |gem|
10
10
  gem.authors = ['John Nunemaker']
11
11
  gem.email = ['nunemaker@gmail.com']
12
12
  gem.summary = 'API for the Flipper gem'
13
- gem.description = 'Rack middleware that provides an API for the flipper gem.'
14
13
  gem.license = 'MIT'
15
14
  gem.homepage = 'https://github.com/jnunemaker/flipper'
16
15
  gem.files = `git ls-files`.split("\n").select(&flipper_api_files) + ['lib/flipper/version.rb']
@@ -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
@@ -12,12 +12,14 @@ module Flipper
12
12
  # Public: Returns instance as hash that is ready to be json dumped.
13
13
  def as_json
14
14
  gate_values = feature.adapter.get(self)
15
+ gates_json = gates.map do |gate|
16
+ Decorators::Gate.new(gate, gate_values[gate.key]).as_json
17
+ end
18
+
15
19
  {
16
20
  'key' => key,
17
21
  'state' => state.to_s,
18
- 'gates' => gates.map do |gate|
19
- Decorators::Gate.new(gate, gate_values[gate.key]).as_json
20
- end,
22
+ 'gates' => gates_json,
21
23
  }
22
24
  end
23
25
  end
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.16.2'.freeze
2
+ VERSION = '0.19.1'.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.16.2
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-20 00:00:00.000000000 Z
11
+ date: 2020-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -36,15 +36,15 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.16.2
39
+ version: 0.19.1
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.16.2
47
- description: Rack middleware that provides an API for the flipper gem.
46
+ version: 0.19.1
47
+ description:
48
48
  email:
49
49
  - nunemaker@gmail.com
50
50
  executables: []
@@ -105,8 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
- rubyforge_project:
109
- rubygems_version: 2.4.5.4
108
+ rubygems_version: 3.0.3
110
109
  signing_key:
111
110
  specification_version: 4
112
111
  summary: API for the Flipper gem