This is a mruby-wrapper for .NET, current for Windows/Linux/MacOS and will come to other platform soon.
From nuget: https://www.nuget.org/packages/MRuby.Library/
dotnet add package MRuby.Library --version 0.1.8A simple code to embed mruby into C# code.
using MRuby.Library
// create ruby env
using var state = Ruby.Open();
// ruby code string
var code = @"
def hello
'Hello, World!'
end
hello
";
// compile code, run and get the result
using var compiler = state.NewCompiler();
var res = compiler.LoadString(code);
// unbox the ruby value
var unboxed = res.ToString();
Assert.Equal("Hello, World!", unboxed);git submodule update --init --recursive./build-mruby-win.bat(for Windows, run this command underVS x64 Command Prommpt)or./build-mruby-linux.shfor (*nix) or./build-mruby-mac.shfor macoscd ../mruby-sharedxmake f -m releasedbgxmakecd ../mruby-wrapperdotnet build --configuration Releasedotnet test
- 100% Unittest Coverage
- Nuget package
- Support Linux
- Support macOS
- Unity integral test
- Support Android
- Support iOS
- Documentation