mruby library bindings for Crystal. Currently only unsafe, generated bindings. Very much a work-in-progress.
- Install
llvmand any dependencies required for mruby on your platform
- On macOS,
brew install llvmwill install the required dependencies (Xcode LLVM may work fine on more recent macOS versions.)
-
Add the dependency to your
shard.yml:dependencies: mruby: github: maxfierke/mruby.cr
-
Run
shards install -
Run
cd lib/mruby && maketo generate the lib binding. (May want to do this in yourMakefileor other build configuration)
require "mruby"
mrb = LibMRuby.mrb_open
code = "5.times { puts 'mruby is awesome!' }"
LibMRuby.mrb_load_string(mrb, code)
LibMRuby.mrb_close(mrb)See src/lib_mruby.cr once generated to view exposed methods (currently only those from mruby.h and mruby/compile.h)
- Follow Installation step 0 to get the required libraries installed.
- If you're on macOS, ensure
gnu-sedis installed. (e.g.brew install gnu-sed)
- If you're on macOS, ensure
- Run
maketo generate the lib bindings - Run
make specto run the tests
- Fork it (https://github.com/maxfierke/mruby.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
- Max Fierke - creator and maintainer