yggdrasil-engine 0.0.6.beta.5-arm-linux → 0.0.8.beta.1-arm-linux

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: 1f9c5bc22f1321fed6854c484e0b0fe26fd84deab2043186197c5ea5cc6065c7
4
- data.tar.gz: c9eb42d2c1a3a22c6944e425c48614c562428191ec75914b176fc9f6c19c0ee3
3
+ metadata.gz: f20a21cee8ef49cb0f93f30e68ddb6e30045d349e474d1615bc0e851bfb3607e
4
+ data.tar.gz: c7bba572749e4f06f482dfda737669965af7fe7fb0fa0c68f17092d81acb5b53
5
5
  SHA512:
6
- metadata.gz: 18e0420e9c0e356c815ade0846786b9f65829914f295856ad4c7e3317de7caf8bbdb198161e92bcda4cc0a9789829008b5d3712a5cbac41dbabec1b8253fdd25
7
- data.tar.gz: 1789388a73d7112644bc596f69d4030a6251b6cd52842da940c7269ad32a181d8961938cc6da2b3a5fc3589250aa554a91e5b53ac27f34db70f6cf2db17cd388
6
+ metadata.gz: 2617934a449b976ab24e78c703d2aa2676159f48468c2d69bee144ebb1b90aa33ae8f24f95fc2070182c71a038ecd7a7f17a363f6a662d7e5057d8f115bcb4f2
7
+ data.tar.gz: 8a1e38e1a2d5717542ee9882f895be204e9bb4c31135d13e1425a2ca6f1d83c82404998d80f456ae68583aaa3f0aac3733359d1dfdf8e246e6b2864edd554578
Binary file
@@ -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
@@ -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,7 +1,7 @@
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.beta.1
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Unleash
@@ -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,7 +39,8 @@ files:
39
39
  homepage: http://github.com/username/my_gem
40
40
  licenses:
41
41
  - MIT
42
- metadata: {}
42
+ metadata:
43
+ yggdrasil_core_version: 0.14.0
43
44
  post_install_message:
44
45
  rdoc_options: []
45
46
  require_paths: