feature_flag_client 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +28 -9
- data/bin/console +1 -1
- data/feature_flag_client.gemspec +1 -1
- data/lib/feature_flag_client/client/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10eaa56f76079b041f451559fdba1ba2d3e1d12d5d3a497f319c1e6253b9f326
|
4
|
+
data.tar.gz: e5104709f1d61669e7190909ff75734f0d63449a5d0f274b184c93351448924c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49fcb38b5df36aed09a6f2841a88d2055c3080a72ed681538965e3ffad100a6d8012566d8f15098a37de2a79d9111d6d07c41e9f02bf24baa6ce6a02fe3b1a47
|
7
|
+
data.tar.gz: 9ce9be77d991a86dcd8ef6603126fc8f0d57c4a907e8de3e8c642e07dea82b1ee86218258c27d6585d94effebcc6781e67a0dcd8e5f199ad40a7efc282bce751
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,13 @@
|
|
1
|
-
#
|
1
|
+
# FeatureFlagClient
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This gem is the API client for FeatureFlag service and allows fetching feature flags for given product from the service.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
7
|
Add this line to your application's Gemfile:
|
10
8
|
|
11
9
|
```ruby
|
12
|
-
gem '
|
10
|
+
gem 'feature_flag_client'
|
13
11
|
```
|
14
12
|
|
15
13
|
And then execute:
|
@@ -18,11 +16,32 @@ And then execute:
|
|
18
16
|
|
19
17
|
Or install it yourself as:
|
20
18
|
|
21
|
-
$ gem install
|
19
|
+
$ gem install feature_flag_client
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
```
|
24
|
+
require 'feature_flag_client'
|
25
|
+
|
26
|
+
# In some initializer
|
27
|
+
FeatureFlagClient::Configure do |config|
|
28
|
+
# Main resource API to get feature flags
|
29
|
+
config.api_base_url = 'https://api-feature-flag-service.eu-west-1.elb.amazonaws.com/api/v1'
|
30
|
+
|
31
|
+
# Featureflag service Auth api to get access token
|
32
|
+
config.auth_url = 'https://api-feature-flag-service.eu-west-1.elb.amazonaws.com/auth/token'
|
33
|
+
|
34
|
+
# client id and secret to get access token
|
35
|
+
config.client_id = '645da701fce2a12c'
|
36
|
+
config.client_secret = '13c77fa6f8e742fa036cd9f9afa912A@' # store this in a secret manager
|
37
|
+
end
|
38
|
+
|
39
|
+
# Elsewhere in the code
|
40
|
+
client = FeatureFlagClient.new
|
41
|
+
product_name = 'cool product'
|
42
|
+
client.features('cool product')
|
43
|
+
# => {"feature name"=>#<OpenStruct name="feature name", enabled=false, createdAt="2020-09-08T22:08:07.971Z", updatedAt="2020-09-18T23:37:59.479Z">, "feature name 2"=>#<OpenStruct name="feature name 2", enabled=true, createdAt="2020-09-08T22:08:14.309Z", updatedAt="2020-09-11T14:27:29.678Z">, "Magic Feature"=>#<OpenStruct name="Magic Feature", enabled=true, createdAt="2020-09-11T14:27:39.515Z", updatedAt="2020-09-11T14:27:45.873Z">}
|
44
|
+
```
|
26
45
|
|
27
46
|
## Development
|
28
47
|
|
@@ -32,7 +51,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
51
|
|
33
52
|
## Contributing
|
34
53
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
54
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ardeshir/feature-flag-clients. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
55
|
|
37
56
|
## License
|
38
57
|
|
@@ -40,4 +59,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
59
|
|
41
60
|
## Code of Conduct
|
42
61
|
|
43
|
-
Everyone interacting in the Feature::Flag::Client project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
62
|
+
Everyone interacting in the Feature::Flag::Client project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ardeshireshghi/feature-flag-clients/blob/master/lib/clients/ruby/feature-flag-client/CODE_OF_CONDUCT.md).
|
data/bin/console
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require 'bundler/setup'
|
5
|
-
require '
|
5
|
+
require 'feature_flag_client'
|
6
6
|
|
7
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
data/feature_flag_client.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
|
14
14
|
spec.summary = 'Write a short summary, because RubyGems requires one.'
|
15
15
|
spec.description = 'Write a longer description or delete this line.'
|
16
|
-
spec.homepage = 'https://github.com/ardeshireshghi/feature-flag-clients/lib/clients/ruby'
|
16
|
+
spec.homepage = 'https://github.com/ardeshireshghi/feature-flag-clients/tree/master/lib/clients/ruby/feature-flag-client'
|
17
17
|
spec.license = 'MIT'
|
18
18
|
|
19
19
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feature_flag_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ardeshir Eshghi
|
@@ -119,12 +119,12 @@ files:
|
|
119
119
|
- lib/feature_flag_client/client.rb
|
120
120
|
- lib/feature_flag_client/client/version.rb
|
121
121
|
- lib/feature_flag_client/session.rb
|
122
|
-
homepage: https://github.com/ardeshireshghi/feature-flag-clients/lib/clients/ruby
|
122
|
+
homepage: https://github.com/ardeshireshghi/feature-flag-clients/tree/master/lib/clients/ruby/feature-flag-client
|
123
123
|
licenses:
|
124
124
|
- MIT
|
125
125
|
metadata:
|
126
126
|
allowed_push_host: https://rubygems.org
|
127
|
-
homepage_uri: https://github.com/ardeshireshghi/feature-flag-clients/lib/clients/ruby
|
127
|
+
homepage_uri: https://github.com/ardeshireshghi/feature-flag-clients/tree/master/lib/clients/ruby/feature-flag-client
|
128
128
|
source_code_uri: https://github.com/ardeshireshghi/feature-flag-clients/lib/clients/ruby
|
129
129
|
changelog_uri: https://github.com/ardeshireshghi/feature-flag-clients/lib/clients/ruby/feature-flag-client/CHANGELOG.md
|
130
130
|
post_install_message:
|