1fa3e21e60
I suppose that many devs will already know what a "version manager" is, but I still think it's better to give an informative description rather than just the name of the software. A larger question: Would a caveat be in order saying something like "This package doesn't literally conflict with homebrew installed versions of Lua, LuaJit, or LuaRocks, but it does not work with them either"? That is, I worry that some (less experienced?) devs might assume that *this* tool and homebrew's Lua items work together.
42 lines
1.2 KiB
Ruby
42 lines
1.2 KiB
Ruby
class Luaver < Formula
|
|
desc "Manage and switch between versions of Lua, LuaJIT, and Luarocks"
|
|
homepage "https://github.com/DhavalKapil/luaver"
|
|
head "https://github.com/DhavalKapil/luaver.git"
|
|
|
|
stable do
|
|
url "https://github.com/DhavalKapil/luaver/archive/v1.0.0.tar.gz"
|
|
sha256 "5c7eb65ea9b3cb4f10987c1d564e6e86bd6ad4f9d829a799121c83f0d85bd390"
|
|
|
|
patch do
|
|
url "https://github.com/DhavalKapil/luaver/pull/9.patch"
|
|
sha256 "390929ef53b6e8e372451049eeffbfa51b9e31d7071e386478b871a835aba2db"
|
|
end
|
|
end
|
|
|
|
bottle :unneeded
|
|
|
|
depends_on "wget" => :run
|
|
|
|
def install
|
|
bin.install "luaver"
|
|
end
|
|
|
|
def caveats; <<-EOS.undent
|
|
Add the following at the end of the correct file yourself:
|
|
if which luaver > /dev/null; then . `which luaver`; fi
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
lua_versions = %w[5.3.3 5.2.4 5.1.5]
|
|
lua_versions.each do |v|
|
|
ENV.deparallelize { system ". #{bin}/luaver && luaver install #{v} < /dev/null" }
|
|
system ". #{bin}/luaver && luaver use #{v} && lua -v"
|
|
end
|
|
luajit_versions = %w[2.0.4]
|
|
luajit_versions.each do |v|
|
|
system ". #{bin}/luaver && luaver install-luajit #{v} < /dev/null"
|
|
system ". #{bin}/luaver && luaver use-luajit #{v} && luajit -v"
|
|
end
|
|
end
|
|
end
|