yggdrasil-engine 0.0.6-x86_64-darwin → 0.0.8.beta.1-x86_64-darwin

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: ef941a88c838018afe79a25fb6ca991e6d4bbdec651c22101010a229c100e004
4
- data.tar.gz: aa8ec8ffc2b999e0f00a6d832a08ede1cccd10c72a9a1ae04e2842be904ba133
3
+ metadata.gz: c92bc17b47b55a337eb944ff2f60558166fc6fe88467e98e8c79cc13a7dcb09d
4
+ data.tar.gz: 8c34092e23dff93726afbdb36e098d9d85a13f8a6d2c59b42cbbe745e2a46b2e
5
5
  SHA512:
6
- metadata.gz: 0cf9cd714c5a576f3cf4a55d4ab37a0fd5f7633325515a43d7ea731f25200902ef0d2bef643d152dd18acbab042526a69cafb8e865555defd3419bde6d199ae4
7
- data.tar.gz: de8a5cfe10f19ce5e0546c1909f892c2074f5c304301faf798fff74936f75c0a28ff7b7688ba421ae0f530636de60570f13112188ba1933ff1c2fc3f262c41c6
6
+ metadata.gz: 4364e1789b9a04216f8129ed7381a9bc007064d79b54e3e6402563e8c7daee5b3b8a8082d7a92a22efd7a427fe12930871c6a069cea6b1cadffdf7793a5febd9
7
+ data.tar.gz: cc1a09c2009374038446143df309ca3674e6f059866836c1b0a36393a57a98795ae9838bbf94125a23c4d739c78e9dc8c41312e3f6f41802d58b333d6086e9bd
@@ -10,29 +10,34 @@ def platform_specific_lib
10
10
  os = RbConfig::CONFIG['host_os']
11
11
  cpu = RbConfig::CONFIG['host_cpu']
12
12
 
13
- extension = case os
14
- when /darwin|mac os/
15
- 'dylib'
16
- when /linux/
17
- 'so'
18
- when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
19
- 'dll'
20
- else
21
- raise "unsupported platform #{os}"
22
- end
13
+ extension, prefix = case os
14
+ when /darwin|mac os/
15
+ ['dylib', 'lib']
16
+ when /linux/
17
+ ['so', 'lib']
18
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
19
+ ['dll', '']
20
+ else
21
+ raise "unsupported platform #{os}"
22
+ end
23
23
 
24
24
  arch_suffix = case cpu
25
- when /x86_64/
26
- 'x86_64'
27
- when /arm/
28
- 'arm64'
29
- when /aarch64/
30
- 'aarch64'
31
- else
32
- raise "unsupported architecture #{cpu}"
33
- end
34
-
35
- "libyggdrasilffi_#{arch_suffix}.#{extension}"
25
+ when /x86_64/
26
+ 'x86_64'
27
+ when /arm|aarch64/
28
+ 'arm64'
29
+ else
30
+ raise "unsupported architecture #{cpu}"
31
+ end
32
+
33
+ lib_type_suffix = if os =~ /linux/
34
+ musl = system("ldd /bin/sh | grep -q musl") # Check if musl is in use
35
+ musl ? "-musl" : ""
36
+ else
37
+ ""
38
+ end
39
+
40
+ "#{prefix}yggdrasilffi_#{arch_suffix}#{lib_type_suffix}.#{extension}"
36
41
  end
37
42
 
38
43
  def to_variant(raw_variant)
@@ -61,6 +66,8 @@ class YggdrasilEngine
61
66
  attach_function :count_toggle, %i[pointer string bool], :void
62
67
  attach_function :count_variant, %i[pointer string string], :void
63
68
 
69
+ attach_function :list_known_toggles, [:pointer], :pointer
70
+
64
71
  def initialize
65
72
  @engine = YggdrasilEngine.new_engine
66
73
  @custom_strategy_handler = CustomStrategyHandler.new
@@ -125,6 +132,13 @@ class YggdrasilEngine
125
132
  metrics[:value]
126
133
  end
127
134
 
135
+ def list_known_toggles
136
+ response_ptr = YggdrasilEngine.list_known_toggles(@engine)
137
+ response_json = response_ptr.read_string
138
+ YggdrasilEngine.free_response(response_ptr)
139
+ JSON.parse(response_json, symbolize_names: true)
140
+ end
141
+
128
142
  def register_custom_strategies(strategies)
129
143
  @custom_strategy_handler.register_custom_strategies(strategies)
130
144
  end
@@ -0,0 +1 @@
1
+ Not Found
@@ -93,6 +93,16 @@ RSpec.describe YggdrasilEngine do
93
93
 
94
94
  expect(metric[:variants][:disabled]).to eq(1)
95
95
  end
96
+
97
+ it 'should list all the features that were loaded' do
98
+ suite_path = File.join('../client-specification/specifications', '01-simple-examples.json')
99
+ suite_data = JSON.parse(File.read(suite_path))
100
+
101
+ yggdrasil_engine.take_state(suite_data['state'].to_json)
102
+
103
+ toggles = yggdrasil_engine.list_known_toggles()
104
+ expect(toggles.length).to eq(3)
105
+ end
96
106
  end
97
107
  end
98
108
 
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yggdrasil-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8.beta.1
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Unleash
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2023-06-28 00:00:00.000000000 Z
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.15.5
19
+ version: 1.16.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.15.5
26
+ version: 1.16.3
27
27
  description: "..."
28
28
  email: liquidwicked64@gmail.com
29
29
  executables: []
@@ -32,15 +32,16 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - README.md
34
34
  - lib/custom_strategy.rb
35
- - lib/libyggdrasilffi_x86_64.dylib
36
35
  - lib/yggdrasil_engine.rb
36
+ - lib/yggdrasilffi_x86_64.dylib
37
37
  - spec/custom_strategy_spec.rb
38
38
  - spec/yggdrasil_engine_spec.rb
39
39
  homepage: http://github.com/username/my_gem
40
40
  licenses:
41
41
  - MIT
42
- metadata: {}
43
- post_install_message:
42
+ metadata:
43
+ yggdrasil_core_version: 0.14.0
44
+ post_install_message:
44
45
  rdoc_options: []
45
46
  require_paths:
46
47
  - lib
@@ -51,12 +52,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
52
  version: '0'
52
53
  required_rubygems_version: !ruby/object:Gem::Requirement
53
54
  requirements:
54
- - - ">="
55
+ - - ">"
55
56
  - !ruby/object:Gem::Version
56
- version: '0'
57
+ version: 1.3.1
57
58
  requirements: []
58
- rubygems_version: 3.5.18
59
- signing_key:
59
+ rubygems_version: 3.3.5
60
+ signing_key:
60
61
  specification_version: 4
61
62
  summary: Unleash engine for evaluating feature toggles
62
63
  test_files: []
Binary file