yggdrasil-engine 0.0.6.beta.5-arm64-darwin → 0.0.8-arm64-darwin

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: 1f109b7119e23fcce0bc8f2d3ba1a14b98352a1bb808999db629fb715eef954d
4
- data.tar.gz: 34b8c67ae4323fcd4361fcd058eed81057eb65a39d327128e0ae3c5c8d8eba61
3
+ metadata.gz: 2e94982b7483841813f1c625dfd9ac1bc82aed2aa637fe4e7ef14fbb0073199c
4
+ data.tar.gz: 0df55c0f5b33672282ad424e86b1559c9b74c2496e2c5befec1b046617b35bf8
5
5
  SHA512:
6
- metadata.gz: 8bb264a55f1d1c1ca9399623bacf02641cea52f76a4427cd87914ec0e11749c6d0b0704d450199c2fed0aea5fb5cb410fd46e6bb40c3c08f78ff47cb31619add
7
- data.tar.gz: 610089c2fe20cdb8d63cfc409f534a5ca74b485e9c79d6e80d297108e8715d0fed4063f58b671d9f05975d2ac27bebc624a2f5141074e7f26e46a06e41db9774
6
+ metadata.gz: 7545f5069a61956c76fd1cae7e5c0056879547cd442884d8e7f5d40f248c6fd842c157554762d83067433921867be57d0c1cbc0197bdebc7d87077b0155eb637
7
+ data.tar.gz: ef056a6ecdd51740f4ee7abe13ce903a4f4e069c5e070934212414eada1139d7053b51254ff35f4228e2bef2810bec4864e81da3372004b7d974bb5dae88fb34
Binary file
@@ -10,13 +10,13 @@ def platform_specific_lib
10
10
  os = RbConfig::CONFIG['host_os']
11
11
  cpu = RbConfig::CONFIG['host_cpu']
12
12
 
13
- extension = case os
13
+ extension, prefix = case os
14
14
  when /darwin|mac os/
15
- 'dylib'
15
+ ['dylib', 'lib']
16
16
  when /linux/
17
- 'so'
17
+ ['so', 'lib']
18
18
  when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
19
- 'dll'
19
+ ['dll', '']
20
20
  else
21
21
  raise "unsupported platform #{os}"
22
22
  end
@@ -24,15 +24,20 @@ def platform_specific_lib
24
24
  arch_suffix = case cpu
25
25
  when /x86_64/
26
26
  'x86_64'
27
- when /arm/
27
+ when /arm|aarch64/
28
28
  'arm64'
29
- when /aarch64/
30
- 'aarch64'
31
29
  else
32
30
  raise "unsupported architecture #{cpu}"
33
31
  end
34
32
 
35
- "libyggdrasilffi_#{arch_suffix}.#{extension}"
33
+ lib_type_suffix = if os =~ /linux/
34
+ musl = system("ldd /bin/sh | grep -q musl")
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
@@ -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.beta.5
4
+ version: 0.0.8
5
5
  platform: arm64-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: []
@@ -39,8 +39,9 @@ files:
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
@@ -55,8 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
56
  - !ruby/object:Gem::Version
56
57
  version: '0'
57
58
  requirements: []
58
- rubygems_version: 3.5.19
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: []