configly-ruby 0.0.7 → 1.0.0

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
  SHA256:
3
- metadata.gz: a42b4285e7b42e00601a87e46cfb8680f07762ad577ae26ab840aeecefa57d1a
4
- data.tar.gz: 96d5942a380b62128d30fac438dff07bfa47746ea85668926c6ab735eeec770c
3
+ metadata.gz: f5cd1a5ca5bd4fff4a416180ea014a83b38c53abb3bf88c95c73a1847acab147
4
+ data.tar.gz: 39f1058a0f232c79c974c3b3f40225e2bf9c686f2fa2a6a35ea1957d101d6ea7
5
5
  SHA512:
6
- metadata.gz: b4f4fd9e7fb133c3ba13376929c06bd64a09c8e707347ddb325887ebb4d4161de3952af67b47edba1d0239401c1758a2c379980e29a2dec73dab0615a265210e
7
- data.tar.gz: e0be4959d0af7c1bd59aa2d1030190cfaa4d798c9d2982f8badc0180f8b924cddee7d0fc892dfcefad0302968bfcce444b213fff253e525dee34383eed41b2e0
6
+ metadata.gz: 7b62c2e1201994d6d6b7e657a4f0ff8054f7fdf27a4c0f72d5321da02aa9216326329ed9c5ce269c53141587a565e6facfccfb206465d7662c378860463826b8
7
+ data.tar.gz: c8faaf70b43269cb72058eb129378de450bd5186135131d9200b4e77e9ea4c3899094e0c7f33d5499d4c10d8a73b9bc931d06e034dbd43c23eae60056f7f0dbc
data/README.md CHANGED
@@ -9,12 +9,17 @@ Table of Contents
9
9
 
10
10
  * [What is Configly?](#what-is-configly)
11
11
  * [Core Features](#core-features)
12
+ * [Concepts/ Data Model](#concepts--data-model)
12
13
  * [Getting Started](#getting-started)
13
- * [Get your API Key](#get-your-api-key)
14
- * [Library installation](#library-installation)
14
+ + [1. Get your API Key](#1-get-your-api-key)
15
+ + [2. Create your first Config](#2-create-your-first-config)
16
+ + [3. Install the client library](#3-install-the-client-library)
17
+ + [4. Fetch the Config](#4-fetch-the-config)
15
18
  * [Usage](#usage)
16
- * [Example](#example)
19
+ * [Feature Flags](#feature-flags)
20
+ * [Configuring this library to use websockets](#configuring-this-library-to-use-websockets)
17
21
  * [License](#license)
22
+ - [Configly Ruby Library](#configly-ruby-library)
18
23
 
19
24
 
20
25
  ## What is Configly?
@@ -38,7 +43,7 @@ read more about the benefits at [Configly](config.ly).
38
43
 
39
44
  - API to fetch Strings, JSON Blobs (arrays and objects), Booleans, and Numbers from the Configly backend
40
45
  - [Web interface](https://www.config.ly/config) for modifying these values without having to deploy code (we call our beloved web interface _the Configulator_).
41
- - High availability, high-throughput, low-latency backend.
46
+ - High availability, high-throughput, low-latency backend.
42
47
  - Smart caching on the client libraries to minimize server requests.
43
48
  - Client libraries available in an expanding amount of languages.
44
49
 
@@ -128,9 +133,9 @@ Be sure to save via clicking 'Send to Clients'. Now, we'll write client code to
128
133
 
129
134
  ### 3. Install the client library
130
135
 
131
- If you're using bundler, add the following line to your project's `Gemfile`:
136
+ If you're using [Bundler](https://bundler.io/) (as is often the case with Rails), add the following line to your project's `Gemfile`:
132
137
  ```sh
133
- gem 'configly-ruby', '~> 0.0.5'
138
+ gem 'configly-ruby', '~> 1.0.0'
134
139
  ```
135
140
 
136
141
  Or, if you're using the Gem directly from your application, you can run:
@@ -138,7 +143,7 @@ Or, if you're using the Gem directly from your application, you can run:
138
143
  gem install configly-ruby
139
144
  ```
140
145
 
141
- You will need to set the `CONFIGLY_API_KEY` environment variable.
146
+ You will need to set the `CONFIGLY_API_KEY` [environment variable](https://www.rubyguides.com/2019/01/ruby-environment-variables/).
142
147
 
143
148
  ### 4. Fetch the Config
144
149
  In a Rails controller, add the following code
@@ -184,8 +189,9 @@ store_catalog:
184
189
  On the Ruby client:
185
190
 
186
191
  ```ruby
192
+ # You can try this example out by setting the `CONFIGLY_API_KEY` environmental variable to our demo account: 'Dem0apiKEY'
187
193
  begin
188
- catalog = Configly::Client.get(KEY)
194
+ catalog = Configly::Client.get("store_catalog")
189
195
  items = catalog['items']
190
196
  prices = catalog['prices']
191
197
 
@@ -199,9 +205,12 @@ end
199
205
 
200
206
  Note: If the key doesn't exist, this will raise a `Configly::KeyError`
201
207
 
208
+ ### Feature Flags
202
209
  Here is an example with feature flags.
203
- // These values are stored on the Config.ly server
210
+
204
211
  ```
212
+ // These values are stored on the Config.ly server
213
+
205
214
  feature1_enabled: true
206
215
  feature2_enabled: false
207
216
  ```
@@ -209,6 +218,9 @@ feature2_enabled: false
209
218
  On the ruby client:
210
219
 
211
220
  ```ruby
221
+ # Remember, you need to set the `CONFIGLY_API_KEY` environment variable.
222
+ # You can find your API Key on https://www.config.ly/config.
223
+
212
224
  begin
213
225
  if Configly::Client.get('feature1_enabled')
214
226
  # Logic for feature 1
@@ -3,7 +3,7 @@ require_relative 'lib/configly/version'
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'configly-ruby'
6
- s.version = '0.0.7'
6
+ s.version = '1.0.0'
7
7
  s.date = '2020-11-16'
8
8
  s.summary = "Configly"
9
9
  s.description = "Configly SDK gem"
@@ -84,6 +84,7 @@ module Configly
84
84
 
85
85
  Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
86
86
  request = Net::HTTP::Get.new uri
87
+ request['X-Lib-Version'] = "configly-ruby/#{Configly::VERSION}"
87
88
  request.basic_auth get_api_key, ''
88
89
  response = http.request request
89
90
  data = JSON.parse(response.body)['data']
@@ -1,3 +1,3 @@
1
1
  module Configly
2
- VERSION = "0.0.7"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configly-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dana Levine