yggdrasil-engine 0.0.6.beta.5-aarch64-linux → 0.0.9-aarch64-linux

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: 1ebeef50aa4fd463a1aca6977b3c58946e54d84267a3dee806af153008551a6c
4
- data.tar.gz: 7779bfd4fcce52c53b99fa635a65f02132c105f5036d07cd70da017220713606
3
+ metadata.gz: 05b07f70c24b4a6cf6b4bc7a96be4a4f4d9cab23771769ef018855b1482c9d6a
4
+ data.tar.gz: 64864cce36e79efbdf76fe23a56ae4597ec9d7fd26efaef9f6aff62455c41868
5
5
  SHA512:
6
- metadata.gz: 636d148a8ff413e23c448ddae1f1250c393b09fc959266f893264028b289386a7d58179b8df8faa170b0756a5d7c14e97a08bb40285b4272eb64b9a1e4511f83
7
- data.tar.gz: 68e2bf44a13181dff407f0c32d41fedb4afa68b1a7efb990e2c0a0f2e17b6743f864eb89bc14b00298a581e1f7c6ea93361665fc5572c79f21fc7e6e9fe8b15a
6
+ metadata.gz: 7287280a20a59acd9e09bee4788b792b02c261f3feddbe9195f3d58c329c463fc795a14a020032b69a8e7a801ae6071dc9b0a8a0f7896f26e0321bdb2068468c
7
+ data.tar.gz: f0ec2dc340f28f51d86822c2a6e767b5376c2a4c30a984e96c40fbc7c2508c407f4d35a49979b33848e8c05b43fd4d018f739aab5788b42a521ee33d1a9e19e4
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,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.9
5
5
  platform: aarch64-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: []
@@ -32,14 +32,15 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - README.md
34
34
  - lib/custom_strategy.rb
35
- - lib/libyggdrasilffi_aarch64.so
35
+ - lib/libyggdrasilffi_arm64.so
36
36
  - lib/yggdrasil_engine.rb
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: {}
42
+ metadata:
43
+ yggdrasil_core_version: 0.14.0
43
44
  post_install_message:
44
45
  rdoc_options: []
45
46
  require_paths:
@@ -51,9 +52,9 @@ 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: 1.3.1
57
+ version: '0'
57
58
  requirements: []
58
59
  rubygems_version: 3.3.5
59
60
  signing_key:
Binary file