featureflow 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 588ff1000fc28617bc73e96020339f8d311a8bef
4
- data.tar.gz: e54f4bfbe4cc09c55ca14d2e18344227c266a6fb
3
+ metadata.gz: e2b92e283ed6338bfc5cea3a091f5238d67d168f
4
+ data.tar.gz: 40b939815e43da2f10b6e2f7cb6c3c7a65d6f7ce
5
5
  SHA512:
6
- metadata.gz: db8eb2eb8031279d65daede41d0fe760f533bd69f5a0f4cee6febd9cf927ebedfdbdc392b6026463407ce9a92d49995ed0d5c6ba014d3734d84bfccaac5eefa3
7
- data.tar.gz: e1f5fcd4cc2e8d062cd8d302200d10be587b173375309a0c49592ca5f303a96a9209365dbd296d604692a1ef2140f2cb48672e7881490d25a3fcca68fd29ef95
6
+ metadata.gz: d9e51aea4bd9aaf4b01521bd2f0d4b598705e6f8b10cee5a62d3b79de76c02ccb75d8d5f38720b543d3fdfcbd72d4bb06160622a3c1ca01b39075699bb6b6247
7
+ data.tar.gz: 27cd52c7e6a43b42c4eafefc3d712916746fe1d60c1283a779b1a6f867a8d162bea29eec543268f0534b780b1ee00368e0648e4e19a074c14fdb440f1ab05435
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg
data/README.md CHANGED
@@ -1,2 +1,4 @@
1
1
  # featureflow-ruby-sdk
2
2
  Ruby SDK for featureflow
3
+
4
+ FEATUREFLOW_SERVER_KEY=
@@ -7,7 +7,9 @@ require 'featureflow/events_client'
7
7
 
8
8
  module Featureflow
9
9
  class Client
10
- def initialize(api_key, config = {})
10
+ def initialize(config = {})
11
+ api_key = config[:api_key] || ENV[:FEATUREFLOW_SERVER_KEY]
12
+ raise ArgumentError, "You have not defined either config[:api_key] or ENV[:FEATUREFLOW_SERVER_KEY]" unless api_key
11
13
  Featureflow.logger.info 'initializing client'
12
14
  @features = {}
13
15
  @config = {
@@ -1,3 +1,3 @@
1
1
  module Featureflow
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/test.rb CHANGED
@@ -5,7 +5,7 @@ with_features = [
5
5
  Featureflow::Feature.create('default', 'variant')
6
6
  ]
7
7
  api_key = 'srv-env-9b5fff890c724d119a334a64ed4d2eb2'
8
- featureflow_client = Featureflow::Client.new(api_key, with_features: with_features)
8
+ featureflow_client = Featureflow::Client.new(api_key: api_key, with_features: with_features)
9
9
  context = Featureflow::ContextBuilder.new('user1').build
10
10
  puts('test-integration is on? ' + featureflow_client.evaluate('test-integration', context).on?.to_s)
11
11
  featureflow_client.evaluate('nooooo', context).on?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: featureflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Young
@@ -87,6 +87,7 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".gitignore"
90
91
  - ".rubocop.yml"
91
92
  - Gemfile
92
93
  - Gemfile.lock