flipt_client 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f2919ba6a195d57dbb67daf562f3262e5e6a931d60b0a4e9b8bacc922259e5d
4
- data.tar.gz: 5ab1a61c5e281c59e89f401e22b632b38ee822dbe7ef84f9d070a680a5ca4b71
3
+ metadata.gz: dff4c9d668eeb7aaa9c83e157e008483db259418034753a443e8410c47a6e992
4
+ data.tar.gz: 62b0d2b34fcd4e9d3f0967f8637a1e70a047fffc1e58a70683c93a4f69d9e32b
5
5
  SHA512:
6
- metadata.gz: 4bb787bcc670834db622390d9c207177dada5e6839acf74b2ecd8b3c1adbf0a72bc374d35a75c1dbfa4f2799f84d450dfe1a7185b516de3bf99d618722e1867b
7
- data.tar.gz: 667af0efda9542289ddc52b662bd168668fa414010c2de75b3a8cd71928099ad3ef148cee4526d1cbbe199cbecdd405d391001fe83d6dcad89074c5e8a8f1e31
6
+ metadata.gz: 159db6c69a4909f775c471c6375d46c1af745fe3388ef4bacecdda726c29cfa0416c3b7608c16f3db5157a5c6676b778d8a8818a4e8f14dd6a5a2fe818a2efa6
7
+ data.tar.gz: 98ef4522ab570ced6c555c7be9d174e3a9817ae1c8fdd87b18f6678945d180e0d529a79247292e7f5709fd76bcb7767feeb434712dffc871da2f9427abab1e82
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
- <!-- Last published: Wed Jan 3 14:22:06 UTC 2024 -->
2
1
  # Flipt Client Ruby
3
2
 
4
3
  [![Gem Version](https://badge.fury.io/rb/flipt_client.svg)](https://badge.fury.io/rb/flipt_client)
@@ -11,6 +10,17 @@ The `flipt-client-ruby` directory contains the Ruby source code for the Flipt [c
11
10
  gem install flipt_client
12
11
  ```
13
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
+
14
24
  ## Usage
15
25
 
16
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/src/error/mod.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/evaluator/mod.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/lib.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/models/common.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/models/flipt.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/models/mod.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/models/source.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/parser/mod.rs /Users/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/store/mod.rs
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
@@ -1 +1 @@
1
- /target/aarch64-unknown-linux-gnu/release/libfliptengine.rlib: /project/flipt-engine/build.rs /project/flipt-engine/src/error/mod.rs /project/flipt-engine/src/evaluator/mod.rs /project/flipt-engine/src/lib.rs /project/flipt-engine/src/models/common.rs /project/flipt-engine/src/models/flipt.rs /project/flipt-engine/src/models/mod.rs /project/flipt-engine/src/models/source.rs /project/flipt-engine/src/parser/mod.rs /project/flipt-engine/src/store/mod.rs
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
@@ -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/src/error/mod.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/evaluator/mod.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/lib.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/models/common.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/models/flipt.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/models/mod.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/models/source.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/parser/mod.rs /home/runner/work/flipt-client-sdks/flipt-client-sdks/flipt-engine/src/store/mod.rs
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flipt
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.5'
5
5
  end
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.3
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-03 00:00:00.000000000 Z
11
+ date: 2024-01-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Flipt Client Evaluation SDK
14
14
  email: