add ruby 3.1.0
This commit is contained in:
parent
6d1156188c
commit
5ee28d918a
|
@ -14,4 +14,5 @@ args: {
|
|||
"erlang" = import ./erlang.nix args;
|
||||
"gawk-awk" = import ./gawk-awk.nix args;
|
||||
"openjdk11_headless-java" = import ./openjdk11_headless-java.nix args;
|
||||
"ruby" = import ./ruby.nix args;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
{pkgs, piston, ...}:
|
||||
let
|
||||
pkg = pkgs.ruby_3_1; # ruby 3.1 stable from unstable channel
|
||||
in piston.mkRuntime {
|
||||
language = "ruby";
|
||||
version = pkg.version;
|
||||
|
||||
aliases = [
|
||||
"ruby3"
|
||||
"rb"
|
||||
];
|
||||
|
||||
run = ''
|
||||
${pkg}/bin/ruby "$@"
|
||||
'';
|
||||
|
||||
# Run the following command to test the package:
|
||||
# $ ./piston test ruby
|
||||
tests = [
|
||||
# standard output test
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.rb" = ''
|
||||
puts("OK");
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.rb";
|
||||
})
|
||||
# args test
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.rb" = ''
|
||||
puts $*;
|
||||
'';
|
||||
};
|
||||
args = ["OK"];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.rb";
|
||||
})
|
||||
# stdin test
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.rb" = ''
|
||||
print Kernel.gets;
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "OK";
|
||||
packages = [];
|
||||
main = "test.rb";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue