flipper-api 0.28.2 → 1.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/flipper-api.gemspec +3 -3
- data/lib/flipper/api/action.rb +2 -2
- data/lib/flipper/api.rb +1 -1
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/api/action_spec.rb +2 -2
- data/spec/flipper/api/v1/actions/clear_feature_spec.rb +8 -8
- metadata +14 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd719f6606e1372006f530832e5e1c696b4e1ddc206109d164bbc4982fa57f7b
|
4
|
+
data.tar.gz: 12344ed08ee934dd1040191650a19e4b5994a314c1181ff59afb2d6701fdefe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ea2eb129be53a8a4af88a756707c7158c920ec961f9738278b5154846cfe6670d5faa858f15ad91040796193fdd3a121021262bd8d80471abb3412a8585a07e
|
7
|
+
data.tar.gz: 9c5e18723f54022a48168da92f76e80ef1582da000787e9605676a3ca6afd77247ad75ca456a83aa3fc310df4a92819efef3514fa6aa8eed2dc4dc0ea7f20c6e
|
data/flipper-api.gemspec
CHANGED
@@ -8,10 +8,10 @@ end
|
|
8
8
|
|
9
9
|
Gem::Specification.new do |gem|
|
10
10
|
gem.authors = ['John Nunemaker']
|
11
|
-
gem.email =
|
11
|
+
gem.email = 'support@flippercloud.io'
|
12
12
|
gem.summary = 'API for the Flipper gem'
|
13
13
|
gem.license = 'MIT'
|
14
|
-
gem.homepage = 'https://
|
14
|
+
gem.homepage = 'https://www.flippercloud.io/docs/api'
|
15
15
|
gem.files = `git ls-files`.split("\n").select(&flipper_api_files) + ['lib/flipper/version.rb']
|
16
16
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_api_files)
|
17
17
|
gem.name = 'flipper-api'
|
@@ -19,6 +19,6 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.version = Flipper::VERSION
|
20
20
|
gem.metadata = Flipper::METADATA
|
21
21
|
|
22
|
-
gem.add_dependency 'rack', '>= 1.4', '<
|
22
|
+
gem.add_dependency 'rack', '>= 1.4', '< 4'
|
23
23
|
gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
|
24
24
|
end
|
data/lib/flipper/api/action.rb
CHANGED
@@ -68,7 +68,7 @@ module Flipper
|
|
68
68
|
@flipper = flipper
|
69
69
|
@request = request
|
70
70
|
@code = 200
|
71
|
-
@headers = { '
|
71
|
+
@headers = { 'content-type' => Api::CONTENT_TYPE }
|
72
72
|
end
|
73
73
|
|
74
74
|
# Public: Runs the request method for the provided request.
|
@@ -113,7 +113,7 @@ module Flipper
|
|
113
113
|
# status - http status code
|
114
114
|
|
115
115
|
def json_response(object, status = 200)
|
116
|
-
header '
|
116
|
+
header 'content-type', Api::CONTENT_TYPE
|
117
117
|
status(status)
|
118
118
|
body = JSON.dump(object)
|
119
119
|
halt [@code, @headers, [body]]
|
data/lib/flipper/api.rb
CHANGED
@@ -9,7 +9,7 @@ module Flipper
|
|
9
9
|
|
10
10
|
def self.app(flipper = nil, options = {})
|
11
11
|
env_key = options.fetch(:env_key, 'flipper')
|
12
|
-
app = ->(_) { [404, { '
|
12
|
+
app = ->(_) { [404, { 'content-type'.freeze => CONTENT_TYPE }, ['{}'.freeze]] }
|
13
13
|
builder = Rack::Builder.new
|
14
14
|
yield builder if block_given?
|
15
15
|
builder.use Flipper::Api::JsonParams
|
data/lib/flipper/version.rb
CHANGED
@@ -67,7 +67,7 @@ RSpec.describe Flipper::Api::Action do
|
|
67
67
|
status, headers, body = response
|
68
68
|
parsed_body = JSON.parse(body[0])
|
69
69
|
|
70
|
-
expect(headers['
|
70
|
+
expect(headers['content-type']).to eq('application/json')
|
71
71
|
expect(parsed_body).to eql(api_not_found_response)
|
72
72
|
end
|
73
73
|
end
|
@@ -81,7 +81,7 @@ RSpec.describe Flipper::Api::Action do
|
|
81
81
|
status, headers, body = response
|
82
82
|
parsed_body = JSON.parse(body[0])
|
83
83
|
|
84
|
-
expect(headers['
|
84
|
+
expect(headers['content-type']).to eq('application/json')
|
85
85
|
expect(parsed_body['code']).to eq(2)
|
86
86
|
expect(parsed_body['message']).to eq('Group not registered.')
|
87
87
|
expect(parsed_body['more_info']).to eq(api_error_code_reference_url)
|
@@ -7,11 +7,11 @@ RSpec.describe Flipper::Api::V1::Actions::ClearFeature do
|
|
7
7
|
actor22 = Flipper::Actor.new('22')
|
8
8
|
|
9
9
|
feature = flipper[:my_feature]
|
10
|
-
feature.enable
|
10
|
+
feature.enable Flipper::Types::Boolean.new
|
11
11
|
feature.enable flipper.group(:admins)
|
12
|
-
feature.enable
|
13
|
-
feature.enable
|
14
|
-
feature.enable
|
12
|
+
feature.enable Flipper::Types::Actor.new(actor22)
|
13
|
+
feature.enable Flipper::Types::PercentageOfActors.new(25)
|
14
|
+
feature.enable Flipper::Types::PercentageOfTime.new(45)
|
15
15
|
|
16
16
|
delete '/features/my_feature/clear'
|
17
17
|
end
|
@@ -28,11 +28,11 @@ RSpec.describe Flipper::Api::V1::Actions::ClearFeature do
|
|
28
28
|
actor22 = Flipper::Actor.new('22')
|
29
29
|
|
30
30
|
feature = flipper["my/feature"]
|
31
|
-
feature.enable
|
31
|
+
feature.enable Flipper::Types::Boolean.new
|
32
32
|
feature.enable flipper.group(:admins)
|
33
|
-
feature.enable
|
34
|
-
feature.enable
|
35
|
-
feature.enable
|
33
|
+
feature.enable Flipper::Types::Actor.new(actor22)
|
34
|
+
feature.enable Flipper::Types::PercentageOfActors.new(25)
|
35
|
+
feature.enable Flipper::Types::PercentageOfTime.new(45)
|
36
36
|
|
37
37
|
delete '/features/my/feature/clear'
|
38
38
|
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.
|
4
|
+
version: 1.0.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '1.4'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '4'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,24 +29,23 @@ dependencies:
|
|
29
29
|
version: '1.4'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '4'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: flipper
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.
|
39
|
+
version: 1.0.0.pre
|
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.
|
46
|
+
version: 1.0.0.pre
|
47
47
|
description:
|
48
|
-
email:
|
49
|
-
- nunemaker@gmail.com
|
48
|
+
email: support@flippercloud.io
|
50
49
|
executables: []
|
51
50
|
extensions: []
|
52
51
|
extra_rdoc_files: []
|
@@ -88,10 +87,14 @@ files:
|
|
88
87
|
- spec/flipper/api/v1/actions/percentage_of_time_gate_spec.rb
|
89
88
|
- spec/flipper/api/v1/decorators/feature_spec.rb
|
90
89
|
- spec/flipper/api_spec.rb
|
91
|
-
homepage: https://
|
90
|
+
homepage: https://www.flippercloud.io/docs/api
|
92
91
|
licenses:
|
93
92
|
- MIT
|
94
93
|
metadata:
|
94
|
+
documentation_uri: https://www.flippercloud.io/docs
|
95
|
+
homepage_uri: https://www.flippercloud.io
|
96
|
+
source_code_uri: https://github.com/jnunemaker/flipper
|
97
|
+
bug_tracker_uri: https://github.com/jnunemaker/flipper/issues
|
95
98
|
changelog_uri: https://github.com/jnunemaker/flipper/blob/main/Changelog.md
|
96
99
|
post_install_message:
|
97
100
|
rdoc_options: []
|
@@ -104,9 +107,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
107
|
version: '0'
|
105
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
109
|
requirements:
|
107
|
-
- - "
|
110
|
+
- - ">"
|
108
111
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
112
|
+
version: 1.3.1
|
110
113
|
requirements: []
|
111
114
|
rubygems_version: 3.3.7
|
112
115
|
signing_key:
|