yggdrasil-engine 0.0.6-universal-java-1.8 → 0.0.8.beta.1-universal-java-1.8

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: b330f88b283bd491f9ddfc95578e42411da5cf47858b4bb8d548de2a5409521e
4
- data.tar.gz: a5fb9566c331132551cde0802607c8eb857d032feafb5126de7100931007c06b
3
+ metadata.gz: 9855a336fcab7e1f81ef682d8c71496998fc3f1dcf250dcf1d698d57a64dd541
4
+ data.tar.gz: bfe88ba34f3cd7cf8bc035bdd3f23bfe61478dc8a56ad69f214ca16952f1cc44
5
5
  SHA512:
6
- metadata.gz: c42453ecdb14bc751890c89ce6685ff4abbb821337306e620bf58bcbbe3c4bf3c8b60c9933cb151d882c2a872360420d9fcdbfbc8f3b9e09b7c172aadc3604bd
7
- data.tar.gz: e0d1b0e2b5e169519d73b46721786969d86691b3910c05f05549e4d64e33b1a09d6e310c89d2e825a20a5e36e819a0a916959802ab2c0ad3b92949c296523c96
6
+ metadata.gz: 43ec045b1949acc59f305804b7d1a676339cebafe554d28ffd3e9b7de5238ac1214a65df6f9750e98a45c4975febfdb6e296fa426dab05b1b36c3fc372d71560
7
+ data.tar.gz: c930002d70b8ac1f32bf3d753bba49545e8a7aec515532a0f21c2b5cd0a6253bc1d56ea7b698d5b3c2b977b7121df99ba3894da6842d66ae064272183c6fdf73
@@ -0,0 +1 @@
1
+ Not Found
@@ -0,0 +1 @@
1
+ Not Found
Binary file
Binary file
@@ -0,0 +1 @@
1
+ Not Found
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
@@ -0,0 +1 @@
1
+ Not Found
@@ -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,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
4
+ version: 0.0.8.beta.1
5
5
  platform: universal-java-1.8
6
6
  authors:
7
7
  - Unleash
@@ -15,7 +15,7 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 1.15.5
18
+ version: 1.16.3
19
19
  name: ffi
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,7 +23,7 @@ dependencies:
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,19 +32,22 @@ 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-musl.so
36
+ - lib/libyggdrasilffi_arm64.dll
36
37
  - lib/libyggdrasilffi_arm64.dylib
37
38
  - lib/libyggdrasilffi_arm64.so
38
- - lib/libyggdrasilffi_x86_64.dll
39
- - lib/libyggdrasilffi_x86_64.dylib
39
+ - lib/libyggdrasilffi_x86_64-linux-musl.so
40
40
  - lib/libyggdrasilffi_x86_64.so
41
41
  - lib/yggdrasil_engine.rb
42
+ - lib/yggdrasilffi_x86_64.dll
43
+ - lib/yggdrasilffi_x86_64.dylib
42
44
  - spec/custom_strategy_spec.rb
43
45
  - spec/yggdrasil_engine_spec.rb
44
46
  homepage: http://github.com/username/my_gem
45
47
  licenses:
46
48
  - MIT
47
- metadata: {}
49
+ metadata:
50
+ yggdrasil_core_version: 0.14.0
48
51
  post_install_message:
49
52
  rdoc_options: []
50
53
  require_paths:
@@ -56,9 +59,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
59
  version: '0'
57
60
  required_rubygems_version: !ruby/object:Gem::Requirement
58
61
  requirements:
59
- - - ">="
62
+ - - ">"
60
63
  - !ruby/object:Gem::Version
61
- version: '0'
64
+ version: 1.3.1
62
65
  requirements: []
63
66
  rubygems_version: 3.1.6
64
67
  signing_key:
Binary file
Binary file
Binary file