ruby/tool/missing-baseruby.bat
Nobuyoshi Nakada 376ae22235
Manage required baseruby version in one place
Add a Ruby script mode to `tool/missing-baseruby.bat` that checks if
`RUBY_VERSION` meets the required version.  This will enable similar
checks on mswin as well.
2024-03-31 00:54:38 +09:00

19 lines
438 B
Batchfile
Executable file

:"" == "
@echo off || (
:warn
echo>&2.%~1
goto :eof
:abort
exit /b 1
)||(
:)"||(
s = %^#
)
: ; call() { local call=${1#:}; shift; $call "$@"; }
: ; warn() { echo "$1" >&2; }
: ; abort () { exit 1; }
call :warn "executable host ruby is required. use --with-baseruby option."
call :warn "Note that BASERUBY must be Ruby 3.0.0 or later."
call :abort
: || (:^; abort if RUBY_VERSION < s[%r"warn .*Ruby ([\d.]+)(?:\.0)?",1])