flipt_client 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/ext/darwin_arm64/libfliptengine.d +1 -1
- data/lib/ext/darwin_arm64/libfliptengine.dylib +0 -0
- data/lib/ext/darwin_arm64/libfliptengine.rlib +0 -0
- data/lib/ext/linux_arm64/libfliptengine.d +1 -1
- data/lib/ext/linux_arm64/libfliptengine.rlib +0 -0
- data/lib/ext/linux_arm64/libfliptengine.so +0 -0
- data/lib/ext/linux_x86_64/libfliptengine.d +1 -1
- data/lib/ext/linux_x86_64/libfliptengine.rlib +0 -0
- data/lib/ext/linux_x86_64/libfliptengine.so +0 -0
- data/lib/flipt_client/version.rb +1 -1
- data/lib/flipt_client.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dff4c9d668eeb7aaa9c83e157e008483db259418034753a443e8410c47a6e992
|
4
|
+
data.tar.gz: 62b0d2b34fcd4e9d3f0967f8637a1e70a047fffc1e58a70683c93a4f69d9e32b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 159db6c69a4909f775c471c6375d46c1af745fe3388ef4bacecdda726c29cfa0416c3b7608c16f3db5157a5c6676b778d8a8818a4e8f14dd6a5a2fe818a2efa6
|
7
|
+
data.tar.gz: 98ef4522ab570ced6c555c7be9d174e3a9817ae1c8fdd87b18f6678945d180e0d529a79247292e7f5709fd76bcb7767feeb434712dffc871da2f9427abab1e82
|
data/README.md
CHANGED
@@ -10,6 +10,17 @@ The `flipt-client-ruby` directory contains the Ruby source code for the Flipt [c
|
|
10
10
|
gem install flipt_client
|
11
11
|
```
|
12
12
|
|
13
|
+
## Using System Libffi
|
14
|
+
|
15
|
+
If you are experiencing segfaults when using this gem, you may need to configure `ffi` to use the system libffi instead of the bundled one.
|
16
|
+
|
17
|
+
You can do this before installing the gem by running the following command:
|
18
|
+
|
19
|
+
```bash
|
20
|
+
gem install ffi -- --enable-system-libffi # to install the gem manually
|
21
|
+
bundle config build.ffi --enable-system-libffi # for bundle install
|
22
|
+
```
|
23
|
+
|
13
24
|
## Usage
|
14
25
|
|
15
26
|
In your Ruby code you can import this client and use it as so:
|
@@ -1 +1 @@
|
|
1
|
-
/Users/runner/work/flipt-client-sdks/flipt-client-sdks/target/aarch64-apple-darwin/release/libfliptengine.rlib: /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/build.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/
|
1
|
+
/Users/runner/work/flipt-client-sdks/flipt-client-sdks/target/aarch64-apple-darwin/release/libfliptengine.rlib: /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine-ffi/build.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine-ffi/src/lib.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/error/mod.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/lib.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/models/common.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/models/flipt.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/models/mod.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/models/source.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/parser/mod.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/store/mod.rs
|
Binary file
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
/target/aarch64-unknown-linux-gnu/release/libfliptengine.rlib: /project/flipt-engine/build.rs /project/flipt-engine/lib/evaluation/src/error/mod.rs /project/flipt-
|
1
|
+
/target/aarch64-unknown-linux-gnu/release/libfliptengine.rlib: /project/flipt-engine-ffi/build.rs /project/flipt-engine-ffi/src/lib.rs /project/flipt-evaluation/src/error/mod.rs /project/flipt-evaluation/src/lib.rs /project/flipt-evaluation/src/models/common.rs /project/flipt-evaluation/src/models/flipt.rs /project/flipt-evaluation/src/models/mod.rs /project/flipt-evaluation/src/models/source.rs /project/flipt-evaluation/src/parser/mod.rs /project/flipt-evaluation/src/store/mod.rs
|
Binary file
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
/home/runner/work/flipt-client-sdks/flipt-client-sdks/target/x86_64-unknown-linux-gnu/release/libfliptengine.rlib: /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/build.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/
|
1
|
+
/home/runner/work/flipt-client-sdks/flipt-client-sdks/target/x86_64-unknown-linux-gnu/release/libfliptengine.rlib: /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine-ffi/build.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine-ffi/src/lib.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/error/mod.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/lib.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/models/common.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/models/flipt.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/models/mod.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/models/source.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/parser/mod.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-evaluation/src/store/mod.rs
|
Binary file
|
Binary file
|
data/lib/flipt_client/version.rb
CHANGED
data/lib/flipt_client.rb
CHANGED
@@ -36,6 +36,14 @@ module Flipt
|
|
36
36
|
# const char *evaluate_boolean(void *engine_ptr, const char *evaluation_request);
|
37
37
|
attach_function :evaluate_boolean, %i[pointer string], :string
|
38
38
|
|
39
|
+
# Create a new Flipt client
|
40
|
+
#
|
41
|
+
# @param namespace [String] namespace
|
42
|
+
# @param opts [Hash] options
|
43
|
+
# @option opts [String] :url Flipt server url
|
44
|
+
# @option opts [String] :auth_token Flipt api key
|
45
|
+
# @option opts [Integer] :update_interval interval in seconds to update the cache
|
46
|
+
# @option opts [String] :reference reference to use for namespace data
|
39
47
|
def initialize(namespace = 'default', opts = {})
|
40
48
|
@namespace = namespace
|
41
49
|
namespace_list = [namespace]
|
@@ -52,6 +60,12 @@ module Flipt
|
|
52
60
|
proc { destroy_engine(engine) }
|
53
61
|
end
|
54
62
|
|
63
|
+
# Evaluate a variant flag for a given request
|
64
|
+
#
|
65
|
+
# @param evaluation_request [Hash] evaluation request
|
66
|
+
# @option evaluation_request [String] :entity_id entity id
|
67
|
+
# @option evaluation_request [String] :flag_key flag key
|
68
|
+
# @option evaluation_request [String] :namespace_key override namespace key
|
55
69
|
def evaluate_variant(evaluation_request = {})
|
56
70
|
evaluation_request[:namespace_key] = @namespace
|
57
71
|
validate_evaluation_request(evaluation_request)
|
@@ -59,6 +73,12 @@ module Flipt
|
|
59
73
|
JSON.parse(resp)
|
60
74
|
end
|
61
75
|
|
76
|
+
# Evaluate a boolean flag for a given request
|
77
|
+
#
|
78
|
+
# @param evaluation_request [Hash] evaluation request
|
79
|
+
# @option evaluation_request [String] :entity_id entity id
|
80
|
+
# @option evaluation_request [String] :flag_key flag key
|
81
|
+
# @option evaluation_request [String] :namespace_key override namespace key
|
62
82
|
def evaluate_boolean(evaluation_request = {})
|
63
83
|
evaluation_request[:namespace_key] = @namespace
|
64
84
|
validate_evaluation_request(evaluation_request)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipt_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flipt Devs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Flipt Client Evaluation SDK
|
14
14
|
email:
|