Skip to content

Commit b130429

Browse files
committed
Support more TruffleRuby versions
1 parent 0b87ad9 commit b130429

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# vfox-ruby
22

3-
[Ruby](https://www.ruby-lang.org/) language plugin for [vfox](https://vfox.lhan.me). For Linux and macos, both [Ruby(conda-forge)](https://github.com/conda-forge/ruby-feedstock) and [TruffleRuby](https://www.graalvm.org/ruby/) are provided. To use TruffleRuby, some [dependencies](https://github.com/oracle/truffleruby/blob/master/README.md#Dependencies) are required.
3+
[Ruby](https://www.ruby-lang.org/) language plugin for [vfox](https://vfox.lhan.me).
4+
5+
For Linux and macos, both [Ruby(conda-forge)](https://github.com/conda-forge/ruby-feedstock) and [TruffleRuby](https://www.graalvm.org/ruby/) are provided. To use TruffleRuby, some [dependencies](https://github.com/oracle/truffleruby/blob/master/README.md#Dependencies) are required.
46

57
## Install
68

lib/util.lua

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ local unixRubyVersions = {
3232
"21.3.0",
3333
"21.2.0.1",
3434
"21.2.0",
35+
"21.1.0",
36+
"21.0.0.2",
37+
"21.0.0",
38+
"20.3.0",
39+
"20.2.0",
40+
"20.1.0",
41+
"20.0.0",
3542
}
3643

3744
-- available.lua
@@ -115,7 +122,7 @@ function fetchForUnix()
115122
version = v,
116123
note = "latest",
117124
})
118-
elseif compareVersion(v, "21.2.0") >= 0 then
125+
elseif compareVersion(v, "20.0.0") >= 0 then
119126
table.insert(result, {
120127
version = v,
121128
note = "truffleruby",
@@ -181,9 +188,7 @@ function generateURL(version, osType, archType)
181188
elseif not hasValue(unixRubyVersions, version) then
182189
print("Unsupported version: " .. version)
183190
os.exit(1)
184-
elseif compareVersion(version, "22.2.0") >= 0 then
185-
file = generateTruffleRuby(version, osType, archType)
186-
elseif compareVersion(version, "21.2.0") >= 0 and (osType ~= "darwin" or archType ~= "arm64") then
191+
elseif compareVersion(version, "20.0.0") >= 0 then
187192
file = generateTruffleRuby(version, osType, archType)
188193
end
189194

@@ -204,6 +209,11 @@ function generateTruffleRuby(version, osType, archType)
204209
local file
205210
local githubURL = os.getenv("GITHUB_URL") or "https://github.com/"
206211
local tag = compareVersion(version, "23.0.0") >= 0 and "graal-" .. version or "vm-" .. version
212+
213+
if compareVersion(version, "22.2.0") < 0 and archType == "arm64" then
214+
print("Unsupported version " .. version .. " for " .. archType)
215+
os.exit(1)
216+
end
207217
if archType == "arm64" then
208218
archType = "aarch64"
209219
end
@@ -234,7 +244,7 @@ function mambaInstall(path, version)
234244
local command4 = "mkdir -p " .. path .. "/share/gems/bin"
235245
local command5 = "rm -rf " .. path .. "/temp " .. path .. "/pkgs " .. path .. "/etc " .. path .. "/conda-meta"
236246

237-
if compareVersion(version, "21.2.0") >= 0 then
247+
if compareVersion(version, "20.0.0") >= 0 then
238248
local status = os.execute(command4)
239249
if status ~= 0 then
240250
print("Failed to execute command: " .. command4)

0 commit comments

Comments
 (0)