From c8b57b20d89dac574dd18afa5e0339931e337f64 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:06:21 -0500 Subject: [PATCH] chore: update READMEs --- flipt-client-node/README.md | 6 +++--- flipt-client-ruby/README.md | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/flipt-client-node/README.md b/flipt-client-node/README.md index 5e80daca..61d720d8 100644 --- a/flipt-client-node/README.md +++ b/flipt-client-node/README.md @@ -6,7 +6,7 @@ The `flipt-client-node` directory contains the TypeScript source code for a Flip Currently, to use this client, you'll need to build the dynamic library and the Node package locally and install it. This is a temporary solution until we can figure out a better way to package and distribute the libraries. -The dynamic library will contain the functionality necessary for the Node client to make FFI calls. +The dynamic library will contain the functionality necessary for the client to make calls to the Flipt engine via FFI. See [flipt-engine](../flipt-engine) for more information on the Flipt engine and FFI. ### Prerequisites @@ -16,7 +16,7 @@ The dynamic library will contain the functionality necessary for the Node client ### Automated Build -1. Build and copy the Rust dynamic library to the `flipt-client-node` directory. You can do this by running the following command from the root of the repository: +1. Build and copy the dynamic library to the `flipt-client-node` directory. You can do this by running the following command from the root of the repository: ```bash @@ -38,7 +38,7 @@ The dynamic library will contain the functionality necessary for the Node client cargo build --release ``` -This should generate a `target/` directory in the root of this repository, which contains the dynamic linking library built for your platform. +This should generate a `target/` directory in the root of this repository, which contains the dynamically linked library built for your platform. 2. You'll need to copy the dynamic library to the `flipt-client-node/ext` directory. This is a temporary solution until we can figure out a better way to package the libraries with the package. diff --git a/flipt-client-ruby/README.md b/flipt-client-ruby/README.md index d79113ca..3c46dad8 100644 --- a/flipt-client-ruby/README.md +++ b/flipt-client-ruby/README.md @@ -6,7 +6,7 @@ The `flipt-client-ruby` directory contains the Ruby source code for a Flipt eval Currently, to use this client, you'll need to build the dynamic library and the gem locally and install it. This is a temporary solution until we can figure out a better way to package and distribute the libraries. -The dynamic library will contain the functionality necessary for the Node client to make FFI calls. +The dynamic library will contain the functionality necessary for the client to make calls to the Flipt engine via FFI. See [flipt-engine](../flipt-engine) for more information on the Flipt engine and FFI. ### Prerequisites @@ -16,7 +16,7 @@ The dynamic library will contain the functionality necessary for the Node client ### Automated Build -1. Build and copy the Rust dynamic library to the `flipt-client-ruby/lib/ext` directory. You can do this by running the following command from the root of the repository: +1. Build and copy the dynamic library to the `flipt-client-ruby/lib/ext` directory. You can do this by running the following command from the root of the repository: ```bash @@ -32,7 +32,7 @@ The dynamic library will contain the functionality necessary for the Node client cargo build --release ``` -This should generate a `target/` directory in the root of this repository, which contains the dynamically linked library built for your platform. This dynamic library will contain the functionality necessary for the Ruby client to make FFI calls. +This should generate a `target/` directory in the root of this repository, which contains the dynamically linked library built for your platform. 2. You'll need to copy the dynamic library to the `flipt-client-ruby/lib/ext` directory. This is a temporary solution until we can figure out a better way to package the libraries with the gem. @@ -56,7 +56,17 @@ In your Ruby code you can import this client and use it as so: ```ruby require 'flipt_client' -client = Flipt::EvaluationClient.new() # uses 'default' namespace +# namespace is the first positional argument and is optional here and will have a value of "default" if not specified. +# opts is the second positional argument and is also optional, the structure is: +# { +# "url": "http://localhost:8080", +# "update_interval": 120, +# "auth_token": "secret" +# } +# +# You can replace the url with where your upstream Flipt instance points to, the update interval for how long you are willing +# to wait for updated flag state, and the auth token if your Flipt instance requires it. +client = Flipt::EvaluationClient.new() resp = client.evaluate_variant({ flag_key: 'buzz', entity_id: 'someentity', context: { fizz: 'buzz' } }) puts resp