yamlscript 0.1.47 → 0.1.48
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 +4 -4
- data/ChangeLog.md +4 -0
- data/lib/yamlscript/version.rb +1 -1
- data/lib/yamlscript.rb +21 -12
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25bc6a4a8da3c4fdbcb664adbfa5b5b7f7f0d33b6cf9a783e6c94e038e3dd66d
|
|
4
|
+
data.tar.gz: b3b382de5eabe5d1aa7e89feab34120d82b177f93ba79f1b76adcfc8c341f265
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21995ea38b53c046c4c36611e13a4b83c3b81dbfce770b431dcbee8dfd5bec842ca227b8f0ed37be4cadb30447399b9831c43746545614d8ac1ab5a8256dc28d
|
|
7
|
+
data.tar.gz: 36dafd7fe695c476602e5d352de4ade5ef5ecdcf6d3a8e08248adcb511c47bcd318aeccef5e4fc11f5318e600ade11cc836bed7c4f86c32cc79b824ba4cb01f6
|
data/ChangeLog.md
CHANGED
data/lib/yamlscript/version.rb
CHANGED
data/lib/yamlscript.rb
CHANGED
|
@@ -13,10 +13,10 @@ require_relative 'yamlscript/version'
|
|
|
13
13
|
class YAMLScript
|
|
14
14
|
Error = Class.new(StandardError)
|
|
15
15
|
|
|
16
|
-
#
|
|
16
|
+
# This value is automatically updated by 'make bump'.
|
|
17
17
|
# The version number is used to find the correct shared library file.
|
|
18
18
|
# We currently only support binding to an exact version of libyamlscript.
|
|
19
|
-
YAMLSCRIPT_VERSION = '0.1.
|
|
19
|
+
YAMLSCRIPT_VERSION = '0.1.48'
|
|
20
20
|
|
|
21
21
|
# A low-level interface to the native library
|
|
22
22
|
module LibYAMLScript
|
|
@@ -33,7 +33,7 @@ class YAMLScript
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
def self.
|
|
36
|
+
def self.libyamlscript_name
|
|
37
37
|
"libyamlscript.#{extension}.#{YAMLSCRIPT_VERSION}"
|
|
38
38
|
end
|
|
39
39
|
|
|
@@ -49,18 +49,24 @@ class YAMLScript
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
# Find the libyamlscript shared library file path
|
|
52
|
-
def self.
|
|
53
|
-
name =
|
|
52
|
+
def self.find_libyamlscript_path
|
|
53
|
+
name = libyamlscript_name
|
|
54
54
|
path = ld_library_paths.map {
|
|
55
55
|
|dir| File.join(dir, name) }.detect { |file| File.exist?(file)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
vers = YAMLSCRIPT_VERSION
|
|
59
|
+
raise Error, <<-ERROR unless path
|
|
60
|
+
|
|
61
|
+
Shared library file `#{name}` not found
|
|
62
|
+
Try: curl -sSL yamlscript.org/install | VERSION=#{vers} LIB=1 bash
|
|
63
|
+
See: https://github.com/yaml/yamlscript/wiki/Installing-YAMLScript
|
|
64
|
+
ERROR
|
|
59
65
|
|
|
60
66
|
path
|
|
61
67
|
end
|
|
62
68
|
|
|
63
|
-
dlload
|
|
69
|
+
dlload find_libyamlscript_path
|
|
64
70
|
|
|
65
71
|
extern \
|
|
66
72
|
'int graal_create_isolate(void* params, void** isolate, void** thread)'
|
|
@@ -93,16 +99,19 @@ class YAMLScript
|
|
|
93
99
|
def load(ys_code)
|
|
94
100
|
# Create a new GraalVM isolate thread for each call to load()
|
|
95
101
|
thread = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
|
|
96
|
-
|
|
102
|
+
raise Error, "Failed to create isolate" unless \
|
|
103
|
+
LibYAMLScript.graal_create_isolate(nil, @isolate.ref, thread.ref).zero?
|
|
97
104
|
|
|
98
105
|
# Call 'load_ys_to_json' function in libyamlscript shared library
|
|
99
106
|
json_data = LibYAMLScript.load_ys_to_json(thread, ys_code)
|
|
100
107
|
resp = JSON.parse(json_data.to_s)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
|
|
109
|
+
raise Error, "Failed to tear down isolate" unless \
|
|
110
|
+
LibYAMLScript.graal_tear_down_isolate(thread).zero?
|
|
111
|
+
raise Error, @error['cause'] if @error = resp['error']
|
|
112
|
+
|
|
104
113
|
data = resp.fetch('data') do
|
|
105
|
-
raise Error,
|
|
114
|
+
raise Error, "Unexpected response from 'libyamlscript'"
|
|
106
115
|
end
|
|
107
116
|
|
|
108
117
|
data
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yamlscript
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.48
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ingy döt Net
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2024-03-
|
|
12
|
+
date: 2024-03-30 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: minitest
|
|
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
63
63
|
- !ruby/object:Gem::Version
|
|
64
64
|
version: '0'
|
|
65
65
|
requirements: []
|
|
66
|
-
rubygems_version: 3.
|
|
66
|
+
rubygems_version: 3.1.2
|
|
67
67
|
signing_key:
|
|
68
68
|
specification_version: 4
|
|
69
69
|
summary: Program in YAML
|